Unverified Commit 8b0df9ea authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!811 [OLK-5.10] net/smc: patches to optimize rmbs and sndbuff

Merge Pull Request from: @giree2 
 
1. add sysctl interface for SMC and make sndbufs or RMBs tunable
2. add sysctl for setting SMC-R buffer type
3. add virtually contiguous sndbufs or RMBs for SMC-R
4. match unused lgr with buf len
5. limit virtually contiguous sndbufs or RMBs to 256MiB
6. add tcp2smc sysctl interface 
 
Link:https://gitee.com/openeuler/kernel/pulls/811

 

Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 08988fd4 694d7a92
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

==========
SMC Sysctl
==========

/proc/sys/net/smc/* Variables
=============================

smcr_buf_type - INTEGER
        Controls which type of sndbufs and RMBs to use in later newly created
        SMC-R link group. Only for SMC-R.

        Default: 0 (physically contiguous sndbufs and RMBs)

        Possible values:

        - 0 - Use physically contiguous buffers
        - 1 - Use virtually contiguous buffers
        - 2 - Mixed use of the two types. Try physically contiguous buffers first.
          If not available, use virtually contiguous buffers then.

wmem - INTEGER
	Initial size of send buffer used by SMC sockets.

	The minimum value is 16KiB and there is no hard limit for max value, but
        only allowed 512KiB for SMC-R using physically contiguous buffers, 256MiB
        for SMC-R using other buf type and 1MiB for SMC-D.

	Default: 64KiB

rmem - INTEGER
	Initial size of receive buffer (RMB) used by SMC sockets.

	The minimum value is 16KiB and there is no hard limit for max value, but
	only allowed 512KiB for SMC-R using physically contiguous buffers, 256MiB
	for SMC-R using other buf type and 1MiB for SMC-D.

	Default: 64KiB
+5 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <net/netns/mpls.h>
#include <net/netns/can.h>
#include <net/netns/xdp.h>
#include <net/netns/smc.h>
#include <net/netns/bpf.h>
#include <linux/ns_common.h>
#include <linux/idr.h>
@@ -190,8 +191,11 @@ struct net {
	struct sock		*crypto_nlsk;
#endif
	struct sock		*diag_nlsk;

#if IS_ENABLED(CONFIG_SMC)
	KABI_USE(1, struct netns_smc *smc)
#else
	KABI_RESERVE(1)
#endif
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
+14 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NETNS_SMC_H__
#define __NETNS_SMC_H__

struct netns_smc {
#ifdef CONFIG_SYSCTL
	struct ctl_table_header		*smc_hdr;
#endif
	unsigned int			sysctl_smcr_buf_type;
	int				sysctl_wmem;
	int				sysctl_rmem;
	int				sysctl_tcp2smc;
};
#endif
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ enum {
};
#endif

/* SMC protocol, IPv4 */
#define SMCPROTO_SMC	0

#if __UAPI_DEF_IN_ADDR
/* Internet address. */
struct in_addr {
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ struct in6_flowlabel_req {
#define IPV6_FL_S_USER		3
#define IPV6_FL_S_ANY		255

/* SMC protocol, IPv6 */
#define SMCPROTO_SMC6		1

/*
 *	Bitmask constant declarations to help applications select out the 
Loading