Skip to content

RFC improve hw flow offload byte accounting

Daniel Golle linux-arm-kernel linux-mediatek lkml netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4net: flow_offload: let drivers report byte counter semanticsinclude/net/flow_offload.h+7 -00 replies
2/4nf_flow_table: track sub-interface and bridge ifindex in flow tupleinclude/net/netfilter/nf_flow_table.h net/netfilter/nf_flow_table_core.c net/netfilter/nf_flow_table_path.c+15 -00 replies
3/4nf_flow_table: convert hw byte counts and update sub-interface statsnet/netfilter/nf_flow_table_offload.c+172 -20 replies
4/4net: ethernet: mtk_eth_soc: report INGRESS_L2 byte_type in flow statsdrivers/net/ethernet/mediatek/mtk_ppe_offload.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC net-next 0/4] improve hw flow offload byte accounting

Hardware flow counters report raw byte counts whose semantics vary by vendor -- some count ingress L2 frames, others egress L2, others L3. The nf_flow_table framework currently passes these bytes straight to conntrack without conversion, and sub-interfaces (VLAN, PPPoE) that are bypassed by hw offload never see any counter updates at all.

This series lets drivers declare what their counters represent, so the framework can normalize to L3 for conntrack and propagate per-layer stats to encap sub-interfaces.

Questions:
- Sub-interface stats accesses vlan_dev_priv() directly -- should there be a generic netdev callback instead?
- Are there hw offload drivers whose counters do not fit the ingress-L2 / egress-L2 / L3 model?

Daniel Golle (4):
net: flow_offload: let drivers report byte counter semantics
nf_flow_table: track sub-interface and bridge ifindex in flow tuple
nf_flow_table: convert hw byte counts and update sub-interface stats
net: ethernet: mtk_eth_soc: report INGRESS_L2 byte_type in flow stats

 .../net/ethernet/mediatek/mtk_ppe_offload.c   |   1 +
 include/net/flow_offload.h                    |   7 +
 include/net/netfilter/nf_flow_table.h         |   5 +
 net/netfilter/nf_flow_table_core.c            |   2 +
 net/netfilter/nf_flow_table_offload.c         | 174 +++++++++++++++++-
 net/netfilter/nf_flow_table_path.c            |   8 +
 6 files changed, 195 insertions(+), 2 deletions(-)
Signature · 1 line
2.53.0