All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] cma: use cached port state when bind loopback
@ 2016-12-12 11:49 Jinpu Wang
       [not found] ` <CAMGffEkCsD1_jAEjrCSuBSnGRZksup=Mjv_A=Nte=wcDKVJT0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jinpu Wang @ 2016-12-12 11:49 UTC (permalink / raw)
  To: Doug Ledford, Hefty, Sean, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Michael Wang, Jason Gunthorpe

>From f2083c81f7738841cc696feda5f0ff5a96beeb01 Mon Sep 17 00:00:00 2001
From: Jack Wang <jinpu.wang-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Date: Mon, 12 Dec 2016 10:29:00 +0100
Subject: [PATCH 4/4] cma: use cached port state when bind loopback

Signed-off-by: Jack Wang <jinpu.wang-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Reviewed-by: Michael Wang <yun.wang-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
---
 drivers/infiniband/core/cma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 3413aec..f57d017 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2613,8 +2613,8 @@ static void cma_set_loopback(struct sockaddr *addr)
 static int cma_bind_loopback(struct rdma_id_private *id_priv)
 {
     struct cma_device *cma_dev, *cur_dev;
-    struct ib_port_attr port_attr;
     union ib_gid gid;
+    enum ib_port_state port_state;
     u16 pkey;
     int ret;
     u8 p;
@@ -2630,8 +2630,8 @@ static int cma_bind_loopback(struct
rdma_id_private *id_priv)
             cma_dev = cur_dev;

         for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
-            if (!ib_query_port(cur_dev->device, p, &port_attr) &&
-                port_attr.state == IB_PORT_ACTIVE) {
+            if (!ib_get_cached_port_state(cur_dev->device, p, &port_state) &&
+                port_state == IB_PORT_ACTIVE) {
                 cma_dev = cur_dev;
                 goto port_found;
             }
-- 
2.7.4


-- 
Jinpu Wang
Linux Kernel Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Tel:       +49 30 577 008  042
Fax:      +49 30 577 008 299
Email:    jinpu.wang-EIkl63zCoXaH+58JC4qpiA@public.gmane.org
URL:      https://www.profitbricks.de

Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 4/4] cma: use cached port state when bind loopback
       [not found] ` <CAMGffEkCsD1_jAEjrCSuBSnGRZksup=Mjv_A=Nte=wcDKVJT0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-12-19 17:30   ` Hefty, Sean
  0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2016-12-19 17:30 UTC (permalink / raw)
  To: Jinpu Wang, Doug Ledford, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Michael Wang, Jason Gunthorpe

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 178 bytes --]

Acked-by: Sean Hefty <sean.hefty@intel.com>
N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±­ÙšŠ{ayº\x1dʇڙë,j\a­¢f£¢·hš‹»öì\x17/oSc¾™Ú³9˜uÀ¦æå‰È&jw¨®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þ–Šàþf£¢·hšˆ§~ˆmš

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

end of thread, other threads:[~2016-12-19 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-12 11:49 [PATCH 4/4] cma: use cached port state when bind loopback Jinpu Wang
     [not found] ` <CAMGffEkCsD1_jAEjrCSuBSnGRZksup=Mjv_A=Nte=wcDKVJT0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-19 17:30   ` Hefty, Sean

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.