All of lore.kernel.org
 help / color / mirror / Atom feed
* Upstream support for multicast IBoE
@ 2011-11-22 22:38 Shawn Bohrer
       [not found] ` <20111122223812.GB2131-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shawn Bohrer @ 2011-11-22 22:38 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Or Gerlitz, Eli Cohen, roland-BHEL68pLQRGGvPXPguhicg

It appears the upstream libmlx4/libibverbs currently do not support
multicast IBoE traffic.  For example:

$ mckey -m 239.1.1.1 -b 10.0.202.3
mckey: starting server
mckey: joining
mckey: joined dgid: ff0e::ffff:ef01:101 mlid 0x0 sl 0
mckey: failure creating address handle
test complete
return status 0

Debugging this I can see it fails in libmlx4 in mlx4_create_ah().  In
this case mlx4_resolve_grh_to_l2() returns 1.  Comparing with the OFED
libmlx4/libibverbs I've found the relevant differences are in the
following patch:

http://git.openfabrics.org/git?p=ofed_1_5/libmlx4.git;a=blob;f=fixes/rocee_add_support.patch;h=017b075d639aa2f349424ec94e0089de631470fd;hb=HEAD

This OFED patch seems to partially overlap and conflict with upstream
libmlx4 commits:

902aa188c156e8e2832f5afdf76eb2655fa80582 Add IBoE support
3e73678e88d2ea414a9f4ae187f6412593bd0a1f Add IBoE UD/VLANs support

In general it is very unclear to me what the development work flow is
between the OFED and upstream versions of these libraries.  Is there a
plan to add multicast IBoE support to the upstream versions?

Thanks,
Shawn


---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found] ` <20111122223812.GB2131-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
@ 2011-11-22 23:44   ` Roland Dreier
       [not found]     ` <CAL1RGDVF5FuVuToN56pmue1cUvHRw9kjaKC9xLOt51zeDJwMag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Roland Dreier @ 2011-11-22 23:44 UTC (permalink / raw)
  To: Shawn Bohrer, Or Gerlitz; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

On Tue, Nov 22, 2011 at 2:38 PM, Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org> wrote:
> $ mckey -m 239.1.1.1 -b 10.0.202.3
> mckey: starting server
> mckey: joining
> mckey: joined dgid: ff0e::ffff:ef01:101 mlid 0x0 sl 0
> mckey: failure creating address handle
> test complete
> return status 0
>
> Debugging this I can see it fails in libmlx4 in mlx4_create_ah().  In
> this case mlx4_resolve_grh_to_l2() returns 1.

Or, looks like the libmlx4 patches I applied from you are missing
multicast AH support?

 - R.
--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]     ` <CAL1RGDVF5FuVuToN56pmue1cUvHRw9kjaKC9xLOt51zeDJwMag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-11-23  0:07       ` Jason Gunthorpe
       [not found]         ` <20111123000735.GF11469-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2011-11-23 21:17       ` Or Gerlitz
  1 sibling, 1 reply; 12+ messages in thread
From: Jason Gunthorpe @ 2011-11-23  0:07 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Shawn Bohrer, Or Gerlitz, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

On Tue, Nov 22, 2011 at 03:44:01PM -0800, Roland Dreier wrote:
> On Tue, Nov 22, 2011 at 2:38 PM, Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org> wrote:
> > $ mckey -m 239.1.1.1 -b 10.0.202.3
> > mckey: starting server
> > mckey: joining
> > mckey: joined dgid: ff0e::ffff:ef01:101 mlid 0x0 sl 0
> > mckey: failure creating address handle
> > test complete
> > return status 0
> >
> > Debugging this I can see it fails in libmlx4 in mlx4_create_ah(). ?In
> > this case mlx4_resolve_grh_to_l2() returns 1.
> 
> Or, looks like the libmlx4 patches I applied from you are missing
> multicast AH support?

I thought that was deliberate because of the lack of specification and
the strange reliance on IPv6 MLD for IBoE packet types...

AFAIK none of that has changed?

