Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
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 /* Request structure */
0010 struct smc_diag_req {
0011     __u8    diag_family;
0012     __u8    pad[2];
0013     __u8    diag_ext;       /* Query extended information */
0014     struct inet_diag_sockid id;
0015 };
0016 
0017 /* Base info structure. It contains socket identity (addrs/ports/cookie) based
0018  * on the internal clcsock, and more SMC-related socket data
0019  */
0020 struct smc_diag_msg {
0021     __u8        diag_family;
0022     __u8        diag_state;
0023     union {
0024         __u8    diag_mode;
0025         __u8    diag_fallback; /* the old name of the field */
0026     };
0027     __u8        diag_shutdown;
0028     struct inet_diag_sockid id;
0029 
0030     __u32       diag_uid;
0031     __aligned_u64   diag_inode;
0032 };
0033 
0034 /* Mode of a connection */
0035 enum {
0036     SMC_DIAG_MODE_SMCR,
0037     SMC_DIAG_MODE_FALLBACK_TCP,
0038     SMC_DIAG_MODE_SMCD,
0039 };
0040 
0041 /* Extensions */
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 /* SMC_DIAG_CONNINFO */
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;      /* unique connection id */
0065     __u32           sndbuf_size;    /* size of send buffer */
0066     __u32           rmbe_size;  /* size of RMB element */
0067     __u32           peer_rmbe_size; /* size of peer RMB element */
0068     /* local RMB element cursors */
0069     struct smc_diag_cursor  rx_prod;    /* received producer cursor */
0070     struct smc_diag_cursor  rx_cons;    /* received consumer cursor */
0071     /* peer RMB element cursors */
0072     struct smc_diag_cursor  tx_prod;    /* sent producer cursor */
0073     struct smc_diag_cursor  tx_cons;    /* sent consumer cursor */
0074     __u8            rx_prod_flags;  /* received producer flags */
0075     __u8            rx_conn_state_flags; /* recvd connection flags*/
0076     __u8            tx_prod_flags;  /* sent producer flags */
0077     __u8            tx_conn_state_flags; /* sent connection flags*/
0078     /* send buffer cursors */
0079     struct smc_diag_cursor  tx_prep;    /* prepared to be sent cursor */
0080     struct smc_diag_cursor  tx_sent;    /* sent cursor */
0081     struct smc_diag_cursor  tx_fin;     /* confirmed sent cursor */
0082 };
0083 
0084 /* SMC_DIAG_LINKINFO */
0085 
0086 struct smc_diag_linkinfo {
0087     __u8 link_id;           /* link identifier */
0088     __u8 ibname[IB_DEVICE_NAME_MAX]; /* name of the RDMA device */
0089     __u8 ibport;            /* RDMA device port number */
0090     __u8 gid[40];           /* local GID */
0091     __u8 peer_gid[40];      /* peer GID */
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 {      /* SMC-D Socket internals */
0105     __u32       linkid;     /* Link identifier */
0106     __aligned_u64   peer_gid;   /* Peer GID */
0107     __aligned_u64   my_gid;     /* My GID */
0108     __aligned_u64   token;      /* Token of DMB */
0109     __aligned_u64   peer_token; /* Token of remote DMBE */
0110 };
0111 
0112 #endif /* _UAPI_SMC_DIAG_H_ */