public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA CM: Fix AF_INET6 support in multicast joining
@ 2009-11-03 18:30 Jason Gunthorpe
       [not found] ` <20091103183033.GR7768-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Gunthorpe @ 2009-11-03 18:30 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Roland Dreier, Sean Hefty

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.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 drivers/infiniband/core/cma.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Sean: Sounded like you approve?

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index a0fa241..1e9a78a 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -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)
-- 
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] RDMA CM: Fix AF_INET6 support in multicast joining
       [not found] ` <20091103183033.GR7768-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2009-11-03 18:36   ` Sean Hefty
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Hefty @ 2009-11-03 18:36 UTC (permalink / raw)
  To: 'Jason Gunthorpe', linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Roland Dreier

>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.
>
>Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

>---
> 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.

>diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
>index a0fa241..1e9a78a 100644
>--- a/drivers/infiniband/core/cma.c
>+++ b/drivers/infiniband/core/cma.c
>@@ -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)
>--
>1.5.4.2


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-03 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 18:30 [PATCH] RDMA CM: Fix AF_INET6 support in multicast joining Jason Gunthorpe
     [not found] ` <20091103183033.GR7768-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-11-03 18:36   ` Sean Hefty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox