#include <rdma/ib_verbs.h>
#include <rdma/rdma_counter.h>
#include "core_priv.h"
#include "restrack.h"
#define ALL_AUTO_MODE_MASKS …
static int __counter_set_mode(struct rdma_port_counter *port_counter,
enum rdma_nl_counter_mode new_mode,
enum rdma_nl_counter_mask new_mask)
{ … }
int rdma_counter_set_auto_mode(struct ib_device *dev, u32 port,
enum rdma_nl_counter_mask mask,
struct netlink_ext_ack *extack)
{ … }
static void auto_mode_init_counter(struct rdma_counter *counter,
const struct ib_qp *qp,
enum rdma_nl_counter_mask new_mask)
{ … }
static int __rdma_counter_bind_qp(struct rdma_counter *counter,
struct ib_qp *qp)
{ … }
int rdma_counter_modify(struct ib_device *dev, u32 port,
unsigned int index, bool enable)
{ … }
static struct rdma_counter *alloc_and_bind(struct ib_device *dev, u32 port,
struct ib_qp *qp,
enum rdma_nl_counter_mode mode)
{ … }
static void rdma_counter_free(struct rdma_counter *counter)
{ … }
static bool auto_mode_match(struct ib_qp *qp, struct rdma_counter *counter,
enum rdma_nl_counter_mask auto_mask)
{ … }
static int __rdma_counter_unbind_qp(struct ib_qp *qp)
{ … }
static void counter_history_stat_update(struct rdma_counter *counter)
{ … }
static struct rdma_counter *rdma_get_counter_auto_mode(struct ib_qp *qp,
u32 port)
{ … }
static void counter_release(struct kref *kref)
{ … }
int rdma_counter_bind_qp_auto(struct ib_qp *qp, u32 port)
{ … }
int rdma_counter_unbind_qp(struct ib_qp *qp, bool force)
{ … }
int rdma_counter_query_stats(struct rdma_counter *counter)
{ … }
static u64 get_running_counters_hwstat_sum(struct ib_device *dev,
u32 port, u32 index)
{ … }
u64 rdma_counter_get_hwstat_value(struct ib_device *dev, u32 port, u32 index)
{ … }
static struct ib_qp *rdma_counter_get_qp(struct ib_device *dev, u32 qp_num)
{ … }
static struct rdma_counter *rdma_get_counter_by_id(struct ib_device *dev,
u32 counter_id)
{ … }
int rdma_counter_bind_qpn(struct ib_device *dev, u32 port,
u32 qp_num, u32 counter_id)
{ … }
int rdma_counter_bind_qpn_alloc(struct ib_device *dev, u32 port,
u32 qp_num, u32 *counter_id)
{ … }
int rdma_counter_unbind_qpn(struct ib_device *dev, u32 port,
u32 qp_num, u32 counter_id)
{ … }
int rdma_counter_get_mode(struct ib_device *dev, u32 port,
enum rdma_nl_counter_mode *mode,
enum rdma_nl_counter_mask *mask)
{ … }
void rdma_counter_init(struct ib_device *dev)
{ … }
void rdma_counter_release(struct ib_device *dev)
{ … }