From: Julius Bairaktaris <julius@bairaktaris.de>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org, fw@strlen.de, phil@nwl.cc,
coreteam@netfilter.org, netdev@vger.kernel.org,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, andrew+netdev@lunn.ch,
shuah@kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, nbd@nbd.name
Subject: [PATCH nf-next 0/3] netfilter: flowtable: update upper device stats in the fast path
Date: Sun, 4 Oct 2026 19:16:13 +0200 [thread overview]
Message-ID: <20261004171616.3544880-1-julius@bairaktaris.de> (raw)
With the software flowtable, packets bypass the bridge, VLAN, PPPoE and
tunnel devices above the flowtable device, so their counters only see
the first packets of each connection. The classic forwarding path
always counts them, so this series does too, without a flag.
Patch 1 adds VLAN stats helpers; it touches include/linux/if_vlan.h, so
a netdev ack would let it go through nf-next. Patch 2 updates the
counters from the fast path with the lengths the classic path counts.
Patch 3 adds bridge, VLAN and tunnel counter checks to nft_flowtable.sh,
which fail without patches 1 and 2.
Hardware offloaded flows are not counted. A GSO packet sent through a
PPPoE device counts once, not once per segment.
Cost: struct flow_offload grows from 296 to 328 bytes (slab object 320
to 384). Forwarding from a bridge with a VLAN port to a veth in an x86
guest, mean of three interleaved runs without/with the series: TCP
55.7/55.0 Gbit/s, 64 byte UDP 177/173 kpps.
This series was written with the help of an AI coding assistant. I have
reviewed and tested it.
Julius Bairaktaris (3):
8021q: add vlan_dev_sw_netstats_rx_add() and
vlan_dev_sw_netstats_tx_add()
netfilter: flowtable: update upper device stats in the fast path
selftests: netfilter: nft_flowtable.sh: check upper device counters
include/linux/if_vlan.h | 36 ++++++++++
include/net/netfilter/nf_flow_table.h | 8 ++-
net/netfilter/nf_flow_table_core.c | 3 +
net/netfilter/nf_flow_table_ip.c | 53 +++++++++++++++
net/netfilter/nf_flow_table_path.c | 9 +++
.../selftests/net/netfilter/nft_flowtable.sh | 67 +++++++++++++++++++
6 files changed, 175 insertions(+), 1 deletion(-)
base-commit: 87b80c2f6b05cad9f0ff9136709c62a0f59923e3
--
2.53.0
next reply other threads:[~2026-10-04 17:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 17:16 Julius Bairaktaris [this message]
2026-10-04 17:16 ` [PATCH nf-next 1/3] 8021q: add vlan_dev_sw_netstats_rx_add() and vlan_dev_sw_netstats_tx_add() Julius Bairaktaris
2026-10-04 17:16 ` [PATCH nf-next 2/3] netfilter: flowtable: update upper device stats in the fast path Julius Bairaktaris
2026-10-04 17:16 ` [PATCH nf-next 3/3] selftests: netfilter: nft_flowtable.sh: check upper device counters Julius Bairaktaris
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=20261004171616.3544880-1-julius@bairaktaris.de \
--to=julius@bairaktaris.de \
--cc=andrew+netdev@lunn.ch \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=shuah@kernel.org \
/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