Blame view
include/rdma/rdma_counter.h
1.74 KB
7ade1ff96
|
1 2 3 4 5 6 7 |
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* * Copyright (c) 2019 Mellanox Technologies. All rights reserved. */ #ifndef _RDMA_COUNTER_H_ #define _RDMA_COUNTER_H_ |
413d33475
|
8 |
#include <linux/mutex.h> |
99fa331dc
|
9 |
#include <linux/pid_namespace.h> |
413d33475
|
10 |
|
7ade1ff96
|
11 |
#include <rdma/restrack.h> |
413d33475
|
12 |
#include <rdma/rdma_netlink.h> |
390d57728
|
13 |
struct ib_device; |
99fa331dc
|
14 |
struct ib_qp; |
413d33475
|
15 16 17 18 19 20 21 22 23 24 25 26 |
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; |
f34a55e49
|
27 |
struct rdma_hw_stats *hstats; |
1bd8e0a9d
|
28 |
unsigned int num_counters; |
413d33475
|
29 30 |
struct mutex lock; }; |
7ade1ff96
|
31 32 33 34 35 |
struct rdma_counter { struct rdma_restrack_entry res; struct ib_device *device; uint32_t id; |
99fa331dc
|
36 37 38 |
struct kref kref; struct rdma_counter_mode mode; struct mutex lock; |
c4ffee7c9
|
39 |
struct rdma_hw_stats *stats; |
7ade1ff96
|
40 41 |
u8 port; }; |
413d33475
|
42 43 44 45 46 |
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); |
99fa331dc
|
47 48 |
int rdma_counter_bind_qp_auto(struct ib_qp *qp, u8 port); int rdma_counter_unbind_qp(struct ib_qp *qp, bool force); |
413d33475
|
49 |
|
c4ffee7c9
|
50 |
int rdma_counter_query_stats(struct rdma_counter *counter); |
f34a55e49
|
51 |
u64 rdma_counter_get_hwstat_value(struct ib_device *dev, u8 port, u32 index); |
1bd8e0a9d
|
52 53 54 55 56 57 |
int rdma_counter_bind_qpn(struct ib_device *dev, u8 port, u32 qp_num, u32 counter_id); int rdma_counter_bind_qpn_alloc(struct ib_device *dev, u8 port, u32 qp_num, u32 *counter_id); int rdma_counter_unbind_qpn(struct ib_device *dev, u8 port, u32 qp_num, u32 counter_id); |
b389327df
|
58 59 60 |
int rdma_counter_get_mode(struct ib_device *dev, u8 port, enum rdma_nl_counter_mode *mode, enum rdma_nl_counter_mask *mask); |
c4ffee7c9
|
61 |
|
7ade1ff96
|
62 |
#endif /* _RDMA_COUNTER_H_ */ |