Article View: linux.kernel.netdev
Article #7427Re: [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring
From: Sebastian Andrzej Siewior
Date: Mon, 26 Oct 2026 10:11
Date: Mon, 26 Oct 2026 10:11
40 lines
11526 bytes
11526 bytes
On 2026-10-20 14:50:38 [-0700], Jakub Kicinski wrote: > On Tue, 20 Oct 2026 23:21:55 +0200 Sebastian Andrzej Siewior wrote: > > > > Is there any other driver doing this? > > > > There is ::get_sset_count() and so on for the per-queue stats. > > > > > > You may be mixing up queue stats (netlink) with the old ethtool -S > > > kitchen sink / garbage dump. > > > > The statistics is folded on device-down into a global counter. So on > > device-up the statistics is still available. At least that is my > > understanding. This means the per-queue stats are lost and global stats > > don't match the per queue stats anymore. > > Yes, that's intentional and recommended by the docs for queue stats. I guess this is Documentation/networking/statistics.rst that I need to study. > > So if this never happens, it might not be needed to preserve this. That > > force-RCU might not be needed. This does happen on down and I would > > assume that the device is no longer processing packets. > > The (old) ndo for stats reading runs under RCU, only. > AI will immediately point that out if we remove the sync. > > May I ask why you care? Is there another driver you're trying > to implement stats in? I'm not sure where you're coming from > and therefore what to explain to you. I tried to be useful and do so some reviews and this stats part is what I did not expect to be "expected". I would expect per-queue stats which are folded into device stats on query time. Anyway. Let me study what is recommended before making noise here again. One last thing: If you replace RCU with SRCU then the logic should remain the same. On the plus side you would have some domain separation and the "synchronize" part will not force/ wait for the global grace period but be limited to the local one. Sebastian
Technical Details
Message-ID:
<20261026101117.YTmp0eu2@linutronix.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351824-linux-kernel-netdev=dewy.ruReferences:
<20261012-mpnic-counters3-v2-0-8afba81c2d5a@gmail.com> <20261012-mpnic-counters3-v2-1-8afba81c2d5a@gmail.com> <20261016220930.i32JEcqe@linutronix.de> <DM8U47F4MNK3.2V54CCQ9YTNBY@gmail.com> <20261019215405.OCzrrKYw@linutronix.de> <20261019190543.419e70bc@kernel.org> <20261020212155.47v0ot4g@linutronix.de> <20261020145038.4f7eb295@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351824-linux-kernel-netdev=dewy.ru From: bigeasy@linutronix.de (Sebastian Andrzej Siewior) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring Date: Mon, 26 Oct 2026 11:11:17 +0100 Organization: Usenet Network Message-ID: <20261026101117.YTmp0eu2@linutronix.de> References: <20261012-mpnic-counters3-v2-0-8afba81c2d5a@gmail.com> <20261012-mpnic-counters3-v2-1-8afba81c2d5a@gmail.com> <20261016220930.i32JEcqe@linutronix.de> <DM8U47F4MNK3.2V54CCQ9YTNBY@gmail.com> <20261019215405.OCzrrKYw@linutronix.de> <20261019190543.419e70bc@kernel.org> <20261020212155.47v0ot4g@linutronix.de> <20261020145038.4f7eb295@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: usenet.network; logging-data="1280498"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:SaSY9LuEWI+WTnOr1eVol39pg0U= sha256:CjNFK6TOCwNnGhCyJXJQgsfjCEldAc+B9Wk/QyfkRc8= sha1:NHgDJTd2KQixQfjK4eVUPFOoqLU= sha256:XqfkiAe0fn/X7O/CjFrMPtbjyettsbZSf/bK9A3utWM= Content-Disposition: inline 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 28520125B99; Mon, 26 Oct 2026 13:16:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=linutronix.de header.b=1YVZacPP; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=linutronix.de header.b=0xswxDpu 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 trAGpDiX0RDy; Mon, 26 Oct 2026 13:16:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-351824-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linutronix.de X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id C8BBD125B98; Mon, 26 Oct 2026 13:16:36 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 36447603DF8; Mon, 26 Oct 2026 10:11:44 +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=1793009492; b=U92WIzA/lszWQ2Einlk0fwha/QN2usRjvFSs0F40Qt3ANBNrI9wkSW4nlUA/f7Z+eOjT jaUWSrUzHBAOs/p5qKXrXs7EDPvg3hXqPNyOU+HjiGqFI4sXKd8PZwkWaq79im1vrHDb8 GTnP8Z9xtndSgxBVS8ueysdThBCpyUKvAC3zpvitp9hVYMrRjBIiDsNPXlSrPHfThlInS S8pP3g5w5BElw3zW78qMbKdwoXFQ14R6jT7vJ4qVoLuH9nBy0gBwjB8SXg/fEm/4VA0Sh jFytvqVBtY45uHl3o9Oxre/9O8+kCdblbg/mcWZoah9jYzWXMHwpI+j7tujH0VCMRvQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793009492; h=X-Original-To:Received:DMARC-Filter:Date:DKIM-Signature: DKIM-Signature:From:To:Cc:Subject:Message-ID:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=nHzLAUsQ2YNWwS+va9j2/lpxa/j+AoQFACmUeHcREIM=; b=T1VgK0qvg7IiXyri3sE1+62TbIWtnIjmhisaXJg9t9tg/KnyIK8+l9a0+fp6A1vkpNiw 1EZgiOK1f8o6wMjNHc+qFgJmM9dAYFsMQPjiQtEzUBGjwKYFG5KTiwrQllragb6iWXW2S bjtVAySWFoZhiO7Pnlut/XByI1vAVxqzfGC1qoewjKVOUwauR5yegE4Q7V0DFrhmFpzbt 2I7xJ9LfLuut6OcaqkmDabpimZDvXjrHdf7RZ/GV546fSAVAvTBogZupDc5v+PYtGLcMK X24K+OucXMaKR5B7UKjv+4WPFkXt7OXDjzYsQKXYsB4iArR5ecWkvnFuiIVhgZOfwaw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=1YVZacPP; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=0xswxDpu; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; 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 BC54A606A33D; Mon, 26 Oct 2026 10:11:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=1YVZacPP; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=0xswxDpu X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793009481; b=SAQny3+xnYjvCAK7kQi6TeG75ZDO7RIukweDN246OkxTHxWD6f4jXKrfQ/9JDkesKIK9 M2hNVZi5t5RSJ54+rnCmqen/K/aCUtNFJgo+EXtWHg0T+Twt2k6lo4n1ej2/uMT0nBLlI KGZmfgLmnmSgCEDg7tXRuYjIzPt9hOxTzm2i76xVd3p4iebpNVjZaNIS5LwVWOuRDFXRE gRW0RXKx1VtN8ScHQaJfMRL3wP51/ECxM1BJhtrV0K8wHyXEhfOhD+Vx6+E21Vo0kyegc CeKHkTVz46zBjRqpqbwiB8BbNnbiHOfP/WGh4Q0z08AGIkZBKfg4Ii2taQ4Qb7xr6gg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793009481; h=DMARC-Filter:Date:DKIM-Signature:DKIM-Signature:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=nHzLAUsQ2YNWwS+va9j2/lpxa/j+AoQFACmUeHcREIM=; b=TjQPxEXqoxe8JtB0xcfdHpKOOG5191HdQ5nnQW1nSpVTiOM9+X4Vc2qw1Wcw6p8cEl6F A8UD+fssT2sQyAJ1CrXkcGPrgjgRvxXQDPx7urPTC5qYfiaoPutmXfOmM6UL1LsgC8hlW OU2dEo2fvog0HofRcaFeuOGeOipH8NyFgVTaARmOor4z4CVXdHmuEhr80vB2fM5eeYU67 ZcGmf3G9aI41fXD7hrw742X1U35tVHUNXUhb2pDwb+8D31SA06aham71lX27mTE31QpfC hlw489zuTcugXxH30Rn0iUGeBtU4xKCtgLscOPtaEYlKn/qQSceofHI1ZKf9xyWL5yg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=1YVZacPP; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=0xswxDpu; arc=none smtp.remote-ip=193.142.43.55 X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C3A5606A31A; Mon, 26 Oct 2026 10:11:21 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5C3A5606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1793009479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nHzLAUsQ2YNWwS+va9j2/lpxa/j+AoQFACmUeHcREIM=; b=1YVZacPP5NPyL4rpBaTY4TTSK6ebdm3IKzjOW4/fl1/gf8jNI0CFONv1ZAQ6MRL9U2ZWYU UXwpv0GtvVqUSi6bo+PTnyrsw3rBxdzlIeUN56TcHSzAcI8/JACyMoOFZKlR21qr9CWbBw DLNfInirpQkuQWrp2HxxBSe348BaqfKeAmrAR7lsfOa7GuI4O5PEoRKyGUaFg7oZSAaojY Yimuf9zNWA9671E5WcR63gf9B67Omsm6FxBVaE+cUNxqPf5xG+m6RbTmnc/Ul2nbGTkINk ZmBkk9pPsdUKrxhdLg0t2xJoFs+dAOn+oSfz7OJ8SSGVBkXLspnvhvGpseTXJA== X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1793009479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nHzLAUsQ2YNWwS+va9j2/lpxa/j+AoQFACmUeHcREIM=; b=0xswxDpu5/IOM5iVsYwwwQMy22SacGvOOFA0XSPsWHkfgLHtx3JPsHUNmU8yP6meOoqWKy rI9FTW0uOhmGSvDg== X-Cc: Daniel Zahka <daniel.zahka@gmail.com>, Alexander Duyck <alexanderduyck@fb.com>, kernel-team@meta.com, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Paolo Abeni <pabeni@redhat.com>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Jesper Dangaard Brouer <hawk@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Stanislav Fomichev <sdf@fomichev.me>, Eric Dumazet <edumazet@kernel.org>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org 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 X-In-Reply-To: <20261020145038.4f7eb295@kernel.org>