net/smc: Introduce SMCR get linkgroup command

Introduce get linkgroup command which loops through
all available SMCR linkgroups. It uses the SMC-R linkgroup
list as entry point, not the socket list, which makes
linkgroup diagnosis possible, in case linkgroup does not
contain active connections anymore.

Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Guvenc Gulce 2020-12-01 20:20:45 +01:00 committed by Jakub Kicinski
parent 099b990bd1
commit e9b8c845cb
4 changed files with 106 additions and 0 deletions

View file

@ -40,12 +40,14 @@ enum { /* SMC PNET Table commands */
/* SMC_GENL_FAMILY commands */
enum {
SMC_NETLINK_GET_SYS_INFO = 1,
SMC_NETLINK_GET_LGR_SMCR,
};
/* SMC_GENL_FAMILY top level attributes */
enum {
SMC_GEN_UNSPEC,
SMC_GEN_SYS_INFO, /* nest */
SMC_GEN_LGR_SMCR, /* nest */
__SMC_GEN_MAX,
SMC_GEN_MAX = __SMC_GEN_MAX - 1
};
@ -62,4 +64,17 @@ enum {
SMC_NLA_SYS_MAX = __SMC_NLA_SYS_MAX - 1
};
/* 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
};
#endif /* _UAPI_LINUX_SMC_H */