lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGKgG+uE+UXEIIbf@gmail.com>
Date: Mon, 30 Jun 2025 07:32:59 -0700
From: Breno Leitao <leitao@...ian.org>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Shuah Khan <shuah@...nel.org>, Simon Horman <horms@...nel.org>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	linux-kselftest@...r.kernel.org, bpf@...r.kernel.org,
	ast@...nel.org
Subject: Re: [PATCH net-next v3 3/3] selftests: net: add netpoll basic
 functionality test

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).

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.

	static int dump_ring(const struct ethtool_ringparam *ering)
	{
		fprintf(stdout,
			"Pre-set maximums:\n"
			"RX:            %u\n"
			"RX Mini:       %u\n"
			"RX Jumbo:      %u\n"
			"TX:            %u\n",
			ering->rx_max_pending,
			ering->rx_mini_max_pending,
			ering->rx_jumbo_max_pending,
			ering->tx_max_pending);

		fprintf(stdout,
			"Current hardware settings:\n"
			"RX:            %u\n"
			"RX Mini:       %u\n"
			"RX Jumbo:      %u\n"
			"TX:            %u\n",
			ering->rx_pending,
			ering->rx_mini_pending,
			ering->rx_jumbo_pending,
			ering->tx_pending);

		fprintf(stdout, "\n");
		return 0;
	}


Thanks for the review,
--breno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