History

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

Pull infiniband/rdma fixes from Doug Ledford: "This should hopefully be the last request for 4.1-rc for the RDMA stack. It contains some late ocrdma fixes that I'm including because they are small and self contained. It also contains two bug fixes that are simple and easily verified. Summary: - a number of small, well contained bug fixes for ocrdma driver - a simple fix for the connection negotiation sequence on IB - fix for broken AF_IB address on UD queue pair support" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: IB/cma: Fix broken AF_IB UD support ib/cm: Change reject message type when destroying cm_id RDMA/ocrdma: Update ocrdma version number RDMA/ocrdma: Fail connection for MTU lesser than 512 RDMA/ocrdma: Fix dmac resolution for link local address RDMA/ocrdma: Prevent allocation of DPP PDs if FW doesnt support it RDMA/ocrdma: Fix the request length for RDMA_QUERY_QP mailbox command to FW. RDMA/ocrdma: Use VID 0 if PFC is enabled and vlan is not configured RDMA/ocrdma: Fix QP state transition in destroy_qp RDMA/ocrdma: Report EQ full fatal error RDMA/ocrdma: Fix EQ destroy failure during driver unload

Linus Torvalds committed 11 years ago

Commit 83ee4122 parents 97793a8 c07678b7 files · +101 −53Browse files

Unified · Split

7 files
  1. drivers/infiniband/core/cm.c +1 −1
  2. drivers/infiniband/core/cma.c +21 −11
  3. drivers/infiniband/hw/ocrdma/ocrdma.h +3 −1
  4. drivers/infiniband/hw/ocrdma/ocrdma_ah.c +10 −2
  5. drivers/infiniband/hw/ocrdma/ocrdma_hw.c +50 −33
  6. drivers/infiniband/hw/ocrdma/ocrdma_sli.h +9 −0
  7. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +7 −5
