netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Breno Leitao <leitao@debian.org>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,  Shuah Khan <shuah@kernel.org>,
	 Simon Horman <horms@kernel.org>,
	 linux-kernel@vger.kernel.org,  netdev@vger.kernel.org,
	 linux-kselftest@vger.kernel.org,  bpf@vger.kernel.org,
	 ast@kernel.org
Subject: Re: [PATCH net-next v3 3/3] selftests: net: add netpoll basic functionality test
Date: Mon, 30 Jun 2025 13:53:58 -0400	[thread overview]
Message-ID: <6862cf369fbcd_162c24294b@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <aGKgG+uE+UXEIIbf@gmail.com>

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	other threads:[~2025-06-30 17:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 17:03 [PATCH net-next v3 0/3] selftest: net: Add selftest for netpoll Breno Leitao
2025-06-27 17:03 ` [PATCH net-next v3 1/3] selftests: drv-net: add helper/wrapper for bpftrace Breno Leitao
2025-06-27 17:03 ` [PATCH net-next v3 2/3] selftests: drv-net: Strip '@' prefix from bpftrace map keys Breno Leitao
2025-06-27 17:03 ` [PATCH net-next v3 3/3] selftests: net: add netpoll basic functionality test Breno Leitao
2025-06-27 18:38   ` Jakub Kicinski
2025-06-30 17:30     ` Breno Leitao
2025-06-28 14:57   ` Willem de Bruijn
2025-06-30 14:32     ` Breno Leitao
2025-06-30 17:53       ` Willem de Bruijn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6862cf369fbcd_162c24294b@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).