Skip to content

Commit bca3821

Browse files
idoschdavem330
authored andcommitted
net/sched: act_mpls: Add extack messages for offload failure
For better error reporting to user space, add extack messages when mpls 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 mpls dec_ttl 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. 18.693915: netlink_extack: msg=act_mpls: Offload not supported when "dec_ttl" option is used tc-182 [000] ..... 18.693921: netlink_extack: msg=cls_matchall: Failed to setup flow action Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4dcaa50 commit bca3821

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/sched/act_mpls.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,14 @@ static int tcf_mpls_offload_act_setup(struct tc_action *act, void *entry_data,
411411
entry->mpls_mangle.bos = tcf_mpls_bos(act);
412412
entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
413413
break;
414+
case TCA_MPLS_ACT_DEC_TTL:
415+
NL_SET_ERR_MSG_MOD(extack, "Offload not supported when \"dec_ttl\" option is used");
416+
return -EOPNOTSUPP;
417+
case TCA_MPLS_ACT_MAC_PUSH:
418+
NL_SET_ERR_MSG_MOD(extack, "Offload not supported when \"mac_push\" option is used");
419+
return -EOPNOTSUPP;
414420
default:
421+
NL_SET_ERR_MSG_MOD(extack, "Unsupported MPLS mode offload");
415422
return -EOPNOTSUPP;
416423
}
417424
*index_inc = 1;

0 commit comments

Comments
 (0)