OSDN Git Service

net/sched: act_police: Add extack messages for offload failure
authorIdo Schimmel <idosch@nvidia.com>
Thu, 7 Apr 2022 07:35:27 +0000 (10:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Apr 2022 12:45:43 +0000 (13:45 +0100)
commitb50e462bc22df4488ec04d85606646e3db5952b8
tree3e3c6063f3bd4daa7721d1b2976bb6bc2f41e71c
parentbf3b99e4f9ce52e8da6158894be5679d1217082b
net/sched: act_police: Add extack messages for offload failure

For better error reporting to user space, add extack messages when
police action offload fails.

Example:

 # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable

 # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action police rate 100Mbit burst 10000
 Error: cls_matchall: Failed to setup flow action.
 We have an error talking to the kernel

 # cat /sys/kernel/tracing/trace_pipe
       tc-182     [000] b..1.    21.592969: netlink_extack: msg=act_police: Offload not supported when conform/exceed action is "reclassify"
       tc-182     [000] .....    21.592982: netlink_extack: msg=cls_matchall: Failed to setup flow action

 # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action police rate 100Mbit burst 10000 conform-exceed drop/continue
 Error: cls_matchall: Failed to setup flow action.
 We have an error talking to the kernel

 # cat /sys/kernel/tracing/trace_pipe
       tc-184     [000] b..1.    38.882579: netlink_extack: msg=act_police: Offload not supported when conform/exceed action is "continue"
       tc-184     [000] .....    38.882593: netlink_extack: msg=cls_matchall: Failed to setup flow action

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_police.c