Thread (12 messages) 12 messages, 4 authors, 2025-09-12

Re: [PATCHv3 net-next 5/5] selftests/net: add offload checking test for virtual interface

From: Paolo Abeni <pabeni@redhat.com>
Date: 2025-09-11 15:41:30
Also in: bridge, linux-kselftest

On 9/11/25 8:54 AM, Hangbin Liu wrote:
On Wed, Sep 10, 2025 at 04:57:54PM +0200, Sabrina Dubroca wrote:
quoted
2025-09-09, 08:18:52 +0000, Hangbin Liu wrote:
quoted
+__check_offload()
+{
+	local dev=$1
+	local opt=$2
+	local expect=$3
+
+	ip netns exec "$ns" ethtool --json -k "$dev" | \
+		jq -r -e ".[].\"$opt\".active == ${expect}" >/dev/null
Sorry Hangbin, I should have noticed this when we discussed the IPsec
test, since the problem is similar for the other features set in
netdev_compute_features_from_lowers:

`ethtool -k` does not test the dev->*_features (mpls, vlan, etc) set
in the new common function, it only checks dev->features and
dev->hw_features. So this will not test the new function.
Hmm, that make the selftest more complex. A very easy way to verify whether
the feature is set is using tracepoint. But Paolo said adding new tracepoint
is not welcomed.

Since all these flags are fixed after compute from lower devices. We need to
find out a proper device and test the features are inherited.

The next question is how to test gso_partial_features, vlan_features,
hw_enc_features, mpls_features (maybe also tso_max_segs/size in future)
effectively.

The veth device only has hw_enc_features and mpls_features, while it's 
hw_enc_features doesn't have NETIF_F_HW_ESP. The netdevsim device only have
hw_enc_features.


For mpls_features, seem we only able to test NETIF_F_GSO_SOFTWARE, but I'm not
sure how to check mpls gso..

For hw_enc_features NETIF_F_HW_ESP. Does sending ipsec data and see if
netdevsim has pkts count enough??

Any advices? Should we just drop the selftest?
Uhm... one possible way of testing netdev_compute_features_from_lowers()
correctness is transmitting over the relevant device (bridge/team/bond)
"arbitrary" GSO packets and verify that the packet is segmented (or not)
before reaching the lower.

GSO packet injection can be done with some work via the tun device (in
tap mode), and the virtio hdr.

That is limited to some GSO types (i.e. no ipsec pkts), and can become
easily very complex.

What about giving it a shot for UDP tunnel GSO types?

Thanks,

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help