RDMA/ocrdma: Always resolve destination mac from GRH for UD QPs
authorDevesh Sharma <devesh.sharma@emulex.com>
Mon, 24 Nov 2014 04:33:39 +0000 (10:03 +0530)
committerRoland Dreier <roland@purestorage.com>
Tue, 16 Dec 2014 02:13:09 +0000 (18:13 -0800)
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>
drivers/infiniband/hw/ocrdma/ocrdma_ah.c

index ac02ce4e804045afa74df9cb34b1f50d1b146361..f3cc8c9e65ae70f9e0b157632189e324970cbea5 100644 (file)
@@ -96,7 +96,6 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
        struct ocrdma_pd *pd = get_ocrdma_pd(ibpd);
        struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device);
        union ib_gid sgid;
-       u8 zmac[ETH_ALEN];
 
        if (!(attr->ah_flags & IB_AH_GRH))
                return ERR_PTR(-EINVAL);
@@ -118,9 +117,7 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
                goto av_conf_err;
        }
 
-       memset(&zmac, 0, ETH_ALEN);
-       if (pd->uctx &&
-           memcmp(attr->dmac, &zmac, ETH_ALEN)) {
+       if (pd->uctx) {
                status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid,
                                         attr->dmac, &attr->vlan_id);
                if (status) {