net: airoha: Add matchall filter offload support
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 15 Apr 2025 07:14:34 +0000 (09:14 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 17 Apr 2025 08:31:57 +0000 (10:31 +0200)
commitdf8398fb7bb7a0e509200af56b79343aa133b7d6
tree723d7714d1659752b498a0d78d246e61e598e0cd
parent4e34a840613bee487a69b32483a11da94356fc2b
net: airoha: Add matchall filter offload support

Introduce tc matchall filter offload support in airoha_eth driver.
Matchall hw filter is used to implement hw rate policing via tc action
police:

$tc qdisc add dev eth0 handle ffff: ingress
$tc filter add dev eth0 parent ffff: matchall action police \
 rate 100mbit burst 1000k drop

The current implementation supports just drop/accept as exceed/notexceed
actions. Moreover, rate and burst are the only supported configuration
parameters.

Reviewed-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250415-airoha-hw-rx-ratelimit-v4-1-03458784fbc3@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/airoha/airoha_eth.c
drivers/net/ethernet/airoha/airoha_eth.h
drivers/net/ethernet/airoha/airoha_ppe.c
drivers/net/ethernet/airoha/airoha_regs.h