IB/srp: Use P_Key cache for P_Key lookups
authorBart Van Assche <bvanassche@acm.org>
Wed, 9 Jul 2014 13:58:22 +0000 (15:58 +0200)
committerDoug Ledford <dledford@redhat.com>
Wed, 15 Apr 2015 20:06:54 +0000 (16:06 -0400)
This change slightly reduces the time needed to log in.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: David Dillow <dave@thedillows.org>
Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srp/ib_srp.c

index 0747c0595a9d42b2ff8c9cb231b38be939821ddb..918814cd0f806f5344e5f293e2bb059010237727 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/parser.h>
 #include <linux/random.h>
 #include <linux/jiffies.h>
+#include <rdma/ib_cache.h>
 
 #include <linux/atomic.h>
 
@@ -265,10 +266,10 @@ static int srp_init_qp(struct srp_target_port *target,
        if (!attr)
                return -ENOMEM;
 
-       ret = ib_find_pkey(target->srp_host->srp_dev->dev,
-                          target->srp_host->port,
-                          be16_to_cpu(target->pkey),
-                          &attr->pkey_index);
+       ret = ib_find_cached_pkey(target->srp_host->srp_dev->dev,
+                                 target->srp_host->port,
+                                 be16_to_cpu(target->pkey),
+                                 &attr->pkey_index);
        if (ret)
                goto out;