drivers/infiniband/core/cm.c+1−1
@@ -861,6 +861,7 @@ retest: · 860 unmodified lines
861861 cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT);
862862 break;
863863 case IB_CM_REQ_SENT:
864+ case IB_CM_MRA_REQ_RCVD:
864865 ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
865866 spin_unlock_irq(&cm_id_priv->lock);
866867 ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT,
@@ -879,7 +880,6 @@ retest: · 12 unmodified lines
879880 NULL, 0, NULL, 0);
880881 }
881882 break;
882− case IB_CM_MRA_REQ_RCVD:
883883 case IB_CM_REP_SENT:
884884 case IB_CM_MRA_REP_RCVD:
885885 ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
drivers/infiniband/core/cma.c+21−11
@@ -845,18 +845,26 @@ static void cma_save_ib_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id · 844 unmodified lines
845845 listen_ib = (struct sockaddr_ib *) &listen_id->route.addr.src_addr;
846846 ib = (struct sockaddr_ib *) &id->route.addr.src_addr;
847847 ib->sib_family = listen_ib->sib_family;
848− ib->sib_pkey = path->pkey;
849− ib->sib_flowinfo = path->flow_label;
850− memcpy(&ib->sib_addr, &path->sgid, 16);
848+ if (path) {
849+ ib->sib_pkey = path->pkey;
850+ ib->sib_flowinfo = path->flow_label;
851+ memcpy(&ib->sib_addr, &path->sgid, 16);
852+ } else {
853+ ib->sib_pkey = listen_ib->sib_pkey;
854+ ib->sib_flowinfo = listen_ib->sib_flowinfo;
855+ ib->sib_addr = listen_ib->sib_addr;
856+ }
851857 ib->sib_sid = listen_ib->sib_sid;
852858 ib->sib_sid_mask = cpu_to_be64(0xffffffffffffffffULL);
853859 ib->sib_scope_id = listen_ib->sib_scope_id;
854860
855− ib = (struct sockaddr_ib *) &id->route.addr.dst_addr;
856− ib->sib_family = listen_ib->sib_family;
857− ib->sib_pkey = path->pkey;
858− ib->sib_flowinfo = path->flow_label;
859− memcpy(&ib->sib_addr, &path->dgid, 16);
861+ if (path) {
862+ ib = (struct sockaddr_ib *) &id->route.addr.dst_addr;
863+ ib->sib_family = listen_ib->sib_family;
864+ ib->sib_pkey = path->pkey;
865+ ib->sib_flowinfo = path->flow_label;
866+ memcpy(&ib->sib_addr, &path->dgid, 16);
867+ }
860868 }
861869
862870 static __be16 ss_get_port(const struct sockaddr_storage *ss)
@@ -905,9 +913,11 @@ static int cma_save_net_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id · 42 unmodified lines
905913 {
906914 struct cma_hdr *hdr;
907915
908− if ((listen_id->route.addr.src_addr.ss_family == AF_IB) &&
909− (ib_event->event == IB_CM_REQ_RECEIVED)) {
910− cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path);
916+ if (listen_id->route.addr.src_addr.ss_family == AF_IB) {
917+ if (ib_event->event == IB_CM_REQ_RECEIVED)
918+ cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path);
919+ else if (ib_event->event == IB_CM_SIDR_REQ_RECEIVED)
920+ cma_save_ib_info(id, listen_id, NULL);
911921 return 0;
912922 }
913923
drivers/infiniband/hw/ocrdma/ocrdma.h+3−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include <be_roce.h>
4141 #include "ocrdma_sli.h"
4242
43−#define OCRDMA_ROCE_DRV_VERSION "10.4.205.0u"
43+#define OCRDMA_ROCE_DRV_VERSION "10.6.0.0"
4444
4545 #define OCRDMA_ROCE_DRV_DESC "Emulex OneConnect RoCE Driver"
4646 #define OCRDMA_NODE_DESC "Emulex OneConnect RoCE HCA"
@@ -515,6 +515,8 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev, · 468 unmodified lines
515515 memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6));
516516 if (rdma_is_multicast_addr(&in6))
517517 rdma_get_mcast_mac(&in6, mac_addr);
518+ else if (rdma_link_local_addr(&in6))
519+ rdma_get_ll_mac(&in6, mac_addr);
518520 else
519521 memcpy(mac_addr, ah_attr->dmac, ETH_ALEN);
520522 return 0;
drivers/infiniband/hw/ocrdma/ocrdma_ah.c+10−2
@@ -56,7 +56,13 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, · 55 unmodified lines
5656 vlan_tag = attr->vlan_id;
5757 if (!vlan_tag || (vlan_tag > 0xFFF))
5858 vlan_tag = dev->pvid;
59− if (vlan_tag && (vlan_tag < 0x1000)) {
59+ if (vlan_tag || dev->pfc_state) {
60+ if (!vlan_tag) {
61+ pr_err("ocrdma%d:Using VLAN with PFC is recommended\n",
62+ dev->id);
63+ pr_err("ocrdma%d:Using VLAN 0 for this connection\n",
64+ dev->id);
65+ }
6066 eth.eth_type = cpu_to_be16(0x8100);
6167 eth.roce_eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE);
6268 vlan_tag |= (dev->sl & 0x07) << OCRDMA_VID_PCP_SHIFT;
@@ -121,7 +127,9 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) · 58 unmodified lines
121127 goto av_conf_err;
122128 }
123129
124− if (pd->uctx) {
130+ if ((pd->uctx) &&
131+ (!rdma_is_multicast_addr((struct in6_addr *)attr->grh.dgid.raw)) &&
132+ (!rdma_link_local_addr((struct in6_addr *)attr->grh.dgid.raw))) {
125133 status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid,
126134 attr->dmac, &attr->vlan_id);
127135 if (status) {
drivers/infiniband/hw/ocrdma/ocrdma_hw.c+50−33
@@ -933,12 +933,18 @@ static irqreturn_t ocrdma_irq_handler(int irq, void *handle) · 932 unmodified lines
933933 struct ocrdma_eqe eqe;
934934 struct ocrdma_eqe *ptr;
935935 u16 cq_id;
936+ u8 mcode;
936937 int budget = eq->cq_cnt;
937938
938939 do {
939940 ptr = ocrdma_get_eqe(eq);
940941 eqe = *ptr;
941942 ocrdma_le32_to_cpu(&eqe, sizeof(eqe));
943+ mcode = (eqe.id_valid & OCRDMA_EQE_MAJOR_CODE_MASK)
944+ >> OCRDMA_EQE_MAJOR_CODE_SHIFT;
945+ if (mcode == OCRDMA_MAJOR_CODE_SENTINAL)
946+ pr_err("EQ full on eqid = 0x%x, eqe = 0x%x\n",
947+ eq->q.id, eqe.id_valid);
942948 if ((eqe.id_valid & OCRDMA_EQE_VALID_MASK) == 0)
943949 break;
944950
@@ -1434,27 +1440,30 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev) · 489 unmodified lines
14341440 struct ocrdma_alloc_pd_range_rsp *rsp;
14351441
14361442 /* Pre allocate the DPP PDs */
1437− cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE, sizeof(*cmd));
1438− if (!cmd)
1439− return -ENOMEM;
1440− cmd->pd_count = dev->attr.max_dpp_pds;
1441− cmd->enable_dpp_rsvd |= OCRDMA_ALLOC_PD_ENABLE_DPP;
1442− status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
1443− if (status)
1444− goto mbx_err;
1445− rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd;
1446−
1447− if ((rsp->dpp_page_pdid & OCRDMA_ALLOC_PD_RSP_DPP) && rsp->pd_count) {
1448− dev->pd_mgr->dpp_page_index = rsp->dpp_page_pdid >>
1449− OCRDMA_ALLOC_PD_RSP_DPP_PAGE_SHIFT;
1450− dev->pd_mgr->pd_dpp_start = rsp->dpp_page_pdid &
1451− OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK;
1452− dev->pd_mgr->max_dpp_pd = rsp->pd_count;
1453− pd_bitmap_size = BITS_TO_LONGS(rsp->pd_count) * sizeof(long);
1454− dev->pd_mgr->pd_dpp_bitmap = kzalloc(pd_bitmap_size,
1455− GFP_KERNEL);
1443+ if (dev->attr.max_dpp_pds) {
1444+ cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE,
1445+ sizeof(*cmd));
1446+ if (!cmd)
1447+ return -ENOMEM;
1448+ cmd->pd_count = dev->attr.max_dpp_pds;
1449+ cmd->enable_dpp_rsvd |= OCRDMA_ALLOC_PD_ENABLE_DPP;
1450+ status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
1451+ rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd;
1452+
1453+ if (!status && (rsp->dpp_page_pdid & OCRDMA_ALLOC_PD_RSP_DPP) &&
1454+ rsp->pd_count) {
1455+ dev->pd_mgr->dpp_page_index = rsp->dpp_page_pdid >>
1456+ OCRDMA_ALLOC_PD_RSP_DPP_PAGE_SHIFT;
1457+ dev->pd_mgr->pd_dpp_start = rsp->dpp_page_pdid &
1458+ OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK;
1459+ dev->pd_mgr->max_dpp_pd = rsp->pd_count;
1460+ pd_bitmap_size =
1461+ BITS_TO_LONGS(rsp->pd_count) * sizeof(long);
1462+ dev->pd_mgr->pd_dpp_bitmap = kzalloc(pd_bitmap_size,
1463+ GFP_KERNEL);
1464+ }
1465+ kfree(cmd);
14561466 }
1457− kfree(cmd);
14581467
14591468 cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE, sizeof(*cmd));
14601469 if (!cmd)
@@ -1462,10 +1471,8 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev) · 1 unmodified line
14621471
14631472 cmd->pd_count = dev->attr.max_pd - dev->attr.max_dpp_pds;
14641473 status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
1465− if (status)
1466− goto mbx_err;
14671474 rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd;
1468− if (rsp->pd_count) {
1475+ if (!status && rsp->pd_count) {
14691476 dev->pd_mgr->pd_norm_start = rsp->dpp_page_pdid &
14701477 OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK;
14711478 dev->pd_mgr->max_normal_pd = rsp->pd_count;
@@ -1473,15 +1480,13 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev) · 1 unmodified line
14731480 dev->pd_mgr->pd_norm_bitmap = kzalloc(pd_bitmap_size,
14741481 GFP_KERNEL);
14751482 }
1483+ kfree(cmd);
14761484
14771485 if (dev->pd_mgr->pd_norm_bitmap || dev->pd_mgr->pd_dpp_bitmap) {
14781486 /* Enable PD resource manager */
14791487 dev->pd_mgr->pd_prealloc_valid = true;
1480− } else {
1481− return -ENOMEM;
1488+ return 0;
14821489 }
1483−mbx_err:
1484− kfree(cmd);
14851490 return status;
14861491 }
14871492
@@ -2406,7 +2411,7 @@ int ocrdma_mbx_query_qp(struct ocrdma_dev *dev, struct ocrdma_qp *qp, · 918 unmodified lines
24062411 struct ocrdma_query_qp *cmd;
24072412 struct ocrdma_query_qp_rsp *rsp;
24082413
2409− cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_QUERY_QP, sizeof(*cmd));
2414+ cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_QUERY_QP, sizeof(*rsp));
24102415 if (!cmd)
24112416 return status;
24122417 cmd->qp_id = qp->id;
@@ -2428,7 +2433,7 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp, · 15 unmodified lines
24282433 int status;
24292434 struct ib_ah_attr *ah_attr = &attrs->ah_attr;
24302435 union ib_gid sgid, zgid;
2431− u32 vlan_id;
2436+ u32 vlan_id = 0xFFFF;
24322437 u8 mac_addr[6];
24332438 struct ocrdma_dev *dev = get_ocrdma_dev(qp->ibqp.device);
24342439
@@ -2468,12 +2473,22 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp, · 33 unmodified lines
24682473 cmd->params.vlan_dmac_b4_to_b5 = mac_addr[4] | (mac_addr[5] << 8);
24692474 if (attr_mask & IB_QP_VID) {
24702475 vlan_id = attrs->vlan_id;
2476+ } else if (dev->pfc_state) {
2477+ vlan_id = 0;
2478+ pr_err("ocrdma%d:Using VLAN with PFC is recommended\n",
2479+ dev->id);
2480+ pr_err("ocrdma%d:Using VLAN 0 for this connection\n",
2481+ dev->id);
2482+ }
2483+
2484+ if (vlan_id < 0x1000) {
24712485 cmd->params.vlan_dmac_b4_to_b5 |=
24722486 vlan_id << OCRDMA_QP_PARAMS_VLAN_SHIFT;
24732487 cmd->flags |= OCRDMA_QP_PARA_VLAN_EN_VALID;
24742488 cmd->params.rnt_rc_sl_fl |=
24752489 (dev->sl & 0x07) << OCRDMA_QP_PARAMS_SL_SHIFT;
24762490 }
2491+
24772492 return 0;
24782493 }
24792494
@@ -2519,8 +2534,10 @@ static int ocrdma_set_qp_params(struct ocrdma_qp *qp, · 39 unmodified lines
25192534 cmd->flags |= OCRDMA_QP_PARA_DST_QPN_VALID;
25202535 }
25212536 if (attr_mask & IB_QP_PATH_MTU) {
2522− if (attrs->path_mtu < IB_MTU_256 ||
2537+ if (attrs->path_mtu < IB_MTU_512 ||
25232538 attrs->path_mtu > IB_MTU_4096) {
2539+ pr_err("ocrdma%d: IB MTU %d is not supported\n",
2540+ dev->id, ib_mtu_enum_to_int(attrs->path_mtu));
25242541 status = -EINVAL;
25252542 goto pmtu_err;
25262543 }
@@ -3147,9 +3164,9 @@ void ocrdma_cleanup_hw(struct ocrdma_dev *dev) · 620 unmodified lines
31473164 ocrdma_free_pd_pool(dev);
31483165 ocrdma_mbx_delete_ah_tbl(dev);
31493166
3150− /* cleanup the eqs */
3151− ocrdma_destroy_eqs(dev);
3152−
31533167 /* cleanup the control path */
31543168 ocrdma_destroy_mq(dev);
3169+
3170+ /* cleanup the eqs */
3171+ ocrdma_destroy_eqs(dev);
31553172 }
drivers/infiniband/hw/ocrdma/ocrdma_sli.h+9−0
@@ -1176,6 +1176,8 @@ struct ocrdma_query_qp_rsp { · 1175 unmodified lines
11761176 struct ocrdma_mqe_hdr hdr;
11771177 struct ocrdma_mbx_rsp rsp;
11781178 struct ocrdma_qp_params params;
1179+ u32 dpp_credits_cqid;
1180+ u32 rbq_id;
11791181 };
11801182
11811183 enum {
@@ -1624,12 +1626,19 @@ struct ocrdma_delete_ah_tbl_rsp { · 442 unmodified lines
16241626 enum {
16251627 OCRDMA_EQE_VALID_SHIFT = 0,
16261628 OCRDMA_EQE_VALID_MASK = BIT(0),
1629+ OCRDMA_EQE_MAJOR_CODE_MASK = 0x0E,
1630+ OCRDMA_EQE_MAJOR_CODE_SHIFT = 0x01,
16271631 OCRDMA_EQE_FOR_CQE_MASK = 0xFFFE,
16281632 OCRDMA_EQE_RESOURCE_ID_SHIFT = 16,
16291633 OCRDMA_EQE_RESOURCE_ID_MASK = 0xFFFF <<
16301634 OCRDMA_EQE_RESOURCE_ID_SHIFT,
16311635 };
16321636
1637+enum major_code {
1638+ OCRDMA_MAJOR_CODE_COMPLETION = 0x00,
1639+ OCRDMA_MAJOR_CODE_SENTINAL = 0x01
1640+};
1641+
16331642 struct ocrdma_eqe {
16341643 u32 id_valid;
16351644 };
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+7−5
@@ -365,7 +365,7 @@ static struct ocrdma_pd *_ocrdma_alloc_pd(struct ocrdma_dev *dev, · 364 unmodified lines
365365 if (!pd)
366366 return ERR_PTR(-ENOMEM);
367367
368− if (udata && uctx) {
368+ if (udata && uctx && dev->attr.max_dpp_pds) {
369369 pd->dpp_enabled =
370370 ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R;
371371 pd->num_dpp_qp =
@@ -1721,18 +1721,20 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp) · 1349 unmodified lines
17211721 struct ocrdma_qp *qp;
17221722 struct ocrdma_dev *dev;
17231723 struct ib_qp_attr attrs;
1724− int attr_mask = IB_QP_STATE;
1724+ int attr_mask;
17251725 unsigned long flags;
17261726
17271727 qp = get_ocrdma_qp(ibqp);
17281728 dev = get_ocrdma_dev(ibqp->device);
17291729
1730− attrs.qp_state = IB_QPS_ERR;
17311730 pd = qp->pd;
17321731
17331732 /* change the QP state to ERROR */
1734− _ocrdma_modify_qp(ibqp, &attrs, attr_mask);
1735−
1733+ if (qp->state != OCRDMA_QPS_RST) {
1734+ attrs.qp_state = IB_QPS_ERR;
1735+ attr_mask = IB_QP_STATE;
1736+ _ocrdma_modify_qp(ibqp, &attrs, attr_mask);
1737+ }
17361738 /* ensure that CQEs for newly created QP (whose id may be same with
17371739 * one which just getting destroyed are same), dont get
17381740 * discarded until the old CQEs are discarded.