diff mbox series

[for-rc,v3] RDMA/core: Fix ENODEV error for iWARP test over vlan

Message ID 20241008114334.146702-1-anumula@chelsio.com (mailing list archive)
State Accepted
Headers show
Series [for-rc,v3] RDMA/core: Fix ENODEV error for iWARP test over vlan | expand

Commit Message

Anumula Murali Mohan Reddy Oct. 8, 2024, 11:43 a.m. UTC
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(+)

Comments

Leon Romanovsky Oct. 8, 2024, 12:08 p.m. UTC | #1
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,
diff mbox series

Patch

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;
 }