Jason
--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]         ` <20111123000735.GF11469-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2011-11-23  7:03           ` Roland Dreier
  0 siblings, 0 replies; 12+ messages in thread
From: Roland Dreier @ 2011-11-23  7:03 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Shawn Bohrer, Or Gerlitz, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

On Tue, Nov 22, 2011 at 4:07 PM, Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> I thought that was deliberate because of the lack of specification and
> the strange reliance on IPv6 MLD for IBoE packet types...
>
> AFAIK none of that has changed?

I honestly can't remember the discussion.  But we have the ad hoc
MGID -> ethernet address mapping in the kernel, did we really decide
just to leave it out of userspace?

The current situation is pretty embarassing -- is the IBTA still pretending
no standard needs to be written?

 - R.
--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]     ` <CAL1RGDVF5FuVuToN56pmue1cUvHRw9kjaKC9xLOt51zeDJwMag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-11-23  0:07       ` Jason Gunthorpe
@ 2011-11-23 21:17       ` Or Gerlitz
       [not found]         ` <CAJZOPZ+mdMYqMZKYNmVas=cAUYiQRw_r=8ty7j5wB2mXJSs5bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Or Gerlitz @ 2011-11-23 21:17 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Shawn Bohrer, Or Gerlitz, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org> wrote:
> looks like the libmlx4 patches I applied from you are missing multicast AH support?

Yes, when I reworked the patches for submission I went from easier
(RC) to harder (ucast UD + Vlans) and eventually didn't nailed down
the multicast front. I probably planned getting there on a later point
but it remained behind, anyway, if you're okay to have the "ad hoc
MGID -> ethernet address mapping" as you commented on this thread, I
can make the patch to add that.

Or.
--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]         ` <CAJZOPZ+mdMYqMZKYNmVas=cAUYiQRw_r=8ty7j5wB2mXJSs5bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-11-23 21:17           ` Or Gerlitz
  2012-01-11 14:59           ` Shawn Bohrer
  1 sibling, 0 replies; 12+ messages in thread
From: Or Gerlitz @ 2011-11-23 21:17 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org> wrote:
>> looks like the libmlx4 patches I applied from you are missing multicast AH support?

On a related note, what/when would it take to get a release of
libibverbs/libmlx4? so far there's no single release that supports
IBoE and people who don't go OFED have nothing to to use (sure, they
can clone the gits...)  IBoE wise.

Or.
--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]         ` <CAJZOPZ+mdMYqMZKYNmVas=cAUYiQRw_r=8ty7j5wB2mXJSs5bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-11-23 21:17           ` Or Gerlitz
@ 2012-01-11 14:59           ` Shawn Bohrer
       [not found]             ` <20120111145924.GA2296-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Shawn Bohrer @ 2012-01-11 14:59 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Roland Dreier, Or Gerlitz, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

On Wed, Nov 23, 2011 at 11:17:02PM +0200, Or Gerlitz wrote:
> Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org> wrote:
> > looks like the libmlx4 patches I applied from you are missing multicast AH support?
> 
> Yes, when I reworked the patches for submission I went from easier
> (RC) to harder (ucast UD + Vlans) and eventually didn't nailed down
> the multicast front. I probably planned getting there on a later point
> but it remained behind, anyway, if you're okay to have the "ad hoc
> MGID -> ethernet address mapping" as you commented on this thread, I
> can make the patch to add that.

Is there any estimate on when we might see something like this
upstream?

Thanks,
Shawn


---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]             ` <20120111145924.GA2296-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
@ 2012-01-11 19:49               ` Or Gerlitz
       [not found]                 ` <CAJZOPZJL11-psmSEwUz2xa4eK4sFEkuYA5D9oEKD7m6P+O6Ffw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Or Gerlitz @ 2012-01-11 19:49 UTC (permalink / raw)
  To: Shawn Bohrer; +Cc: Roland Dreier, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org> wrote:
> Is there any estimate on when we might see something like this upstream?

Could you elaborate a little on your use case for multicast IBoE
traffic? e.g how the setup looks like and how are your Ethernet
switches act to route that traffic.

Or.
--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]                 ` <CAJZOPZJL11-psmSEwUz2xa4eK4sFEkuYA5D9oEKD7m6P+O6Ffw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-01-12 17:01                   ` Shawn Bohrer
       [not found]                     ` <20120112170157.GA2324-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shawn Bohrer @ 2012-01-12 17:01 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Roland Dreier, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

On Wed, Jan 11, 2012 at 09:49:25PM +0200, Or Gerlitz wrote:
> Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org> wrote:
> > Is there any estimate on when we might see something like this upstream?
> 
> Could you elaborate a little on your use case for multicast IBoE
> traffic? e.g how the setup looks like and how are your Ethernet
> switches act to route that traffic.

I'm not sure exactly what you are asking here.  We do what I would
imagine is a typical one to many UD multicast.  We code directly to
libibvers and librdmacm, and everything is sent IBoE.

The hosts are in a spine/leaf configuration and all traffic is sent
over vlans.  My understanding is that the multicast IBoE traffic is
simply sent as broadcast and that the adapters do the necessary
filtering.

Really from my point of view OFED already does what we want, but I
would really like to see this supported upstream.

Thanks,
Shawn


---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

--
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] 12+ messages in thread

* Re: Upstream support for multicast IBoE
       [not found]                     ` <20120112170157.GA2324-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
@ 2012-01-24 15:11                       ` Shawn Bohrer
       [not found]                         ` <20120124151105.GA2178-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shawn Bohrer @ 2012-01-24 15:11 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Roland Dreier, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen

Hi Or,

On Thu, Jan 12, 2012 at 11:01:58AM -0600, Shawn Bohrer wrote:
> On Wed, Jan 11, 2012 at 09:49:25PM +0200, Or Gerlitz wrote:
> > Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org> wrote:
> > > Is there any estimate on when we might see something like this upstream?
> > 
> > Could you elaborate a little on your use case for multicast IBoE
> > traffic? e.g how the setup looks like and how are your Ethernet
> > switches act to route that traffic.
> 
> I'm not sure exactly what you are asking here.  We do what I would
> imagine is a typical one to many UD multicast.  We code directly to
> libibvers and librdmacm, and everything is sent IBoE.
> 
> The hosts are in a spine/leaf configuration and all traffic is sent
> over vlans.  My understanding is that the multicast IBoE traffic is
> simply sent as broadcast and that the adapters do the necessary
> filtering.
> 
> Really from my point of view OFED already does what we want, but I
> would really like to see this supported upstream.

Is this something you are working on adding to upstream libibverbs?
I'd be happy to help with testing or whatever else might be needed.

Thanks,
Shawn

-- 

---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.
--
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] 12+ messages in thread

