]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dsa: eliminate local type for tc policers
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 6 Feb 2026 07:54:21 +0000 (15:54 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Feb 2026 14:30:11 +0000 (15:30 +0100)
commitc22ba07c827f2ac84573ac788383a8e1eafe21bc
treed6d90d795ec3d85b499aa7f1dc6c2e0275cf6b8f
parent86dbebfb9053cd8626ee7c0297e991ce4843bd3f
net: dsa: eliminate local type for tc policers

David Yang is saying that struct flow_action_entry in
include/net/flow_offload.h has gained new fields and DSA's struct
dsa_mall_policer_tc_entry, derived from that, isn't keeping up.
This structure is passed to drivers and they are completely oblivious to
the values of fields they don't see.

This has happened before, and almost always the solution was to make the
DSA layer thinner and use the upstream data structures. Here, the reason
why we didn't do that is because struct flow_action_entry :: police is
an anonymous structure.

That is easily enough fixable, just name those fields "struct
flow_action_police" and reference them from DSA.

Make the according transformations to the two users (sja1105 and felix):
"rate_bytes_per_sec" -> "rate_bytes_ps".

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Co-developed-by: David Yang <mmyangfl@gmail.com>
Signed-off-by: David Yang <mmyangfl@gmail.com>
Link: https://patch.msgid.link/20260206075427.44733-1-mmyangfl@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/sja1105/sja1105_main.c
include/net/dsa.h
include/net/flow_offload.h
net/dsa/user.c