summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMark Zhang <markz@mellanox.com>2019-07-02 06:02:43 -0400
committerJason Gunthorpe <jgg@mellanox.com>2019-07-05 09:22:55 -0400
commit1bd8e0a9d0fd1be03d2833a0c15ac676bdf275d8 (patch)
treedd234113ffdfcdc0b23027ab7cc5f01ceb1c4cb0 /include/rdma
parentf34a55e497e81347ffbdc6e828f123520d33ce5d (diff)
RDMA/counter: Allow manual mode configuration support
In manual mode a QP is bound to a counter manually. If counter is not specified then a new one will be allocated. Manual mode is enabled when user binds a QP, and disabled when the last manually bound QP is unbound. When auto-mode is turned off and there are counters left, manual mode is enabled so that the user is able to access these counters. Signed-off-by: Mark Zhang <markz@mellanox.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/rdma_counter.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rdma/rdma_counter.h b/include/rdma/rdma_counter.h
index bf2c3578768f..6603e10eb352 100644
--- a/include/rdma/rdma_counter.h
+++ b/include/rdma/rdma_counter.h
@@ -28,6 +28,7 @@ struct rdma_counter_mode {
28struct rdma_port_counter { 28struct rdma_port_counter {
29 struct rdma_counter_mode mode; 29 struct rdma_counter_mode mode;
30 struct rdma_hw_stats *hstats; 30 struct rdma_hw_stats *hstats;
31 unsigned int num_counters;
31 struct mutex lock; 32 struct mutex lock;
32}; 33};
33 34
@@ -51,5 +52,11 @@ int rdma_counter_unbind_qp(struct ib_qp *qp, bool force);
51 52
52int rdma_counter_query_stats(struct rdma_counter *counter); 53int rdma_counter_query_stats(struct rdma_counter *counter);
53u64 rdma_counter_get_hwstat_value(struct ib_device *dev, u8 port, u32 index); 54u64 rdma_counter_get_hwstat_value(struct ib_device *dev, u8 port, u32 index);
55int rdma_counter_bind_qpn(struct ib_device *dev, u8 port,
56 u32 qp_num, u32 counter_id);
57int rdma_counter_bind_qpn_alloc(struct ib_device *dev, u8 port,
58 u32 qp_num, u32 *counter_id);
59int rdma_counter_unbind_qpn(struct ib_device *dev, u8 port,
60 u32 qp_num, u32 counter_id);
54 61
55#endif /* _RDMA_COUNTER_H_ */ 62#endif /* _RDMA_COUNTER_H_ */