summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ocrdma/ocrdma.h
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2013-12-12 17:03:15 +0100
committerRoland Dreier <roland@purestorage.com>2014-01-20 00:13:58 +0100
commit40aca6ffcac57dd9c65877a59a8bbb210c4691ca (patch)
tree38d04201204be282164c9c8005787c45063625b3 /drivers/infiniband/hw/ocrdma/ocrdma.h
parentIB/mlx4: Handle Ethernet L2 parameters for IP based GID addressing (diff)
downloadlinux-40aca6ffcac57dd9c65877a59a8bbb210c4691ca.tar.xz
linux-40aca6ffcac57dd9c65877a59a8bbb210c4691ca.zip
RDMA/ocrdma: Handle Ethernet L2 parameters for IP based GID addressing
This patch is similar in spirit to the "IB/mlx4: Handle Ethernet L2 parameters for IP based GID addressing". It handles the fact that IP based RoCE gids don't store Ethernet L2 parameters, MAC and VLAN. When building an address handle, instead of parsing the dgid to get the MAC and VLAN, take them from the address handle attributes. Cc: Naresh Gottumukkala <bgottumukkala@emulex.com> Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma.h')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 294dd27b601e..7c001b97b23f 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -423,5 +423,17 @@ static inline int is_cqe_wr_imm(struct ocrdma_cqe *cqe)
OCRDMA_CQE_WRITE_IMM) ? 1 : 0;
}
+static inline int ocrdma_resolve_dmac(struct ocrdma_dev *dev,
+ struct ib_ah_attr *ah_attr, u8 *mac_addr)
+{
+ struct in6_addr in6;
+
+ memcpy(&in6, ah_attr->grh.dgid.raw, sizeof(in6));
+ if (rdma_is_multicast_addr(&in6))
+ rdma_get_mcast_mac(&in6, mac_addr);
+ else
+ memcpy(mac_addr, ah_attr->dmac, ETH_ALEN);
+ return 0;
+}
#endif