All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan
@ 2024-10-08 11:43 Anumula Murali Mohan Reddy
  2024-10-08 12:08 ` Leon Romanovsky
  2024-11-10 13:07 ` Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Anumula Murali Mohan Reddy @ 2024-10-08 11:43 UTC (permalink / raw)
  To: jgg, leonro; +Cc: linux-rdma, Anumula Murali Mohan Reddy, Potnuri Bharat Teja

If traffic is over vlan, cma_validate_port() fails to match vlan
net_device ifindex with bound_if_index and results in ENODEV error.
It is because rdma_copy_src_l2_addr() always assigns bound_if_index with
real net_device ifindex.
This patch fixes the issue by assigning bound_if_index with vlan
net_device index if traffic is over vlan.

Fixes: f8ef1be816bf ("RDMA/cma: Avoid GID lookups on iWARP devices")
Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
Changes since v2:
Addressed previous review comments
---
 drivers/infiniband/core/addr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index be0743dac3ff..c4cf26f1d149 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -269,6 +269,8 @@ rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in)
 		break;
 #endif
 	}
+	if (!ret && dev && is_vlan_dev(dev))
+		dev = vlan_dev_real_dev(dev);
 	return ret ? ERR_PTR(ret) : dev;
 }
 
-- 
2.39.3


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

