Commit a4143dbf authored by Litao Jiao's avatar Litao Jiao
Browse files

net/smc: Use sysctl-specified types of buffers in new link group

mainline inclusion
from mainline-v6.0-rc1
commit b984f370
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I76JHC
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/smc?id=b984f370ed5182d180f92dbf14bdf847ff6ccc04



--------------------------------

This patch introduces a new SMC-R specific element buf_type
in struct smc_link_group, for recording the value of sysctl
smcr_buf_type when link group is created.

New created link group will create and reuse buffers of the
type specified by buf_type.

Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLitao Jiao <jiaolitao@sangfor.com.cn>
parent eb4f17f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -437,6 +437,7 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini)
			goto free_wq;
		lgr_list = &smc_lgr_list.list;
		lgr_lock = &smc_lgr_list.lock;
		lgr->buf_type = sock_net(&smc->sk)->smc.sysctl_smcr_buf_type;
		atomic_inc(&lgr_cnt);
	}
	smc->conn.lgr = lgr;
+1 −0
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ struct smc_link_group {
						/* used rtoken elements */
			u8			next_link_id;
			enum smc_lgr_type	type;
			enum smcr_buf_type	buf_type;
						/* redundancy state */
			u8			pnet_id[SMC_MAX_PNETID_LEN + 1];
						/* pnet id of this lgr */