From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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 ; Sat, 5 Dec 2026 19:42:40 +0000 (UTC) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 125851F0092B; Sat, 5 Dec 2026 19:42:39 +0000 (UTC) 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== Subject: Re: [PATCH net-next v9 10/13] ibmveth: Keep rx_no_buffer across ifdown/up 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 Date: Sat, 05 Dec 2026 19:42:38 +0000 Message-ID: <179649975864.3148.9458536362975253347@kernel.org> In-Reply-To: <20261201190216.62407-11-mmc@linux.ibm.com> References: <20261201190216.62407-11-mmc@linux.ibm.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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