Re: [PATCH net-next v5 5/5] net/smc: Add global configure for auto fallback by netlink

Tony Lu
2022-02-09T09:41:41Z

On Tue, Feb 08, 2022 at 08:53:13PM +0800, D. Wythe wrote:
> From: "D. Wythe" <alibuda@linux.alibaba.com>
>
> Although we can control SMC auto fallback through socket options, which
> means that applications who need it must modify their code. It's quite
> troublesome for many existing applications. This patch modifies the
> global default value of auto fallback through netlink, providing a way
> to auto fallback without modifying any code for applications.
>
> Suggested-by: Tony Lu <tonylu@linux.alibaba.com>
> Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
> ---
> include/uapi/linux/smc.h | 3 +++
> net/smc/af_smc.c | 17 +++++++++++++++++
> net/smc/smc.h | 7 +++++++
> net/smc/smc_core.c | 2 ++
> net/smc/smc_netlink.c | 10 ++++++++++
> 5 files changed, 39 insertions(+)
>
> diff --git a/include/uapi/linux/smc.h b/include/uapi/linux/smc.h
> index 9f2cbf8..33f7fb8 100644
> --- a/include/uapi/linux/smc.h
> +++ b/include/uapi/linux/smc.h
> @@ -59,6 +59,8 @@ enum {
> SMC_NETLINK_DUMP_SEID,
> SMC_NETLINK_ENABLE_SEID,
> SMC_NETLINK_DISABLE_SEID,
> + SMC_NETLINK_ENABLE_AUTO_FALLBACK,
> + SMC_NETLINK_DISABLE_AUTO_FALLBACK,
> };
>
> /* SMC_GENL_FAMILY top level attributes */
> @@ -85,6 +87,7 @@ enum {
> SMC_NLA_SYS_LOCAL_HOST, /* string */
> SMC_NLA_SYS_SEID, /* string */
> SMC_NLA_SYS_IS_SMCR_V2, /* u8 */
> + SMC_NLA_SYS_AUTO_FALLBACK, /* u8 */
> __SMC_NLA_SYS_MAX,
> SMC_NLA_SYS_MAX = __SMC_NLA_SYS_MAX - 1
> };
> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> index c313561..4a25ce7 100644
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -59,6 +59,8 @@
> * creation on client
> */
>
> +bool smc_auto_fallback; /* default behavior for auto fallback, disable by default */

SMC supports net namespace, it would be better to provide a per
net-namespace switch. Generally, one container has one application, runs
different workload that is different from others. So the behavior could
be different, such as high-performance (don't fallback for limit) or TCP
transparent replacement (limit if needed).

Thank you,
Tony Lu