summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2015-05-13 20:02:58 -0400
committerDoug Ledford <dledford@redhat.com>2015-05-20 12:38:13 -0400
commit7738613e7cb419179545910744b1777d87edac5c (patch)
treefb2f63a6dd2b81c536cff96e2e60ca3c2173e82d /include/rdma
parent26c454288a4beac774ea31c15284783fcd75721d (diff)
IB/core: Add per port immutable struct to ib_device
As of commit 5eb620c81ce3 "IB/core: Add helpers for uncached GID and P_Key searches"; pkey_tbl_len and gid_tbl_len are immutable data which are stored in the ib_device. The per port core capability flags to be added later are also immutable data to be stored in the ib_device object. In preparation for this create a structure for per port immutable data and place the pkey and gid table lengths within this structure. "get_port_immutable" is added as a mandatory device function to allow the drivers to fill in this data. Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index be4465b5df7b..2d3515edc3fa 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1481,6 +1481,11 @@ struct ib_dma_mapping_ops {
1481 1481
1482struct iw_cm_verbs; 1482struct iw_cm_verbs;
1483 1483
1484struct ib_port_immutable {
1485 int pkey_tbl_len;
1486 int gid_tbl_len;
1487};
1488
1484struct ib_device { 1489struct ib_device {
1485 struct device *dma_device; 1490 struct device *dma_device;
1486 1491
@@ -1494,8 +1499,10 @@ struct ib_device {
1494 struct list_head client_data_list; 1499 struct list_head client_data_list;
1495 1500
1496 struct ib_cache cache; 1501 struct ib_cache cache;
1497 int *pkey_tbl_len; 1502 /**
1498 int *gid_tbl_len; 1503 * port_immutable is indexed by port number
1504 */
1505 struct ib_port_immutable *port_immutable;
1499 1506
1500 int num_comp_vectors; 1507 int num_comp_vectors;
1501 1508
@@ -1684,6 +1691,14 @@ struct ib_device {
1684 u32 local_dma_lkey; 1691 u32 local_dma_lkey;
1685 u8 node_type; 1692 u8 node_type;
1686 u8 phys_port_cnt; 1693 u8 phys_port_cnt;
1694
1695 /**
1696 * The following mandatory functions are used only at device
1697 * registration. Keep functions such as these at the end of this
1698 * structure to avoid cache line misses when accessing struct ib_device
1699 * in fast paths.
1700 */
1701 int (*get_port_immutable)(struct ib_device *, u8, struct ib_port_immutable *);
1687}; 1702};
1688 1703
1689struct ib_client { 1704struct ib_client {