1 #ifndef STRACE_LINUX_SMC_DIAG_H 2 #define STRACE_LINUX_SMC_DIAG_H 3 4 #include <linux/inet_diag.h> 5 6 #include "gcc_compat.h" 7 8 /* Request structure */ 9 struct smc_diag_req { 10 uint8_t diag_family; 11 uint8_t pad[2]; 12 uint8_t diag_ext; /* Query extended information */ 13 struct inet_diag_sockid id; 14 }; 15 16 struct smc_diag_msg { 17 uint8_t diag_family; 18 uint8_t diag_state; 19 uint8_t diag_fallback; 20 uint8_t diag_shutdown; 21 struct inet_diag_sockid id; 22 23 uint32_t diag_uid; 24 uint64_t diag_inode; 25 }; 26 27 /* Extensions */ 28 enum { 29 SMC_DIAG_NONE, 30 SMC_DIAG_CONNINFO, 31 SMC_DIAG_LGRINFO, 32 SMC_DIAG_SHUTDOWN, 33 SMC_DIAG_DMBINFO, 34 SMC_DIAG_FALLBACK, 35 }; 36 37 /* SMC_DIAG_CONNINFO */ 38 struct smc_diag_cursor { 39 uint16_t reserved; 40 uint16_t wrap; 41 uint32_t count; 42 }; 43 44 struct smc_diag_conninfo { 45 uint32_t token; 46 uint32_t sndbuf_size; 47 uint32_t rmbe_size; 48 uint32_t peer_rmbe_size; 49 struct smc_diag_cursor rx_prod; 50 struct smc_diag_cursor rx_cons; 51 struct smc_diag_cursor tx_prod; 52 struct smc_diag_cursor tx_cons; 53 uint8_t rx_prod_flags; 54 uint8_t rx_conn_state_flags; 55 uint8_t tx_prod_flags; 56 uint8_t tx_conn_state_flags; 57 struct smc_diag_cursor tx_prep; 58 struct smc_diag_cursor tx_sent; 59 struct smc_diag_cursor tx_fin; 60 }; 61 62 /* SMC_DIAG_LINKINFO */ 63 struct smc_diag_linkinfo { 64 uint8_t link_id; 65 uint8_t ibname[64]; /* IB_DEVICE_NAME_MAX */ 66 uint8_t ibport; 67 uint8_t gid[40]; 68 uint8_t peer_gid[40]; 69 }; 70 71 /* SMC_DIAG_LGRINFO */ 72 struct smc_diag_lgrinfo { 73 struct smc_diag_linkinfo lnk[1]; 74 uint8_t role; 75 }; 76 77 /* SMC_DIAG_DMBINFO */ 78 struct smcd_diag_dmbinfo { 79 uint32_t linkid; 80 uint64_t ATTRIBUTE_ALIGNED(8) peer_gid; 81 uint64_t ATTRIBUTE_ALIGNED(8) my_gid; 82 uint64_t ATTRIBUTE_ALIGNED(8) token; 83 uint64_t ATTRIBUTE_ALIGNED(8) peer_token; 84 }; 85 86 /* SMC_DIAG_FALLBACK */ 87 struct smc_diag_fallback { 88 uint32_t reason; 89 uint32_t peer_diagnosis; 90 }; 91 92 #endif /* !STRACE_LINUX_SMC_DIAG_H */ 93