* [PATCH] Add multicast IBoE support
       [not found]                         ` <20120124151105.GA2178-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
@ 2012-01-25 22:56                           ` Shawn Bohrer
       [not found]                             ` <1327532208-5463-1-git-send-email-sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shawn Bohrer @ 2012-01-25 22:56 UTC (permalink / raw)
  To: Roland Dreier
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen, Or Gerlitz, Shawn Bohrer

Add multicast support for IBoE to the address handle creation flow.
Derived from work by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Signed-off-by: Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org>
---
 src/verbs.c |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/src/verbs.c b/src/verbs.c
index 199d107..2772de5 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -624,6 +624,11 @@ static int link_local_gid(const union ibv_gid *gid)
 	return 0;
 }
 
+static int is_multicast_gid(const union ibv_gid *gid)
+{
+	return gid->raw[0] == 0xff;
+}
+
 static uint16_t get_vlan_id(union ibv_gid *gid)
 {
 	uint16_t vid;
@@ -631,9 +636,12 @@ static uint16_t get_vlan_id(union ibv_gid *gid)
 	return vid < 0x1000 ? vid : 0xffff;
 }
 
-static int mlx4_resolve_grh_to_l2(struct mlx4_ah *ah, struct ibv_ah_attr *attr)
+static int mlx4_resolve_grh_to_l2(struct ibv_pd *pd, struct mlx4_ah *ah,
+				  struct ibv_ah_attr *attr)
 {
+	int err, i;
 	uint16_t vid;
+	union ibv_gid sgid;
 
 	if (link_local_gid(&attr->grh.dgid)) {
 		memcpy(ah->mac, &attr->grh.dgid.raw[8], 3);
@@ -641,13 +649,29 @@ static int mlx4_resolve_grh_to_l2(struct mlx4_ah *ah, struct ibv_ah_attr *attr)
 		ah->mac[0] ^= 2;
 
 		vid = get_vlan_id(&attr->grh.dgid);
-		if (vid != 0xffff) {
-			ah->av.port_pd |= htonl(1 << 29);
-			ah->vlan = vid | ((attr->sl & 7) << 13);
-		}
-		return 0;
+	} else if (is_multicast_gid(&attr->grh.dgid)) {
+		ah->mac[0] = 0x33;
+		ah->mac[1] = 0x33;
+		for (i = 2; i < 6; ++i)
+			ah->mac[i] = attr->grh.dgid.raw[i + 10];
+
+		err = ibv_query_gid(pd->context, attr->port_num,
+				    attr->grh.sgid_index, &sgid);
+		if (err)
+			return err;
+
+		ah->av.dlid = htons(0xc0000);
+		ah->av.port_pd |= htonl(1 << 31);
+
+		vid = get_vlan_id(&sgid);
 	} else
 		return 1;
+
+	if (vid != 0xFFFF) {
+		ah->av.port_pd |= htonl(1 << 29);
+		ah->vlan = vid | ((attr->sl & 7) << 13);
+	}
+	return 0;
 }
 
 struct ibv_ah *mlx4_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr)
@@ -687,7 +711,7 @@ struct ibv_ah *mlx4_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr)
 	}
 
 	if (port_attr.link_layer == IBV_LINK_LAYER_ETHERNET)
-		if (mlx4_resolve_grh_to_l2(ah, attr)) {
+		if (mlx4_resolve_grh_to_l2(pd, ah, attr)) {
 			free(ah);
 			return NULL;
 		}
-- 
1.7.7.5


-- 

---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.
--
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] 12+ messages in thread

* Re: [PATCH] Add multicast IBoE support
       [not found]                             ` <1327532208-5463-1-git-send-email-sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org>
