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
Subject: Re: [PATCH net-next 2/8] ibmveth: Refactor RX resource allocation for MQ RX bring-up
Date: Mon, 23 Nov 2026 01:06:06 +0000 [thread overview]
Message-ID: <179539596618.3135.16248027677119364858@kernel.org> (raw)
In-Reply-To: <20261119000711.18093-3-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 kernel-doc for ibmveth_cleanup_rx_resources() in
drivers/net/ethernet/ibm/ibmveth.c says "Free all RX queue resources",…
--
ibmveth: Refactor RX resource allocation for MQ RX bring-up
This moves the filter list and per-queue RX ring and buffer list
allocation out of ibmveth_open() into helpers that loop over
num_rx_queues and undo their own partial failures. ibmveth_close() and
the open() error path now free through the same helpers.
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index fc50036d5d265..559c4d2d957bb 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -159,6 +159,177 @@ static unsigned int ibmveth_real_max_tx_queues(void)
[ ... ]
> +/**
> + * ibmveth_cleanup_rx_resources - Free all RX queue resources
> + * @adapter: ibmveth adapter structure
> + */
> +static void
> +ibmveth_cleanup_rx_resources(struct ibmveth_adapter *adapter)
> +{
> + struct device *dev = &adapter->vdev->dev;
> + int i;
> +
> + for (i = 0; i < adapter->num_rx_queues; i++) {
> + if (adapter->buffer_list_addr[i]) {
> + dma_unmap_single(dev, adapter->buffer_list_dma[i],
> + 4096, DMA_BIDIRECTIONAL);
> + adapter->buffer_list_dma[i] = 0;
> + }
> +
> + if (adapter->rx_queue[i].queue_addr) {
> + dma_free_coherent(dev, adapter->rx_queue[i].queue_len,
> + adapter->rx_queue[i].queue_addr,
> + adapter->rx_queue[i].queue_dma);
> + adapter->rx_queue[i].queue_addr = NULL;
> + }
> +
> + if (adapter->buffer_list_addr[i]) {
> + free_page((unsigned long)adapter->buffer_list_addr[i]);
> + adapter->buffer_list_addr[i] = NULL;
> + }
> + }
> +}
[Severity: Low]
This isn't a bug, but is the kernel-doc for ibmveth_cleanup_rx_resources()
accurate? It says "Free all RX queue resources". The body only frees
buffer_list_addr[i] with its buffer_list_dma[i] mapping, plus the coherent
ring at rx_queue[i].queue_addr.
It doesn't free the per-queue buffer pools in adapter->rx_buff_pool[queue][*]
(the free_map, dma_addr and skbuff arrays and the DMA-mapped skbs). That is
why ibmveth_close() still frees them in a separate loop after calling this
helper:
ibmveth_cleanup_rx_resources(adapter);
ibmveth_free_filter_list(adapter);
for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
if (adapter->rx_buff_pool[0][i].active)
ibmveth_free_buffer_pool(adapter,
&adapter->rx_buff_pool[0][i]);
The ibmveth_open() error path also keeps its own out_free_buffer_pools
label for the same reason.
At the end of the series this doc line hasn't changed. There, close() and
the open() error path call ibmveth_free_buffer_pools() separately before
this helper. So the helper doesn't seem meant to free the pools.
Could the comment be narrowed to describe the buffer lists and RX rings it
actually frees? The name could also be changed to match its allocator,
ibmveth_alloc_rx_queues().
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119000711.18093-1-mmc%40linux.ibm.com
next prev parent reply other threads:[~2026-11-23 1:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 0:07 [PATCH net-next 0/8] ibmveth: prepare the RX path for multi-queue Mingming Cao
2026-11-19 0:07 ` [PATCH net-next 1/8] ibmveth: Prepare MQ RX adapter data structures Mingming Cao
2026-11-19 0:07 ` [PATCH net-next 2/8] ibmveth: Refactor RX resource allocation for MQ RX bring-up Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko [this message]
2026-11-19 0:07 ` [PATCH net-next 3/8] ibmveth: Refactor buffer pool management for per-queue MQ RX Mingming Cao
2026-11-19 0:07 ` [PATCH net-next 4/8] ibmveth: Refactor RX interrupt control for MQ RX queues Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 5/8] ibmveth: Refactor TX resource allocation in open/close paths Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 6/8] ibmveth: Add RX queue register helpers for MQ Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 7/8] ibmveth: Pass the RX queue index through replenish and poll Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 8/8] ibmveth: Split RX poll into per-slot helpers for MQ Mingming Cao
2026-11-23 1:06 ` 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=179539596618.3135.16248027677119364858@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