Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The author's DCO sign-off in commit "virtio_net: Add get ethtool
flow rules ops" misspells the author's name.
- [Low] Registering `.get_rxnfc = virtnet_get_rxnfc` in
`virtnet_ethtool_ops` also changes channel-count behaviour, and the…
--
virtio_net: Add get ethtool flow rules ops
This adds a get_rxnfc ethtool op to virtio_net. It reports the rule count
(ETHTOOL_GRXCLSRLCNT), a single rule (ETHTOOL_GRXCLSRULE) and all rule
locations (ETHTOOL_GRXCLSRLALL), taken from the driver's ethtool flow
filter xarray.
> Signed-off-by: Dniel Jurgens <dani…@nvidia.com>
[Severity: Low]
This isn't a bug, but the author's sign-off has a typo: "Dniel" instead
of "Daniel". It doesn't match the Author: line, and checkpatch.pl reports
it as a From:/Signed-off-by: name mismatch.
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6fcc157464f3e..a5fe4a5b383ed 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
[ ... ]
> @@ -6712,6 +6786,7 @@ static const struct ethtool_ops virtnet_ethtool_ops = {
> .get_rxfh_fields = virtnet_get_hashflow,
> .set_rxfh_fields = virtnet_set_hashflow,
> .get_rx_ring_count = virtnet_get_rx_ring_count,
> + .get_rxnfc = virtnet_get_rxnfc,
> .set_rxnfc = virtnet_set_rxnfc,
> };
[Severity: Low]
Should the commit message mention that registering .get_rxnfc also
changes how ethtool -L behaves?
Before this patch, ethtool_get_max_rxnfc_channel() in
net/ethtool/common.c returned early:
if (!ops->get_rxnfc)
return -EOPNOTSUPP;
As a result, ethtool_check_max_channel() fell back to max_rxnfc_in_use = 0,
and flow rules never blocked a channel reduction.
With this op registered, the core now walks the installed rules, takes the
largest ring_cookie, and rejects the request in ethtool_check_max_channel():
if (channels.combined_count + channels.rx_count <= max_rxnfc_in_use) {
if (info)
GENL_SET_ERR_MSG(info, "requested channel counts are too low for existing ntuple filter settings");
return -EINVAL;
}
The ioctl path, ethtool_set_channels(), and the netlink channels path
both apply this check.
The new behaviour looks correct. validate_flow_input() only checks
ring_cookie against curr_queue_pairs when a rule is inserted. Without
this op, a later "ethtool -L <dev> combined M" with M at or below a rule's
target queue would succeed and leave that rule steering to a queue the
driver no longer uses.
The commit message describes the patch only as read-only rule reporting.
Could it also say that the patch turns on the core's ntuple-aware channel
validation for virtio_net? Anyone backporting only the set_rxnfc patches
would then know they need this one as well.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40nvidia.com