public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper API to retrieve the vlan ID
@ 2019-09-25 11:23 Yuval Basson
  2019-09-25 17:17 ` Parav Pandit
  0 siblings, 1 reply; 3+ messages in thread
From: Yuval Basson @ 2019-09-25 11:23 UTC (permalink / raw)
  To: dledford, jgg; +Cc: leon, mkalderon, linux-rdma, Yuval Basson, Ariel Elior

When working over a macvlan device which was itself
created over a vlan device, the roce CM traffic should use
the vlan from the lower vlan device, but instead it simply queries
the macvlan device as to whether it is itself a vlan device. 
Since it is not, the roce CM traffic is sent without any vlan, which
causes it not to be accepted by the peer which is running directly
over a vlan device, and will thus only accept roce CM traffic carrying
the vlan.

Fixes: dbf727de7440 ("Use GID table in AH creation and dmac resolution")
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Yuval Basson <ybason@marvell.com>
---
 drivers/infiniband/core/verbs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index f974b68..1d2d9be0 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -662,13 +662,13 @@ static bool find_gid_index(const union ib_gid *gid,
 			   void *context)
 {
 	struct find_gid_index_context *ctx = context;
+	u16 vlan_id;
 
 	if (ctx->gid_type != gid_attr->gid_type)
 		return false;
 
-	if ((!!(ctx->vlan_id != 0xffff) == !is_vlan_dev(gid_attr->ndev)) ||
-	    (is_vlan_dev(gid_attr->ndev) &&
-	     vlan_dev_vlan_id(gid_attr->ndev) != ctx->vlan_id))
+	rdma_read_gid_l2_fields(gid_attr, &vlan_id, NULL);
+	if (ctx->vlan_id != vlan_id)
 		return false;
 
 	return true;
-- 
1.8.3.1


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

* RE: [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper API to retrieve the vlan ID
  2019-09-25 11:23 [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper API to retrieve the vlan ID Yuval Basson
@ 2019-09-25 17:17 ` Parav Pandit
  2019-09-26  8:00   ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Parav Pandit @ 2019-09-25 17:17 UTC (permalink / raw)
  To: Yuval Basson, dledford@redhat.com, jgg@ziepe.ca
  Cc: leon@kernel.org, mkalderon@marvell.com,
	linux-rdma@vger.kernel.org, Ariel Elior

Hi Yuval,


> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org <linux-rdma-
> owner@vger.kernel.org> On Behalf Of Yuval Basson
> Sent: Wednesday, September 25, 2019 6:23 AM
> To: dledford@redhat.com; jgg@ziepe.ca
> Cc: leon@kernel.org; mkalderon@marvell.com; linux-rdma@vger.kernel.org;
> Yuval Basson <ybason@marvell.com>; Ariel Elior <aelior@marvell.com>
> Subject: [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper
> API to retrieve the vlan ID
> 
> When working over a macvlan device which was itself created over a vlan
> device, the roce CM traffic should use the vlan from the lower vlan device, but
> instead it simply queries the macvlan device as to whether it is itself a vlan
> device.
> Since it is not, the roce CM traffic is sent without any vlan, which causes it not
> to be accepted by the peer which is running directly over a vlan device, and will
> thus only accept roce CM traffic carrying the vlan.
> 
> Fixes: dbf727de7440 ("Use GID table in AH creation and dmac resolution")
> Signed-off-by: Ariel Elior <aelior@marvell.com>
> Signed-off-by: Yuval Basson <ybason@marvell.com>
> ---
>  drivers/infiniband/core/verbs.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index f974b68..1d2d9be0 100644
> --- a/drivers/infiniband/core/verbs.c
> +++ b/drivers/infiniband/core/verbs.c
> @@ -662,13 +662,13 @@ static bool find_gid_index(const union ib_gid *gid,
>  			   void *context)
>  {
>  	struct find_gid_index_context *ctx = context;
> +	u16 vlan_id;
> 
>  	if (ctx->gid_type != gid_attr->gid_type)
>  		return false;
> 
> -	if ((!!(ctx->vlan_id != 0xffff) == !is_vlan_dev(gid_attr->ndev)) ||
> -	    (is_vlan_dev(gid_attr->ndev) &&
> -	     vlan_dev_vlan_id(gid_attr->ndev) != ctx->vlan_id))
> +	rdma_read_gid_l2_fields(gid_attr, &vlan_id, NULL);
> +	if (ctx->vlan_id != vlan_id)
>  		return false;

A little shorter version [1] along with rdmacm support [2] are in Leon's queue which is needed for macvlan to work properly.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?h=rdma-next&id=9811bdac481cf6278512a8d052c5ba91cfb69c71
[2] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?h=rdma-next&id=d190d04808be104a2a3ef71841ff03c5ffaa16f8

> 
>  	return true;
> --
> 1.8.3.1


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

* Re: [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper API to retrieve the vlan ID
  2019-09-25 17:17 ` Parav Pandit
@ 2019-09-26  8:00   ` Leon Romanovsky
  0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2019-09-26  8:00 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Yuval Basson, dledford@redhat.com, jgg@ziepe.ca,
	mkalderon@marvell.com, linux-rdma@vger.kernel.org, Ariel Elior

On Wed, Sep 25, 2019 at 05:17:49PM +0000, Parav Pandit wrote:
> Hi Yuval,
>
>
> > -----Original Message-----
> > From: linux-rdma-owner@vger.kernel.org <linux-rdma-
> > owner@vger.kernel.org> On Behalf Of Yuval Basson
> > Sent: Wednesday, September 25, 2019 6:23 AM
> > To: dledford@redhat.com; jgg@ziepe.ca
> > Cc: leon@kernel.org; mkalderon@marvell.com; linux-rdma@vger.kernel.org;
> > Yuval Basson <ybason@marvell.com>; Ariel Elior <aelior@marvell.com>
> > Subject: [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper
> > API to retrieve the vlan ID
> >
> > When working over a macvlan device which was itself created over a vlan
> > device, the roce CM traffic should use the vlan from the lower vlan device, but
> > instead it simply queries the macvlan device as to whether it is itself a vlan
> > device.
> > Since it is not, the roce CM traffic is sent without any vlan, which causes it not
> > to be accepted by the peer which is running directly over a vlan device, and will
> > thus only accept roce CM traffic carrying the vlan.
> >
> > Fixes: dbf727de7440 ("Use GID table in AH creation and dmac resolution")
> > Signed-off-by: Ariel Elior <aelior@marvell.com>
> > Signed-off-by: Yuval Basson <ybason@marvell.com>
> > ---
> >  drivers/infiniband/core/verbs.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> > index f974b68..1d2d9be0 100644
> > --- a/drivers/infiniband/core/verbs.c
> > +++ b/drivers/infiniband/core/verbs.c
> > @@ -662,13 +662,13 @@ static bool find_gid_index(const union ib_gid *gid,
> >  			   void *context)
> >  {
> >  	struct find_gid_index_context *ctx = context;
> > +	u16 vlan_id;
> >
> >  	if (ctx->gid_type != gid_attr->gid_type)
> >  		return false;
> >
> > -	if ((!!(ctx->vlan_id != 0xffff) == !is_vlan_dev(gid_attr->ndev)) ||
> > -	    (is_vlan_dev(gid_attr->ndev) &&
> > -	     vlan_dev_vlan_id(gid_attr->ndev) != ctx->vlan_id))
> > +	rdma_read_gid_l2_fields(gid_attr, &vlan_id, NULL);
> > +	if (ctx->vlan_id != vlan_id)
> >  		return false;
>
> A little shorter version [1] along with rdmacm support [2] are in Leon's queue which is needed for macvlan to work properly.

I'll start sending after merge window will end.

Thanks

>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?h=rdma-next&id=9811bdac481cf6278512a8d052c5ba91cfb69c71
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?h=rdma-next&id=d190d04808be104a2a3ef71841ff03c5ffaa16f8
>
> >
> >  	return true;
> > --
> > 1.8.3.1
>

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

end of thread, other threads:[~2019-09-26  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-25 11:23 [PATCH rdma-next] RDMA/core: Fix find_gid_index to use the proper API to retrieve the vlan ID Yuval Basson
2019-09-25 17:17 ` Parav Pandit
2019-09-26  8:00   ` Leon Romanovsky

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