History

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma fixes from Doug Ledford: - Smattering of miscellanous fixes - A five patch series for i40iw that had a patch (5/5) that was larger than I would like, but I took it because it's needed for large scale users - An 8 patch series for bnxt_re that landed right as I was leaving on PTO and so had to wait until now...they are all appropriate fixes for -rc IMO * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (22 commits) bnxt_re: Don't issue cmd to delete GID for QP1 GID entry before the QP is destroyed bnxt_re: Fix memory leak in FRMR path bnxt_re: Remove RTNL lock dependency in bnxt_re_query_port bnxt_re: Fix race between the netdev register and unregister events bnxt_re: Free up devices in module_exit path bnxt_re: Fix compare and swap atomic operands bnxt_re: Stop issuing further cmds to FW once a cmd times out bnxt_re: Fix update of qplib_qp.mtu when modified i40iw: Add support for port reuse on active side connections i40iw: Add missing VLAN priority i40iw: Call i40iw_cm_disconn on modify QP to disconnect i40iw: Prevent multiple netdev event notifier registrations i40iw: Fail open if there are no available MSI-X vectors RDMA/vmw_pvrdma: Fix reporting correct opcodes for completion IB/bnxt_re: Fix frame stack compilation warning IB/mlx5: fix debugfs cleanup IB/ocrdma: fix incorrect fall-through on switch statement IB/ipoib: Suppress the retry related completion errors iw_cxgb4: remove the stid on listen create failure iw_cxgb4: drop listen destroy replies if no ep found ...

Linus Torvalds committed 9 years ago

Commit ded85032 parents 71aa60f 89aaca517 files · +281 −161Browse files

Unified · Split

17 files
  1. drivers/infiniband/core/verbs.c +2 −2
  2. drivers/infiniband/hw/bnxt_re/bnxt_re.h +9 −5
  3. drivers/infiniband/hw/bnxt_re/ib_verbs.c +64 −43
  4. drivers/infiniband/hw/bnxt_re/main.c +28 −0
  5. drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +4 −0
  6. drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +2 −1
  7. drivers/infiniband/hw/cxgb4/cm.c +7 −2
  8. drivers/infiniband/hw/i40iw/i40iw.h +0 −1
  9. drivers/infiniband/hw/i40iw/i40iw_cm.c +77 −77
  10. drivers/infiniband/hw/i40iw/i40iw_cm.h +5 −0
  11. drivers/infiniband/hw/i40iw/i40iw_main.c +23 −16
  12. drivers/infiniband/hw/i40iw/i40iw_utils.c +3 −3
  13. drivers/infiniband/hw/i40iw/i40iw_verbs.c +12 −0
  14. drivers/infiniband/hw/mlx5/main.c +3 −3
  15. drivers/infiniband/hw/ocrdma/ocrdma_hw.c +3 −0
  16. drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +28 −3
  17. drivers/infiniband/ulp/ipoib/ipoib_cm.c +11 −5
