Breno Leitao wrote:
> Hello Willem,
> 
> On Sat, Jun 28, 2025 at 10:57:20AM -0400, Willem de Bruijn wrote:
> > Breno Leitao wrote:
> > > +NETCONSOLE_CONFIGFS_PATH: str = "/sys/kernel/config/netconsole"
> > > +NETCONS_REMOTE_PORT: int = 6666
> > > +NETCONS_LOCAL_PORT: int = 1514
> > > +# Max number of netcons messages to send. Each iteration will setup
> > > +# netconsole and send 10 messages
> > > +ITERATIONS: int = 20
> > > +# MAPS contains the information coming from bpftrace
> > > +# it will have only one key: @hits, which tells the number of times
> > > +# netpoll_poll_dev() was called
> > 
> > nit: no longer has ampersand prefix
> 
> Good catch. I will update.
> 
> > > +def ethtool_read_rx_tx_queue(interface_name: str) -> tuple[int, int]:
> > > +    """
> > > +    Read the number of RX and TX queues using ethtool. This will be used
> > > +    to restore it after the test
> > > +    """
> > > +    rx_queue = 0
> > > +    tx_queue = 0
> > > +
> > > +    try:
> > > +        ethtool_result = ethtool(f"-g {interface_name}").stdout
> > > +        for line in ethtool_result.splitlines():
> > > +            if line.startswith("RX:"):
> > > +                rx_queue = int(line.split()[1])
> > > +            if line.startswith("TX:"):
> > > +                tx_queue = int(line.split()[1])
> > 
> > Does this work on devices that use combined?
> 
> Not sure. This is suppossed to work mostly on netdevsim (for now).

Okay. Given that the test targets that. LGTM.
 
> Since I am not familiar with combined TX/RX, I've looked at ethtool
> code, and it seems RX and TX wil always be printed?
> 
> This is what I found when `-g` is passed to ethtool.

I'm also a bit confused about how combined is supposed to work. This
was discussed or documented somewhere recently, but I can't seem to
find an authoritative reference.

To my intuition, "tx N rx M" is equivalent to "combined min(N, M)"
plus the remainder of the larger ones. So "tx 1 rx 1" is equivalent
to "combined 1". But not sure if this is true for all drivers.

Anyway, as said, targeting netdevsim, so can leave out of scope.

Reply via email to