From: netdev-bot+sashiko@kernel.org
To: houminxi@gmail.com
Cc: netdev@vger.kernel.org, dev@openvswitch.org, aconole@redhat.com,
echaudro@redhat.com, i.maximets@ovn.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, matttbe@kernel.org, shuah@kernel.org,
netdev-bot+sashiko@kernel.org
Subject: Re: [PATCH net v6 3/3] selftests/net/openvswitch: check that a failed set keeps the features
Date: Wed, 25 Nov 2026 14:53:05 +0000 [thread overview]
Message-ID: <179561838528.3135.298909861336575885@kernel.org> (raw)
In-Reply-To: <20261124145033.627044-4-houminxi@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In tools/testing/selftests/net/openvswitch/openvswitch.sh,
both new tests guard datapath creation with `ovs_add_dp "$t" "$dp" ||…
--
selftests/net/openvswitch: check that a failed set keeps the features
This adds a set-dp command to ovs-dpctl.py and two openvswitch selftests
that use it. The tests check that a set with an empty per-cpu-pids is
rejected with EINVAL and leaves the datapath features unchanged, and that
an outdated OVS_DP_CMD_NEW request drops the features. The config fragment
also gains NET_SCHED, NET_CLS_ACT and NET_TC_SKB_EXT for the recirc bit.
> diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh
> index 21444657a0404..cdeca5a63671f 100755
> --- a/tools/testing/selftests/net/openvswitch/openvswitch.sh
> +++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh
[ ... ]
> +test_dp_features() {
> + local t="test_dp_features"
> + local dp="dpfeat0"
> +
> + sbx_add "$t" || return $?
> + ovs_add_dp "$t" "$dp" || return 1
[Severity: Medium]
Can this "|| return 1" ever trigger when add-dp fails?
ovs_add_dp() runs add-dp and then calls on_exit():
ovs_add_dp () {
...
ovs_sbx "$sbxname" python3 $ovs_base/ovs-dpctl.py add-dp $*
on_exit "ovs_sbx $sbxname python3 $ovs_base/ovs-dpctl.py del-dp $1;"
}
on_exit() {
echo "$1" > ${ovs_dir}/cleanup.tmp
cat ${ovs_dir}/cleanup >> ${ovs_dir}/cleanup.tmp
mv ${ovs_dir}/cleanup.tmp ${ovs_dir}/cleanup
}
The function returns the status of the final mv, so the exit status of
add-dp is lost. OvsDatapath.create() swallows only EEXIST and re-raises
any other NetlinkError, so add-dp can exit non-zero.
If that happens, the first failure the test sees is the next step:
> +
> + info "clear the datapath features"
> + ovs_sbx "$t" ovs_dp_features_set "$dp" --features 0 ||
> + { ovs_fail "the datapath features could not be cleared"; return 1; }
Here set-dp prints "DP 'dpfeat0' not found." to stdout. ovs_sbx sends that
into debug.log, and run_test removes $ovs_dir on FAIL. The only reason left
on stderr is "the datapath features could not be cleared", while the real
cause was that the datapath was never created.
The commit message says:
Every step that can fail says why it did.
The datapath creation step doesn't seem to meet that. Could add-dp's
status be checked, either with "|| return 1" on the add-dp line in
ovs_add_dp() before on_exit, or by calling add-dp directly in the new tests
with an ovs_fail message?
The ovs_add_dp() behaviour is older than this patch, but the new tests
depend on a return status that the helper never gives.
[ ... ]
> +test_dp_features_recirc() {
> + local t="test_dp_features_recirc"
> + local dp="dpfeat1"
> +
> + sbx_add "$t" || return $?
> + ovs_add_dp "$t" "$dp" || return 1
> +
> + ovs_sbx "$t" ovs_dp_features_set "$dp" --features 0 ||
> + { ovs_fail "the datapath features could not be cleared"; return 1; }
The same applies here. A failed add-dp for dpfeat1 would be reported as
"the datapath features could not be cleared".
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124145033.627044-1-houminxi%40gmail.com
next prev parent reply other threads:[~2026-11-25 14:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 14:50 [PATCH net v6 0/3] net: openvswitch: fix a feature leak on a failed change Minxi Hou
2026-11-24 14:50 ` [PATCH net v6 1/3] net: openvswitch: read the datapath features once when sending an upcall Minxi Hou
2026-11-25 14:53 ` netdev-bot+sashiko
2026-11-24 14:50 ` [PATCH net v6 2/3] net: openvswitch: do not record user features when the change fails Minxi Hou
2026-11-25 14:53 ` netdev-bot+sashiko
2026-11-24 14:50 ` [PATCH net v6 3/3] selftests/net/openvswitch: check that a failed set keeps the features Minxi Hou
2026-11-25 14:53 ` netdev-bot+sashiko [this message]
2026-11-24 14:52 ` [PATCH net v6 0/3] net: openvswitch: fix a feature leak on a failed change netdev-bot+sinfo
2026-11-24 15:08 ` Minxi Hou
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=179561838528.3135.298909861336575885@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aconole@redhat.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=echaudro@redhat.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=houminxi@gmail.com \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=matttbe@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@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