aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_hw.c')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_hw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 6bbcc786ef6d..af01ba202d40 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -2124,9 +2124,10 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
2124{ 2124{
2125 int status; 2125 int status;
2126 struct ib_ah_attr *ah_attr = &attrs->ah_attr; 2126 struct ib_ah_attr *ah_attr = &attrs->ah_attr;
2127 union ib_gid sgid; 2127 union ib_gid sgid, zgid;
2128 u32 vlan_id; 2128 u32 vlan_id;
2129 u8 mac_addr[6]; 2129 u8 mac_addr[6];
2130
2130 if ((ah_attr->ah_flags & IB_AH_GRH) == 0) 2131 if ((ah_attr->ah_flags & IB_AH_GRH) == 0)
2131 return -EINVAL; 2132 return -EINVAL;
2132 cmd->params.tclass_sq_psn |= 2133 cmd->params.tclass_sq_psn |=
@@ -2142,6 +2143,11 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
2142 ah_attr->grh.sgid_index, &sgid); 2143 ah_attr->grh.sgid_index, &sgid);
2143 if (status) 2144 if (status)
2144 return status; 2145 return status;
2146
2147 memset(&zgid, 0, sizeof(zgid));
2148 if (!memcmp(&sgid, &zgid, sizeof(zgid)))
2149 return -EINVAL;
2150
2145 qp->sgid_idx = ah_attr->grh.sgid_index; 2151 qp->sgid_idx = ah_attr->grh.sgid_index;
2146 memcpy(&cmd->params.sgid[0], &sgid.raw[0], sizeof(cmd->params.sgid)); 2152 memcpy(&cmd->params.sgid[0], &sgid.raw[0], sizeof(cmd->params.sgid));
2147 ocrdma_resolve_dgid(qp->dev, &ah_attr->grh.dgid, &mac_addr[0]); 2153 ocrdma_resolve_dgid(qp->dev, &ah_attr->grh.dgid, &mac_addr[0]);