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

Commit 9636a56f authored by Noa Osherovich's avatar Noa Osherovich Committed by Doug Ledford
Browse files

IB/core: Add support for RoCEv2 multicast



When creating address handle from multicast GID, set MAC according to
the appropriate formula instead of searching for it in the GID table:
- For IPv4 multicast GID use ip_eth_mc_map().
- For IPv6 multicast GID use ipv6_eth_mc_map().

Signed-off-by: default avatarNoa Osherovich <noaos@mellanox.com>
Reviewed-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent be1d325a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1244,6 +1244,18 @@ int ib_resolve_eth_dmac(struct ib_device *device,
	if (rdma_link_local_addr((struct in6_addr *)grh->dgid.raw)) {
		rdma_get_ll_mac((struct in6_addr *)grh->dgid.raw,
				ah_attr->roce.dmac);
		return 0;
	}
	if (rdma_is_multicast_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) {
		if (ipv6_addr_v4mapped((struct in6_addr *)ah_attr->grh.dgid.raw)) {
			__be32 addr = 0;

			memcpy(&addr, ah_attr->grh.dgid.raw + 12, 4);
			ip_eth_mc_map(addr, (char *)ah_attr->roce.dmac);
		} else {
			ipv6_eth_mc_map((struct in6_addr *)ah_attr->grh.dgid.raw,
					(char *)ah_attr->roce.dmac);
		}
	} else {
		union ib_gid		sgid;
		struct ib_gid_attr	sgid_attr;