Skip to content

Commit 2f59823

Browse files
liuhangbinkuba-moo
authored andcommitted
net/sched: act_api: add specific 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 add a TCA_ROOT_EXT_WARN_MSG for tc action specifically and put this param before going to the TCA_ACT_TAB nest. Fixes: 0349b87 ("sched: add new attr TCA_EXT_WARN_MSG to report tc extact message") Signed-off-by: Hangbin Liu <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8de2bd0 commit 2f59823

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,6 +1589,10 @@ 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;
@@ -1598,10 +1602,6 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
15981602

15991603
nla_nest_end(skb, nest);
16001604

1601-
if (extack && extack->_msg &&
1602-
nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg))
1603-
goto out_nlmsg_trim;
1604-
16051605
nlh->nlmsg_len = skb_tail_pointer(skb) - b;
16061606

16071607
return skb->len;

0 commit comments

Comments
 (0)