@ 2012-01-25 23:21                               ` Shawn Bohrer
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Bohrer @ 2012-01-25 23:21 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eli Cohen, Or Gerlitz

Sorry, probably should have mentioned this is a patch for libmlx4.

On Wed, Jan 25, 2012 at 04:56:48PM -0600, Shawn Bohrer wrote:
> Add multicast support for IBoE to the address handle creation flow.
> Derived from work by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
> 
> Signed-off-by: Shawn Bohrer <sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org>
> ---
>  src/verbs.c |   38 +++++++++++++++++++++++++++++++-------
>  1 files changed, 31 insertions(+), 7 deletions(-)
> 
> diff --git a/src/verbs.c b/src/verbs.c
> index 199d107..2772de5 100644
> --- a/src/verbs.c
> +++ b/src/verbs.c
> @@ -624,6 +624,11 @@ static int link_local_gid(const union ibv_gid *gid)
>  	return 0;
>  }
>  
> +static int is_multicast_gid(const union ibv_gid *gid)
> +{
> +	return gid->raw[0] == 0xff;
> +}
> +
>  static uint16_t get_vlan_id(union ibv_gid *gid)
>  {
>  	uint16_t vid;
> @@ -631,9 +636,12 @@ static uint16_t get_vlan_id(union ibv_gid *gid)
>  	return vid < 0x1000 ? vid : 0xffff;
>  }
>  
> -static int mlx4_resolve_grh_to_l2(struct mlx4_ah *ah, struct ibv_ah_attr *attr)
> +static int mlx4_resolve_grh_to_l2(struct ibv_pd *pd, struct mlx4_ah *ah,
> +				  struct ibv_ah_attr *attr)
>  {
> +	int err, i;
>  	uint16_t vid;
> +	union ibv_gid sgid;
>  
>  	if (link_local_gid(&attr->grh.dgid)) {
>  		memcpy(ah->mac, &attr->grh.dgid.raw[8], 3);
> @@ -641,13 +649,29 @@ static int mlx4_resolve_grh_to_l2(struct mlx4_ah *ah, struct ibv_ah_attr *attr)
>  		ah->mac[0] ^= 2;
>  
>  		vid = get_vlan_id(&attr->grh.dgid);
> -		if (vid != 0xffff) {
> -			ah->av.port_pd |= htonl(1 << 29);
> -			ah->vlan = vid | ((attr->sl & 7) << 13);
> -		}
> -		return 0;
> +	} else if (is_multicast_gid(&attr->grh.dgid)) {
> +		ah->mac[0] = 0x33;
> +		ah->mac[1] = 0x33;
> +		for (i = 2; i < 6; ++i)
> +			ah->mac[i] = attr->grh.dgid.raw[i + 10];
> +
> +		err = ibv_query_gid(pd->context, attr->port_num,
> +				    attr->grh.sgid_index, &sgid);
> +		if (err)
> +			return err;
> +
> +		ah->av.dlid = htons(0xc0000);
> +		ah->av.port_pd |= htonl(1 << 31);
> +
> +		vid = get_vlan_id(&sgid);
>  	} else
>  		return 1;
> +
> +	if (vid != 0xFFFF) {
> +		ah->av.port_pd |= htonl(1 << 29);
> +		ah->vlan = vid | ((attr->sl & 7) << 13);
> +	}
> +	return 0;
>  }
>  
>  struct ibv_ah *mlx4_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr)
> @@ -687,7 +711,7 @@ struct ibv_ah *mlx4_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr)
>  	}
>  
>  	if (port_attr.link_layer == IBV_LINK_LAYER_ETHERNET)
> -		if (mlx4_resolve_grh_to_l2(ah, attr)) {
> +		if (mlx4_resolve_grh_to_l2(pd, ah, attr)) {
>  			free(ah);
>  			return NULL;
>  		}
> -- 
> 1.7.7.5
> 

-- 

---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.
--
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] 12+ messages in thread

end of thread, other threads:[~2012-01-25 23:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 22:38 Upstream support for multicast IBoE Shawn Bohrer
     [not found] ` <20111122223812.GB2131-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
2011-11-22 23:44   ` Roland Dreier
     [not found]     ` <CAL1RGDVF5FuVuToN56pmue1cUvHRw9kjaKC9xLOt51zeDJwMag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-23  0:07       ` Jason Gunthorpe
     [not found]         ` <20111123000735.GF11469-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-11-23  7:03           ` Roland Dreier
2011-11-23 21:17       ` Or Gerlitz
     [not found]         ` <CAJZOPZ+mdMYqMZKYNmVas=cAUYiQRw_r=8ty7j5wB2mXJSs5bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-23 21:17           ` Or Gerlitz
2012-01-11 14:59           ` Shawn Bohrer
     [not found]             ` <20120111145924.GA2296-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
2012-01-11 19:49               ` Or Gerlitz
     [not found]                 ` <CAJZOPZJL11-psmSEwUz2xa4eK4sFEkuYA5D9oEKD7m6P+O6Ffw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-12 17:01                   ` Shawn Bohrer
     [not found]                     ` <20120112170157.GA2324-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
2012-01-24 15:11                       ` Shawn Bohrer
     [not found]                         ` <20120124151105.GA2178-uiVi7NQFpn/F3E+8IioSZGvqpqeGGIMLAL8bYrjMMd8@public.gmane.org>
2012-01-25 22:56                           ` [PATCH] Add multicast IBoE support Shawn Bohrer
     [not found]                             ` <1327532208-5463-1-git-send-email-sbohrer-EgGFQ3RFNTIP7C3xziwOQw@public.gmane.org>
2012-01-25 23:21                               ` Shawn Bohrer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.