Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: mmc@linux.ibm.com
Cc: netdev@vger.kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
	npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com,
	sshegde@linux.ibm.com, nnac123@linux.ibm.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com,
	linuxppc-dev@lists.ozlabs.org, horms@kernel.org,
	davemarq@linux.ibm.com, haren@linux.ibm.com,
	ricklind@linux.ibm.com, bjking1@linux.ibm.com,
	shaik.abdulla1@ibm.com, willemb@google.com
Subject: Re: [PATCH net-next v9 13/13] ibmveth: Allow changing the RX queue count
Date: Sat, 05 Dec 2026 19:42:40 +0000	[thread overview]
Message-ID: <179649976030.3148.10183919613130315002@kernel.org> (raw)
In-Reply-To: <20261201190216.62407-14-mmc@linux.ibm.com>

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 commit message says "A queue count change is logged with the
  old and new counts", but the code only logs when the RX count changes.

--

ibmveth: Allow changing the RX queue count

This commit lets ethtool -L change the RX queue count on multi-queue
firmware (1 to 16 queues). A running device is closed and reopened to
apply the new counts, with a fallback to the old counts and the reset
work if the reopen fails. Queue count changes are also logged.

> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index 20cb9202b7d3f..87ce6bcda4721 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c

[ ... ]

> @@ -2144,11 +2147,90 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev,
>  static void ibmveth_get_channels(struct net_device *netdev,
>  				 struct ethtool_channels *channels)
>  {
> +	struct ibmveth_adapter *adapter = netdev_priv(netdev);
> +
>  	channels->max_tx = ibmveth_real_max_tx_queues();
>  	channels->tx_count = netdev->real_num_tx_queues;
>  
> -	channels->max_rx = netdev->real_num_rx_queues;
>  	channels->rx_count = netdev->real_num_rx_queues;
> +	channels->max_rx = adapter->multi_queue ?
> +			   IBMVETH_MAX_RX_QUEUES : channels->rx_count;
> +}
> +
> +/* Called with the device closed: open() sizes the RX queues and the TX
> + * LTBs from these counts.
> + */
> +static int ibmveth_set_queue_counts(struct net_device *netdev,
> +				    unsigned int rx, unsigned int tx)
> +{
> +	struct ibmveth_adapter *adapter = netdev_priv(netdev);
> +	unsigned int old_rx = adapter->num_rx_queues;
> +	unsigned int old_tx = netdev->real_num_tx_queues;
> +	int rc;
> +
> +	rc = netif_set_real_num_queues(netdev, tx, rx);
> +	if (!rc) {
> +		adapter->num_rx_queues = rx;
> +		if (old_rx != rx || old_tx != tx) {
> +			if (adapter->multi_queue)
> +				netdev_info(netdev,
> +					    "queues %08x: RX %u -> %u, TX %u -> %u\n",
> +					    adapter->vdev->unit_address,
> +					    old_rx, rx, old_tx, tx);
> +			else if (old_tx != tx)
> +				netdev_info(netdev,
> +					    "queues %08x: TX %u -> %u (RX 1)\n",
> +					    adapter->vdev->unit_address,
> +					    old_tx, tx);

[Severity: Low]

Can this non-MQ branch ever run?

Without MQ, ibmveth_get_channels() above sets max_rx to the current
rx_count, which is 1. The ethtool core rejects an rx_count above max_rx.
It also rejects an rx_count of 0 when combined_count is 0.

So on a non-MQ adapter, rx always equals adapter->num_rx_queues, and
ibmveth_set_channels() never reaches ibmveth_set_queue_counts():

	if (rx != adapter->num_rx_queues) {
		if (adapter->opened)
			return ibmveth_reopen_with_counts(netdev, rx, goal);
		return ibmveth_set_queue_counts(netdev, rx, goal);
	}

There is a related point in the commit message, which says:

  A queue count change is logged with the old and new counts.

A TX-only change such as "ethtool -L <dev> tx N" resubmits the current
rx_count, so it skips the block above. It takes the existing live TX
path in ibmveth_set_channels(), which calls
netif_set_real_num_tx_queues() and logs nothing.

Should the commit message or the logging be adjusted so they match, and
can the unreachable non-MQ branch be dropped?

> +		}
> +	}
> +	return rc;
> +}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201190216.62407-1-mmc%40linux.ibm.com

      reply	other threads:[~2026-12-05 19:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 19:02 [PATCH net-next v9 00/13] ibmveth: Add multi-queue RX support Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 01/13] ibmveth: Keep a buffer pool enabled after its allocation fails Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 02/13] ibmveth: Keep TX statistics per queue Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 03/13] powerpc/pseries: Add hcall numbers for multi-queue virtual ethernet Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 04/13] ibmveth: Add RX queue handles Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 05/13] ibmveth: Register subordinate RX queues Mingming Cao
2026-12-05 19:42   ` netdev-bot+sashiko
2026-12-01 19:02 ` [PATCH net-next v9 06/13] ibmveth: Add subordinate RX queue interrupt control Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 07/13] ibmveth: Add the MQ RX buffer submit hypercall Mingming Cao
2026-12-05 19:42   ` netdev-bot+sashiko
2026-12-01 19:02 ` [PATCH net-next v9 08/13] ibmveth: Start every RX queue on open and resume Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 09/13] ibmveth: Keep RX statistics per queue Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 10/13] ibmveth: Keep rx_no_buffer across ifdown/up Mingming Cao
2026-12-05 19:42   ` netdev-bot+sashiko
2026-12-01 19:02 ` [PATCH net-next v9 11/13] ibmveth: Report per-queue statistics through netdev_stat_ops Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 12/13] ibmveth: Enable multi-queue RX Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 13/13] ibmveth: Allow changing the RX queue count Mingming Cao
2026-12-05 19:42   ` netdev-bot+sashiko [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=179649976030.3148.10183919613130315002@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bjking1@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=davem@davemloft.net \
    --cc=davemarq@linux.ibm.com \
    --cc=edumazet@kernel.org \
    --cc=haren@linux.ibm.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mmc@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=nnac123@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=ricklind@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=shaik.abdulla1@ibm.com \
    --cc=sshegde@linux.ibm.com \
    --cc=willemb@google.com \
    /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