mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
RDMA/netlink: Implement counter dumpit calback
This patch adds the ability to return all available counters together with their properties and hwstats. Signed-off-by: Mark Zhang <[email protected]> Reviewed-by: Majd Dibbiny <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
parent
b47ae6f803
commit
c4ffee7c9b
6 changed files with 268 additions and 8 deletions
|
|
@ -2503,6 +2503,16 @@ struct ib_device_ops {
|
|||
* counter_dealloc -De-allocate the hw counter
|
||||
*/
|
||||
int (*counter_dealloc)(struct rdma_counter *counter);
|
||||
/**
|
||||
* counter_alloc_stats - Allocate a struct rdma_hw_stats and fill in
|
||||
* the driver initialized data.
|
||||
*/
|
||||
struct rdma_hw_stats *(*counter_alloc_stats)(
|
||||
struct rdma_counter *counter);
|
||||
/**
|
||||
* counter_update_stats - Query the stats value of this counter
|
||||
*/
|
||||
int (*counter_update_stats)(struct rdma_counter *counter);
|
||||
|
||||
DECLARE_RDMA_OBJ_SIZE(ib_ah);
|
||||
DECLARE_RDMA_OBJ_SIZE(ib_cq);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ struct rdma_counter {
|
|||
struct kref kref;
|
||||
struct rdma_counter_mode mode;
|
||||
struct mutex lock;
|
||||
struct rdma_hw_stats *stats;
|
||||
u8 port;
|
||||
};
|
||||
|
||||
|
|
@ -47,4 +48,6 @@ int rdma_counter_set_auto_mode(struct ib_device *dev, u8 port,
|
|||
int rdma_counter_bind_qp_auto(struct ib_qp *qp, u8 port);
|
||||
int rdma_counter_unbind_qp(struct ib_qp *qp, bool force);
|
||||
|
||||
int rdma_counter_query_stats(struct rdma_counter *counter);
|
||||
|
||||
#endif /* _RDMA_COUNTER_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue