Skip to content

Commit

Permalink
net/smc: Extend SMCR v2 linkgroup netlink attribute
Browse files Browse the repository at this point in the history
Add SMC_NLA_LGR_R_V2_MAX_CONNS and SMC_NLA_LGR_R_V2_MAX_LINKS
to SMCR v2 linkgroup netlink attribute SMC_NLA_LGR_R_V2 for
linkgroup's detail info showing.

Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Reviewed-by: Jan Karcher <jaka@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Guangguan Wang authored and David S. Miller committed Aug 19, 2023
1 parent 69b888e commit bbed596
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/uapi/linux/smc.h
Original file line number Diff line number Diff line change
@@ -107,6 +107,8 @@ enum {
enum {
SMC_NLA_LGR_R_V2_UNSPEC,
SMC_NLA_LGR_R_V2_DIRECT, /* u8 */
SMC_NLA_LGR_R_V2_MAX_CONNS, /* u8 */
SMC_NLA_LGR_R_V2_MAX_LINKS, /* u8 */
__SMC_NLA_LGR_R_V2_MAX,
SMC_NLA_LGR_R_V2_MAX = __SMC_NLA_LGR_R_V2_MAX - 1
};
4 changes: 4 additions & 0 deletions net/smc/smc_core.c
Original file line number Diff line number Diff line change
@@ -319,6 +319,10 @@ static int smc_nl_fill_smcr_lgr_v2(struct smc_link_group *lgr,
goto errattr;
if (nla_put_u8(skb, SMC_NLA_LGR_R_V2_DIRECT, !lgr->uses_gateway))
goto errv2attr;
if (nla_put_u8(skb, SMC_NLA_LGR_R_V2_MAX_CONNS, lgr->max_conns))
goto errv2attr;
if (nla_put_u8(skb, SMC_NLA_LGR_R_V2_MAX_LINKS, lgr->max_links))
goto errv2attr;

nla_nest_end(skb, v2_attrs);
return 0;

0 comments on commit bbed596

Please sign in to comment.