Article View: linux.kernel.netdev
Article #27488Re: [PATCH net-next v9 10/13] ibmveth: Keep rx_no_buffer across ifdown/up
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 19:42
Date: Sat, 05 Dec 2026 19:42
129 lines
13655 bytes
13655 bytes
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
Technical Details
Message-ID:
<179649975864.3148.9458536362975253347@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378112-linux-kernel-netdev=dewy.ruReferences:
<20261201190216.62407-11-mmc@linux.ibm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378112-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179649975864.3148.9458536362975253347@kernel.org> References: <20261201190216.62407-11-mmc@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3107231"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:AU1QWCJioZBp2ZvVRLGEO2LU2ig= sha256:29vrgqjI6YVNQEtaHF5ZiEIYfTgPdKjwlNQQaJKZCS4= sha1:xHrl2QdMIJBGcU3W6K9pucLjROg= sha256:AxBiNsWiksBz0pbNeIj1MsppLsX6X8SLzimPxzheGmc= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 8267D117E49; Sat, 5 Dec 2026 22:42:57 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.539 X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wRsQPYk7S08U; Sat, 5 Dec 2026 22:42:54 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378112-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B2085117E9A; Sat, 5 Dec 2026 22:42:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 94EC33179E; Sat, 5 Dec 2026 19:42:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796499761; b=B0xXbNFDeyK4vJB9uYykXXVqD8zep2+sfQ4SsQruSmtBHtLF4qcQyZVHfW4Nyj0FQQTR AxKNH6zcghHfKkv7fDCF+Znep3osuL0/MAFXV1f4mC83hKfz9xtcMM36m4f2gkgUl3WY1 iSr1ACTyp9MYKzrh5tnM34swcpq6Ctj+cK6J+pjItcvy/RR5mxA5La3n3/9MMOyhYeVrF 6ZNuAUs/8g6xgCMDxNFmIm/oxz1wXqphF9QymBIfD6FDx5CQX+k5HR7wz59wEmuHyue1+ brPBigfVwOAZUJ9+/vxNFVcRPMk9QLdolqmgjPNUmMnwDiEC8fPs4KkKL3cS1RZ5Taw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796499761; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=jW58MRgcLk6CTqmGpAIehmGqW2jVLKSrxF2ig3qDhHg=; b=d1zdDHvtnV1du2fGaR2Cobo4ILEu+So9NCG/xJxrzDasY8SwgyFY4QQouA3p3+Yj6Trs N9GoB2EXsq5CF+U1H+Jy9pLE4rwMUbAVNbew7IMkhCwTKHp0GXCCxhbwfVGyO1kOCw918 yq1HF0ooNSyEUA6MgULZPVPhMgPfpbjQiJBVXQ4mh/IowFahRwHLkVawIndC1ePBC3qzB ynINmvftxxlDMgQAQDGTJog2Z9IFPUncXSt/eL4xCkSZX7/ANREm80tU8oOdAST8RT2VE TOcN/hyW/KEaGN9RB2LoZnzBBk2GrlC0wgt0nPjBvuXJG178nNs+s/OwiLtKYmJ+4sQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SHboasPF; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AD82606A685; Sat, 5 Dec 2026 19:42:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SHboasPF X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796499760; b=k6DbrE89di1AYhQ60G3O/FOVoTl7+KVUMfTgMUHjB5gCx8XDnzqi2lVYM2c+yBZgfWQQ vkASL2tWIlZWWZaQAHio+JfZnM/AF+AFuMN0kZ6BVXHpqqg1jqwWdQ6u6DS6Xzb0TB2/O 6M2yarGXz7R0uIFywVEsog4ml49rhkj3a02F4hrfPlYIZF4IzKIqxntFqMoK7x71bM0ts Xv7a49rH+d4z6sZLGHth9vNjQKnPyUmg+D4kQlH83PouggLbIp00LRl1DtolfRT9TtGEE truz6DIbDXNoQ5soJbPnVvtAmptcpxlOJfkUb3WAfS5drYQn5wdAC43tDgBWfo5TE0g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796499760; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=jW58MRgcLk6CTqmGpAIehmGqW2jVLKSrxF2ig3qDhHg=; b=00yzvJwLaZ/YWZgyVezF8glY+0o9Ur/GRBV4FiqzCn8bdTbnATew85I+0Aee3YJ15o3F F7ssVgpW4C1fXt5OqmzIMTCmBIFhxKmnyBMO+pUig2lGn5tCOJo1XQmkIhSZovFBCaF/s mIVjekYziGveH+S77UfGOddsrAINykMNlvUVRD9loyJDCgO268dcjmGuPAswLcfBoVEW4 6VSaJcfeRYxnrZQcj+pmsINLQ1iRf/DSeqj9QadxjS71EvzjD8K5mAHirFVltP18Mc2RQ gBtBk5PI8M/Ayl6AlqDGyWn93Y2Xewiz5vDVAUmXtN8PsIpRe+fQfJtuKxNBLBOrVpA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SHboasPF; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B987606A330 for <netdev@vger.kernel.org>; Sat, 5 Dec 2026 19:42:40 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 125851F0092B; Sat, 5 Dec 2026 19:42:39 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796499760; bh=jW58MRgcLk6CTqmGpAIehmGqW2jVLKSrxF2ig3qDhHg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SHboasPFGHf0MfZ7X2oyKXZmpFWSJ0d0b+BmpIseH/1ExZsmifTWlMAYjQD4M0s4L Q2STk4INdyIpRk2M9M94dCJxrz5Z6vgVQwGg5YgbFqL7Hlajwen6YZjHWBGS+r82FL qoOp1nw16uUIm5BR9Is6COWj9sHppoI1Yx0p0nds9pDYLQ0RkG7BgavpbqtIlq1K3i ARlTCBCTw0VPdYxHFb0mLoYq3gTHVLsX+YhLs/8uqaBKl+FcvItMuZz0YYYJSYy9RE o8YrsfgXnrWCPe/OaKzID2gYkiw2L2NOvlQuaKNtfOIaXwj8dq1pkXTO6Iny0+pI5b fpCbvDUN+iY8Q== X-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 X-In-Reply-To: <20261201190216.62407-11-mmc@linux.ibm.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list