2017-11-01 22:08:43 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
2017-01-09 23:55:15 +08:00
|
|
|
/*
|
|
|
|
* Shared Memory Communications over RDMA (SMC-R) and RoCE
|
|
|
|
*
|
|
|
|
* Definitions for generic netlink based configuration of an SMC-R PNET table
|
|
|
|
*
|
|
|
|
* Copyright IBM Corp. 2016
|
|
|
|
*
|
|
|
|
* Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _UAPI_LINUX_SMC_H_
|
|
|
|
#define _UAPI_LINUX_SMC_H_
|
|
|
|
|
|
|
|
/* Netlink SMC_PNETID attributes */
|
|
|
|
enum {
|
|
|
|
SMC_PNETID_UNSPEC,
|
|
|
|
SMC_PNETID_NAME,
|
|
|
|
SMC_PNETID_ETHNAME,
|
|
|
|
SMC_PNETID_IBNAME,
|
|
|
|
SMC_PNETID_IBPORT,
|
|
|
|
__SMC_PNETID_MAX,
|
|
|
|
SMC_PNETID_MAX = __SMC_PNETID_MAX - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
enum { /* SMC PNET Table commands */
|
|
|
|
SMC_PNETID_GET = 1,
|
|
|
|
SMC_PNETID_ADD,
|
|
|
|
SMC_PNETID_DEL,
|
|
|
|
SMC_PNETID_FLUSH
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SMCR_GENL_FAMILY_NAME "SMC_PNETID"
|
|
|
|
#define SMCR_GENL_FAMILY_VERSION 1
|
|
|
|
|
2020-12-02 03:20:43 +08:00
|
|
|
/* gennetlink interface to access non-socket information from SMC module */
|
|
|
|
#define SMC_GENL_FAMILY_NAME "SMC_GEN_NETLINK"
|
|
|
|
#define SMC_GENL_FAMILY_VERSION 1
|
|
|
|
|
2020-12-02 03:20:48 +08:00
|
|
|
#define SMC_PCI_ID_STR_LEN 16 /* Max length of pci id string */
|
|
|
|
|
2020-12-02 03:20:44 +08:00
|
|
|
/* SMC_GENL_FAMILY commands */
|
|
|
|
enum {
|
|
|
|
SMC_NETLINK_GET_SYS_INFO = 1,
|
2020-12-02 03:20:45 +08:00
|
|
|
SMC_NETLINK_GET_LGR_SMCR,
|
2020-12-02 03:20:46 +08:00
|
|
|
SMC_NETLINK_GET_LINK_SMCR,
|
2020-12-02 03:20:47 +08:00
|
|
|
SMC_NETLINK_GET_LGR_SMCD,
|
2020-12-02 03:20:48 +08:00
|
|
|
SMC_NETLINK_GET_DEV_SMCD,
|
2020-12-02 03:20:49 +08:00
|
|
|
SMC_NETLINK_GET_DEV_SMCR,
|
2021-06-16 22:52:56 +08:00
|
|
|
SMC_NETLINK_GET_STATS,
|
2021-06-16 22:52:57 +08:00
|
|
|
SMC_NETLINK_GET_FBACK_STATS,
|
2020-12-02 03:20:44 +08:00
|
|
|
};
|
|
|
|
|
2020-12-02 03:20:43 +08:00
|
|
|
/* SMC_GENL_FAMILY top level attributes */
|
|
|
|
enum {
|
|
|
|
SMC_GEN_UNSPEC,
|
2020-12-02 03:20:44 +08:00
|
|
|
SMC_GEN_SYS_INFO, /* nest */
|
2020-12-02 03:20:45 +08:00
|
|
|
SMC_GEN_LGR_SMCR, /* nest */
|
2020-12-02 03:20:46 +08:00
|
|
|
SMC_GEN_LINK_SMCR, /* nest */
|
2020-12-02 03:20:47 +08:00
|
|
|
SMC_GEN_LGR_SMCD, /* nest */
|
2020-12-02 03:20:48 +08:00
|
|
|
SMC_GEN_DEV_SMCD, /* nest */
|
2020-12-02 03:20:49 +08:00
|
|
|
SMC_GEN_DEV_SMCR, /* nest */
|
2021-06-16 22:52:56 +08:00
|
|
|
SMC_GEN_STATS, /* nest */
|
2021-06-16 22:52:57 +08:00
|
|
|
SMC_GEN_FBACK_STATS, /* nest */
|
2020-12-02 03:20:43 +08:00
|
|
|
__SMC_GEN_MAX,
|
|
|
|
SMC_GEN_MAX = __SMC_GEN_MAX - 1
|
|
|
|
};
|
|
|
|
|
2020-12-02 03:20:44 +08:00
|
|
|
/* SMC_GEN_SYS_INFO attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_SYS_UNSPEC,
|
|
|
|
SMC_NLA_SYS_VER, /* u8 */
|
|
|
|
SMC_NLA_SYS_REL, /* u8 */
|
|
|
|
SMC_NLA_SYS_IS_ISM_V2, /* u8 */
|
|
|
|
SMC_NLA_SYS_LOCAL_HOST, /* string */
|
|
|
|
SMC_NLA_SYS_SEID, /* string */
|
|
|
|
__SMC_NLA_SYS_MAX,
|
|
|
|
SMC_NLA_SYS_MAX = __SMC_NLA_SYS_MAX - 1
|
|
|
|
};
|
|
|
|
|
2020-12-02 03:20:47 +08:00
|
|
|
/* SMC_NLA_LGR_V2 nested attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_LGR_V2_VER, /* u8 */
|
|
|
|
SMC_NLA_LGR_V2_REL, /* u8 */
|
|
|
|
SMC_NLA_LGR_V2_OS, /* u8 */
|
|
|
|
SMC_NLA_LGR_V2_NEG_EID, /* string */
|
|
|
|
SMC_NLA_LGR_V2_PEER_HOST, /* string */
|
|
|
|
};
|
|
|
|
|
2020-12-02 03:20:45 +08:00
|
|
|
/* SMC_GEN_LGR_SMCR attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_LGR_R_UNSPEC,
|
|
|
|
SMC_NLA_LGR_R_ID, /* u32 */
|
|
|
|
SMC_NLA_LGR_R_ROLE, /* u8 */
|
|
|
|
SMC_NLA_LGR_R_TYPE, /* u8 */
|
|
|
|
SMC_NLA_LGR_R_PNETID, /* string */
|
|
|
|
SMC_NLA_LGR_R_VLAN_ID, /* u8 */
|
|
|
|
SMC_NLA_LGR_R_CONNS_NUM, /* u32 */
|
|
|
|
__SMC_NLA_LGR_R_MAX,
|
|
|
|
SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1
|
|
|
|
};
|
|
|
|
|
2020-12-02 03:20:46 +08:00
|
|
|
/* SMC_GEN_LINK_SMCR attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_LINK_UNSPEC,
|
|
|
|
SMC_NLA_LINK_ID, /* u8 */
|
|
|
|
SMC_NLA_LINK_IB_DEV, /* string */
|
|
|
|
SMC_NLA_LINK_IB_PORT, /* u8 */
|
|
|
|
SMC_NLA_LINK_GID, /* string */
|
|
|
|
SMC_NLA_LINK_PEER_GID, /* string */
|
|
|
|
SMC_NLA_LINK_CONN_CNT, /* u32 */
|
|
|
|
SMC_NLA_LINK_NET_DEV, /* u32 */
|
|
|
|
SMC_NLA_LINK_UID, /* u32 */
|
|
|
|
SMC_NLA_LINK_PEER_UID, /* u32 */
|
|
|
|
SMC_NLA_LINK_STATE, /* u32 */
|
|
|
|
__SMC_NLA_LINK_MAX,
|
|
|
|
SMC_NLA_LINK_MAX = __SMC_NLA_LINK_MAX - 1
|
|
|
|
};
|
2020-12-02 03:20:47 +08:00
|
|
|
|
|
|
|
/* SMC_GEN_LGR_SMCD attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_LGR_D_UNSPEC,
|
|
|
|
SMC_NLA_LGR_D_ID, /* u32 */
|
|
|
|
SMC_NLA_LGR_D_GID, /* u64 */
|
|
|
|
SMC_NLA_LGR_D_PEER_GID, /* u64 */
|
|
|
|
SMC_NLA_LGR_D_VLAN_ID, /* u8 */
|
|
|
|
SMC_NLA_LGR_D_CONNS_NUM, /* u32 */
|
|
|
|
SMC_NLA_LGR_D_PNETID, /* string */
|
|
|
|
SMC_NLA_LGR_D_CHID, /* u16 */
|
|
|
|
SMC_NLA_LGR_D_PAD, /* flag */
|
|
|
|
SMC_NLA_LGR_V2, /* nest */
|
|
|
|
__SMC_NLA_LGR_D_MAX,
|
|
|
|
SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1
|
|
|
|
};
|
2020-12-02 03:20:48 +08:00
|
|
|
|
2020-12-02 03:20:49 +08:00
|
|
|
/* SMC_NLA_DEV_PORT nested attributes */
|
2020-12-02 03:20:48 +08:00
|
|
|
enum {
|
|
|
|
SMC_NLA_DEV_PORT_UNSPEC,
|
|
|
|
SMC_NLA_DEV_PORT_PNET_USR, /* u8 */
|
|
|
|
SMC_NLA_DEV_PORT_PNETID, /* string */
|
2020-12-02 03:20:49 +08:00
|
|
|
SMC_NLA_DEV_PORT_NETDEV, /* u32 */
|
|
|
|
SMC_NLA_DEV_PORT_STATE, /* u8 */
|
|
|
|
SMC_NLA_DEV_PORT_VALID, /* u8 */
|
|
|
|
SMC_NLA_DEV_PORT_LNK_CNT, /* u32 */
|
2020-12-02 03:20:48 +08:00
|
|
|
__SMC_NLA_DEV_PORT_MAX,
|
|
|
|
SMC_NLA_DEV_PORT_MAX = __SMC_NLA_DEV_PORT_MAX - 1
|
|
|
|
};
|
|
|
|
|
2020-12-02 03:20:49 +08:00
|
|
|
/* SMC_GEN_DEV_SMCD and SMC_GEN_DEV_SMCR attributes */
|
2020-12-02 03:20:48 +08:00
|
|
|
enum {
|
|
|
|
SMC_NLA_DEV_UNSPEC,
|
|
|
|
SMC_NLA_DEV_USE_CNT, /* u32 */
|
|
|
|
SMC_NLA_DEV_IS_CRIT, /* u8 */
|
|
|
|
SMC_NLA_DEV_PCI_FID, /* u32 */
|
|
|
|
SMC_NLA_DEV_PCI_CHID, /* u16 */
|
|
|
|
SMC_NLA_DEV_PCI_VENDOR, /* u16 */
|
|
|
|
SMC_NLA_DEV_PCI_DEVICE, /* u16 */
|
|
|
|
SMC_NLA_DEV_PCI_ID, /* string */
|
|
|
|
SMC_NLA_DEV_PORT, /* nest */
|
2020-12-02 03:20:49 +08:00
|
|
|
SMC_NLA_DEV_PORT2, /* nest */
|
|
|
|
SMC_NLA_DEV_IB_NAME, /* string */
|
2020-12-02 03:20:48 +08:00
|
|
|
__SMC_NLA_DEV_MAX,
|
|
|
|
SMC_NLA_DEV_MAX = __SMC_NLA_DEV_MAX - 1
|
|
|
|
};
|
2020-12-02 03:20:49 +08:00
|
|
|
|
2021-06-16 22:52:56 +08:00
|
|
|
/* SMC_NLA_STATS_T_TX(RX)_RMB_SIZE nested attributes */
|
|
|
|
/* SMC_NLA_STATS_TX(RX)PLOAD_SIZE nested attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_STATS_PLOAD_PAD,
|
|
|
|
SMC_NLA_STATS_PLOAD_8K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_16K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_32K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_64K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_128K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_256K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_512K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_1024K, /* u64 */
|
|
|
|
SMC_NLA_STATS_PLOAD_G_1024K, /* u64 */
|
|
|
|
__SMC_NLA_STATS_PLOAD_MAX,
|
|
|
|
SMC_NLA_STATS_PLOAD_MAX = __SMC_NLA_STATS_PLOAD_MAX - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* SMC_NLA_STATS_T_TX(RX)_RMB_STATS nested attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_STATS_RMB_PAD,
|
|
|
|
SMC_NLA_STATS_RMB_SIZE_SM_PEER_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_RMB_SIZE_SM_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_RMB_FULL_PEER_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_RMB_FULL_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_RMB_REUSE_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_RMB_ALLOC_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_RMB_DGRADE_CNT, /* u64 */
|
|
|
|
__SMC_NLA_STATS_RMB_MAX,
|
|
|
|
SMC_NLA_STATS_RMB_MAX = __SMC_NLA_STATS_RMB_MAX - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* SMC_NLA_STATS_SMCD_TECH and _SMCR_TECH nested attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_STATS_T_PAD,
|
|
|
|
SMC_NLA_STATS_T_TX_RMB_SIZE, /* nest */
|
|
|
|
SMC_NLA_STATS_T_RX_RMB_SIZE, /* nest */
|
|
|
|
SMC_NLA_STATS_T_TXPLOAD_SIZE, /* nest */
|
|
|
|
SMC_NLA_STATS_T_RXPLOAD_SIZE, /* nest */
|
|
|
|
SMC_NLA_STATS_T_TX_RMB_STATS, /* nest */
|
|
|
|
SMC_NLA_STATS_T_RX_RMB_STATS, /* nest */
|
|
|
|
SMC_NLA_STATS_T_CLNT_V1_SUCC, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_CLNT_V2_SUCC, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_SRV_V1_SUCC, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_SRV_V2_SUCC, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_SENDPAGE_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_SPLICE_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_CORK_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_NDLY_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_URG_DATA_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_RX_BYTES, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_TX_BYTES, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_RX_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_T_TX_CNT, /* u64 */
|
|
|
|
__SMC_NLA_STATS_T_MAX,
|
|
|
|
SMC_NLA_STATS_T_MAX = __SMC_NLA_STATS_T_MAX - 1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* SMC_GEN_STATS attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_STATS_PAD,
|
|
|
|
SMC_NLA_STATS_SMCD_TECH, /* nest */
|
|
|
|
SMC_NLA_STATS_SMCR_TECH, /* nest */
|
|
|
|
SMC_NLA_STATS_CLNT_HS_ERR_CNT, /* u64 */
|
|
|
|
SMC_NLA_STATS_SRV_HS_ERR_CNT, /* u64 */
|
|
|
|
__SMC_NLA_STATS_MAX,
|
|
|
|
SMC_NLA_STATS_MAX = __SMC_NLA_STATS_MAX - 1
|
|
|
|
};
|
2021-06-16 22:52:57 +08:00
|
|
|
|
|
|
|
/* SMC_GEN_FBACK_STATS attributes */
|
|
|
|
enum {
|
|
|
|
SMC_NLA_FBACK_STATS_PAD,
|
|
|
|
SMC_NLA_FBACK_STATS_TYPE, /* u8 */
|
|
|
|
SMC_NLA_FBACK_STATS_SRV_CNT, /* u64 */
|
|
|
|
SMC_NLA_FBACK_STATS_CLNT_CNT, /* u64 */
|
|
|
|
SMC_NLA_FBACK_STATS_RSN_CODE, /* u32 */
|
|
|
|
SMC_NLA_FBACK_STATS_RSN_CNT, /* u16 */
|
|
|
|
__SMC_NLA_FBACK_STATS_MAX,
|
|
|
|
SMC_NLA_FBACK_STATS_MAX = __SMC_NLA_FBACK_STATS_MAX - 1
|
|
|
|
};
|
2017-01-09 23:55:15 +08:00
|
|
|
#endif /* _UAPI_LINUX_SMC_H */
|