linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly
@ 2018-07-13 23:50 Qing Huang
  2018-07-14 15:57 ` Or Gerlitz
  0 siblings, 1 reply; 8+ messages in thread
From: Qing Huang @ 2018-07-13 23:50 UTC (permalink / raw)
  To: linux-kernel, linux-rdma; +Cc: jgg, dledford, leon, gerald.gibson, qing.huang

When a CX5 device is configured in dual-port RoCE mode, after creating
many VFs against port 1, creating the same number of VFs against port 2
will flood kernel/syslog with something like
"mlx5_*:mlx5_ib_bind_slave_port:4266:(pid 5269): port 2 already
affiliated."

So basically, when traversing mlx5_ib_dev_list, mlx5_ib_add_slave_port()
shouldn't repeatedly attempt to bind the new mpi data unit to every device
on the list until it finds an unbound device.

Reported-by: Gerald Gibson <gerald.gibson@oracle.com>
Signed-off-by: Qing Huang <qing.huang@oracle.com>
---
 drivers/infiniband/hw/mlx5/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index b3ba9a2..1ddd1d3 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -6068,7 +6068,8 @@ static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev, u8 port_num)
 
 	mutex_lock(&mlx5_ib_multiport_mutex);
 	list_for_each_entry(dev, &mlx5_ib_dev_list, ib_dev_list) {
-		if (dev->sys_image_guid == mpi->sys_image_guid)
+		if (dev->sys_image_guid == mpi->sys_image_guid &&
+		    !dev->port[mlx5_core_native_port_num(mdev) - 1].mp.mpi)
 			bound = mlx5_ib_bind_slave_port(dev, mpi);
 
 		if (bound) {
-- 
2.9.3


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

end of thread, other threads:[~2018-07-23 18:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 23:50 [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly Qing Huang
2018-07-14 15:57 ` Or Gerlitz
2018-07-15  6:04   ` Leon Romanovsky
2018-07-15 19:48   ` Daniel Jurgens
2018-07-23 15:36     ` Qing Huang
2018-07-23 16:21       ` Parav Pandit
2018-07-23 18:11       ` Daniel Jurgens
2018-07-23 18:21         ` Qing Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).