MPTCP Linux Development
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: Matthieu Baerts <matttbe@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: Tue, 15 Apr 2025 11:44:00 +0800	[thread overview]
Message-ID: <8046b5fa40756fe4739fb17376fc5afe1029d0f7.camel@kernel.org> (raw)
In-Reply-To: <ffb15da5-a01f-4703-8ab0-f07acbbc1bef@kernel.org>

Hi Matt,

Thanks for the review.

On Thu, 2025-04-10 at 19:38 +0200, Matthieu Baerts wrote:
> 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.

Better to rename it as "pick" or something.

> 
> 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?

Sure. Let's drop this patch now, and resend it with other patches in
the future if we have other modifications in this helper.

Thanks,
-Geliang

> 
> This is also to be aligned with:
> 
>  
> https://docs.kernel.org/process/maintainer-netdev.html#clean-up-patche
> s
> 
> (trying to avoid cleanup patches "alone", except if it is part of
> another set of changes related to that)
> 
> >  			}
> >  
> >  			if (!alt)
> Cheers,
> Matt


      reply	other threads:[~2025-04-15  3:44 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
2025-04-15  3:44   ` Geliang Tang [this message]

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=8046b5fa40756fe4739fb17376fc5afe1029d0f7.camel@kernel.org \
    --to=geliang@kernel.org \
    --cc=matttbe@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