Skip to content

Commit 168bd29

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "Small set of three regression fixing patches, things are looking pretty good here. - Fix cxgb4 to work again with non-4k page sizes - NULL pointer oops in SRP during sg_reset" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: iw_cxgb4: cq/qp mask depends on bar2 pages in a host page cxgb4: Export sge_host_page_size to ulds RDMA/srp: Rework SCSI device reset handling
2 parents a3504f7 + f09ef13 commit 168bd29

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

drivers/infiniband/hw/cxgb4/device.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev,
783783
static int c4iw_rdev_open(struct c4iw_rdev *rdev)
784784
{
785785
int err;
786+
unsigned int factor;
786787

787788
c4iw_init_dev_ucontext(rdev, &rdev->uctx);
788789

@@ -806,8 +807,18 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
806807
return -EINVAL;
807808
}
808809

809-
rdev->qpmask = rdev->lldi.udb_density - 1;
810-
rdev->cqmask = rdev->lldi.ucq_density - 1;
810+
/* This implementation requires a sge_host_page_size <= PAGE_SIZE. */
811+
if (rdev->lldi.sge_host_page_size > PAGE_SIZE) {
812+
pr_err("%s: unsupported sge host page size %u\n",
813+
pci_name(rdev->lldi.pdev),
814+
rdev->lldi.sge_host_page_size);
815+
return -EINVAL;
816+
}
817+
818+
factor = PAGE_SIZE / rdev->lldi.sge_host_page_size;
819+
rdev->qpmask = (rdev->lldi.udb_density * factor) - 1;
820+
rdev->cqmask = (rdev->lldi.ucq_density * factor) - 1;
821+
811822
pr_debug("dev %s stag start 0x%0x size 0x%0x num stags %d pbl start 0x%0x size 0x%0x rq start 0x%0x size 0x%0x qp qid start %u size %u cq qid start %u size %u srq size %u\n",
812823
pci_name(rdev->lldi.pdev), rdev->lldi.vr->stag.start,
813824
rdev->lldi.vr->stag.size, c4iw_num_stags(rdev),

drivers/infiniband/ulp/srp/ib_srp.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,6 @@ static int srp_reset_device(struct scsi_cmnd *scmnd)
30323032
{
30333033
struct srp_target_port *target = host_to_target(scmnd->device->host);
30343034
struct srp_rdma_ch *ch;
3035-
int i, j;
30363035
u8 status;
30373036

30383037
shost_printk(KERN_ERR, target->scsi_host, "SRP reset_device called\n");
@@ -3044,15 +3043,6 @@ static int srp_reset_device(struct scsi_cmnd *scmnd)
30443043
if (status)
30453044
return FAILED;
30463045

3047-
for (i = 0; i < target->ch_count; i++) {
3048-
ch = &target->ch[i];
3049-
for (j = 0; j < target->req_ring_size; ++j) {
3050-
struct srp_request *req = &ch->req_ring[j];
3051-
3052-
srp_finish_req(ch, req, scmnd->device, DID_RESET << 16);
3053-
}
3054-
}
3055-
30563046
return SUCCESS;
30573047
}
30583048

drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ static void uld_init(struct adapter *adap, struct cxgb4_lld_info *lld)
660660
lld->cclk_ps = 1000000000 / adap->params.vpd.cclk;
661661
lld->udb_density = 1 << adap->params.sge.eq_qpp;
662662
lld->ucq_density = 1 << adap->params.sge.iq_qpp;
663+
lld->sge_host_page_size = 1 << (adap->params.sge.hps + 10);
663664
lld->filt_mode = adap->params.tp.vlan_pri_map;
664665
/* MODQ_REQ_MAP sets queues 0-3 to chan 0-3 */
665666
for (i = 0; i < NCHAN; i++)

drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ struct cxgb4_lld_info {
336336
unsigned int cclk_ps; /* Core clock period in psec */
337337
unsigned short udb_density; /* # of user DB/page */
338338
unsigned short ucq_density; /* # of user CQs/page */
339+
unsigned int sge_host_page_size; /* SGE host page size */
339340
unsigned short filt_mode; /* filter optional components */
340341
unsigned short tx_modq[NCHAN]; /* maps each tx channel to a */
341342
/* scheduler queue */

0 commit comments

Comments
 (0)