Commit 83ee4121 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 97793a81 c07678bb
...@@ -861,6 +861,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err) ...@@ -861,6 +861,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT);
break; break;
case IB_CM_REQ_SENT: case IB_CM_REQ_SENT:
case IB_CM_MRA_REQ_RCVD:
ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
spin_unlock_irq(&cm_id_priv->lock); spin_unlock_irq(&cm_id_priv->lock);
ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT, ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT,
...@@ -879,7 +880,6 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err) ...@@ -879,7 +880,6 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
NULL, 0, NULL, 0); NULL, 0, NULL, 0);
} }
break; break;
case IB_CM_MRA_REQ_RCVD:
case IB_CM_REP_SENT: case IB_CM_REP_SENT:
case IB_CM_MRA_REP_RCVD: case IB_CM_MRA_REP_RCVD:
ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
......
...@@ -845,18 +845,26 @@ static void cma_save_ib_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id ...@@ -845,18 +845,26 @@ static void cma_save_ib_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id
listen_ib = (struct sockaddr_ib *) &listen_id->route.addr.src_addr; listen_ib = (struct sockaddr_ib *) &listen_id->route.addr.src_addr;
ib = (struct sockaddr_ib *) &id->route.addr.src_addr; ib = (struct sockaddr_ib *) &id->route.addr.src_addr;
ib->sib_family = listen_ib->sib_family; ib->sib_family = listen_ib->sib_family;
ib->sib_pkey = path->pkey; if (path) {
ib->sib_flowinfo = path->flow_label; ib->sib_pkey = path->pkey;
memcpy(&ib->sib_addr, &path->sgid, 16); ib->sib_flowinfo = path->flow_label;
memcpy(&ib->sib_addr, &path->sgid, 16);
} else {
ib->sib_pkey = listen_ib->sib_pkey;
ib->sib_flowinfo = listen_ib->sib_flowinfo;
ib->sib_addr = listen_ib->sib_addr;
}
ib->sib_sid = listen_ib->sib_sid; ib->sib_sid = listen_ib->sib_sid;
ib->sib_sid_mask = cpu_to_be64(0xffffffffffffffffULL); ib->sib_sid_mask = cpu_to_be64(0xffffffffffffffffULL);
ib->sib_scope_id = listen_ib->sib_scope_id; ib->sib_scope_id = listen_ib->sib_scope_id;
ib = (struct sockaddr_ib *) &id->route.addr.dst_addr; if (path) {
ib->sib_family = listen_ib->sib_family; ib = (struct sockaddr_ib *) &id->route.addr.dst_addr;
ib->sib_pkey = path->pkey; ib->sib_family = listen_ib->sib_family;
ib->sib_flowinfo = path->flow_label; ib->sib_pkey = path->pkey;
memcpy(&ib->sib_addr, &path->dgid, 16); ib->sib_flowinfo = path->flow_label;
memcpy(&ib->sib_addr, &path->dgid, 16);
}
} }
static __be16 ss_get_port(const struct sockaddr_storage *ss) 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 ...@@ -905,9 +913,11 @@ static int cma_save_net_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id
{ {
struct cma_hdr *hdr; struct cma_hdr *hdr;
if ((listen_id->route.addr.src_addr.ss_family == AF_IB) && if (listen_id->route.addr.src_addr.ss_family == AF_IB) {
(ib_event->event == IB_CM_REQ_RECEIVED)) { if (ib_event->event == IB_CM_REQ_RECEIVED)
cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path); cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path);
else if (ib_event->event == IB_CM_SIDR_REQ_RECEIVED)
cma_save_ib_info(id, listen_id, NULL);
return 0; return 0;
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <be_roce.h> #include <be_roce.h>
#include "ocrdma_sli.h" #include "ocrdma_sli.h"
#define OCRDMA_ROCE_DRV_VERSION "10.4.205.0u" #define OCRDMA_ROCE_DRV_VERSION "10.6.0.0"
#define OCRDMA_ROCE_DRV_DESC "Emulex OneConnect RoCE Driver" #define OCRDMA_ROCE_DRV_DESC "Emulex OneConnect RoCE Driver"
#define OCRDMA_NODE_DESC "Emulex OneConnect RoCE HCA" #define OCRDMA_NODE_DESC "Emulex OneConnect RoCE HCA"
...@@ -515,6 +515,8 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev, ...@@ -515,6 +515,8 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev,
memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6)); memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6));
if (rdma_is_multicast_addr(&in6)) if (rdma_is_multicast_addr(&in6))
rdma_get_mcast_mac(&in6, mac_addr); rdma_get_mcast_mac(&in6, mac_addr);
else if (rdma_link_local_addr(&in6))
rdma_get_ll_mac(&in6, mac_addr);
else else
memcpy(mac_addr, ah_attr->dmac, ETH_ALEN); memcpy(mac_addr, ah_attr->dmac, ETH_ALEN);
return 0; return 0;
......
...@@ -56,7 +56,13 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, ...@@ -56,7 +56,13 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
vlan_tag = attr->vlan_id; vlan_tag = attr->vlan_id;
if (!vlan_tag || (vlan_tag > 0xFFF)) if (!vlan_tag || (vlan_tag > 0xFFF))
vlan_tag = dev->pvid; vlan_tag = dev->pvid;
if (vlan_tag && (vlan_tag < 0x1000)) { if (vlan_tag || dev->pfc_state) {
if (!vlan_tag) {
pr_err("ocrdma%d:Using VLAN with PFC is recommended\n",
dev->id);
pr_err("ocrdma%d:Using VLAN 0 for this connection\n",
dev->id);
}
eth.eth_type = cpu_to_be16(0x8100); eth.eth_type = cpu_to_be16(0x8100);
eth.roce_eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE); eth.roce_eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE);
vlan_tag |= (dev->sl & 0x07) << OCRDMA_VID_PCP_SHIFT; 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) ...@@ -121,7 +127,9 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
goto av_conf_err; goto av_conf_err;
} }
if (pd->uctx) { if ((pd->uctx) &&
(!rdma_is_multicast_addr((struct in6_addr *)attr->grh.dgid.raw)) &&
(!rdma_link_local_addr((struct in6_addr *)attr->grh.dgid.raw))) {
status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid, status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid,
attr->dmac, &attr->vlan_id); attr->dmac, &attr->vlan_id);
if (status) { if (status) {
......
...@@ -933,12 +933,18 @@ static irqreturn_t ocrdma_irq_handler(int irq, void *handle) ...@@ -933,12 +933,18 @@ static irqreturn_t ocrdma_irq_handler(int irq, void *handle)
struct ocrdma_eqe eqe; struct ocrdma_eqe eqe;
struct ocrdma_eqe *ptr; struct ocrdma_eqe *ptr;
u16 cq_id; u16 cq_id;
u8 mcode;
int budget = eq->cq_cnt; int budget = eq->cq_cnt;
do { do {
ptr = ocrdma_get_eqe(eq); ptr = ocrdma_get_eqe(eq);
eqe = *ptr; eqe = *ptr;
ocrdma_le32_to_cpu(&eqe, sizeof(eqe)); ocrdma_le32_to_cpu(&eqe, sizeof(eqe));
mcode = (eqe.id_valid & OCRDMA_EQE_MAJOR_CODE_MASK)
>> OCRDMA_EQE_MAJOR_CODE_SHIFT;
if (mcode == OCRDMA_MAJOR_CODE_SENTINAL)
pr_err("EQ full on eqid = 0x%x, eqe = 0x%x\n",
eq->q.id, eqe.id_valid);
if ((eqe.id_valid & OCRDMA_EQE_VALID_MASK) == 0) if ((eqe.id_valid & OCRDMA_EQE_VALID_MASK) == 0)
break; break;
...@@ -1434,27 +1440,30 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev) ...@@ -1434,27 +1440,30 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev)
struct ocrdma_alloc_pd_range_rsp *rsp; struct ocrdma_alloc_pd_range_rsp *rsp;
/* Pre allocate the DPP PDs */ /* Pre allocate the DPP PDs */
cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE, sizeof(*cmd)); if (dev->attr.max_dpp_pds) {
if (!cmd) cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE,
return -ENOMEM; sizeof(*cmd));
cmd->pd_count = dev->attr.max_dpp_pds; if (!cmd)
cmd->enable_dpp_rsvd |= OCRDMA_ALLOC_PD_ENABLE_DPP; return -ENOMEM;
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd); cmd->pd_count = dev->attr.max_dpp_pds;
if (status) cmd->enable_dpp_rsvd |= OCRDMA_ALLOC_PD_ENABLE_DPP;
goto mbx_err; status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd; rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd;
if ((rsp->dpp_page_pdid & OCRDMA_ALLOC_PD_RSP_DPP) && rsp->pd_count) { if (!status && (rsp->dpp_page_pdid & OCRDMA_ALLOC_PD_RSP_DPP) &&
dev->pd_mgr->dpp_page_index = rsp->dpp_page_pdid >> rsp->pd_count) {
OCRDMA_ALLOC_PD_RSP_DPP_PAGE_SHIFT; dev->pd_mgr->dpp_page_index = rsp->dpp_page_pdid >>
dev->pd_mgr->pd_dpp_start = rsp->dpp_page_pdid & OCRDMA_ALLOC_PD_RSP_DPP_PAGE_SHIFT;
OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK; dev->pd_mgr->pd_dpp_start = rsp->dpp_page_pdid &
dev->pd_mgr->max_dpp_pd = rsp->pd_count; OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK;
pd_bitmap_size = BITS_TO_LONGS(rsp->pd_count) * sizeof(long); dev->pd_mgr->max_dpp_pd = rsp->pd_count;
dev->pd_mgr->pd_dpp_bitmap = kzalloc(pd_bitmap_size, pd_bitmap_size =
GFP_KERNEL); BITS_TO_LONGS(rsp->pd_count) * sizeof(long);
dev->pd_mgr->pd_dpp_bitmap = kzalloc(pd_bitmap_size,
GFP_KERNEL);
}
kfree(cmd);
} }
kfree(cmd);
cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE, sizeof(*cmd)); cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_ALLOC_PD_RANGE, sizeof(*cmd));
if (!cmd) if (!cmd)
...@@ -1462,10 +1471,8 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev) ...@@ -1462,10 +1471,8 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev)
cmd->pd_count = dev->attr.max_pd - dev->attr.max_dpp_pds; cmd->pd_count = dev->attr.max_pd - dev->attr.max_dpp_pds;
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd); status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
if (status)
goto mbx_err;
rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd; rsp = (struct ocrdma_alloc_pd_range_rsp *)cmd;
if (rsp->pd_count) { if (!status && rsp->pd_count) {
dev->pd_mgr->pd_norm_start = rsp->dpp_page_pdid & dev->pd_mgr->pd_norm_start = rsp->dpp_page_pdid &
OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK; OCRDMA_ALLOC_PD_RNG_RSP_START_PDID_MASK;
dev->pd_mgr->max_normal_pd = rsp->pd_count; dev->pd_mgr->max_normal_pd = rsp->pd_count;
...@@ -1473,15 +1480,13 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev) ...@@ -1473,15 +1480,13 @@ static int ocrdma_mbx_alloc_pd_range(struct ocrdma_dev *dev)
dev->pd_mgr->pd_norm_bitmap = kzalloc(pd_bitmap_size, dev->pd_mgr->pd_norm_bitmap = kzalloc(pd_bitmap_size,
GFP_KERNEL); GFP_KERNEL);
} }
kfree(cmd);
if (dev->pd_mgr->pd_norm_bitmap || dev->pd_mgr->pd_dpp_bitmap) { if (dev->pd_mgr->pd_norm_bitmap || dev->pd_mgr->pd_dpp_bitmap) {
/* Enable PD resource manager */ /* Enable PD resource manager */
dev->pd_mgr->pd_prealloc_valid = true; dev->pd_mgr->pd_prealloc_valid = true;
} else { return 0;
return -ENOMEM;
} }
mbx_err:
kfree(cmd);
return status; return status;
} }
...@@ -2406,7 +2411,7 @@ int ocrdma_mbx_query_qp(struct ocrdma_dev *dev, struct ocrdma_qp *qp, ...@@ -2406,7 +2411,7 @@ int ocrdma_mbx_query_qp(struct ocrdma_dev *dev, struct ocrdma_qp *qp,
struct ocrdma_query_qp *cmd; struct ocrdma_query_qp *cmd;
struct ocrdma_query_qp_rsp *rsp; struct ocrdma_query_qp_rsp *rsp;
cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_QUERY_QP, sizeof(*cmd)); cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_QUERY_QP, sizeof(*rsp));
if (!cmd) if (!cmd)
return status; return status;
cmd->qp_id = qp->id; cmd->qp_id = qp->id;
...@@ -2428,7 +2433,7 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp, ...@@ -2428,7 +2433,7 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
int status; int status;
struct ib_ah_attr *ah_attr = &attrs->ah_attr; struct ib_ah_attr *ah_attr = &attrs->ah_attr;
union ib_gid sgid, zgid; union ib_gid sgid, zgid;
u32 vlan_id; u32 vlan_id = 0xFFFF;
u8 mac_addr[6]; u8 mac_addr[6];
struct ocrdma_dev *dev = get_ocrdma_dev(qp->ibqp.device); struct ocrdma_dev *dev = get_ocrdma_dev(qp->ibqp.device);
...@@ -2468,12 +2473,22 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp, ...@@ -2468,12 +2473,22 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
cmd->params.vlan_dmac_b4_to_b5 = mac_addr[4] | (mac_addr[5] << 8); cmd->params.vlan_dmac_b4_to_b5 = mac_addr[4] | (mac_addr[5] << 8);
if (attr_mask & IB_QP_VID) { if (attr_mask & IB_QP_VID) {
vlan_id = attrs->vlan_id; vlan_id = attrs->vlan_id;
} else if (dev->pfc_state) {
vlan_id = 0;
pr_err("ocrdma%d:Using VLAN with PFC is recommended\n",
dev->id);
pr_err("ocrdma%d:Using VLAN 0 for this connection\n",
dev->id);
}
if (vlan_id < 0x1000) {
cmd->params.vlan_dmac_b4_to_b5 |= cmd->params.vlan_dmac_b4_to_b5 |=
vlan_id << OCRDMA_QP_PARAMS_VLAN_SHIFT; vlan_id << OCRDMA_QP_PARAMS_VLAN_SHIFT;
cmd->flags |= OCRDMA_QP_PARA_VLAN_EN_VALID; cmd->flags |= OCRDMA_QP_PARA_VLAN_EN_VALID;
cmd->params.rnt_rc_sl_fl |= cmd->params.rnt_rc_sl_fl |=
(dev->sl & 0x07) << OCRDMA_QP_PARAMS_SL_SHIFT; (dev->sl & 0x07) << OCRDMA_QP_PARAMS_SL_SHIFT;
} }
return 0; return 0;
} }
...@@ -2519,8 +2534,10 @@ static int ocrdma_set_qp_params(struct ocrdma_qp *qp, ...@@ -2519,8 +2534,10 @@ static int ocrdma_set_qp_params(struct ocrdma_qp *qp,
cmd->flags |= OCRDMA_QP_PARA_DST_QPN_VALID; cmd->flags |= OCRDMA_QP_PARA_DST_QPN_VALID;
} }
if (attr_mask & IB_QP_PATH_MTU) { if (attr_mask & IB_QP_PATH_MTU) {
if (attrs->path_mtu < IB_MTU_256 || if (attrs->path_mtu < IB_MTU_512 ||
attrs->path_mtu > IB_MTU_4096) { attrs->path_mtu > IB_MTU_4096) {
pr_err("ocrdma%d: IB MTU %d is not supported\n",
dev->id, ib_mtu_enum_to_int(attrs->path_mtu));
status = -EINVAL; status = -EINVAL;
goto pmtu_err; goto pmtu_err;
} }
...@@ -3147,9 +3164,9 @@ void ocrdma_cleanup_hw(struct ocrdma_dev *dev) ...@@ -3147,9 +3164,9 @@ void ocrdma_cleanup_hw(struct ocrdma_dev *dev)
ocrdma_free_pd_pool(dev); ocrdma_free_pd_pool(dev);
ocrdma_mbx_delete_ah_tbl(dev); ocrdma_mbx_delete_ah_tbl(dev);
/* cleanup the eqs */
ocrdma_destroy_eqs(dev);
/* cleanup the control path */ /* cleanup the control path */
ocrdma_destroy_mq(dev); ocrdma_destroy_mq(dev);
/* cleanup the eqs */
ocrdma_destroy_eqs(dev);
} }
...@@ -1176,6 +1176,8 @@ struct ocrdma_query_qp_rsp { ...@@ -1176,6 +1176,8 @@ struct ocrdma_query_qp_rsp {
struct ocrdma_mqe_hdr hdr; struct ocrdma_mqe_hdr hdr;
struct ocrdma_mbx_rsp rsp; struct ocrdma_mbx_rsp rsp;
struct ocrdma_qp_params params; struct ocrdma_qp_params params;
u32 dpp_credits_cqid;
u32 rbq_id;
}; };
enum { enum {
...@@ -1624,12 +1626,19 @@ struct ocrdma_delete_ah_tbl_rsp { ...@@ -1624,12 +1626,19 @@ struct ocrdma_delete_ah_tbl_rsp {
enum { enum {
OCRDMA_EQE_VALID_SHIFT = 0, OCRDMA_EQE_VALID_SHIFT = 0,
OCRDMA_EQE_VALID_MASK = BIT(0), OCRDMA_EQE_VALID_MASK = BIT(0),
OCRDMA_EQE_MAJOR_CODE_MASK = 0x0E,
OCRDMA_EQE_MAJOR_CODE_SHIFT = 0x01,
OCRDMA_EQE_FOR_CQE_MASK = 0xFFFE, OCRDMA_EQE_FOR_CQE_MASK = 0xFFFE,
OCRDMA_EQE_RESOURCE_ID_SHIFT = 16, OCRDMA_EQE_RESOURCE_ID_SHIFT = 16,
OCRDMA_EQE_RESOURCE_ID_MASK = 0xFFFF << OCRDMA_EQE_RESOURCE_ID_MASK = 0xFFFF <<
OCRDMA_EQE_RESOURCE_ID_SHIFT, OCRDMA_EQE_RESOURCE_ID_SHIFT,
}; };
enum major_code {
OCRDMA_MAJOR_CODE_COMPLETION = 0x00,
OCRDMA_MAJOR_CODE_SENTINAL = 0x01
};
struct ocrdma_eqe { struct ocrdma_eqe {
u32 id_valid; u32 id_valid;
}; };
......
...@@ -365,7 +365,7 @@ static struct ocrdma_pd *_ocrdma_alloc_pd(struct ocrdma_dev *dev, ...@@ -365,7 +365,7 @@ static struct ocrdma_pd *_ocrdma_alloc_pd(struct ocrdma_dev *dev,
if (!pd) if (!pd)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (udata && uctx) { if (udata && uctx && dev->attr.max_dpp_pds) {
pd->dpp_enabled = pd->dpp_enabled =
ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R; ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R;
pd->num_dpp_qp = pd->num_dpp_qp =
...@@ -1721,18 +1721,20 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp) ...@@ -1721,18 +1721,20 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp)
struct ocrdma_qp *qp; struct ocrdma_qp *qp;
struct ocrdma_dev *dev; struct ocrdma_dev *dev;
struct ib_qp_attr attrs; struct ib_qp_attr attrs;
int attr_mask = IB_QP_STATE; int attr_mask;
unsigned long flags; unsigned long flags;
qp = get_ocrdma_qp(ibqp); qp = get_ocrdma_qp(ibqp);
dev = get_ocrdma_dev(ibqp->device); dev = get_ocrdma_dev(ibqp->device);
attrs.qp_state = IB_QPS_ERR;
pd = qp->pd; pd = qp->pd;
/* change the QP state to ERROR */ /* change the QP state to ERROR */
_ocrdma_modify_qp(ibqp, &attrs, attr_mask); if (qp->state != OCRDMA_QPS_RST) {
attrs.qp_state = IB_QPS_ERR;
attr_mask = IB_QP_STATE;
_ocrdma_modify_qp(ibqp, &attrs, attr_mask);
}
/* ensure that CQEs for newly created QP (whose id may be same with /* ensure that CQEs for newly created QP (whose id may be same with
* one which just getting destroyed are same), dont get * one which just getting destroyed are same), dont get
* discarded until the old CQEs are discarded. * discarded until the old CQEs are discarded.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment