在 2022/2/9 下午5:16, Tony Lu 写道:
On Tue, Feb 08, 2022 at 08:53:13PM +0800, D. Wythe wrote:
From: "D. Wythe" <alibuda@xxxxxxxxxxxxxxxxx>
@@ -248,6 +248,8 @@ int smc_nl_get_sys_info(struct sk_buff *skb, struct netlink_callback *cb)
goto errattr;
if (nla_put_u8(skb, SMC_NLA_SYS_IS_SMCR_V2, true))
goto errattr;
+ if (nla_put_u8(skb, SMC_NLA_SYS_AUTO_FALLBACK, smc_auto_fallback))
READ_ONCE(smc_auto_fallback) ?
No READ_ONCE() will cause ?
+ goto errattr;
smc_clc_get_hostname(&host);
if (host) {
memcpy(hostname, host, SMC_MAX_HOSTNAME_LEN);
diff --git a/net/smc/smc_netlink.c b/net/smc/smc_netlink.c
index f13ab06..a7de517 100644
--- a/net/smc/smc_netlink.c
+++ b/net/smc/smc_netlink.c
@@ -111,6 +111,16 @@
.flags = GENL_ADMIN_PERM,
.doit = smc_nl_disable_seid,
},
+ {
+ .cmd = SMC_NETLINK_ENABLE_AUTO_FALLBACK,
+ .flags = GENL_ADMIN_PERM,
+ .doit = smc_enable_auto_fallback,
+ },
+ {
+ .cmd = SMC_NETLINK_DISABLE_AUTO_FALLBACK,
+ .flags = GENL_ADMIN_PERM,
+ .doit = smc_disable_auto_fallback,
+ },
};
Consider adding the separated cmd to query the status of this config,
just as SEID does?
It is common to check this value after user-space setted. Combined with
sys_info maybe a little heavy in this scene.
Add a independent dumpit is quite okay, but is there have really
scenarios that access this value frequently? With more and more such
switches in the future, is is necessary for us to repeat on each switch
? I do have a plan to put them unified within a NLA attributes, but I
don't have much time yet.