All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/ipoib: improve latency in ipoib/cm connection formation
@ 2021-01-21 17:50 Manjunath Patil
  2021-01-21 18:16 ` Jason Gunthorpe
  0 siblings, 1 reply; 6+ messages in thread
From: Manjunath Patil @ 2021-01-21 17:50 UTC (permalink / raw)
  To: dledford, jgg, leon, valentinef, gustavoars
  Cc: haakon.bugge, manjunath.b.patil, linux-rdma

ipoib connected mode presently queries the device[HCA] to get P_Key
table entry during connection formation. This will increase the time
taken to form the connection, especially when limited P_Keys are in use.
This gets worse when multiple connection attempts are done in parallel.
Improve this by using the cached version of ib_find_pkey().

This improved the latency from 500ms to 3ms on an internal setup.

Suggested-by: Haakon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 8f0b598..013a1d8 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -40,6 +40,7 @@
 #include <linux/moduleparam.h>
 #include <linux/sched/signal.h>
 #include <linux/sched/mm.h>
+#include <rdma/ib_cache.h>
 
 #include "ipoib.h"
 
@@ -1122,7 +1123,8 @@ static int ipoib_cm_modify_tx_init(struct net_device *dev,
 	struct ipoib_dev_priv *priv = ipoib_priv(dev);
 	struct ib_qp_attr qp_attr;
 	int qp_attr_mask, ret;
-	ret = ib_find_pkey(priv->ca, priv->port, priv->pkey, &qp_attr.pkey_index);
+	ret = ib_find_cached_pkey(priv->ca, priv->port, priv->pkey,
+						&qp_attr.pkey_index);
 	if (ret) {
 		ipoib_warn(priv, "pkey 0x%x not found: %d\n", priv->pkey, ret);
 		return ret;
-- 
1.7.1


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

end of thread, other threads:[~2021-01-27  4:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 17:50 [PATCH] IB/ipoib: improve latency in ipoib/cm connection formation Manjunath Patil
2021-01-21 18:16 ` Jason Gunthorpe
2021-01-25 18:49   ` Manjunath Patil
2021-01-26 20:01     ` Haakon Bugge
2021-01-26 20:28     ` Haakon Bugge
2021-01-27  0:16       ` Jason Gunthorpe

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.