From: netdev-bot+sashiko@kernel.org
To: mmc@linux.ibm.com
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
horms@kernel.org, edumazet@kernel.org, pabeni@redhat.com,
andrew+netdev@lunn.ch, nnac123@linux.ibm.com,
maddy@linux.ibm.com, mpe@ellerman.id.au,
linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com,
chleroy@kernel.org, ritesh.list@gmail.com, sshegde@linux.ibm.com,
haren@linux.ibm.com, ricklind@linux.ibm.com,
davemarq@linux.ibm.com, bjking1@linux.ibm.com,
shaik.abdulla1@ibm.com
Subject: Re: [PATCH net-next v8 07/15] ibmveth: Add RX queue register helpers for MQ
Date: Thu, 12 Nov 2026 23:57:04 +0000 [thread overview]
Message-ID: <179452782438.2199510.12943082355356211419@kernel.org> (raw)
In-Reply-To: <20261109235556.60604-8-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 patch's version notes do not match the code.
- [Low] The v8 notes say ibmveth_register_logical_lan() was changed to
return `long`, 'the hypercall status type', but the callers convert…
--
ibmveth: Add RX queue register helpers for MQ
This commit moves queue 0 logical LAN registration and teardown out of
ibmveth_open() and ibmveth_close() into ibmveth_register_logical_lan(),
ibmveth_register_rx_queues() and ibmveth_free_all_queues(), and adds a
queue_registered[] flag next to queue_handle[]. It also moves buffer pool
allocation in open() ahead of PHYP registration and calls
netif_set_real_num_rx_queues() after registration.
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index cab895cc970c5..e2aa108655676 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -1335,10 +1335,31 @@ static void ibmveth_free_tx_resources(struct ibmveth_adapter *adapter)
[ ... ]
> +static long ibmveth_register_logical_lan(struct ibmveth_adapter *adapter,
> + union ibmveth_buf_desc rxq_desc,
> + u64 mac_address)
> +{
> + long rc;
[ ... ]
> @@ -1362,14 +1398,97 @@ static int ibmveth_register_logical_lan(struct ibmveth_adapter *adapter,
[ ... ]
> +static void ibmveth_free_all_queues(struct ibmveth_adapter *adapter)
> +{
> + unsigned long lpar_rc;
> + int i;
> +
> + netdev_dbg(adapter->netdev, "freeing all RX queues at once\n");
> +
> + do {
> + lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
> + } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
> +
> + if (lpar_rc != H_SUCCESS) {
> + netdev_err(adapter->netdev,
> + "h_free_logical_lan failed: %ld\n", lpar_rc);
> + }
[ ... ]
> +static int
> +ibmveth_register_rx_queues(struct ibmveth_adapter *adapter, u64 mac_address)
> +{
> + struct net_device *netdev = adapter->netdev;
> + union ibmveth_buf_desc rxq_desc;
> + unsigned long lpar_rc;
> + int rc;
[ ... ]
> + lpar_rc = ibmveth_register_logical_lan(adapter, rxq_desc, mac_address);
> + if (lpar_rc != H_SUCCESS) {
> + netdev_err(netdev,
> + "h_register_logical_lan failed: %ld\n", lpar_rc);
[Severity: Low]
This isn't a bug, but the v8 changelog says:
- ibmveth_register_logical_lan() returns long, the hypercall status
type
ibmveth_register_rx_queues() stores that long return value in an
unsigned long lpar_rc and prints it with %ld.
ibmveth_free_all_queues() does the same with the return value of
h_free_logical_lan(). The close() code it replaces declared that local
as long lpar_rc.
PAPR H_* error codes are negative (H_PARAMETER is -4, for example). The
printed value only comes out right because varargs pass the same bits,
and the default -Wformat does not check signedness.
Should both locals be declared long so the status stays signed?
[ ... ]
> @@ -1480,15 +1597,7 @@ static int ibmveth_close(struct net_device *netdev)
>
> ibmveth_cleanup_rx_interrupts(adapter);
>
> - /* Full LAN teardown (subordinates arrive with register helpers). */
> - do {
> - lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
> - } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
> - if (lpar_rc != H_SUCCESS) {
> - netdev_err(adapter->netdev,
> - "h_free_logical_lan failed with %lx, continuing\n",
> - lpar_rc);
> - }
> + ibmveth_free_all_queues(adapter);
> ibmveth_update_rx_no_buffer(adapter);
[Severity: Low]
This isn't a bug, but the per-version notes don't match the code here.
The v5 notes say:
- Call out close() update_rx_no_buffer() before free_lan as intentional
last-glimpse accounting while the LAN is still registered (order
already in v4; v4 step list omitted it)
In ibmveth_close(), ibmveth_free_all_queues() issues H_FREE_LOGICAL_LAN
first, and ibmveth_update_rx_no_buffer() runs after it. So the
no-buffer counter is read after the LAN has been freed, not while it is
still registered.
The pre-patch close() used the same order, so behaviour is unchanged.
The note just describes an ordering the code does not follow.
The v6 notes also say:
This patch no longer touches ibmveth.h
However, v8 adds queue_registered[] to struct ibmveth_adapter in
drivers/net/ethernet/ibm/ibmveth.h.
Could these notes be updated to match the code?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109235556.60604-1-mmc%40linux.ibm.com
next prev parent reply other threads:[~2026-11-12 23:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 23:55 [PATCH net-next v8 00/15] ibmveth: Add multi-queue RX support Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 01/15] ibmveth: Add MQ RX hypercall wrappers and call definitions Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 02/15] ibmveth: Prepare MQ RX adapter data structures Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 03/15] ibmveth: Refactor RX resource allocation for MQ RX bring-up Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 04/15] ibmveth: Refactor buffer pool management for per-queue MQ RX Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 05/15] ibmveth: Refactor RX interrupt control for MQ RX queues Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 06/15] ibmveth: Refactor TX resource allocation in open/close paths Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 07/15] ibmveth: Add RX queue register helpers for MQ Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko [this message]
2026-11-09 23:55 ` [PATCH net-next v8 08/15] ibmveth: Add queue-aware RX buffer submit helper " Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 09/15] ibmveth: Split RX poll into per-slot helpers " Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 10/15] ibmveth: Enable multi-queue RX receive path Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 11/15] ibmveth: Add per-queue RX and TX statistics collection Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 12/15] ibmveth: Report MQ-aware RX counts in ethtool get_channels Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 13/15] ibmveth: Expose per-queue buffer pool details via debugfs Mingming Cao
2026-11-09 23:55 ` [PATCH net-next v8 14/15] ibmveth: Implement incremental MQ RX queue resize Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
2026-11-09 23:55 ` [PATCH net-next v8 15/15] ibmveth: Complete set_channels down-path Mingming Cao
2026-11-12 23:57 ` netdev-bot+sashiko
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=179452782438.2199510.12943082355356211419@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 \
/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