mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
RDMA/restrack: Introduce statistic counter
Introduce statistic counter as a new resource. It allows a user to monitor specific objects (e.g., QPs) by binding to a counter. In some cases a user counter resource is created with task other then "current", because its creation is done as part of rdmatool call. 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
5600a410ea
commit
7ade1ff96c
3 changed files with 39 additions and 5 deletions
18
include/rdma/rdma_counter.h
Normal file
18
include/rdma/rdma_counter.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* 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_
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
#include <rdma/restrack.h>
|
||||
|
||||
struct rdma_counter {
|
||||
struct rdma_restrack_entry res;
|
||||
struct ib_device *device;
|
||||
uint32_t id;
|
||||
u8 port;
|
||||
};
|
||||
#endif /* _RDMA_COUNTER_H_ */
|
||||
|
|
@ -42,6 +42,10 @@ enum rdma_restrack_type {
|
|||
* @RDMA_RESTRACK_CTX: Verbs contexts (CTX)
|
||||
*/
|
||||
RDMA_RESTRACK_CTX,
|
||||
/**
|
||||
* @RDMA_RESTRACK_COUNTER: Statistic Counter
|
||||
*/
|
||||
RDMA_RESTRACK_COUNTER,
|
||||
/**
|
||||
* @RDMA_RESTRACK_MAX: Last entry, used for array dclarations
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue