aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorNir Muchtar <nirm@voltaire.com>2011-01-03 10:33:53 -0500
committerRoland Dreier <roland@purestorage.com>2011-05-25 16:46:23 -0400
commit753f618ae03a699cc30044d64eea84165016dc6e (patch)
tree145bbd73eef824f047affe79ee0570a6bb0940b1 /include/rdma
parentb26f9b9949013fec31b23c426fc463164ae08891 (diff)
RDMA/cma: Add support for netlink statistics export
Add callbacks and data types for statistics export of all current devices/ids. The schema for RDMA CM is a series of netlink messages. Each one contains an rdma_cm_stat struct. Additionally, two netlink attributes are created for the addresses for each message (if applicable). Their types used are: RDMA_NL_RDMA_CM_ATTR_SRC_ADDR (The source address for this ID) RDMA_NL_RDMA_CM_ATTR_DST_ADDR (The destination address for this ID) sockaddr_* structs are encapsulated within these attributes. In other words, every transaction contains a series of messages like: -------message 1------- struct rdma_cm_id_stats { __u32 qp_num; __u32 bound_dev_if; __u32 port_space; __s32 pid; __u8 cm_state; __u8 node_type; __u8 port_num; __u8 reserved; } RDMA_NL_RDMA_CM_ATTR_SRC_ADDR attribute - contains the source address RDMA_NL_RDMA_CM_ATTR_DST_ADDR attribute - contains the destination address -------end 1------- -------message 2------- struct rdma_cm_id_stats RDMA_NL_RDMA_CM_ATTR_SRC_ADDR attribute RDMA_NL_RDMA_CM_ATTR_DST_ADDR attribute -------end 2------- Signed-off-by: Nir Muchtar <nirm@voltaire.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/rdma_netlink.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
index c983a193cecf..3c5363ab867b 100644
--- a/include/rdma/rdma_netlink.h
+++ b/include/rdma/rdma_netlink.h
@@ -1,10 +1,38 @@
1#ifndef _RDMA_NETLINK_H 1#ifndef _RDMA_NETLINK_H
2#define _RDMA_NETLINK_H 2#define _RDMA_NETLINK_H
3 3
4#include <linux/types.h>
5
6enum {
7 RDMA_NL_RDMA_CM = 1
8};
9
4#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10) 10#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
5#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) 11#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
6#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) 12#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
7 13
14enum {
15 RDMA_NL_RDMA_CM_ID_STATS = 0,
16 RDMA_NL_RDMA_CM_NUM_OPS
17};
18
19enum {
20 RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
21 RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
22 RDMA_NL_RDMA_CM_NUM_ATTR,
23};
24
25struct rdma_cm_id_stats {
26 __u32 qp_num;
27 __u32 bound_dev_if;
28 __u32 port_space;
29 __s32 pid;
30 __u8 cm_state;
31 __u8 node_type;
32 __u8 port_num;
33 __u8 qp_type;
34};
35
8#ifdef __KERNEL__ 36#ifdef __KERNEL__
9 37
10#include <linux/netlink.h> 38#include <linux/netlink.h>