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 10/13] ibmveth: Keep rx_no_buffer across ifdown/up
Date: Sat, 05 Dec 2026 19:42:38 +0000 [thread overview]
Message-ID: <179649975864.3148.9458536362975253347@kernel.org> (raw)
In-Reply-To: <20261201190216.62407-11-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] ibmveth_get_stats64() now sets stats->rx_missed_errors to the
PHYP no-buffer sum (ibmveth.c:2921).
- [Low] The commit message's root-cause sentence ("H_FREE_LOGICAL_LAN
zeroes [the page], and close() reads it after the free, so it goes…
- [Low] Several new or kept comments do not match what the code does: 1.
--
ibmveth: Keep rx_no_buffer across ifdown/up
This commit keeps a per-queue running total of the PHYP no-buffer drop
count, so the count no longer resets on close/open. Each queue's count
is sampled before H_FREE_LOGICAL_LAN and folded into a retired total
afterwards. The sum is also reported as rx_missed_errors from
ibmveth_get_stats64().
> rx_no_buffer counts frames PHYP dropped because the queue had no
> buffer posted. PHYP keeps the count in each queue's buffer-list page,
> which H_FREE_LOGICAL_LAN zeroes, and close() reads it after the free,
> so it goes back to 0 on every close/open. The next patch reports it
> as per-queue hw_drops, which must not go backwards.
[Severity: Low]
Is this the full root cause? ibmveth_alloc_rx_queues() allocates a new
zeroed buffer-list page for every queue on every open:
adapter->buffer_list_addr[i] =
(void *)get_zeroed_page(GFP_KERNEL);
ibmveth_cleanup_rx_resources() frees the old page on close.
So even if close() had sampled before H_FREE_LOGICAL_LAN, the old plain
WRITE_ONCE() of *p into no_buffer_drops would still have stored 0 on the
first replenish after reopen. Moving the read alone would not keep the
count. The no_buffer_retired accumulator in
ibmveth_retire_rx_no_buffer() is what keeps it.
The code handles both causes, and the next paragraph does describe the
running total. Could this paragraph also mention the zeroed page that
each open allocates?
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index e36c25609c622..56b645ffb18ca 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -79,6 +79,8 @@ MODULE_PARM_DESC(old_large_send,
> * @IBMVETH_STAT_ADAPTER: plain u64 in struct ibmveth_adapter
> * @IBMVETH_STAT_RX_QSUM: per-queue u64, summed over rx_qstats[]
> * @IBMVETH_STAT_TX_QSUM: per-queue u64, summed over tx_qstats[]
> + * @IBMVETH_STAT_RX_NO_BUFFER: running total plus the value from the
> + * queue's last replenish pass (see ibmveth_sum_rx_no_buffer())
[Severity: Low]
This isn't a bug, but is "the value from the queue's last replenish
pass" accurate? ibmveth_update_rx_no_buffer() is also called from
ibmveth_free_all_queues(), which runs on close and on the open error
paths:
for (i = 0; i < adapter->num_rx_queues; i++)
ibmveth_update_rx_no_buffer(adapter, i);
lpar_rc = ibmveth_free_logical_lan(adapter);
After ifdown, the reported total comes from that close-time sample,
folded into no_buffer_retired, not from a replenish pass. The kernel-doc
for ibmveth_get_stats64() further down uses the same wording.
Also, ibmveth_sum_rx_no_buffer() only sums the per-queue totals. The
scheme itself is explained on ibmveth_update_rx_no_buffer() and
ibmveth_retire_rx_no_buffer(). Should the reference point to those
instead?
The struct ibmveth_stat comment still says:
/* Offset into the struct named by @src. */
size_t off;
That no longer holds for IBMVETH_STAT_RX_NO_BUFFER, which does not use
off.
These comments are still unchanged at the end of the series.
[ ... ]
> @@ -2843,6 +2901,9 @@ static netdev_features_t ibmveth_features_check(struct sk_buff *skb,
> * @stats: rtnl link statistics storage
> *
> * Sums per-queue rx_qstats and tx_qstats into the rtnl counters.
> + * rx_missed_errors is the PHYP no-buffer sum (retired plus the value
> + * from the last replenish pass), which if_link.h counts separately
> + * from rx_dropped.
> * Walk the full allocated arrays (not the live queue count) so shrinking
> * channels cannot make the totals go backwards.
> */
> @@ -2857,6 +2918,7 @@ static void ibmveth_get_stats64(struct net_device *dev,
> stats->rx_bytes += READ_ONCE(adapter->rx_qstats[i].bytes);
> stats->rx_dropped += READ_ONCE(adapter->rx_qstats[i].dropped);
> }
> + stats->rx_missed_errors = ibmveth_sum_rx_no_buffer(adapter);
[Severity: Low]
The commit message says "ip -s link now shows these drops as missed".
Should it also mention /proc/net/dev? dev_seq_printf_stats() in
net/core/net-procfs.c adds this counter to the drop column:
stats->rx_dropped + stats->rx_missed_errors,
The rx_missed_errors kernel-doc in include/uapi/linux/if_link.h also
says it is folded into the "drop" counter in /proc/net/dev.
Before this patch the driver never set rx_missed_errors. With this
patch, the drop count that ifconfig, netstat -i, sar and other
/proc/net/dev readers see now grows with every PHYP no-buffer drop. That
includes single-queue adapters, and the count no longer resets when the
link goes down and up.
The new kernel-doc line "which if_link.h counts separately from
rx_dropped" is correct for the rtnl struct, but it doesn't mention the
procfs folding either. This is still the case at the end of the series.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201190216.62407-1-mmc%40linux.ibm.com
next prev parent 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 [this message]
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
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=179649975864.3148.9458536362975253347@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