1
2 #ifndef _UAPI_SMC_DIAG_H_
3 #define _UAPI_SMC_DIAG_H_
4
5 #include <linux/types.h>
6 #include <linux/inet_diag.h>
7 #include <rdma/ib_user_verbs.h>
8
9
10 struct smc_diag_req {
11 __u8 diag_family;
12 __u8 pad[2];
13 __u8 diag_ext;
14 struct inet_diag_sockid id;
15 };
16
17
18
19
20 struct smc_diag_msg {
21 __u8 diag_family;
22 __u8 diag_state;
23 union {
24 __u8 diag_mode;
25 __u8 diag_fallback;
26 };
27 __u8 diag_shutdown;
28 struct inet_diag_sockid id;
29
30 __u32 diag_uid;
31 __aligned_u64 diag_inode;
32 };
33
34
35 enum {
36 SMC_DIAG_MODE_SMCR,
37 SMC_DIAG_MODE_FALLBACK_TCP,
38 SMC_DIAG_MODE_SMCD,
39 };
40
41
42
43 enum {
44 SMC_DIAG_NONE,
45 SMC_DIAG_CONNINFO,
46 SMC_DIAG_LGRINFO,
47 SMC_DIAG_SHUTDOWN,
48 SMC_DIAG_DMBINFO,
49 SMC_DIAG_FALLBACK,
50 __SMC_DIAG_MAX,
51 };
52
53 #define SMC_DIAG_MAX (__SMC_DIAG_MAX - 1)
54
55
56
57 struct smc_diag_cursor {
58 __u16 reserved;
59 __u16 wrap;
60 __u32 count;
61 };
62
63 struct smc_diag_conninfo {
64 __u32 token;
65 __u32 sndbuf_size;
66 __u32 rmbe_size;
67 __u32 peer_rmbe_size;
68
69 struct smc_diag_cursor rx_prod;
70 struct smc_diag_cursor rx_cons;
71
72 struct smc_diag_cursor tx_prod;
73 struct smc_diag_cursor tx_cons;
74 __u8 rx_prod_flags;
75 __u8 rx_conn_state_flags;
76 __u8 tx_prod_flags;
77 __u8 tx_conn_state_flags;
78
79 struct smc_diag_cursor tx_prep;
80 struct smc_diag_cursor tx_sent;
81 struct smc_diag_cursor tx_fin;
82 };
83
84
85
86 struct smc_diag_linkinfo {
87 __u8 link_id;
88 __u8 ibname[IB_DEVICE_NAME_MAX];
89 __u8 ibport;
90 __u8 gid[40];
91 __u8 peer_gid[40];
92 };
93
94 struct smc_diag_lgrinfo {
95 struct smc_diag_linkinfo lnk[1];
96 __u8 role;
97 };
98
99 struct smc_diag_fallback {
100 __u32 reason;
101 __u32 peer_diagnosis;
102 };
103
104 struct smcd_diag_dmbinfo {
105 __u32 linkid;
106 __aligned_u64 peer_gid;
107 __aligned_u64 my_gid;
108 __aligned_u64 token;
109 __aligned_u64 peer_token;
110 };
111
112 #endif