diff options
Diffstat (limited to 'drivers/scsi/cxgbi')
-rw-r--r-- | drivers/scsi/cxgbi/Kconfig | 1 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/Makefile | 1 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/Kbuild | 1 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/Kconfig | 1 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 10 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb4i/Kbuild | 1 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb4i/Kconfig | 1 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 17 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 19 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.h | 9 |
10 files changed, 44 insertions, 17 deletions
diff --git a/drivers/scsi/cxgbi/Kconfig b/drivers/scsi/cxgbi/Kconfig index 17eb5d522f42..75f9428a8a14 100644 --- a/drivers/scsi/cxgbi/Kconfig +++ b/drivers/scsi/cxgbi/Kconfig @@ -1,2 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only source "drivers/scsi/cxgbi/cxgb3i/Kconfig" source "drivers/scsi/cxgbi/cxgb4i/Kconfig" diff --git a/drivers/scsi/cxgbi/Makefile b/drivers/scsi/cxgbi/Makefile index f78c9cc460a2..abfd38a26fec 100644 --- a/drivers/scsi/cxgbi/Makefile +++ b/drivers/scsi/cxgbi/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb obj-$(CONFIG_SCSI_CXGB3_ISCSI) += libcxgbi.o cxgb3i/ diff --git a/drivers/scsi/cxgbi/cxgb3i/Kbuild b/drivers/scsi/cxgbi/cxgb3i/Kbuild index 663c52e05d81..8d8a43f5ea80 100644 --- a/drivers/scsi/cxgbi/cxgb3i/Kbuild +++ b/drivers/scsi/cxgbi/cxgb3i/Kbuild @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb3 ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/libcxgb diff --git a/drivers/scsi/cxgbi/cxgb3i/Kconfig b/drivers/scsi/cxgbi/cxgb3i/Kconfig index f68c871b16ca..3e4b644249cb 100644 --- a/drivers/scsi/cxgbi/cxgb3i/Kconfig +++ b/drivers/scsi/cxgbi/cxgb3i/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only config SCSI_CXGB3_ISCSI tristate "Chelsio T3 iSCSI support" depends on PCI && INET && (IPV6 || IPV6=n) diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c index b8dd9e648dd0..524cdbcd29aa 100644 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c @@ -1243,8 +1243,12 @@ static int cxgb3i_ddp_init(struct cxgbi_device *cdev) tformat.pgsz_order[i] = uinfo.pgsz_factor[i]; cxgbi_tagmask_check(tagmask, &tformat); - cxgbi_ddp_ppm_setup(&tdev->ulp_iscsi, cdev, &tformat, ppmax, - uinfo.llimit, uinfo.llimit, 0); + err = cxgbi_ddp_ppm_setup(&tdev->ulp_iscsi, cdev, &tformat, + (uinfo.ulimit - uinfo.llimit + 1), + uinfo.llimit, uinfo.llimit, 0, 0, 0); + if (err) + return err; + if (!(cdev->flags & CXGBI_FLAG_DDP_OFF)) { uinfo.tagmask = tagmask; uinfo.ulimit = uinfo.llimit + (ppmax << PPOD_SIZE_SHIFT); @@ -1318,7 +1322,7 @@ static void cxgb3i_dev_open(struct t3cdev *t3dev) err = cxgb3i_ddp_init(cdev); if (err) { - pr_info("0x%p ddp init failed\n", cdev); + pr_info("0x%p ddp init failed %d\n", cdev, err); goto err_out; } diff --git a/drivers/scsi/cxgbi/cxgb4i/Kbuild b/drivers/scsi/cxgbi/cxgb4i/Kbuild index 38e03c280417..fd3e0c964de6 100644 --- a/drivers/scsi/cxgbi/cxgb4i/Kbuild +++ b/drivers/scsi/cxgbi/cxgb4i/Kbuild @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb4 ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/libcxgb diff --git a/drivers/scsi/cxgbi/cxgb4i/Kconfig b/drivers/scsi/cxgbi/cxgb4i/Kconfig index f36b76e8e12c..d1f1baba3285 100644 --- a/drivers/scsi/cxgbi/cxgb4i/Kconfig +++ b/drivers/scsi/cxgbi/cxgb4i/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only config SCSI_CXGB4_ISCSI tristate "Chelsio T4 iSCSI support" depends on PCI && INET && (IPV6 || IPV6=n) diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index 0e767e65f04f..da50e87921bc 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c @@ -2074,7 +2074,7 @@ static int cxgb4i_ddp_init(struct cxgbi_device *cdev) struct net_device *ndev = cdev->ports[0]; struct cxgbi_tag_format tformat; unsigned int ppmax; - int i; + int i, err; if (!lldi->vr->iscsi.size) { pr_warn("%s, iscsi NOT enabled, check config!\n", ndev->name); @@ -2090,8 +2090,17 @@ static int cxgb4i_ddp_init(struct cxgbi_device *cdev) & 0xF; cxgbi_tagmask_check(lldi->iscsi_tagmask, &tformat); - cxgbi_ddp_ppm_setup(lldi->iscsi_ppm, cdev, &tformat, ppmax, - lldi->iscsi_llimit, lldi->vr->iscsi.start, 2); + pr_info("iscsi_edram.start 0x%x iscsi_edram.size 0x%x", + lldi->vr->ppod_edram.start, lldi->vr->ppod_edram.size); + + err = cxgbi_ddp_ppm_setup(lldi->iscsi_ppm, cdev, &tformat, + lldi->vr->iscsi.size, lldi->iscsi_llimit, + lldi->vr->iscsi.start, 2, + lldi->vr->ppod_edram.start, + lldi->vr->ppod_edram.size); + + if (err < 0) + return err; cdev->csk_ddp_setup_digest = ddp_setup_conn_digest; cdev->csk_ddp_setup_pgidx = ddp_setup_conn_pgidx; @@ -2145,7 +2154,7 @@ static void *t4_uld_add(const struct cxgb4_lld_info *lldi) rc = cxgb4i_ddp_init(cdev); if (rc) { - pr_info("t4 0x%p ddp init failed.\n", cdev); + pr_info("t4 0x%p ddp init failed %d.\n", cdev, rc); goto err_out; } rc = cxgb4i_ofld_init(cdev); diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 8b915d4ed98d..3e17af8aedeb 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -639,6 +639,10 @@ cxgbi_check_route(struct sockaddr *dst_addr, int ifindex) if (ndev->flags & IFF_LOOPBACK) { ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr); + if (!ndev) { + err = -ENETUNREACH; + goto rel_neigh; + } mtu = ndev->mtu; pr_info("rt dev %s, loopback -> %s, mtu %u.\n", n->dev->name, ndev->name, mtu); @@ -1281,14 +1285,15 @@ EXPORT_SYMBOL_GPL(cxgbi_ddp_set_one_ppod); static unsigned char padding[4]; -void cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *cdev, - struct cxgbi_tag_format *tformat, unsigned int ppmax, - unsigned int llimit, unsigned int start, - unsigned int rsvd_factor) +int cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *cdev, + struct cxgbi_tag_format *tformat, + unsigned int iscsi_size, unsigned int llimit, + unsigned int start, unsigned int rsvd_factor, + unsigned int edram_start, unsigned int edram_size) { int err = cxgbi_ppm_init(ppm_pp, cdev->ports[0], cdev->pdev, - cdev->lldev, tformat, ppmax, llimit, start, - rsvd_factor); + cdev->lldev, tformat, iscsi_size, llimit, start, + rsvd_factor, edram_start, edram_size); if (err >= 0) { struct cxgbi_ppm *ppm = (struct cxgbi_ppm *)(*ppm_pp); @@ -1300,6 +1305,8 @@ void cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *cdev, } else { cdev->flags |= CXGBI_FLAG_DDP_OFF; } + + return err; } EXPORT_SYMBOL_GPL(cxgbi_ddp_ppm_setup); diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h index 1917ff57651d..84b96af52655 100644 --- a/drivers/scsi/cxgbi/libcxgbi.h +++ b/drivers/scsi/cxgbi/libcxgbi.h @@ -617,8 +617,9 @@ void cxgbi_ddp_page_size_factor(int *); void cxgbi_ddp_set_one_ppod(struct cxgbi_pagepod *, struct cxgbi_task_tag_info *, struct scatterlist **sg_pp, unsigned int *sg_off); -void cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *, - struct cxgbi_tag_format *, unsigned int ppmax, - unsigned int llimit, unsigned int start, - unsigned int rsvd_factor); +int cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *cdev, + struct cxgbi_tag_format *tformat, + unsigned int iscsi_size, unsigned int llimit, + unsigned int start, unsigned int rsvd_factor, + unsigned int edram_start, unsigned int edram_size); #endif /*__LIBCXGBI_H__*/ |