From: Geliang Tang <geliang@kernel.org>
To: Gang Yan <gang.yan@linux.dev>, mptcp@lists.linux.dev
Cc: Gang Yan <yangang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v3 2/7] mptcp: take TCP_MAXSEG handling into __mptcp_setsockopt_set_val
Date: Mon, 27 Jul 2026 14:39:36 +0800 [thread overview]
Message-ID: <13ffac6c4624bb4c3fee240d50027e892f52a49a.camel@kernel.org> (raw)
In-Reply-To: <20260727022849.20923-3-gang.yan@linux.dev>
On Mon, 2026-07-27 at 10:28 +0800, Gang Yan wrote:
> From: Gang Yan <yangang@kylinos.cn>
>
> mptcp_setsockopt_all_sf is only used in 'TCP_MAXSEG', and it can be
> replaced with __mptcp_setsockopt_set_val.
>
> Signed-off-by: Gang Yan <yangang@kylinos.cn>
> ---
> net/ipv4/tcp.c | 1 +
> net/mptcp/sockopt.c | 5 ++---
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index b427f924608c..5915d0e62f43 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -3830,6 +3830,7 @@ int tcp_sock_set_maxseg(struct sock *sk, int
> val)
> WRITE_ONCE(tcp_sk(sk)->rx_opt.user_mss, val);
> return 0;
> }
> +EXPORT_SYMBOL(tcp_sock_set_maxseg);
>
> /*
> * Socket option code for TCP.
> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index 9c4faa0d82ef..a7d4135757e7 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
> @@ -889,9 +889,8 @@ static int mptcp_setsockopt_sol_tcp(struct
> mptcp_sock *msk, int optname,
> val);
> break;
> case TCP_MAXSEG:
> - msk->maxseg = val;
> - ret = mptcp_setsockopt_all_sf(msk, SOL_TCP, optname,
> optval,
> - optlen);
> + ret = __mptcp_setsockopt_set_val(msk,
> &tcp_sock_set_maxseg,
> + &msk->maxseg, val);
So, here you do need to pass in MAX_TCP_MAXSEG, and you need to
consider what would be a reasonable value to define it as.
> break;
> default:
> ret = -ENOPROTOOPT;
next prev parent reply other threads:[~2026-07-27 6:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 2:28 [PATCH mptcp-next v3 0/7] mptcp: add bpf_setsockopt support Gang Yan
2026-07-27 2:28 ` [PATCH mptcp-next v3 1/7] mptcp: drop unused @max arg of __mptcp_setsockopt_set_val Gang Yan
2026-07-27 6:37 ` Geliang Tang
2026-07-27 2:28 ` [PATCH mptcp-next v3 2/7] mptcp: take TCP_MAXSEG handling into __mptcp_setsockopt_set_val Gang Yan
2026-07-27 6:39 ` Geliang Tang [this message]
2026-07-27 2:28 ` [PATCH mptcp-next v3 3/7] mptcp: use sockopt_lock/release_sock in sockopt Gang Yan
2026-07-27 2:28 ` [PATCH mptcp-next v3 4/7] mptcp: reject sockopt requiring ssks' lock in BPF context Gang Yan
2026-07-27 2:28 ` [PATCH mptcp-next v3 5/7] mptcp: enable bpf_setsockopt on the master socket Gang Yan
2026-07-27 2:28 ` [PATCH mptcp-next v3 6/7] mptcp: add TCP_CONNECT_CB sock_ops hook Gang Yan
2026-07-27 2:28 ` [PATCH mptcp-next v3 7/7] selftests: bpf: verify mptcp bpf_setsockopt from TCP_CONNECT_CB Gang Yan
2026-07-27 2:53 ` [PATCH mptcp-next v3 0/7] mptcp: add bpf_setsockopt support MPTCP CI
2026-07-27 3:12 ` MPTCP CI
2026-07-27 6:04 ` Geliang Tang
2026-07-27 6:20 ` gang.yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13ffac6c4624bb4c3fee240d50027e892f52a49a.camel@kernel.org \
--to=geliang@kernel.org \
--cc=gang.yan@linux.dev \
--cc=mptcp@lists.linux.dev \
--cc=yangang@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.