History

net/sched: act_api: add specific EXT_WARN_MSG for tc action

In my previous commit 0349b8779cc9 ("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.

Hangbin Liu committed 3 years ago

Commit 2f598231 parent 8de2bd02 files · +5 −4Browse files

Unified · Split

2 files
  1. include/uapi/linux/rtnetlink.h +1 −0
  2. net/sched/act_api.c +4 −4
include/uapi/linux/rtnetlink.h+1−0
@@ -789,6 +789,7 @@ enum { · 788 unmodified lines
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+4−4
@@ -1589,6 +1589,10 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[], · 1588 unmodified lines
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[], · 3 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t