Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5f0508d authored by Devesh Sharma's avatar Devesh Sharma Committed by Roland Dreier
Browse files

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: default avatarSelvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: default avatarDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 95bf0093
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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) {