summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorJack Wang <jinpu.wang@profitbricks.com>2017-01-17 10:11:12 +0100
committerDoug Ledford <dledford@redhat.com>2017-01-24 16:20:37 -0500
commit21d6454a392d552c7e845f39884f7cf86f9426b9 (patch)
treec8d266a076d56d53d02e55a13faac61917c53de3 /include/rdma
parentdfc0e5550664a727a59921db7d9e7a41c21d03bb (diff)
downloadlinux-21d6454a392d552c7e845f39884f7cf86f9426b9.tar.gz
linux-21d6454a392d552c7e845f39884f7cf86f9426b9.tar.xz
RDMA/core: create struct ib_port_cache
As Jason suggested, we have 4 elements for per port arrays, it's better to have a separate structure to represent them. It simplifies code a bit, ~ 30 lines of code less :) Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com> Reviewed-by: Michael Wang <yun.wang@profitbricks.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index fafa988e0e9a..e55afec6bb84 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1775,13 +1775,17 @@ enum ib_mad_result {
#define IB_DEVICE_NAME_MAX 64
+struct ib_port_cache {
+ struct ib_pkey_cache *pkey;
+ struct ib_gid_table *gid;
+ u8 lmc;
+ enum ib_port_state port_state;
+};
+
struct ib_cache {
rwlock_t lock;
struct ib_event_handler event_handler;
- struct ib_pkey_cache **pkey_cache;
- struct ib_gid_table **gid_cache;
- u8 *lmc_cache;
- enum ib_port_state *port_state_cache;
+ struct ib_port_cache *ports;
};
struct ib_dma_mapping_ops {