aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevesh Sharma <devesh.sharma@emulex.com>2014-11-23 23:33:39 -0500
committerRoland Dreier <roland@purestorage.com>2014-12-15 21:13:09 -0500
commite5f0508d43b45d138d426afcaa1e4cce7658cff4 (patch)
tree9e044a2b6e27c93f4a76c5b5165b17add1ed1752
parent95bf0093a95f864044d7782ddd15528350f915be (diff)
RDMA/ocrdma: Always resolve destination mac from GRH for UD QPs
For user applications that use UD QPs, always resolve destination MAC from the GRH. This is to avoid failure due to any garbage value in the attr->dmac. Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com> Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_ah.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
index ac02ce4e8040..f3cc8c9e65ae 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
@@ -96,7 +96,6 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
96 struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); 96 struct ocrdma_pd *pd = get_ocrdma_pd(ibpd);
97 struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device); 97 struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device);
98 union ib_gid sgid; 98 union ib_gid sgid;
99 u8 zmac[ETH_ALEN];
100 99
101 if (!(attr->ah_flags & IB_AH_GRH)) 100 if (!(attr->ah_flags & IB_AH_GRH))
102 return ERR_PTR(-EINVAL); 101 return ERR_PTR(-EINVAL);
@@ -118,9 +117,7 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
118 goto av_conf_err; 117 goto av_conf_err;
119 } 118 }
120 119
121 memset(&zmac, 0, ETH_ALEN); 120 if (pd->uctx) {
122 if (pd->uctx &&
123 memcmp(attr->dmac, &zmac, ETH_ALEN)) {
124 status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid, 121 status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid,
125 attr->dmac, &attr->vlan_id); 122 attr->dmac, &attr->vlan_id);
126 if (status) { 123 if (status) {