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>
This commit is contained in:

committed by
Jason Gunthorpe

parent
6a6c306a09
commit
413d334750
@@ -62,6 +62,7 @@
|
||||
#include <linux/irqflags.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <uapi/rdma/ib_user_verbs.h>
|
||||
#include <rdma/rdma_counter.h>
|
||||
#include <rdma/restrack.h>
|
||||
#include <rdma/signature.h>
|
||||
#include <uapi/rdma/rdma_user_ioctl.h>
|
||||
@@ -2119,6 +2120,7 @@ struct ib_port_data {
|
||||
spinlock_t netdev_lock;
|
||||
struct net_device __rcu *netdev;
|
||||
struct hlist_node ndev_hash_link;
|
||||
struct rdma_port_counter port_counter;
|
||||
};
|
||||
|
||||
/* rdma netdev type - specifies protocol type */
|
||||
|
@@ -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_ */
|
||||
|
Reference in New Issue
Block a user