Re: [PATCH net-next v3 3/4] selftests: openvswitch: add missing docstrings in ovs-dpctl.py

From
netdev-bot+sashiko@kernel.org
Date
2026-09-10 17:22:04
Also in
linux-kselftest
Reply to
Minxi Hou, 2026-09-08
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 0 · Low: 1

- [Low] The docstring added to print_ovsdp_full()
  (tools/testing/selftests/net/openvswitch/ovs-dpctl.py line 2940)…

--

selftests: openvswitch: add missing docstrings in ovs-dpctl.py

This adds one-line docstrings to the module, classes and methods in the
openvswitch selftest helper ovs-dpctl.py to silence pylint C0114, C0115
and C0116. No code behaviour is changed.
quoted hunk ↗ jump to hunk
diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
index 502e6eb4c4b4..dc88cb1b20c1 100644
--- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
+++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
[ ... ]
quoted hunk ↗ jump to hunk
@@ -2887,6 +2973,7 @@ class PsampleEvent(EventSocket):
 
 
 def print_ovsdp_full(dp_lookup_rep, ifindex, ndb=NDB(), vpl=OvsVport()):
+    """Print full datapath state: stats, vports, and flows."""
 	  dp_name = dp_lookup_rep.get_attr("OVS_DP_ATTR_NAME")
 	  base_stats = dp_lookup_rep.get_attr("OVS_DP_ATTR_STATS")
 	  megaflow_stats = dp_lookup_rep.get_attr("OVS_DP_ATTR_MEGAFLOW_STATS")
[Severity: Low]
Does print_ovsdp_full() actually print flows?  The body only emits the
datapath name, the values from OVS_DP_ATTR_STATS,
OVS_DP_ATTR_MEGAFLOW_STATS, OVS_DP_ATTR_MASKS_CACHE_SIZE and
OVS_DP_ATTR_USER_FEATURES, then one line per vport:

    print(f"  flows:{int(base_stats['flows'])}")
    ...
    # port print out
    for iface in ndb.interfaces:
        rep = vpl.info(iface.ifname, ifindex)
        if rep is not None:
            print(
                f"  port {int(rep.get_attr('OVS_VPORT_ATTR_PORT_NO'))}: "
                ...

The only flow-related output is the flows:<n> counter that comes from
OVS_DP_ATTR_STATS, which is already covered by "stats".

Flow enumeration lives in OvsFlow.dump(), and main() calls that only for
the dump subcommand, not on the show path that reaches
print_ovsdp_full().

Would something like "Print datapath statistics and attached vports." be
a more accurate one-liner here?

The commit message says "Each docstring describes the command or
attribute group the code actually implements", so this one looks like it
overstates the output.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260908171859.1967327-1-houminxi%40gmail.com
Thread (8 messages) 8 messages, 3 authors, last reply 2026-09-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help