All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-rc v2] IB/IPoIB: Fix queue count for non-enhanced IPoIB over netlink
@ 2023-01-24 18:24 Leon Romanovsky
  2023-01-26 18:35 ` Leon Romanovsky
  2023-01-26 19:19 ` Leon Romanovsky
  0 siblings, 2 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-01-24 18:24 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Dragos Tatulea, linux-rdma

From: Dragos Tatulea <dtatulea@nvidia.com>

Make sure that non-enhanced IPoIB queues are configured with only
1 tx and rx queues over netlink. This behavior is consistent with the
sysfs child_create configuration.

The cited commit opened up the possibility for child PKEY interface
to have multiple tx/rx queues. It is the driver's responsibility to
re-adjust the queue count accordingly. This patch does exactly that:
non-enhanced IPoIB supports only 1 tx and 1 rx queue.

Fixes: dbc94a0fb817 ("IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@nvidia.coma
---
Changelog:
v2:
 * Changed implementation
v1: https://lore.kernel.org/all/752143b0eef72a966662ce94526b1ceb5ba4bbb3.1674234106.git.leon@kernel.org
 * Fixed typo in warning print.
v0: https://lore.kernel.org/all/4a7ecec08ee30ad8004019818fadf1e58057e945.1674137153.git.leon@kernel.org>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index ac25fc80fb33..f10d4bcf87d2 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2200,6 +2200,14 @@ int ipoib_intf_init(struct ib_device *hca, u32 port, const char *name,
 		rn->attach_mcast = ipoib_mcast_attach;
 		rn->detach_mcast = ipoib_mcast_detach;
 		rn->hca = hca;
+
+		rc = netif_set_real_num_tx_queues(dev, 1);
+		if (rc)
+			goto out;
+
+		rc = netif_set_real_num_rx_queues(dev, 1);
+		if (rc)
+			goto out;
 	}
 
 	priv->rn_ops = dev->netdev_ops;
-- 
2.39.1


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

end of thread, other threads:[~2023-01-26 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 18:24 [PATCH rdma-rc v2] IB/IPoIB: Fix queue count for non-enhanced IPoIB over netlink Leon Romanovsky
2023-01-26 18:35 ` Leon Romanovsky
2023-01-26 18:40   ` Jason Gunthorpe
2023-01-26 18:53     ` Leon Romanovsky
2023-01-26 19:02       ` Dragos Tatulea
2023-01-26 19:04         ` Jason Gunthorpe
2023-01-26 19:19 ` Leon Romanovsky

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.