strace/linux/smc_diag.h
Eugene Syromyatnikov cf174ac87a netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding
The message has been added by Linux commit v4.19-rc1~140^2~507^2~1.

* linux/smc_diag.h: Include "gcc_compat.h".
(enum): Add SMC_DIAG_DMBINFO.
(struct smcd_diag_dmbinfo): New type definition.
* xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant.
* netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function.
(smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls
decode_smc_diag_dmbinfo.
* tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check.
2018-08-27 23:41:41 +00:00

86 lines
1.7 KiB
C

#ifndef STRACE_LINUX_SMC_DIAG_H
#define STRACE_LINUX_SMC_DIAG_H
#include <linux/inet_diag.h>
#include "gcc_compat.h"
/* Request structure */
struct smc_diag_req {
uint8_t diag_family;
uint8_t pad[2];
uint8_t diag_ext; /* Query extended information */
struct inet_diag_sockid id;
};
struct smc_diag_msg {
uint8_t diag_family;
uint8_t diag_state;
uint8_t diag_fallback;
uint8_t diag_shutdown;
struct inet_diag_sockid id;
uint32_t diag_uid;
uint64_t diag_inode;
};
/* Extensions */
enum {
SMC_DIAG_NONE,
SMC_DIAG_CONNINFO,
SMC_DIAG_LGRINFO,
SMC_DIAG_SHUTDOWN,
SMC_DIAG_DMBINFO,
};
/* SMC_DIAG_CONNINFO */
struct smc_diag_cursor {
uint16_t reserved;
uint16_t wrap;
uint32_t count;
};
struct smc_diag_conninfo {
uint32_t token;
uint32_t sndbuf_size;
uint32_t rmbe_size;
uint32_t peer_rmbe_size;
struct smc_diag_cursor rx_prod;
struct smc_diag_cursor rx_cons;
struct smc_diag_cursor tx_prod;
struct smc_diag_cursor tx_cons;
uint8_t rx_prod_flags;
uint8_t rx_conn_state_flags;
uint8_t tx_prod_flags;
uint8_t tx_conn_state_flags;
struct smc_diag_cursor tx_prep;
struct smc_diag_cursor tx_sent;
struct smc_diag_cursor tx_fin;
};
/* SMC_DIAG_LINKINFO */
struct smc_diag_linkinfo {
uint8_t link_id;
uint8_t ibname[64]; /* IB_DEVICE_NAME_MAX */
uint8_t ibport;
uint8_t gid[40];
uint8_t peer_gid[40];
};
/* SMC_DIAG_LGRINFO */
struct smc_diag_lgrinfo {
struct smc_diag_linkinfo lnk[1];
uint8_t role;
};
/* SMC_DIAG_DMBINFO */
struct smcd_diag_dmbinfo {
uint32_t linkid;
uint64_t ATTRIBUTE_ALIGNED(8) peer_gid;
uint64_t ATTRIBUTE_ALIGNED(8) my_gid;
uint64_t ATTRIBUTE_ALIGNED(8) token;
uint64_t ATTRIBUTE_ALIGNED(8) peer_token;
};
#endif /* !STRACE_LINUX_SMC_DIAG_H */