Skip to content

Commit 85578fe

Browse files
committed
Merge branch 'net-sched-fix-parsing-of-tca_ext_warn_msg-for-tc-action'
Hangbin Liu says: ==================== net/sched: fix parsing of TCA_EXT_WARN_MSG for tc action In my previous commit 0349b87 ("sched: add new attr TCA_EXT_WARN_MSG to report tc extact message") I didn't notice the tc action use different enum with filter. So we can't use TCA_EXT_WARN_MSG directly for tc action. Let's rever the previous fix 923b2e3 ("net/sched: act_api: move TCA_EXT_WARN_MSG to the correct hierarchy") and add a new TCA_ROOT_EXT_WARN_MSG for tc action specifically. Here is the tdc test result: 1..1119 ok 1 d959 - Add cBPF action with valid bytecode ok 2 f84a - Add cBPF action with invalid bytecode ok 3 e939 - Add eBPF action with valid object-file ok 4 282d - Add eBPF action with invalid object-file ok 5 d819 - Replace cBPF bytecode and action control ok 6 6ae3 - Delete cBPF action ok 7 3e0d - List cBPF actions ok 8 55ce - Flush BPF actions ok 9 ccc3 - Add cBPF action with duplicate index ok 10 89c7 - Add cBPF action with invalid index [...] ok 1115 2348 - Show TBF class ok 1116 84a0 - Create TEQL with default setting ok 1117 7734 - Create TEQL with multiple device ok 1118 34a9 - Delete TEQL with valid handle ok 1119 6289 - Show TEQL stats ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 5ae0632 + 2f59823 commit 85578fe

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/uapi/linux/rtnetlink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ enum {
789789
TCA_ROOT_FLAGS,
790790
TCA_ROOT_COUNT,
791791
TCA_ROOT_TIME_DELTA, /* in msecs */
792+
TCA_ROOT_EXT_WARN_MSG,
792793
__TCA_ROOT_MAX,
793794
#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
794795
};

net/sched/act_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,17 +1589,17 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
15891589
t->tca__pad1 = 0;
15901590
t->tca__pad2 = 0;
15911591

1592+
if (extack && extack->_msg &&
1593+
nla_put_string(skb, TCA_ROOT_EXT_WARN_MSG, extack->_msg))
1594+
goto out_nlmsg_trim;
1595+
15921596
nest = nla_nest_start_noflag(skb, TCA_ACT_TAB);
15931597
if (!nest)
15941598
goto out_nlmsg_trim;
15951599

15961600
if (tcf_action_dump(skb, actions, bind, ref, false) < 0)
15971601
goto out_nlmsg_trim;
15981602

1599-
if (extack && extack->_msg &&
1600-
nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg))
1601-
goto out_nlmsg_trim;
1602-
16031603
nla_nest_end(skb, nest);
16041604

16051605
nlh->nlmsg_len = skb_tail_pointer(skb) - b;

0 commit comments

Comments
 (0)