* Re: [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan
  2024-10-08 11:43 [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan Anumula Murali Mohan Reddy
@ 2024-10-08 12:08 ` Leon Romanovsky
  2024-11-10 13:07 ` Leon Romanovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-10-08 12:08 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky, Anumula Murali Mohan Reddy
  Cc: linux-rdma, Potnuri Bharat Teja


On Tue, 08 Oct 2024 17:13:34 +0530, Anumula Murali Mohan Reddy wrote:
> If traffic is over vlan, cma_validate_port() fails to match vlan
> net_device ifindex with bound_if_index and results in ENODEV error.
> It is because rdma_copy_src_l2_addr() always assigns bound_if_index with
> real net_device ifindex.
> This patch fixes the issue by assigning bound_if_index with vlan
> net_device index if traffic is over vlan.
> 
> [...]

Applied, thanks!

[1/1] RDMA/core: Fix ENODEV error for iWARP test over vlan
      https://git.kernel.org/rdma/rdma/c/5069d7e202f640

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


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

* Re: [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan
  2024-10-08 11:43 [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan Anumula Murali Mohan Reddy
  2024-10-08 12:08 ` Leon Romanovsky
@ 2024-11-10 13:07 ` Leon Romanovsky
  2024-11-12 14:04   ` Anumula Murali Mohan Reddy
  1 sibling, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2024-11-10 13:07 UTC (permalink / raw)
  To: Anumula Murali Mohan Reddy; +Cc: jgg, linux-rdma, Potnuri Bharat Teja

On Tue, Oct 08, 2024 at 05:13:34PM +0530, Anumula Murali Mohan Reddy wrote:
> If traffic is over vlan, cma_validate_port() fails to match vlan
> net_device ifindex with bound_if_index and results in ENODEV error.
> It is because rdma_copy_src_l2_addr() always assigns bound_if_index with
> real net_device ifindex.
> This patch fixes the issue by assigning bound_if_index with vlan
> net_device index if traffic is over vlan.
> 
> Fixes: f8ef1be816bf ("RDMA/cma: Avoid GID lookups on iWARP devices")
> Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
> Changes since v2:
> Addressed previous review comments
> ---
>  drivers/infiniband/core/addr.c | 2 ++
>  1 file changed, 2 insertions(+)

This patch causes to udaddy regression. It doesn't work over VLANs
anymore.

# Client:
ifconfig eth2 1.1.1.1
ip link add link eth2 name p0.3597 type vlan protocol 802.1Q id 3597
ip link set dev p0.3597 up
ip addr add 2.2.2.2/16 dev p0.3597
udaddy -S 847 -C 220 -c 2 -t 0 -s 2.2.2.3 -b 2.2.2.2

# Server:
ifconfig eth2 1.1.1.3
ip link add link eth2 name p0.3597 type vlan protocol 802.1Q id 3597
ip link set dev p0.3597 up
ip addr add 2.2.2.3/16 dev p0.3597
udaddy -S 847 -C 220 -c 2 -t 0 -b 2.2.2.3

Thanks

> 
> diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> index be0743dac3ff..c4cf26f1d149 100644
> --- a/drivers/infiniband/core/addr.c
> +++ b/drivers/infiniband/core/addr.c
> @@ -269,6 +269,8 @@ rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in)
>  		break;
>  #endif
>  	}
> +	if (!ret && dev && is_vlan_dev(dev))
> +		dev = vlan_dev_real_dev(dev);
>  	return ret ? ERR_PTR(ret) : dev;
>  }
>  
> -- 
> 2.39.3
> 

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

* Re: [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan
  2024-11-10 13:07 ` Leon Romanovsky
@ 2024-11-12 14:04   ` Anumula Murali Mohan Reddy
  0 siblings, 0 replies; 4+ messages in thread
From: Anumula Murali Mohan Reddy @ 2024-11-12 14:04 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: jgg@nvidia.com, linux-rdma@vger.kernel.org, Potnuri Bharat Teja

On Sunday, November 11/10/24, 2024 at 18:37:46 +0530, Leon Romanovsky wrote:
> On Tue, Oct 08, 2024 at 05:13:34PM +0530, Anumula Murali Mohan Reddy wrote:
> > If traffic is over vlan, cma_validate_port() fails to match vlan
> > net_device ifindex with bound_if_index and results in ENODEV error.
> > It is because rdma_copy_src_l2_addr() always assigns bound_if_index with
> > real net_device ifindex.
> > This patch fixes the issue by assigning bound_if_index with vlan
> > net_device index if traffic is over vlan.
> > 
> > Fixes: f8ef1be816bf ("RDMA/cma: Avoid GID lookups on iWARP devices")
> > Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
> > Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> > ---
> > Changes since v2:
> > Addressed previous review comments
> > ---
> >  drivers/infiniband/core/addr.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> This patch causes to udaddy regression. It doesn't work over VLANs
> anymore.
> 
> # Client:
> ifconfig eth2 1.1.1.1
> ip link add link eth2 name p0.3597 type vlan protocol 802.1Q id 3597
> ip link set dev p0.3597 up
> ip addr add 2.2.2.2/16 dev p0.3597
> udaddy -S 847 -C 220 -c 2 -t 0 -s 2.2.2.3 -b 2.2.2.2
> 
> # Server:
> ifconfig eth2 1.1.1.3
> ip link add link eth2 name p0.3597 type vlan protocol 802.1Q id 3597
> ip link set dev p0.3597 up
> ip addr add 2.2.2.3/16 dev p0.3597
> udaddy -S 847 -C 220 -c 2 -t 0 -b 2.2.2.3
> 
> Thanks
> 
> > 
> > diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> > index be0743dac3ff..c4cf26f1d149 100644
> > --- a/drivers/infiniband/core/addr.c
> > +++ b/drivers/infiniband/core/addr.c
> > @@ -269,6 +269,8 @@ rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in)
> >  		break;
> >  #endif
> >  	}
> > +	if (!ret && dev && is_vlan_dev(dev))
> > +		dev = vlan_dev_real_dev(dev);
> >  	return ret ? ERR_PTR(ret) : dev;
> >  }
> >  
> > -- 
> > 2.39.3
> >
i am able to reproduce the issue with udaddy, i am working on a new patch.
for now you can proceed with reverting this change

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

end of thread, other threads:[~2024-11-12 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 11:43 [PATCH for-rc v3] RDMA/core: Fix ENODEV error for iWARP test over vlan Anumula Murali Mohan Reddy
2024-10-08 12:08 ` Leon Romanovsky
2024-11-10 13:07 ` Leon Romanovsky
2024-11-12 14:04   ` Anumula Murali Mohan Reddy

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.