Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: marcelomspessoto@gmail.com
Cc: Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	marcelospe@proton.me
Subject: Re: [PATCH net-next 1/4] selftests: net: test IPV6_FL_A_RENEW
Date: Thu, 30 Jul 2026 18:39:52 -0700	[thread overview]
Message-ID: <20260731013952.752309-1-kuba@kernel.org> (raw)
In-Reply-To: <20260727043516.93101-2-marcelospe@proton.me>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
--- Patch [1]: [PATCH net-next 1/4] selftests: net: test IPV6_FL_A_RENEW ---
commit e6f2968aee0cf7d9f88007bffba4ffec657d1cd4
Author: Marcelo Mendes Spessoto Junior <marcelomspessoto@gmail.com>

selftests: net: test IPV6_FL_A_RENEW

This adds a flowlabel_renew() helper wrapping IPV6_FLOWLABEL_MGR with
IPV6_FL_A_RENEW, and a new sub-test in run_tests() that creates an
exclusive label, renews it with a longer linger, releases it, sleeps past
the default linger, and expects re-creation to fail.

> diff --git a/tools/testing/selftests/net/ipv6_flowlabel_mgr.c b/tools/testing/selftests/net/ipv6_flowlabel_mgr.c
> index af95b48acea90..cfa7e6270994a 100644
> --- a/tools/testing/selftests/net/ipv6_flowlabel_mgr.c
> +++ b/tools/testing/selftests/net/ipv6_flowlabel_mgr.c

[ ... ]

> @@ -160,6 +171,18 @@ static void run_tests(int fd)
>  		error(1, errno, "wait");
>  	if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus) != 0)
>  		error(1, errno, "wait: unexpected child result");
> +
> +	if (cfg_long_running) {

[Severity: Medium]
Does the new test ever run in an automated pass?  The whole block,
including the only call site of the new flowlabel_renew() helper, sits
inside if (cfg_long_running), and cfg_long_running is only set by the '-l'
option in parse_opts():

	case 'l':
		cfg_long_running = true;
		break;

The only in-tree invocation of this binary is in
tools/testing/selftests/net/ipv6_flowlabel.sh, which passes no arguments:

	echo "TEST management"
	./in_netns.sh ./ipv6_flowlabel_mgr

So under make run_tests the fl6_renew() path is not exercised, while the
changelog says "RENEW was the only flow label action without selftests
coverage".  Should the sub-test be unconditional, or should
ipv6_flowlabel.sh pass '-l'?

A sleep-free variant seems possible: renew of a label held by the socket
returns 0, renew of an unknown label returns -ESRCH, and renew with
linger > FL_MAX_LINGER without CAP_NET_ADMIN returns -EPERM.

> +		explain("create a new label with FL_MIN_LINGER linger time");
> +		expect_pass(flowlabel_get(fd, 5, IPV6_FL_S_EXCL, IPV6_FL_F_CREATE));
> +		explain("renew the label to increase its linger time and put it");
> +		expect_pass(flowlabel_renew(fd, 5, 2 * (FL_MIN_LINGER * 2 + 1)));
> +		expect_pass(flowlabel_put(fd, 5));
> +		sleep(FL_MIN_LINGER * 2 + 1);
> +		explain("The label cannot be created because the new linger time is not over yet");
> +		expect_fail(flowlabel_get(fd, 5, IPV6_FL_S_ANY, IPV6_FL_F_CREATE));

[Severity: Low]
This isn't a bug, but would it be worth bounding the renewed linger from
both sides?  The sequence only checks the negative case, and the label was
created with IPV6_FL_S_EXCL, so in net/ipv6/ip6_flowlabel.c the create at
t=13s fails as long as the entry is still hashed:

net/ipv6/ip6_flowlabel.c:ipv6_flowlabel_get() {
	...
	if (fl1->share == IPV6_FL_S_EXCL ||
	    fl1->share != fl->share ||
	...
		goto release;
}

Since expect_fail() cannot inspect errno, an "entry still present"
failure is indistinguishable from a share/permission failure, and no upper
bound on the renewed lifetime is tested.  A kernel change that made a
renewed label linger forever, or that clamped linger/expires too high in
fl6_renew(), would still pass.  Adding a second sleep past the renewed 26s
followed by expect_pass(flowlabel_get(fd, 5, ...)) would pin both ends.

The RENEW error paths are also untested: -ESRCH for an unknown label,
-EPERM for linger above FL_MAX_LINGER without CAP_NET_ADMIN, and the
IPV6_FL_S_NONE plus CAP_NET_ADMIN lookup branch in
ipv6_flowlabel_renew().

> +	}
> +
>  }

[Severity: Low]
There is a stray blank line between the closing brace of the new
if (cfg_long_running) block and the closing brace of run_tests().
scripts/checkpatch.pl reports:

	CHECK: Blank lines aren't necessary before a close brace '}'

>  
>  static void parse_opts(int argc, char **argv)

[Severity: Low]
The From: and Signed-off-by: identities use different addresses:

	Author: Marcelo Mendes Spessoto Junior <marcelomspessoto@gmail.com>
	Signed-off-by: Marcelo Mendes Spessoto Junior <marcelospe@proton.me>

checkpatch reports WARNING: FROM_SIGN_OFF_MISMATCH for this.  Could the
two be made to match on resend?
-- 
pw-bot: cr

  reply	other threads:[~2026-07-31  1:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  4:25 [PATCH net-next 0/4] net: selftests: adjustments to ipv6_flowlabel_mgr Marcelo Mendes Spessoto Junior
2026-07-27  4:25 ` [PATCH net-next 1/4] selftests: net: test IPV6_FL_A_RENEW Marcelo Mendes Spessoto Junior
2026-07-31  1:39   ` Jakub Kicinski [this message]
2026-07-27  4:25 ` [PATCH net-next 2/4] selftests: net: test IPV6_FL_F_REMOTE Marcelo Mendes Spessoto Junior
2026-07-31  1:39   ` Jakub Kicinski
2026-07-31  1:42   ` Jakub Kicinski
2026-07-27  4:25 ` [PATCH net-next 3/4] selftests: net: test IPV6_FL_F_REFLECT Marcelo Mendes Spessoto Junior
2026-07-31  1:39   ` Jakub Kicinski
2026-07-27  4:25 ` [PATCH 4/4] selftests: net: adopt harness for flow label mgr Marcelo Mendes Spessoto Junior
2026-07-31  1:39   ` Jakub Kicinski
2026-07-31  1:41 ` [PATCH net-next 0/4] net: selftests: adjustments to ipv6_flowlabel_mgr Jakub Kicinski

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=20260731013952.752309-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=marcelomspessoto@gmail.com \
    --cc=marcelospe@proton.me \
    --cc=netdev@vger.kernel.org \
    /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