drivers/infiniband/core/verbs.c+2−2
@@ -1646,7 +1646,7 @@ static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid) · 1645 unmodified lines
16461646 */
16471647 if (!ib_query_qp(qp, &attr, IB_QP_STATE | IB_QP_PORT, &init_attr)) {
16481648 if (attr.qp_state >= IB_QPS_INIT) {
1649− if (qp->device->get_link_layer(qp->device, attr.port_num) !=
1649+ if (rdma_port_get_link_layer(qp->device, attr.port_num) !=
16501650 IB_LINK_LAYER_INFINIBAND)
16511651 return true;
16521652 goto lid_check;
@@ -1655,7 +1655,7 @@ static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid) · 2 unmodified lines
16551655
16561656 /* Can't get a quick answer, iterate over all ports */
16571657 for (port = 0; port < qp->device->phys_port_cnt; port++)
1658− if (qp->device->get_link_layer(qp->device, port) !=
1658+ if (rdma_port_get_link_layer(qp->device, port) !=
16591659 IB_LINK_LAYER_INFINIBAND)
16601660 num_eth_ports++;
16611661
drivers/infiniband/hw/bnxt_re/bnxt_re.h+9−5
@@ -93,11 +93,13 @@ struct bnxt_re_dev { · 92 unmodified lines
9393 struct ib_device ibdev;
9494 struct list_head list;
9595 unsigned long flags;
96−#define BNXT_RE_FLAG_NETDEV_REGISTERED 0
97−#define BNXT_RE_FLAG_IBDEV_REGISTERED 1
98−#define BNXT_RE_FLAG_GOT_MSIX 2
99−#define BNXT_RE_FLAG_RCFW_CHANNEL_EN 8
100−#define BNXT_RE_FLAG_QOS_WORK_REG 16
96+#define BNXT_RE_FLAG_NETDEV_REGISTERED 0
97+#define BNXT_RE_FLAG_IBDEV_REGISTERED 1
98+#define BNXT_RE_FLAG_GOT_MSIX 2
99+#define BNXT_RE_FLAG_HAVE_L2_REF 3
100+#define BNXT_RE_FLAG_RCFW_CHANNEL_EN 4
101+#define BNXT_RE_FLAG_QOS_WORK_REG 5
102+#define BNXT_RE_FLAG_TASK_IN_PROG 6
101103 struct net_device *netdev;
102104 unsigned int version, major, minor;
103105 struct bnxt_en_dev *en_dev;
@@ -108,6 +110,8 @@ struct bnxt_re_dev { · 4 unmodified lines
108110
109111 struct delayed_work worker;
110112 u8 cur_prio_map;
113+ u8 active_speed;
114+ u8 active_width;
111115
112116 /* FP Notification Queue (CQ & SRQ) */
113117 struct tasklet_struct nq_task;
drivers/infiniband/hw/bnxt_re/ib_verbs.c+64−43
@@ -259,14 +259,9 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num, · 258 unmodified lines
259259 port_attr->sm_sl = 0;
260260 port_attr->subnet_timeout = 0;
261261 port_attr->init_type_reply = 0;
262− /* call the underlying netdev's ethtool hooks to query speed settings
263− * for which we acquire rtnl_lock _only_ if it's registered with
264− * IB stack to avoid race in the NETDEV_UNREG path
265− */
266− if (test_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags))
267− if (ib_get_eth_speed(ibdev, port_num, &port_attr->active_speed,
268− &port_attr->active_width))
269− return -EINVAL;
262+ port_attr->active_speed = rdev->active_speed;
263+ port_attr->active_width = rdev->active_width;
264+
270265 return 0;
271266 }
272267
@@ -319,6 +314,7 @@ int bnxt_re_del_gid(struct ib_device *ibdev, u8 port_num, · 46 unmodified lines
319314 struct bnxt_re_gid_ctx *ctx, **ctx_tbl;
320315 struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibdev, ibdev);
321316 struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl;
317+ struct bnxt_qplib_gid *gid_to_del;
322318
323319 /* Delete the entry from the hardware */
324320 ctx = *context;
@@ -328,11 +324,25 @@ int bnxt_re_del_gid(struct ib_device *ibdev, u8 port_num, · 3 unmodified lines
328324 if (sgid_tbl && sgid_tbl->active) {
329325 if (ctx->idx >= sgid_tbl->max)
330326 return -EINVAL;
327+ gid_to_del = &sgid_tbl->tbl[ctx->idx];
328+ /* DEL_GID is called in WQ context(netdevice_event_work_handler)
329+ * or via the ib_unregister_device path. In the former case QP1
330+ * may not be destroyed yet, in which case just return as FW
331+ * needs that entry to be present and will fail it's deletion.
332+ * We could get invoked again after QP1 is destroyed OR get an
333+ * ADD_GID call with a different GID value for the same index
334+ * where we issue MODIFY_GID cmd to update the GID entry -- TBD
335+ */
336+ if (ctx->idx == 0 &&
337+ rdma_link_local_addr((struct in6_addr *)gid_to_del) &&
338+ ctx->refcnt == 1 && rdev->qp1_sqp) {
339+ dev_dbg(rdev_to_dev(rdev),
340+ "Trying to delete GID0 while QP1 is alive\n");
341+ return -EFAULT;
342+ }
331343 ctx->refcnt--;
332344 if (!ctx->refcnt) {
333− rc = bnxt_qplib_del_sgid(sgid_tbl,
334− &sgid_tbl->tbl[ctx->idx],
335− true);
345+ rc = bnxt_qplib_del_sgid(sgid_tbl, gid_to_del, true);
336346 if (rc) {
337347 dev_err(rdev_to_dev(rdev),
338348 "Failed to remove GID: %#x", rc);
@@ -816,6 +826,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp) · 477 unmodified lines
816826
817827 kfree(rdev->sqp_ah);
818828 kfree(rdev->qp1_sqp);
829+ rdev->qp1_sqp = NULL;
830+ rdev->sqp_ah = NULL;
819831 }
820832
821833 if (!IS_ERR_OR_NULL(qp->rumem))
@@ -1436,11 +1448,14 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, · 614 unmodified lines
14361448 qp->qplib_qp.modify_flags |=
14371449 CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU;
14381450 qp->qplib_qp.path_mtu = __from_ib_mtu(qp_attr->path_mtu);
1451+ qp->qplib_qp.mtu = ib_mtu_enum_to_int(qp_attr->path_mtu);
14391452 } else if (qp_attr->qp_state == IB_QPS_RTR) {
14401453 qp->qplib_qp.modify_flags |=
14411454 CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU;
14421455 qp->qplib_qp.path_mtu =
14431456 __from_ib_mtu(iboe_get_mtu(rdev->netdev->mtu));
1457+ qp->qplib_qp.mtu =
1458+ ib_mtu_enum_to_int(iboe_get_mtu(rdev->netdev->mtu));
14441459 }
14451460
14461461 if (qp_attr_mask & IB_QP_TIMEOUT) {
@@ -1551,43 +1566,46 @@ int bnxt_re_query_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, · 104 unmodified lines
15511566 {
15521567 struct bnxt_re_qp *qp = container_of(ib_qp, struct bnxt_re_qp, ib_qp);
15531568 struct bnxt_re_dev *rdev = qp->rdev;
1554− struct bnxt_qplib_qp qplib_qp;
1569+ struct bnxt_qplib_qp *qplib_qp;
15551570 int rc;
15561571
1557− memset(&qplib_qp, 0, sizeof(struct bnxt_qplib_qp));
1558− qplib_qp.id = qp->qplib_qp.id;
1559− qplib_qp.ah.host_sgid_index = qp->qplib_qp.ah.host_sgid_index;
1572+ qplib_qp = kzalloc(sizeof(*qplib_qp), GFP_KERNEL);
1573+ if (!qplib_qp)
1574+ return -ENOMEM;
1575+
1576+ qplib_qp->id = qp->qplib_qp.id;
1577+ qplib_qp->ah.host_sgid_index = qp->qplib_qp.ah.host_sgid_index;
15601578
1561− rc = bnxt_qplib_query_qp(&rdev->qplib_res, &qplib_qp);
1579+ rc = bnxt_qplib_query_qp(&rdev->qplib_res, qplib_qp);
15621580 if (rc) {
15631581 dev_err(rdev_to_dev(rdev), "Failed to query HW QP");
1564− return rc;
1582+ goto out;
15651583 }
1566− qp_attr->qp_state = __to_ib_qp_state(qplib_qp.state);
1567− qp_attr->en_sqd_async_notify = qplib_qp.en_sqd_async_notify ? 1 : 0;
1568− qp_attr->qp_access_flags = __to_ib_access_flags(qplib_qp.access);
1569− qp_attr->pkey_index = qplib_qp.pkey_index;
1570− qp_attr->qkey = qplib_qp.qkey;
1584+ qp_attr->qp_state = __to_ib_qp_state(qplib_qp->state);
1585+ qp_attr->en_sqd_async_notify = qplib_qp->en_sqd_async_notify ? 1 : 0;
1586+ qp_attr->qp_access_flags = __to_ib_access_flags(qplib_qp->access);
1587+ qp_attr->pkey_index = qplib_qp->pkey_index;
1588+ qp_attr->qkey = qplib_qp->qkey;
15711589 qp_attr->ah_attr.type = RDMA_AH_ATTR_TYPE_ROCE;
1572− rdma_ah_set_grh(&qp_attr->ah_attr, NULL, qplib_qp.ah.flow_label,
1573− qplib_qp.ah.host_sgid_index,
1574− qplib_qp.ah.hop_limit,
1575− qplib_qp.ah.traffic_class);
1576− rdma_ah_set_dgid_raw(&qp_attr->ah_attr, qplib_qp.ah.dgid.data);
1577− rdma_ah_set_sl(&qp_attr->ah_attr, qplib_qp.ah.sl);
1578− ether_addr_copy(qp_attr->ah_attr.roce.dmac, qplib_qp.ah.dmac);
1579− qp_attr->path_mtu = __to_ib_mtu(qplib_qp.path_mtu);
1580− qp_attr->timeout = qplib_qp.timeout;
1581− qp_attr->retry_cnt = qplib_qp.retry_cnt;
1582− qp_attr->rnr_retry = qplib_qp.rnr_retry;
1583− qp_attr->min_rnr_timer = qplib_qp.min_rnr_timer;
1584− qp_attr->rq_psn = qplib_qp.rq.psn;
1585− qp_attr->max_rd_atomic = qplib_qp.max_rd_atomic;
1586− qp_attr->sq_psn = qplib_qp.sq.psn;
1587− qp_attr->max_dest_rd_atomic = qplib_qp.max_dest_rd_atomic;
1588− qp_init_attr->sq_sig_type = qplib_qp.sig_type ? IB_SIGNAL_ALL_WR :
1589− IB_SIGNAL_REQ_WR;
1590− qp_attr->dest_qp_num = qplib_qp.dest_qpn;
1590+ rdma_ah_set_grh(&qp_attr->ah_attr, NULL, qplib_qp->ah.flow_label,
1591+ qplib_qp->ah.host_sgid_index,
1592+ qplib_qp->ah.hop_limit,
1593+ qplib_qp->ah.traffic_class);
1594+ rdma_ah_set_dgid_raw(&qp_attr->ah_attr, qplib_qp->ah.dgid.data);
1595+ rdma_ah_set_sl(&qp_attr->ah_attr, qplib_qp->ah.sl);
1596+ ether_addr_copy(qp_attr->ah_attr.roce.dmac, qplib_qp->ah.dmac);
1597+ qp_attr->path_mtu = __to_ib_mtu(qplib_qp->path_mtu);
1598+ qp_attr->timeout = qplib_qp->timeout;
1599+ qp_attr->retry_cnt = qplib_qp->retry_cnt;
1600+ qp_attr->rnr_retry = qplib_qp->rnr_retry;
1601+ qp_attr->min_rnr_timer = qplib_qp->min_rnr_timer;
1602+ qp_attr->rq_psn = qplib_qp->rq.psn;
1603+ qp_attr->max_rd_atomic = qplib_qp->max_rd_atomic;
1604+ qp_attr->sq_psn = qplib_qp->sq.psn;
1605+ qp_attr->max_dest_rd_atomic = qplib_qp->max_dest_rd_atomic;
1606+ qp_init_attr->sq_sig_type = qplib_qp->sig_type ? IB_SIGNAL_ALL_WR :
1607+ IB_SIGNAL_REQ_WR;
1608+ qp_attr->dest_qp_num = qplib_qp->dest_qpn;
15911609
15921610 qp_attr->cap.max_send_wr = qp->qplib_qp.sq.max_wqe;
15931611 qp_attr->cap.max_send_sge = qp->qplib_qp.sq.max_sge;
@@ -1596,7 +1614,9 @@ int bnxt_re_query_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, · 2 unmodified lines
15961614 qp_attr->cap.max_inline_data = qp->qplib_qp.max_inline_data;
15971615 qp_init_attr->cap = qp_attr->cap;
15981616
1599− return 0;
1617+out:
1618+ kfree(qplib_qp);
1619+ return rc;
16001620 }
16011621
16021622 /* Routine for sending QP1 packets for RoCE V1 an V2
@@ -1908,6 +1928,7 @@ static int bnxt_re_build_atomic_wqe(struct ib_send_wr *wr, · 305 unmodified lines
19081928 switch (wr->opcode) {
19091929 case IB_WR_ATOMIC_CMP_AND_SWP:
19101930 wqe->type = BNXT_QPLIB_SWQE_TYPE_ATOMIC_CMP_AND_SWP;
1931+ wqe->atomic.cmp_data = atomic_wr(wr)->compare_add;
19111932 wqe->atomic.swap_data = atomic_wr(wr)->swap;
19121933 break;
19131934 case IB_WR_ATOMIC_FETCH_AND_ADD:
@@ -3062,7 +3083,7 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr) · 1148 unmodified lines
30623083 return rc;
30633084 }
30643085
3065− if (mr->npages && mr->pages) {
3086+ if (mr->pages) {
30663087 rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
30673088 &mr->qplib_frpl);
30683089 kfree(mr->pages);
drivers/infiniband/hw/bnxt_re/main.c+28−0
@@ -1161,6 +1161,8 @@ static int bnxt_re_ib_reg(struct bnxt_re_dev *rdev) · 1160 unmodified lines
11611161 }
11621162 }
11631163 set_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags);
1164+ ib_get_eth_speed(&rdev->ibdev, 1, &rdev->active_speed,
1165+ &rdev->active_width);
11641166 bnxt_re_dispatch_event(&rdev->ibdev, NULL, 1, IB_EVENT_PORT_ACTIVE);
11651167 bnxt_re_dispatch_event(&rdev->ibdev, NULL, 1, IB_EVENT_GID_CHANGE);
11661168
@@ -1255,10 +1257,14 @@ static void bnxt_re_task(struct work_struct *work) · 88 unmodified lines
12551257 else if (netif_carrier_ok(rdev->netdev))
12561258 bnxt_re_dispatch_event(&rdev->ibdev, NULL, 1,
12571259 IB_EVENT_PORT_ACTIVE);
1260+ ib_get_eth_speed(&rdev->ibdev, 1, &rdev->active_speed,
1261+ &rdev->active_width);
12581262 break;
12591263 default:
12601264 break;
12611265 }
1266+ smp_mb__before_atomic();
1267+ clear_bit(BNXT_RE_FLAG_TASK_IN_PROG, &rdev->flags);
12621268 kfree(re_work);
12631269 }
12641270
@@ -1317,6 +1323,11 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier, · 52 unmodified lines
13171323 break;
13181324
13191325 case NETDEV_UNREGISTER:
1326+ /* netdev notifier will call NETDEV_UNREGISTER again later since
1327+ * we are still holding the reference to the netdev
1328+ */
1329+ if (test_bit(BNXT_RE_FLAG_TASK_IN_PROG, &rdev->flags))
1330+ goto exit;
13201331 bnxt_re_ib_unreg(rdev, false);
13211332 bnxt_re_remove_one(rdev);
13221333 bnxt_re_dev_unreg(rdev);
@@ -1335,6 +1346,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier, · 12 unmodified lines
13351346 re_work->vlan_dev = (real_dev == netdev ?
13361347 NULL : netdev);
13371348 INIT_WORK(&re_work->work, bnxt_re_task);
1349+ set_bit(BNXT_RE_FLAG_TASK_IN_PROG, &rdev->flags);
13381350 queue_work(bnxt_re_wq, &re_work->work);
13391351 }
13401352 }
@@ -1375,6 +1387,22 @@ err_netdev: · 34 unmodified lines
13751387
13761388 static void __exit bnxt_re_mod_exit(void)
13771389 {
1390+ struct bnxt_re_dev *rdev;
1391+ LIST_HEAD(to_be_deleted);
1392+
1393+ mutex_lock(&bnxt_re_dev_lock);
1394+ /* Free all adapter allocated resources */
1395+ if (!list_empty(&bnxt_re_dev_list))
1396+ list_splice_init(&bnxt_re_dev_list, &to_be_deleted);
1397+ mutex_unlock(&bnxt_re_dev_lock);
1398+
1399+ list_for_each_entry(rdev, &to_be_deleted, list) {
1400+ dev_info(rdev_to_dev(rdev), "Unregistering Device");
1401+ bnxt_re_dev_stop(rdev);
1402+ bnxt_re_ib_unreg(rdev, true);
1403+ bnxt_re_remove_one(rdev);
1404+ bnxt_re_dev_unreg(rdev);
1405+ }
13781406 unregister_netdevice_notifier(&bnxt_re_netdev_notifier);
13791407 if (bnxt_re_wq)
13801408 destroy_workqueue(bnxt_re_wq);
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c+4−0
@@ -107,6 +107,9 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req, · 106 unmodified lines
107107 return -EINVAL;
108108 }
109109
110+ if (test_bit(FIRMWARE_TIMED_OUT, &rcfw->flags))
111+ return -ETIMEDOUT;
112+
110113 /* Cmdq are in 16-byte units, each request can consume 1 or more
111114 * cmdqe
112115 */
@@ -226,6 +229,7 @@ int bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw, · 113 unmodified lines
226229 /* timed out */
227230 dev_err(&rcfw->pdev->dev, "QPLIB: cmdq[%#x]=%#x timedout (%d)msec",
228231 cookie, opcode, RCFW_CMD_WAIT_TIME_MS);
232+ set_bit(FIRMWARE_TIMED_OUT, &rcfw->flags);
229233 return rc;
230234 }
231235
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h+2−1
@@ -162,8 +162,9 @@ struct bnxt_qplib_rcfw { · 161 unmodified lines
162162 unsigned long *cmdq_bitmap;
163163 u32 bmap_size;
164164 unsigned long flags;
165−#define FIRMWARE_INITIALIZED_FLAG 1
165+#define FIRMWARE_INITIALIZED_FLAG BIT(0)
166166 #define FIRMWARE_FIRST_FLAG BIT(31)
167+#define FIRMWARE_TIMED_OUT BIT(3)
167168 wait_queue_head_t waitq;
168169 int (*aeq_handler)(struct bnxt_qplib_rcfw *,
169170 struct creq_func_event *);
drivers/infiniband/hw/cxgb4/cm.c+7−2
@@ -2333,9 +2333,14 @@ static int close_listsrv_rpl(struct c4iw_dev *dev, struct sk_buff *skb) · 2332 unmodified lines
23332333 unsigned int stid = GET_TID(rpl);
23342334 struct c4iw_listen_ep *ep = get_ep_from_stid(dev, stid);
23352335
2336+ if (!ep) {
2337+ pr_debug("%s stid %d lookup failure!\n", __func__, stid);
2338+ goto out;
2339+ }
23362340 pr_debug("%s ep %p\n", __func__, ep);
23372341 c4iw_wake_up(&ep->com.wr_wait, status2errno(rpl->status));
23382342 c4iw_put_ep(&ep->com);
2343+out:
23392344 return 0;
23402345 }
23412346
@@ -2594,9 +2599,9 @@ fail: · 252 unmodified lines
25942599 c4iw_put_ep(&child_ep->com);
25952600 reject:
25962601 reject_cr(dev, hwtid, skb);
2602+out:
25972603 if (parent_ep)
25982604 c4iw_put_ep(&parent_ep->com);
2599−out:
26002605 return 0;
26012606 }
26022607
@@ -3457,7 +3462,7 @@ int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog) · 854 unmodified lines
34573462 cm_id->provider_data = ep;
34583463 goto out;
34593464 }
3460−
3465+ remove_handle(ep->com.dev, &ep->com.dev->stid_idr, ep->stid);
34613466 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid,
34623467 ep->com.local_addr.ss_family);
34633468 fail2:
drivers/infiniband/hw/i40iw/i40iw.h+0−1
@@ -201,7 +201,6 @@ enum init_completion_state { · 200 unmodified lines
201201 CEQ_CREATED,
202202 ILQ_CREATED,
203203 IEQ_CREATED,
204− INET_NOTIFIER,
205204 IP_ADDR_REGISTERED,
206205 RDMA_DEV_REGISTERED
207206 };
drivers/infiniband/hw/i40iw/i40iw_cm.c+77−77
@@ -1504,23 +1504,40 @@ static void i40iw_add_hte_node(struct i40iw_cm_core *cm_core, · 1503 unmodified lines
15041504 }
15051505
15061506 /**
1507− * listen_port_in_use - determine if port is in use
1508− * @port: Listen port number
1507+ * i40iw_port_in_use - determine if port is in use
1508+ * @port: port number
1509+ * @active_side: flag for listener side vs active side
15091510 */
1510−static bool i40iw_listen_port_in_use(struct i40iw_cm_core *cm_core, u16 port)
1511+static bool i40iw_port_in_use(struct i40iw_cm_core *cm_core, u16 port, bool active_side)
15111512 {
15121513 struct i40iw_cm_listener *listen_node;
1514+ struct i40iw_cm_node *cm_node;
15131515 unsigned long flags;
15141516 bool ret = false;
15151517
1516− spin_lock_irqsave(&cm_core->listen_list_lock, flags);
1517− list_for_each_entry(listen_node, &cm_core->listen_nodes, list) {
1518− if (listen_node->loc_port == port) {
1519− ret = true;
1520− break;
1518+ if (active_side) {
1519+ /* search connected node list */
1520+ spin_lock_irqsave(&cm_core->ht_lock, flags);
1521+ list_for_each_entry(cm_node, &cm_core->connected_nodes, list) {
1522+ if (cm_node->loc_port == port) {
1523+ ret = true;
1524+ break;
1525+ }
1526+ }
1527+ if (!ret)
1528+ clear_bit(port, cm_core->active_side_ports);
1529+ spin_unlock_irqrestore(&cm_core->ht_lock, flags);
1530+ } else {
1531+ spin_lock_irqsave(&cm_core->listen_list_lock, flags);
1532+ list_for_each_entry(listen_node, &cm_core->listen_nodes, list) {
1533+ if (listen_node->loc_port == port) {
1534+ ret = true;
1535+ break;
1536+ }
15211537 }
1538+ spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
15221539 }
1523− spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
1540+
15241541 return ret;
15251542 }
15261543
@@ -1868,7 +1885,7 @@ static int i40iw_dec_refcnt_listen(struct i40iw_cm_core *cm_core, · 341 unmodified lines
18681885 spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
18691886
18701887 if (listener->iwdev) {
1871− if (apbvt_del && !i40iw_listen_port_in_use(cm_core, listener->loc_port))
1888+ if (apbvt_del && !i40iw_port_in_use(cm_core, listener->loc_port, false))
18721889 i40iw_manage_apbvt(listener->iwdev,
18731890 listener->loc_port,
18741891 I40IW_MANAGE_APBVT_DEL);
@@ -2247,21 +2264,21 @@ static void i40iw_rem_ref_cm_node(struct i40iw_cm_node *cm_node) · 372 unmodified lines
22472264 if (cm_node->listener) {
22482265 i40iw_dec_refcnt_listen(cm_core, cm_node->listener, 0, true);
22492266 } else {
2250− if (!i40iw_listen_port_in_use(cm_core, cm_node->loc_port) &&
2251− cm_node->apbvt_set) {
2267+ if (!i40iw_port_in_use(cm_core, cm_node->loc_port, true) && cm_node->apbvt_set) {
22522268 i40iw_manage_apbvt(cm_node->iwdev,
22532269 cm_node->loc_port,
22542270 I40IW_MANAGE_APBVT_DEL);
2255− i40iw_get_addr_info(cm_node, &nfo);
2256− if (cm_node->qhash_set) {
2257− i40iw_manage_qhash(cm_node->iwdev,
2258− &nfo,
2259− I40IW_QHASH_TYPE_TCP_ESTABLISHED,
2260− I40IW_QHASH_MANAGE_TYPE_DELETE,
2261− NULL,
2262− false);
2263− cm_node->qhash_set = 0;
2264− }
2271+ cm_node->apbvt_set = 0;
2272+ }
2273+ i40iw_get_addr_info(cm_node, &nfo);
2274+ if (cm_node->qhash_set) {
2275+ i40iw_manage_qhash(cm_node->iwdev,
2276+ &nfo,
2277+ I40IW_QHASH_TYPE_TCP_ESTABLISHED,
2278+ I40IW_QHASH_MANAGE_TYPE_DELETE,
2279+ NULL,
2280+ false);
2281+ cm_node->qhash_set = 0;
22652282 }
22662283 }
22672284
@@ -3255,7 +3272,8 @@ static void i40iw_init_tcp_ctx(struct i40iw_cm_node *cm_node, · 987 unmodified lines
32553272 tcp_info->snd_mss = cpu_to_le32(((u32)cm_node->tcp_cntxt.mss));
32563273 if (cm_node->vlan_id < VLAN_TAG_PRESENT) {
32573274 tcp_info->insert_vlan_tag = true;
3258− tcp_info->vlan_tag = cpu_to_le16(cm_node->vlan_id);
3275+ tcp_info->vlan_tag = cpu_to_le16(((u16)cm_node->user_pri << I40IW_VLAN_PRIO_SHIFT) |
3276+ cm_node->vlan_id);
32593277 }
32603278 if (cm_node->ipv4) {
32613279 tcp_info->src_port = cpu_to_le16(cm_node->loc_port);
@@ -3737,10 +3755,8 @@ int i40iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 475 unmodified lines
37373755 struct sockaddr_in *raddr;
37383756 struct sockaddr_in6 *laddr6;
37393757 struct sockaddr_in6 *raddr6;
3740− bool qhash_set = false;
3741− int apbvt_set = 0;
3742− int err = 0;
3743− enum i40iw_status_code status;
3758+ int ret = 0;
3759+ unsigned long flags;
37443760
37453761 ibqp = i40iw_get_qp(cm_id->device, conn_param->qpn);
37463762 if (!ibqp)
@@ -3789,32 +3805,6 @@ int i40iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 42 unmodified lines
37893805 cm_info.user_pri = rt_tos2priority(cm_id->tos);
37903806 i40iw_debug(&iwdev->sc_dev, I40IW_DEBUG_DCB, "%s TOS:[%d] UP:[%d]\n",
37913807 __func__, cm_id->tos, cm_info.user_pri);
3792− if ((cm_info.ipv4 && (laddr->sin_addr.s_addr != raddr->sin_addr.s_addr)) ||
3793− (!cm_info.ipv4 && memcmp(laddr6->sin6_addr.in6_u.u6_addr32,
3794− raddr6->sin6_addr.in6_u.u6_addr32,
3795− sizeof(laddr6->sin6_addr.in6_u.u6_addr32)))) {
3796− status = i40iw_manage_qhash(iwdev,
3797− &cm_info,
3798− I40IW_QHASH_TYPE_TCP_ESTABLISHED,
3799− I40IW_QHASH_MANAGE_TYPE_ADD,
3800− NULL,
3801− true);
3802− if (status)
3803− return -EINVAL;
3804− qhash_set = true;
3805− }
3806− status = i40iw_manage_apbvt(iwdev, cm_info.loc_port, I40IW_MANAGE_APBVT_ADD);
3807− if (status) {
3808− i40iw_manage_qhash(iwdev,
3809− &cm_info,
3810− I40IW_QHASH_TYPE_TCP_ESTABLISHED,
3811− I40IW_QHASH_MANAGE_TYPE_DELETE,
3812− NULL,
3813− false);
3814− return -EINVAL;
3815− }
3816−
3817− apbvt_set = 1;
38183808 cm_id->add_ref(cm_id);
38193809 cm_node = i40iw_create_cm_node(&iwdev->cm_core, iwdev,
38203810 conn_param->private_data_len,
@@ -3822,17 +3812,40 @@ int i40iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 1 unmodified line
38223812 &cm_info);
38233813
38243814 if (IS_ERR(cm_node)) {
3825− err = PTR_ERR(cm_node);
3826− goto err_out;
3815+ ret = PTR_ERR(cm_node);
3816+ cm_id->rem_ref(cm_id);
3817+ return ret;
3818+ }
3819+
3820+ if ((cm_info.ipv4 && (laddr->sin_addr.s_addr != raddr->sin_addr.s_addr)) ||
3821+ (!cm_info.ipv4 && memcmp(laddr6->sin6_addr.in6_u.u6_addr32,
3822+ raddr6->sin6_addr.in6_u.u6_addr32,
3823+ sizeof(laddr6->sin6_addr.in6_u.u6_addr32)))) {
3824+ if (i40iw_manage_qhash(iwdev, &cm_info, I40IW_QHASH_TYPE_TCP_ESTABLISHED,
3825+ I40IW_QHASH_MANAGE_TYPE_ADD, NULL, true)) {
3826+ ret = -EINVAL;
3827+ goto err;
3828+ }
3829+ cm_node->qhash_set = true;
38273830 }
38283831
3832+ spin_lock_irqsave(&iwdev->cm_core.ht_lock, flags);
3833+ if (!test_and_set_bit(cm_info.loc_port, iwdev->cm_core.active_side_ports)) {
3834+ spin_unlock_irqrestore(&iwdev->cm_core.ht_lock, flags);
3835+ if (i40iw_manage_apbvt(iwdev, cm_info.loc_port, I40IW_MANAGE_APBVT_ADD)) {
3836+ ret = -EINVAL;
3837+ goto err;
3838+ }
3839+ } else {
3840+ spin_unlock_irqrestore(&iwdev->cm_core.ht_lock, flags);
3841+ }
3842+
3843+ cm_node->apbvt_set = true;
38293844 i40iw_record_ird_ord(cm_node, (u16)conn_param->ird, (u16)conn_param->ord);
38303845 if (cm_node->send_rdma0_op == SEND_RDMA_READ_ZERO &&
38313846 !cm_node->ord_size)
38323847 cm_node->ord_size = 1;
38333848
3834− cm_node->apbvt_set = apbvt_set;
3835− cm_node->qhash_set = qhash_set;
38363849 iwqp->cm_node = cm_node;
38373850 cm_node->iwqp = iwqp;
38383851 iwqp->cm_id = cm_id;
@@ -3840,11 +3853,9 @@ int i40iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 1 unmodified line
38403853
38413854 if (cm_node->state != I40IW_CM_STATE_OFFLOADED) {
38423855 cm_node->state = I40IW_CM_STATE_SYN_SENT;
3843− err = i40iw_send_syn(cm_node, 0);
3844− if (err) {
3845− i40iw_rem_ref_cm_node(cm_node);
3846− goto err_out;
3847− }
3856+ ret = i40iw_send_syn(cm_node, 0);
3857+ if (ret)
3858+ goto err;
38483859 }
38493860
38503861 i40iw_debug(cm_node->dev,
@@ -3853,9 +3864,10 @@ int i40iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) · 2 unmodified lines
38533864 cm_node->rem_port,
38543865 cm_node,
38553866 cm_node->cm_id);
3867+
38563868 return 0;
38573869
3858−err_out:
3870+err:
38593871 if (cm_info.ipv4)
38603872 i40iw_debug(&iwdev->sc_dev,
38613873 I40IW_DEBUG_CM,
@@ -3867,22 +3879,10 @@ err_out: · 5 unmodified lines
38673879 "Api - connect() FAILED: dest addr=%pI6",
38683880 cm_info.rem_addr);
38693881
3870− if (qhash_set)
3871− i40iw_manage_qhash(iwdev,
3872− &cm_info,
3873− I40IW_QHASH_TYPE_TCP_ESTABLISHED,
3874− I40IW_QHASH_MANAGE_TYPE_DELETE,
3875− NULL,
3876− false);
3877−
3878− if (apbvt_set && !i40iw_listen_port_in_use(&iwdev->cm_core,
3879− cm_info.loc_port))
3880− i40iw_manage_apbvt(iwdev,
3881− cm_info.loc_port,
3882− I40IW_MANAGE_APBVT_DEL);
3882+ i40iw_rem_ref_cm_node(cm_node);
38833883 cm_id->rem_ref(cm_id);
38843884 iwdev->cm_core.stats_connect_errs++;
3885− return err;
3885+ return ret;
38863886 }
38873887
38883888 /**
drivers/infiniband/hw/i40iw/i40iw_cm.h+5−0
@@ -71,6 +71,9 @@ · 70 unmodified lines
7171 #define I40IW_HW_IRD_SETTING_32 32
7272 #define I40IW_HW_IRD_SETTING_64 64
7373
74+#define MAX_PORTS 65536
75+#define I40IW_VLAN_PRIO_SHIFT 13
76+
7477 enum ietf_mpa_flags {
7578 IETF_MPA_FLAGS_MARKERS = 0x80, /* receive Markers */
7679 IETF_MPA_FLAGS_CRC = 0x40, /* receive Markers */
@@ -411,6 +414,8 @@ struct i40iw_cm_core { · 334 unmodified lines
411414 spinlock_t ht_lock; /* manage hash table */
412415 spinlock_t listen_list_lock; /* listen list */
413416
417+ unsigned long active_side_ports[BITS_TO_LONGS(MAX_PORTS)];
418+
414419 u64 stats_nodes_created;
415420 u64 stats_nodes_destroyed;
416421 u64 stats_listen_created;
drivers/infiniband/hw/i40iw/i40iw_main.c+23−16
@@ -99,8 +99,6 @@ static struct notifier_block i40iw_net_notifier = { · 98 unmodified lines
9999 .notifier_call = i40iw_net_event
100100 };
101101
102−static atomic_t i40iw_notifiers_registered;
103−
104102 /**
105103 * i40iw_find_i40e_handler - find a handler given a client info
106104 * @ldev: pointer to a client info
@@ -1376,11 +1374,20 @@ error: · 1269 unmodified lines
13761374 */
13771375 static void i40iw_register_notifiers(void)
13781376 {
1379− if (atomic_inc_return(&i40iw_notifiers_registered) == 1) {
1380− register_inetaddr_notifier(&i40iw_inetaddr_notifier);
1381− register_inet6addr_notifier(&i40iw_inetaddr6_notifier);
1382− register_netevent_notifier(&i40iw_net_notifier);
1383− }
1377+ register_inetaddr_notifier(&i40iw_inetaddr_notifier);
1378+ register_inet6addr_notifier(&i40iw_inetaddr6_notifier);
1379+ register_netevent_notifier(&i40iw_net_notifier);
1380+}
1381+
1382+/**
1383+ * i40iw_unregister_notifiers - unregister tcp ip notifiers
1384+ */
1385+
1386+static void i40iw_unregister_notifiers(void)
1387+{
1388+ unregister_netevent_notifier(&i40iw_net_notifier);
1389+ unregister_inetaddr_notifier(&i40iw_inetaddr_notifier);
1390+ unregister_inet6addr_notifier(&i40iw_inetaddr6_notifier);
13841391 }
13851392
13861393 /**
@@ -1400,6 +1407,11 @@ static enum i40iw_status_code i40iw_save_msix_info(struct i40iw_device *iwdev, · 13 unmodified lines
14001407 u32 i;
14011408 u32 size;
14021409
1410+ if (!ldev->msix_count) {
1411+ i40iw_pr_err("No MSI-X vectors\n");
1412+ return I40IW_ERR_CONFIG;
1413+ }
1414+
14031415 iwdev->msix_count = ldev->msix_count;
14041416
14051417 size = sizeof(struct i40iw_msix_vector) * iwdev->msix_count;
@@ -1462,12 +1474,6 @@ static void i40iw_deinit_device(struct i40iw_device *iwdev) · 56 unmodified lines
14621474 if (!iwdev->reset)
14631475 i40iw_del_macip_entry(iwdev, (u8)iwdev->mac_ip_table_idx);
14641476 /* fallthrough */
1465− case INET_NOTIFIER:
1466− if (!atomic_dec_return(&i40iw_notifiers_registered)) {
1467− unregister_netevent_notifier(&i40iw_net_notifier);
1468− unregister_inetaddr_notifier(&i40iw_inetaddr_notifier);
1469− unregister_inet6addr_notifier(&i40iw_inetaddr6_notifier);
1470− }
14711477 /* fallthrough */
14721478 case PBLE_CHUNK_MEM:
14731479 i40iw_destroy_pble_pool(dev, iwdev->pble_rsrc);
@@ -1550,7 +1556,7 @@ static enum i40iw_status_code i40iw_setup_init_state(struct i40iw_handler *hdl, · 76 unmodified lines
15501556
15511557 status = i40iw_save_msix_info(iwdev, ldev);
15521558 if (status)
1553− goto exit;
1559+ return status;
15541560 iwdev->hw.dev_context = (void *)ldev->pcidev;
15551561 iwdev->hw.hw_addr = ldev->hw_addr;
15561562 status = i40iw_allocate_dma_mem(&iwdev->hw,
@@ -1667,8 +1673,6 @@ static int i40iw_open(struct i40e_info *ldev, struct i40e_client *client) · 110 unmodified lines
16671673 break;
16681674 iwdev->init_state = PBLE_CHUNK_MEM;
16691675 iwdev->virtchnl_wq = alloc_ordered_workqueue("iwvch", WQ_MEM_RECLAIM);
1670− i40iw_register_notifiers();
1671− iwdev->init_state = INET_NOTIFIER;
16721676 status = i40iw_add_mac_ip(iwdev);
16731677 if (status)
16741678 break;
@@ -2018,6 +2022,8 @@ static int __init i40iw_init_module(void) · 343 unmodified lines
20182022 i40iw_client.type = I40E_CLIENT_IWARP;
20192023 spin_lock_init(&i40iw_handler_lock);
20202024 ret = i40e_register_client(&i40iw_client);
2025+ i40iw_register_notifiers();
2026+
20212027 return ret;
20222028 }
20232029
@@ -2029,6 +2035,7 @@ static int __init i40iw_init_module(void) · 5 unmodified lines
20292035 */
20302036 static void __exit i40iw_exit_module(void)
20312037 {
2038+ i40iw_unregister_notifiers();
20322039 i40e_unregister_client(&i40iw_client);
20332040 }
20342041
drivers/infiniband/hw/i40iw/i40iw_utils.c+3−3
@@ -160,7 +160,7 @@ int i40iw_inetaddr_event(struct notifier_block *notifier, · 159 unmodified lines
160160 return NOTIFY_DONE;
161161
162162 iwdev = &hdl->device;
163− if (iwdev->init_state < INET_NOTIFIER)
163+ if (iwdev->init_state < IP_ADDR_REGISTERED || iwdev->closing)
164164 return NOTIFY_DONE;
165165
166166 netdev = iwdev->ldev->netdev;
@@ -217,7 +217,7 @@ int i40iw_inet6addr_event(struct notifier_block *notifier, · 50 unmodified lines
217217 return NOTIFY_DONE;
218218
219219 iwdev = &hdl->device;
220− if (iwdev->init_state < INET_NOTIFIER)
220+ if (iwdev->init_state < IP_ADDR_REGISTERED || iwdev->closing)
221221 return NOTIFY_DONE;
222222
223223 netdev = iwdev->ldev->netdev;
@@ -266,7 +266,7 @@ int i40iw_net_event(struct notifier_block *notifier, unsigned long event, void * · 42 unmodified lines
266266 if (!iwhdl)
267267 return NOTIFY_DONE;
268268 iwdev = &iwhdl->device;
269− if (iwdev->init_state < INET_NOTIFIER)
269+ if (iwdev->init_state < IP_ADDR_REGISTERED || iwdev->closing)
270270 return NOTIFY_DONE;
271271 p = (__be32 *)neigh->primary_key;
272272 i40iw_copy_ip_ntohl(local_ipaddr, p);
drivers/infiniband/hw/i40iw/i40iw_verbs.c+12−0
@@ -1027,7 +1027,19 @@ int i40iw_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, · 1026 unmodified lines
10271027 iwqp->hw_tcp_state = I40IW_TCP_STATE_CLOSED;
10281028 iwqp->last_aeq = I40IW_AE_RESET_SENT;
10291029 spin_unlock_irqrestore(&iwqp->lock, flags);
1030+ i40iw_cm_disconn(iwqp);
10301031 }
1032+ } else {
1033+ spin_lock_irqsave(&iwqp->lock, flags);
1034+ if (iwqp->cm_id) {
1035+ if (atomic_inc_return(&iwqp->close_timer_started) == 1) {
1036+ iwqp->cm_id->add_ref(iwqp->cm_id);
1037+ i40iw_schedule_cm_timer(iwqp->cm_node,
1038+ (struct i40iw_puda_buf *)iwqp,
1039+ I40IW_TIMER_TYPE_CLOSE, 1, 0);
1040+ }
1041+ }
1042+ spin_unlock_irqrestore(&iwqp->lock, flags);
10311043 }
10321044 }
10331045 return 0;
drivers/infiniband/hw/mlx5/main.c+3−3
@@ -3837,11 +3837,13 @@ static int delay_drop_debugfs_init(struct mlx5_ib_dev *dev) · 3836 unmodified lines
38373837 if (!dbg)
38383838 return -ENOMEM;
38393839
3840+ dev->delay_drop.dbg = dbg;
3841+
38403842 dbg->dir_debugfs =
38413843 debugfs_create_dir("delay_drop",
38423844 dev->mdev->priv.dbg_root);
38433845 if (!dbg->dir_debugfs)
3844− return -ENOMEM;
3846+ goto out_debugfs;
38453847
38463848 dbg->events_cnt_debugfs =
38473849 debugfs_create_atomic_t("num_timeout_events", 0400,
@@ -3865,8 +3867,6 @@ static int delay_drop_debugfs_init(struct mlx5_ib_dev *dev) · 17 unmodified lines
38653867 if (!dbg->timeout_debugfs)
38663868 goto out_debugfs;
38673869
3868− dev->delay_drop.dbg = dbg;
3869−
38703870 return 0;
38713871
38723872 out_debugfs:
drivers/infiniband/hw/ocrdma/ocrdma_hw.c+3−0
@@ -252,7 +252,10 @@ static int ocrdma_get_mbx_errno(u32 status) · 251 unmodified lines
252252 case OCRDMA_MBX_ADDI_STATUS_INSUFFICIENT_RESOURCES:
253253 err_num = -EAGAIN;
254254 break;
255+ default:
256+ err_num = -EFAULT;
255257 }
258+ break;
256259 default:
257260 err_num = -EFAULT;
258261 }
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+28−3
@@ -416,9 +416,34 @@ static inline enum ib_wc_status pvrdma_wc_status_to_ib( · 415 unmodified lines
416416 return (enum ib_wc_status)status;
417417 }
418418
419−static inline int pvrdma_wc_opcode_to_ib(int opcode)
420−{
421− return opcode;
419+static inline int pvrdma_wc_opcode_to_ib(unsigned int opcode)
420+{
421+ switch (opcode) {
422+ case PVRDMA_WC_SEND:
423+ return IB_WC_SEND;
424+ case PVRDMA_WC_RDMA_WRITE:
425+ return IB_WC_RDMA_WRITE;
426+ case PVRDMA_WC_RDMA_READ:
427+ return IB_WC_RDMA_READ;
428+ case PVRDMA_WC_COMP_SWAP:
429+ return IB_WC_COMP_SWAP;
430+ case PVRDMA_WC_FETCH_ADD:
431+ return IB_WC_FETCH_ADD;
432+ case PVRDMA_WC_LOCAL_INV:
433+ return IB_WC_LOCAL_INV;
434+ case PVRDMA_WC_FAST_REG_MR:
435+ return IB_WC_REG_MR;
436+ case PVRDMA_WC_MASKED_COMP_SWAP:
437+ return IB_WC_MASKED_COMP_SWAP;
438+ case PVRDMA_WC_MASKED_FETCH_ADD:
439+ return IB_WC_MASKED_FETCH_ADD;
440+ case PVRDMA_WC_RECV:
441+ return IB_WC_RECV;
442+ case PVRDMA_WC_RECV_RDMA_WITH_IMM:
443+ return IB_WC_RECV_RDMA_WITH_IMM;
444+ default:
445+ return IB_WC_SEND;
446+ }
422447 }
423448
424449 static inline int pvrdma_wc_flags_to_ib(int flags)
drivers/infiniband/ulp/ipoib/ipoib_cm.c+11−5
@@ -823,12 +823,18 @@ void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc) · 822 unmodified lines
823823 wc->status != IB_WC_WR_FLUSH_ERR) {
824824 struct ipoib_neigh *neigh;
825825
826− if (wc->status != IB_WC_RNR_RETRY_EXC_ERR)
827− ipoib_warn(priv, "failed cm send event (status=%d, wrid=%d vend_err %x)\n",
828− wc->status, wr_id, wc->vendor_err);
826+ /* IB_WC[_RNR]_RETRY_EXC_ERR error is part of the life cycle,
827+ * so don't make waves.
828+ */
829+ if (wc->status == IB_WC_RNR_RETRY_EXC_ERR ||
830+ wc->status == IB_WC_RETRY_EXC_ERR)
831+ ipoib_dbg(priv,
832+ "%s: failed cm send event (status=%d, wrid=%d vend_err 0x%x)\n",
833+ __func__, wc->status, wr_id, wc->vendor_err);
829834 else
830− ipoib_dbg(priv, "failed cm send event (status=%d, wrid=%d vend_err %x)\n",
831− wc->status, wr_id, wc->vendor_err);
835+ ipoib_warn(priv,
836+ "%s: failed cm send event (status=%d, wrid=%d vend_err 0x%x)\n",
837+ __func__, wc->status, wr_id, wc->vendor_err);
832838
833839 spin_lock_irqsave(&priv->lock, flags);
834840 neigh = tx->neigh;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t