Skip to content

Commit e0fd9af

Browse files
committed
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull InfiniBand/RDMA changes from Roland Dreier: - XRC transport fixes - Fix DHCP on IPoIB - mlx4 preparations for flow steering - iSER fixes - miscellaneous other fixes * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (23 commits) IB/iser: Add support for iser CM REQ additional info IB/iser: Return error to upper layers on EAGAIN registration failures IB/iser: Move informational messages from error to info level IB/iser: Add module version mlx4_core: Expose a few helpers to fill DMFS HW strucutures mlx4_core: Directly expose fields of DMFS HW rule control segment mlx4_core: Change a few DMFS fields names to match firmare spec mlx4: Match DMFS promiscuous field names to firmware spec mlx4_core: Move DMFS HW structs to common header file IB/mlx4: Set link type for RAW PACKET QPs in the QP context IB/mlx4: Disable VLAN stripping for RAW PACKET QPs mlx4_core: Reduce warning message for SRQ_LIMIT event to debug level RDMA/iwcm: Don't touch cmid after dropping reference IB/qib: Correct qib_verbs_register_sysfs() error handling IB/ipath: Correct ipath_verbs_register_sysfs() error handling RDMA/cxgb4: Fix SQ allocation when on-chip SQ is disabled SRPT: Fix odd use of WARN_ON() IPoIB: Fix ipoib_hard_header() return value RDMA: Rename random32() to prandom_u32() RDMA/cxgb3: Fix uninitialized variable ...
2 parents 3d15b79 + ea9627c commit e0fd9af

File tree

23 files changed

+322
-195
lines changed

23 files changed

+322
-195
lines changed

drivers/infiniband/core/iwcm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,8 @@ static void cm_work_handler(struct work_struct *_work)
878878
}
879879
return;
880880
}
881+
if (empty)
882+
return;
881883
spin_lock_irqsave(&cm_id_priv->lock, flags);
882884
}
883885
spin_unlock_irqrestore(&cm_id_priv->lock, flags);

drivers/infiniband/core/verbs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ static void __ib_shared_qp_event_handler(struct ib_event *event, void *context)
348348
struct ib_qp *qp = context;
349349

350350
list_for_each_entry(event->element.qp, &qp->open_list, open_list)
351-
event->element.qp->event_handler(event, event->element.qp->qp_context);
351+
if (event->element.qp->event_handler)
352+
event->element.qp->event_handler(event, event->element.qp->qp_context);
352353
}
353354

354355
static void __ib_insert_xrcd_qp(struct ib_xrcd *xrcd, struct ib_qp *qp)

drivers/infiniband/hw/cxgb3/iwch_provider.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr,
559559
__be64 *page_list = NULL;
560560
int shift = 0;
561561
u64 total_size;
562-
int npages;
562+
int npages = 0;
563563
int ret;
564564

565565
PDBG("%s ib_mr %p ib_pd %p\n", __func__, mr, pd);

drivers/infiniband/hw/cxgb4/qp.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ static int alloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq)
111111
return 0;
112112
}
113113

114+
static int alloc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq, int user)
115+
{
116+
int ret = -ENOSYS;
117+
if (user)
118+
ret = alloc_oc_sq(rdev, sq);
119+
if (ret)
120+
ret = alloc_host_sq(rdev, sq);
121+
return ret;
122+
}
123+
114124
static int destroy_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
115125
struct c4iw_dev_ucontext *uctx)
116126
{
@@ -179,15 +189,9 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
179189
goto free_sw_rq;
180190
}
181191

182-
if (user) {
183-
if (alloc_oc_sq(rdev, &wq->sq) && alloc_host_sq(rdev, &wq->sq))
184-
goto free_hwaddr;
185-
} else {
186-
ret = alloc_host_sq(rdev, &wq->sq);
187-
if (ret)
188-
goto free_hwaddr;
189-
}
190-
192+
ret = alloc_sq(rdev, &wq->sq, user);
193+
if (ret)
194+
goto free_hwaddr;
191195
memset(wq->sq.queue, 0, wq->sq.memsize);
192196
dma_unmap_addr_set(&wq->sq, mapping, wq->sq.dma_addr);
193197

drivers/infiniband/hw/ipath/ipath_verbs.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,8 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
21872187
if (ret)
21882188
goto err_reg;
21892189

2190-
if (ipath_verbs_register_sysfs(dev))
2190+
ret = ipath_verbs_register_sysfs(dev);
2191+
if (ret)
21912192
goto err_class;
21922193

21932194
enable_timer(dd);
@@ -2327,15 +2328,15 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev)
23272328
int i;
23282329
int ret;
23292330

2330-
for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i)
2331-
if (device_create_file(&dev->dev,
2332-
ipath_class_attributes[i])) {
2333-
ret = 1;
2331+
for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i) {
2332+
ret = device_create_file(&dev->dev,
2333+
ipath_class_attributes[i]);
2334+
if (ret)
23342335
goto bail;
2335-
}
2336-
2337-
ret = 0;
2338-
2336+
}
2337+
return 0;
23392338
bail:
2339+
for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i)
2340+
device_remove_file(&dev->dev, ipath_class_attributes[i]);
23402341
return ret;
23412342
}

drivers/infiniband/hw/mlx4/cq.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include <linux/mlx4/cq.h>
3535
#include <linux/mlx4/qp.h>
36+
#include <linux/mlx4/srq.h>
3637
#include <linux/slab.h>
3738

3839
#include "mlx4_ib.h"
@@ -585,6 +586,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
585586
struct mlx4_qp *mqp;
586587
struct mlx4_ib_wq *wq;
587588
struct mlx4_ib_srq *srq;
589+
struct mlx4_srq *msrq = NULL;
588590
int is_send;
589591
int is_error;
590592
u32 g_mlpath_rqpn;
@@ -653,6 +655,20 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
653655

654656
wc->qp = &(*cur_qp)->ibqp;
655657

658+
if (wc->qp->qp_type == IB_QPT_XRC_TGT) {
659+
u32 srq_num;
660+
g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn);
661+
srq_num = g_mlpath_rqpn & 0xffffff;
662+
/* SRQ is also in the radix tree */
663+
msrq = mlx4_srq_lookup(to_mdev(cq->ibcq.device)->dev,
664+
srq_num);
665+
if (unlikely(!msrq)) {
666+
pr_warn("CQ %06x with entry for unknown SRQN %06x\n",
667+
cq->mcq.cqn, srq_num);
668+
return -EINVAL;
669+
}
670+
}
671+
656672
if (is_send) {
657673
wq = &(*cur_qp)->sq;
658674
if (!(*cur_qp)->sq_signal_bits) {
@@ -666,6 +682,11 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
666682
wqe_ctr = be16_to_cpu(cqe->wqe_index);
667683
wc->wr_id = srq->wrid[wqe_ctr];
668684
mlx4_ib_free_srq_wqe(srq, wqe_ctr);
685+
} else if (msrq) {
686+
srq = to_mibsrq(msrq);
687+
wqe_ctr = be16_to_cpu(cqe->wqe_index);
688+
wc->wr_id = srq->wrid[wqe_ctr];
689+
mlx4_ib_free_srq_wqe(srq, wqe_ctr);
669690
} else {
670691
wq = &(*cur_qp)->rq;
671692
tail = wq->tail & (wq->wqe_cnt - 1);

drivers/infiniband/hw/mlx4/qp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,8 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
12921292
if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
12931293
context->sq_size_stride |= !!qp->sq_no_prefetch << 7;
12941294
context->xrcd = cpu_to_be32((u32) qp->xrcdn);
1295+
if (ibqp->qp_type == IB_QPT_RAW_PACKET)
1296+
context->param3 |= cpu_to_be32(1 << 30);
12951297
}
12961298

12971299
if (qp->ibqp.uobject)
@@ -1458,6 +1460,10 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
14581460
}
14591461
}
14601462

1463+
if (qp->ibqp.qp_type == IB_QPT_RAW_PACKET)
1464+
context->pri_path.ackto = (context->pri_path.ackto & 0xf8) |
1465+
MLX4_IB_LINK_TYPE_ETH;
1466+
14611467
if (cur_state == IB_QPS_RTS && new_state == IB_QPS_SQD &&
14621468
attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY && attr->en_sqd_async_notify)
14631469
sqd_event = 1;

