mirror of https://gitee.com/openkylin/linux.git
RDMA/ocrdma: Fix dmac resolution for link local address
rdma_addr_find_dmac_by_grh fails to resolve dmac for link local address. Use rdma_get_ll_mac to resolve the link local address. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com> Signed-off-by: Mitesh Ahuja <mitesh.ahuja@avagotech.com> Signed-off-by: Devesh Sharma <devesh.sharma@avagotech.com> Signed-off-by: Selvin Xavier <selvin.xavier@avagotech.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
59582d86e2
commit
d27b2f15eb
|
@ -515,6 +515,8 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev,
|
|||
memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6));
|
||||
if (rdma_is_multicast_addr(&in6))
|
||||
rdma_get_mcast_mac(&in6, mac_addr);
|
||||
else if (rdma_link_local_addr(&in6))
|
||||
rdma_get_ll_mac(&in6, mac_addr);
|
||||
else
|
||||
memcpy(mac_addr, ah_attr->dmac, ETH_ALEN);
|
||||
return 0;
|
||||
|
|
|
@ -127,7 +127,9 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
|
|||
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,
|
||||
attr->dmac, &attr->vlan_id);
|
||||
if (status) {
|
||||
|
|
Loading…
Reference in New Issue