🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4153

Re: [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring

#4153
From: Sebastian Andrzej Siewior
Date: Fri, 16 Oct 2026 22:09
25 lines
7853 bytes
On 2026-10-12 05:04:34 [-0700], Daniel Zahka wrote:
> Keep packet, byte and drop counters on each Tx work, Tx completion, and
> Rx completion queue. Report them to the core via the rtnl_link_stats64
> interface.
> 
> Rx completion queues also count errors. Frames the device marked with an
> uncorrectable error are counted as errors, and frames that fail for any
> other reason are counted as drops.
> 
> All packets cleaned from the TWQ during mpnic_flush() are counted as
> drops, though completions for some of them may have been DMA'd into
> the completion ring between the time mpnic_poll() last ran and before
> mpnic_wait_all_queues_idle() returns. This is done for code simplicity.
> 
> An RCU approach is used because ndo_get_stats64 is not called with the
> instance lock.

Why do you have the two mpnic_base_stats and fold the stats into into
it? My guess would be that on stop the counters are reset and you want
to preserve the stats.

> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>

Sebastian
Technical Details
Message-ID: <20261016220930.i32JEcqe@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-347557-linux-kernel-netdev=dewy.ru
References: <20261012-mpnic-counters3-v2-0-8afba81c2d5a@gmail.com> <20261012-mpnic-counters3-v2-1-8afba81c2d5a@gmail.com>

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-347557-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: Sat, 17 Oct 2026 00:09:30 +0200
Organization: Usenet Network
Message-ID: <20261016220930.i32JEcqe@linutronix.de>
References: <20261012-mpnic-counters3-v2-0-8afba81c2d5a@gmail.com>
 <20261012-mpnic-counters3-v2-1-8afba81c2d5a@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="2898701"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kh8f4CBf9hg6HNY2+vW5gV4a+60= sha256:GHUyQXWgh5mlswt7Hl3nBnlPiw4ib9GaS/LIJqxUMz4=
	sha1:0Z1KKmg5nDJPHF2D6uctmqmWdow= sha256:EjM03cW2nJ0+r0aL0B+woxuF7P5GKU9Mqa17AGhCECM=
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 659EC11060B; Sat, 17 Oct 2026 01:10:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, 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=uqXedRqQ; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=nVby1LuX
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 eYD47G8Qf09A;
	Sat, 17 Oct 2026 01:09:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-347557-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 309CE110611; Sat, 17 Oct 2026 01:09:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id E07B342A31; Fri, 16 Oct 2026 22:09:36 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 249AD3BCD26;
	Fri, 16 Oct 2026 22:09:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uqXedRqQ";
	dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nVby1LuX"
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD6C81F78E6;
	Fri, 16 Oct 2026 22:09:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792188576; cv=none; b=PqyPY8FfBzM8VwZSFGMUAz/RvOBW45natVHIHosejgDQ2mTknrbnn53qCseZZ97F5V/pLwlgg1GfolMa7LRX7PnbX3jfn7qJqcOLN+N2GsdY1KwG2gRdciT8obrP9MVzDh2u88p7qMVQxp5A76nJkwK0n+y86NNbSUtWVQxrTyw=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792188576; c=relaxed/simple;
	bh=GLwbzJas5PXKArHxep2FQ/KdeesZycyGODfzWDZ5zOs=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=eTLCsnN7SOSiZha7tL5pSfK73WW6eXLDGm7atV6PO+g33p833RDmdul9phYHTT8xbbCmTnSvMwJzVKJ1If4MnYNy+9MHdj/M4I1DFJmjfmkXHGu/04prBmys912272qAKM11b+kITmItIIq+27jmzRDD7dkJJQC7UgIQ3dXBmug=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uqXedRqQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nVby1LuX; arc=none smtp.client-ip=193.142.43.55
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=1792188571;
	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=H/2ADdDbuj4BQqbOm4loAw0ifhUty9QJDOLv9sli7hE=;
	b=uqXedRqQ7v+qOd01Fzv6lYfprhhQ+l59Try2TtMDKRs3mkIZIgzMOtxiB1YyePzkIVHgob
	pay/ewdXZ4JwwDOCAdUa1WuV6vBFZUabo1qyqkhnsBcKhhjv2PbrIsDO4zbVw9W7lT/bWJ
	CE0iwC1elZmO+j16+oxI8u5NQzbigRAAm940ZcYswKsYhUGJAh7clLBXIC/52YJzvOaLs/
	XpdZNiWk9guUdIDZ5DAXqx81uspDrCio1qBxzqxOpz4m+4ZpGY+Blz9OmsV0lyoiZ9Ho0d
	NUmAENPWxHqeMZdmfIiAdq0dAiAlVTIGdG8FvdA78o6yaxjU2SZA/xxVnFhn8Q==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1792188571;
	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=H/2ADdDbuj4BQqbOm4loAw0ifhUty9QJDOLv9sli7hE=;
	b=nVby1LuXwCCsFlqV/iLSSj3/Jnz6IDAHVCzBax6B3X+/P7ufsmH7vr8ikS2vICfZj81NxU
	s9qvsNLH+ChzqTCg==
X-Cc: Alexander Duyck <alexanderduyck@fb.com>,
	Jakub Kicinski <kuba@kernel.org>, 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-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261012-mpnic-counters3-v2-1-8afba81c2d5a@gmail.com>