Skip to contentSkip to conversation

RDMA CM: Fix AF_INET6 support in multicast joining

PATCH In review Jason Gunthorpe 2 participants 2 messages Nov 3, 2009 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA CM: Fix AF_INET6 support in multicast joining

If joining to an AF_INET6 address we need to map the address to a MGID in the same way as the IP stack. The old code would just fall through to the IPv4 case and generate garbage.

---
 drivers/infiniband/core/cma.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Sean: Sounded like you approve?

drivers/infiniband/core/cma.c +5 -0
index a0fa241..1e9a78a 100644
@@ -2724,6 +2724,11 @@ static void cma_set_mgid(struct rdma_id_private *id_priv,
 								 0xFF10A01B)) {
 		/* IPv6 address is an SA assigned MGID. */
 		memcpy(mgid, &sin6->sin6_addr, sizeof *mgid);
+	} else if ((addr->sa_family == AF_INET6)) {
+		ipv6_ib_mc_map(&sin6->sin6_addr, dev_addr->broadcast, mc_map);
+		if (id_priv->id.ps == RDMA_PS_UDP)
+			mc_map[7] = 0x01;	/* Use RDMA CM signature */
+		*mgid = *(union ib_gid *) (mc_map + 4);
 	} else {
 		ip_ib_mc_map(sin->sin_addr.s_addr, dev_addr->broadcast, mc_map);
 		if (id_priv->id.ps == RDMA_PS_UDP)
Signature · 6 lines
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20091103183033.GR7768-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org

Acked-by
#2 lore raw
Quoted 5 lines

If joining to an AF_INET6 address we need to map the address to a MGID in the same way as the IP stack. The old code would just fall through to the IPv4 case and generate garbage.

Quoted 5 lines

---
drivers/infiniband/core/cma.c | 5 +++++

1 files changed, 5 insertions(+), 0 deletions(-)

Sean: Sounded like you approve?

yes - thanks. I either missed this or dropped it when you first posted it.

Quoted 17 lines
drivers/infiniband/core/cma.c +5 -0
index a0fa241..1e9a78a 100644
@@ -2724,6 +2724,11 @@ static void cma_set_mgid(struct rdma_id_private
 *id_priv,
 								 0xFF10A01B)) {
 		/* IPv6 address is an SA assigned MGID. */
 		memcpy(mgid, &sin6->sin6_addr, sizeof *mgid);
+	} else if ((addr->sa_family == AF_INET6)) {
+		ipv6_ib_mc_map(&sin6->sin6_addr, dev_addr->broadcast, mc_map);
+		if (id_priv->id.ps == RDMA_PS_UDP)
+			mc_map[7] = 0x01;	/* Use RDMA CM signature */
+		*mgid = *(union ib_gid *) (mc_map + 4);
 	} else {
 		ip_ib_mc_map(sin->sin_addr.s_addr, dev_addr->broadcast, mc_map);
		if (id_priv->id.ps == RDMA_PS_UDP)
Quoted 2 lines

--
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html