diff options
author | Mark Zhang <markz@mellanox.com> | 2019-07-02 12:02:34 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-07-05 15:22:54 +0200 |
commit | 413d3347503bc39e17577eaf16451fd492a68558 (patch) | |
tree | e0a8713098e5973f8aaeca2a7979033307b2dae4 /include/rdma/rdma_counter.h | |
parent | RDMA/restrack: Make is_visible_in_pid_ns() as an API (diff) | |
download | linux-413d3347503bc39e17577eaf16451fd492a68558.tar.xz linux-413d3347503bc39e17577eaf16451fd492a68558.zip |
RDMA/counter: Add set/clear per-port auto mode support
Add an API to support set/clear per-port auto mode.
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/rdma_counter.h')
-rw-r--r-- | include/rdma/rdma_counter.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/rdma/rdma_counter.h b/include/rdma/rdma_counter.h index 283ac1a0cdb7..8dd2619c015d 100644 --- a/include/rdma/rdma_counter.h +++ b/include/rdma/rdma_counter.h @@ -6,8 +6,26 @@ #ifndef _RDMA_COUNTER_H_ #define _RDMA_COUNTER_H_ +#include <linux/mutex.h> + #include <rdma/ib_verbs.h> #include <rdma/restrack.h> +#include <rdma/rdma_netlink.h> + +struct auto_mode_param { + int qp_type; +}; + +struct rdma_counter_mode { + enum rdma_nl_counter_mode mode; + enum rdma_nl_counter_mask mask; + struct auto_mode_param param; +}; + +struct rdma_port_counter { + struct rdma_counter_mode mode; + struct mutex lock; +}; struct rdma_counter { struct rdma_restrack_entry res; @@ -15,4 +33,10 @@ struct rdma_counter { uint32_t id; u8 port; }; + +void rdma_counter_init(struct ib_device *dev); +void rdma_counter_release(struct ib_device *dev); +int rdma_counter_set_auto_mode(struct ib_device *dev, u8 port, + bool on, enum rdma_nl_counter_mask mask); + #endif /* _RDMA_COUNTER_H_ */ |