drivers/infiniband/hw/qib/qib_sysfs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,10 +808,14 @@ int qib_verbs_register_sysfs(struct qib_devdata *dd)
808808
for (i = 0; i < ARRAY_SIZE(qib_attributes); ++i) {
809809
ret = device_create_file(&dev->dev, qib_attributes[i]);
810810
if (ret)
811-
return ret;
811+
goto bail;
812812
}
813813

814814
return 0;
815+
bail:
816+
for (i = 0; i < ARRAY_SIZE(qib_attributes); ++i)
817+
device_remove_file(&dev->dev, qib_attributes[i]);
818+
return ret;
815819
}
816820

817821
/*

drivers/infiniband/hw/qib/qib_verbs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,8 @@ int qib_register_ib_device(struct qib_devdata *dd)
22342234
if (ret)
22352235
goto err_agents;
22362236

2237-
if (qib_verbs_register_sysfs(dd))
2237+
ret = qib_verbs_register_sysfs(dd);
2238+
if (ret)
22382239
goto err_class;
22392240

22402241
goto bail;

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
830830
*/
831831
memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
832832

833-
return 0;
833+
return sizeof *header;
834834
}
835835

836836
static void ipoib_set_mcast_list(struct net_device *dev)

drivers/infiniband/ulp/iser/iscsi_iser.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO);
8282

8383
int iser_debug_level = 0;
8484

85-
MODULE_DESCRIPTION("iSER (iSCSI Extensions for RDMA) Datamover "
86-
"v" DRV_VER " (" DRV_DATE ")");
85+
MODULE_DESCRIPTION("iSER (iSCSI Extensions for RDMA) Datamover");
8786
MODULE_LICENSE("Dual BSD/GPL");
8887
MODULE_AUTHOR("Alex Nezhinsky, Dan Bar Dov, Or Gerlitz");
88+
MODULE_VERSION(DRV_VER);
8989

9090
module_param_named(debug_level, iser_debug_level, int, 0644);
9191
MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0 (default:disabled)");
@@ -370,8 +370,8 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
370370
/* binds the iSER connection retrieved from the previously
371371
* connected ep_handle to the iSCSI layer connection. exchanges
372372
* connection pointers */
373-
iser_err("binding iscsi/iser conn %p %p to ib_conn %p\n",
374-
conn, conn->dd_data, ib_conn);
373+
iser_info("binding iscsi/iser conn %p %p to ib_conn %p\n",
374+
conn, conn->dd_data, ib_conn);
375375
iser_conn = conn->dd_data;
376376
ib_conn->iser_conn = iser_conn;
377377
iser_conn->ib_conn = ib_conn;
@@ -475,28 +475,28 @@ iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
475475
case ISCSI_PARAM_HDRDGST_EN:
476476
sscanf(buf, "%d", &value);
477477
if (value) {
478-
printk(KERN_ERR "DataDigest wasn't negotiated to None");
478+
iser_err("DataDigest wasn't negotiated to None");
479479
return -EPROTO;
480480
}
481481
break;
482482
case ISCSI_PARAM_DATADGST_EN:
483483
sscanf(buf, "%d", &value);
484484
if (value) {
485-
printk(KERN_ERR "DataDigest wasn't negotiated to None");
485+
iser_err("DataDigest wasn't negotiated to None");
486486
return -EPROTO;
487487
}
488488
break;
489489
case ISCSI_PARAM_IFMARKER_EN:
490490
sscanf(buf, "%d", &value);
491491
if (value) {
492-
printk(KERN_ERR "IFMarker wasn't negotiated to No");
492+
iser_err("IFMarker wasn't negotiated to No");
493493
return -EPROTO;
494494
}
495495
break;
496496
case ISCSI_PARAM_OFMARKER_EN:
497497
sscanf(buf, "%d", &value);
498498
if (value) {
499-
printk(KERN_ERR "OFMarker wasn't negotiated to No");
499+
iser_err("OFMarker wasn't negotiated to No");
500500
return -EPROTO;
501501
}
502502
break;
@@ -596,7 +596,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
596596
ib_conn->state == ISER_CONN_DOWN))
597597
rc = -1;
598598

599-
iser_err("ib conn %p rc = %d\n", ib_conn, rc);
599+
iser_info("ib conn %p rc = %d\n", ib_conn, rc);
600600

601601
if (rc > 0)
602602
return 1; /* success, this is the equivalent of POLLOUT */
@@ -623,7 +623,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep)
623623
iscsi_suspend_tx(ib_conn->iser_conn->iscsi_conn);
624624

625625

626-
iser_err("ib conn %p state %d\n",ib_conn, ib_conn->state);
626+
iser_info("ib conn %p state %d\n", ib_conn, ib_conn->state);
627627
iser_conn_terminate(ib_conn);
628628
}
629629

@@ -682,7 +682,7 @@ static umode_t iser_attr_is_visible(int param_type, int param)
682682

683683
static struct scsi_host_template iscsi_iser_sht = {
684684
.module = THIS_MODULE,
685-
.name = "iSCSI Initiator over iSER, v." DRV_VER,
685+
.name = "iSCSI Initiator over iSER",
686686
.queuecommand = iscsi_queuecommand,
687687
.change_queue_depth = iscsi_change_queue_depth,
688688
.sg_tablesize = ISCSI_ISER_SG_TABLESIZE,
@@ -740,7 +740,7 @@ static int __init iser_init(void)
740740
iser_dbg("Starting iSER datamover...\n");
741741

742742
if (iscsi_max_lun < 1) {
743-
printk(KERN_ERR "Invalid max_lun value of %u\n", iscsi_max_lun);
743+
iser_err("Invalid max_lun value of %u\n", iscsi_max_lun);
744744
return -EINVAL;
745745
}
746746

drivers/infiniband/ulp/iser/iscsi_iser.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#include <linux/types.h>
4444
#include <linux/net.h>
45+
#include <linux/printk.h>
4546
#include <scsi/libiscsi.h>
4647
#include <scsi/scsi_transport_iscsi.h>
4748

@@ -65,20 +66,26 @@
6566

6667
#define DRV_NAME "iser"
6768
#define PFX DRV_NAME ": "
68-
#define DRV_VER "0.1"
69-
#define DRV_DATE "May 7th, 2006"
69+
#define DRV_VER "1.1"
7070

7171
#define iser_dbg(fmt, arg...) \
7272
do { \
73-
if (iser_debug_level > 1) \
73+
if (iser_debug_level > 2) \
7474
printk(KERN_DEBUG PFX "%s:" fmt,\
7575
__func__ , ## arg); \
7676
} while (0)
7777

7878
#define iser_warn(fmt, arg...) \
79+
do { \
80+
if (iser_debug_level > 1) \
81+
pr_warn(PFX "%s:" fmt, \
82+
__func__ , ## arg); \
83+
} while (0)
84+
85+
#define iser_info(fmt, arg...) \
7986
do { \
8087
if (iser_debug_level > 0) \
81-
printk(KERN_DEBUG PFX "%s:" fmt,\
88+
pr_info(PFX "%s:" fmt, \
8289
__func__ , ## arg); \
8390
} while (0)
8491

@@ -133,6 +140,15 @@ struct iser_hdr {
133140
__be64 read_va;
134141
} __attribute__((packed));
135142

143+
144+
#define ISER_ZBVA_NOT_SUPPORTED 0x80
145+
#define ISER_SEND_W_INV_NOT_SUPPORTED 0x40
146+
147+
struct iser_cm_hdr {
148+
u8 flags;
149+
u8 rsvd[3];
150+
} __packed;
151+
136152
/* Constant PDU lengths calculations */
137153
#define ISER_HEADERS_LEN (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))
138154

drivers/infiniband/ulp/iser/iser_memory.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,9 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *iser_task,
416416
for (i=0 ; i<ib_conn->page_vec->length ; i++)
417417
iser_err("page_vec[%d] = 0x%llx\n", i,
418418
(unsigned long long) ib_conn->page_vec->pages[i]);
419-
return err;
420419
}
420+
if (err)
421+
return err;
421422
}
422423
return 0;
423424
}

0 commit comments

Comments
 (0)