aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ocrdma
diff options
context:
space:
mode:
authorMitesh Ahuja <mitesh.ahuja@avagotech.com>2015-05-19 02:02:38 -0400
committerDoug Ledford <dledford@redhat.com>2015-05-18 10:25:24 -0400
commitd27b2f15eb535b4f02a75070108c08cefb540257 (patch)
tree7864d11c30fdd5de1037968c8c6fff6b32162ebd /drivers/infiniband/hw/ocrdma
parent59582d86e23f30466413a04cc4db678b09f937ea (diff)
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>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma.h2
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_ah.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index c9780d919769..ee9e3351a64c 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -515,6 +515,8 @@ static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev,
515 memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6)); 515 memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6));
516 if (rdma_is_multicast_addr(&in6)) 516 if (rdma_is_multicast_addr(&in6))
517 rdma_get_mcast_mac(&in6, mac_addr); 517 rdma_get_mcast_mac(&in6, mac_addr);
518 else if (rdma_link_local_addr(&in6))
519 rdma_get_ll_mac(&in6, mac_addr);
518 else 520 else
519 memcpy(mac_addr, ah_attr->dmac, ETH_ALEN); 521 memcpy(mac_addr, ah_attr->dmac, ETH_ALEN);
520 return 0; 522 return 0;
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
index 2a5993b75651..f5a5ea836dbd 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
@@ -127,7 +127,9 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
127 goto av_conf_err; 127 goto av_conf_err;
128 } 128 }
129 129
130 if (pd->uctx) { 130 if ((pd->uctx) &&
131 (!rdma_is_multicast_addr((struct in6_addr *)attr->grh.dgid.raw)) &&
132 (!rdma_link_local_addr((struct in6_addr *)attr->grh.dgid.raw))) {
131 status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid, 133 status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid,
132 attr->dmac, &attr->vlan_id); 134 attr->dmac, &attr->vlan_id);
133 if (status) { 135 if (status) {