MPTCP Linux Development
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next] mptcp: pm: drop redundant mptcp_pm_send_ack
Date: Thu, 10 Apr 2025 19:38:27 +0200	[thread overview]
Message-ID: <ffb15da5-a01f-4703-8ab0-f07acbbc1bef@kernel.org> (raw)
In-Reply-To: <539ce4556220df3d2ea4826c311c5bc4e306f9a2.1743863553.git.tanggeliang@kylinos.cn>

Hi Geliang,

On 05/04/2025 16:33, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> mptcp_pm_send_ack() is called twice in __mptcp_pm_addr_send_ack(), which
> makes the code a bit redundant. The first call to mptcp_pm_send_ack() when
> a non-stale subflow is found in the loop can be removed. Instead, we can
> break the loop to use the second mptcp_pm_send_ack().
> 
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  net/mptcp/pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index be1e27ee393e..a4f9cb113018 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -225,8 +225,8 @@ void mptcp_pm_addr_send_ack(struct mptcp_sock *msk)
>  	mptcp_for_each_subflow(msk, subflow) {
>  		if (__mptcp_subflow_active(subflow)) {
>  			if (!subflow->stale) {
> -				mptcp_pm_send_ack(msk, subflow, false, false);
> -				return;
> +				alt = subflow;
> +				break;

Is this patch going to simplify another one later on? Because the
modification sounds strange: here 'alt' stands for 'alternative'. So to
be complete, better to rename the variable as well.

But... is this really worth it? If you need to modify this helper later
on, maybe. If not, I guess it is fine to keep 'mptcp_pm_send_ack()'
duplicated for the moment. WDYT?

This is also to be aligned with:

 https://docs.kernel.org/process/maintainer-netdev.html#clean-up-patches

(trying to avoid cleanup patches "alone", except if it is part of
another set of changes related to that)

>  			}
>  
>  			if (!alt)
Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  parent reply	other threads:[~2025-04-10 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-05 14:33 [PATCH mptcp-next] mptcp: pm: drop redundant mptcp_pm_send_ack Geliang Tang
2025-04-05 15:47 ` MPTCP CI
2025-04-10 17:38 ` Matthieu Baerts [this message]
2025-04-15  3:44   ` Geliang Tang

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=ffb15da5-a01f-4703-8ab0-f07acbbc1bef@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox