On 16/11/2026 16:33, netdev-bot+sashiko@kernel.org wrote:
[Severity: High] Can this early clear of dp->user_features race with
upcalls that are still in flight?
It can, and you are right about the two reads. __dp_destroy() runs before
the ports are detached and before the datapath leaves the list, so
queue_userspace_packet() can be between its two reads while it runs:
OVS_DP_F_UNALIGNED decides whether the skb is copied as fragments, and
pad_packet() reads the same field again to decide whether to pad. A store
that clears the whole bitmap between them can make pad_packet() pad a skb
whose message was sized for the smaller linear part, so the padding has
nowhere to go.
Your second suggestion is what the respin does. __dp_destroy() now clears
only the bit that path was already dropping:
ovs_dp_set_user_features(dp, dp->user_features &
~OVS_DP_F_TC_RECIRC_SHARING);
The ovs_dp_cmd_new() error path frees the datapath without going through
__dp_destroy(), and it writes the field the same way now, so it does not
open the same window from that side. ovs_dp_reset_user_features() still
clears everything, which is the point of it: an outdated user space
instance re-adding a datapath is supposed to lose the features.
I took the snapshot for the older variant as well, since a set can change
OVS_DP_F_UNALIGNED just as easily as a destroy can.
queue_userspace_packet() reads the field once and hands that value to
pad_packet(), so the head room and the padding always agree and a set in
the middle can no longer split them. The setter stores through
WRITE_ONCE() for the same reason: the receive path reads the field
without ovs_mutex.
Low priority / nit picks for your consideration:
- The patch adds `exec 9>&1` and `ovs_fail()` so that a FAIL prints
its reason on the real stdout.
- The patch runs `exec 9>&1` once at the top level of openvswitch.sh
(line 52) and never closes it.
Both are gone, and the fd was worse than a style problem. The daemons the
suite starts inherit the handle, and the kselftest runner reads the test
output from a pipe, so the pipe never reached EOF: every subtest reported
OK and the run then sat there until the harness timed out. Matthieu
reported exactly that from the CI side. Those messages go to stderr now,
which still reaches the runner from inside ovs_sbx and is not held open by
anything that outlives the script.
- ovs_dp_features_check's comment says "A show that fails and a datapath
that reports other features are different faults, so they..."
Rewritten in the respin, and it turned out to be a real bug: ovs-dpctl
prints "No DP found" and exits 0, and it leaves the features line out when
the kernel does not report them, so the check reported both of those as a
feature mismatch. Both are
recognised in the output now, and the "could not run" status is left for
the CLI failing.
You also asked in the earlier review of the series whether the return 2
path can be reached with the datapath missing. It cannot, and that is the
same mistake as above. The recirc failure should have used ovs_fail rather
than info(), and it does now, as do the sets that only did "|| return 1",
so a FAIL carries its reason.
pw-bot: cr