diff options
author | Ido Schimmel <idosch@nvidia.com> | 2022-04-07 10:35:28 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-08 13:45:43 +0100 |
commit | a9c64939b669b3c83cc54738d1986430e6beaff2 (patch) | |
tree | b4dfff581214c52585d6b52a2b9f0535b158a173 /net/sched/act_skbedit.c | |
parent | b50e462bc22df4488ec04d85606646e3db5952b8 (diff) | |
download | linux-a9c64939b669b3c83cc54738d1986430e6beaff2.tar.gz linux-a9c64939b669b3c83cc54738d1986430e6beaff2.tar.bz2 linux-a9c64939b669b3c83cc54738d1986430e6beaff2.zip |
net/sched: act_skbedit: Add extack messages for offload failure
For better error reporting to user space, add extack messages when
skbedit 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 skbedit queue_mapping 1234
Error: cls_matchall: Failed to setup flow action.
We have an error talking to the kernel
# cat /sys/kernel/tracing/trace_pipe
tc-185 [002] b..1. 31.802414: netlink_extack: msg=act_skbedit: Offload not supported when "queue_mapping" option is used
tc-185 [002] ..... 31.802418: netlink_extack: msg=cls_matchall: Failed to setup flow action
# tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action skbedit inheritdsfield
Error: cls_matchall: Failed to setup flow action.
We have an error talking to the kernel
# cat /sys/kernel/tracing/trace_pipe
tc-187 [002] b..1. 45.985145: netlink_extack: msg=act_skbedit: Offload not supported when "inheritdsfield" option is used
tc-187 [002] ..... 45.985160: 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>
Diffstat (limited to 'net/sched/act_skbedit.c')
-rw-r--r-- | net/sched/act_skbedit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 8cd8e506c9c9..92d0dc754207 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c @@ -343,7 +343,14 @@ static int tcf_skbedit_offload_act_setup(struct tc_action *act, void *entry_data } else if (is_tcf_skbedit_priority(act)) { entry->id = FLOW_ACTION_PRIORITY; entry->priority = tcf_skbedit_priority(act); + } else if (is_tcf_skbedit_queue_mapping(act)) { + NL_SET_ERR_MSG_MOD(extack, "Offload not supported when \"queue_mapping\" option is used"); + return -EOPNOTSUPP; + } else if (is_tcf_skbedit_inheritdsfield(act)) { + NL_SET_ERR_MSG_MOD(extack, "Offload not supported when \"inheritdsfield\" option is used"); + return -EOPNOTSUPP; } else { + NL_SET_ERR_MSG_MOD(extack, "Unsupported skbedit option offload"); return -EOPNOTSUPP; } *index_inc = 1; |