0001
0002 #ifndef _UAPI_SMC_DIAG_H_
0003 #define _UAPI_SMC_DIAG_H_
0004
0005 #include <linux/types.h>
0006 #include <linux/inet_diag.h>
0007 #include <rdma/ib_user_verbs.h>
0008
0009
0010 struct smc_diag_req {
0011 __u8 diag_family;
0012 __u8 pad[2];
0013 __u8 diag_ext;
0014 struct inet_diag_sockid id;
0015 };
0016
0017
0018
0019
0020 struct smc_diag_msg {
0021 __u8 diag_family;
0022 __u8 diag_state;
0023 union {
0024 __u8 diag_mode;
0025 __u8 diag_fallback;
0026 };
0027 __u8 diag_shutdown;
0028 struct inet_diag_sockid id;
0029
0030 __u32 diag_uid;
0031 __aligned_u64 diag_inode;
0032 };
0033
0034
0035 enum {
0036 SMC_DIAG_MODE_SMCR,
0037 SMC_DIAG_MODE_FALLBACK_TCP,
0038 SMC_DIAG_MODE_SMCD,
0039 };
0040
0041
0042
0043 enum {
0044 SMC_DIAG_NONE,
0045 SMC_DIAG_CONNINFO,
0046 SMC_DIAG_LGRINFO,
0047 SMC_DIAG_SHUTDOWN,
0048 SMC_DIAG_DMBINFO,
0049 SMC_DIAG_FALLBACK,
0050 __SMC_DIAG_MAX,
0051 };
0052
0053 #define SMC_DIAG_MAX (__SMC_DIAG_MAX - 1)
0054
0055
0056
0057 struct smc_diag_cursor {
0058 __u16 reserved;
0059 __u16 wrap;
0060 __u32 count;
0061 };
0062
0063 struct smc_diag_conninfo {
0064 __u32 token;
0065 __u32 sndbuf_size;
0066 __u32 rmbe_size;
0067 __u32 peer_rmbe_size;
0068
0069 struct smc_diag_cursor rx_prod;
0070 struct smc_diag_cursor rx_cons;
0071
0072 struct smc_diag_cursor tx_prod;
0073 struct smc_diag_cursor tx_cons;
0074 __u8 rx_prod_flags;
0075 __u8 rx_conn_state_flags;
0076 __u8 tx_prod_flags;
0077 __u8 tx_conn_state_flags;
0078
0079 struct smc_diag_cursor tx_prep;
0080 struct smc_diag_cursor tx_sent;
0081 struct smc_diag_cursor tx_fin;
0082 };
0083
0084
0085
0086 struct smc_diag_linkinfo {
0087 __u8 link_id;
0088 __u8 ibname[IB_DEVICE_NAME_MAX];
0089 __u8 ibport;
0090 __u8 gid[40];
0091 __u8 peer_gid[40];
0092 };
0093
0094 struct smc_diag_lgrinfo {
0095 struct smc_diag_linkinfo lnk[1];
0096 __u8 role;
0097 };
0098
0099 struct smc_diag_fallback {
0100 __u32 reason;
0101 __u32 peer_diagnosis;
0102 };
0103
0104 struct smcd_diag_dmbinfo {
0105 __u32 linkid;
0106 __aligned_u64 peer_gid;
0107 __aligned_u64 my_gid;
0108 __aligned_u64 token;
0109 __aligned_u64 peer_token;
0110 };
0111
0112 #endif