From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Ahern <dsahern@kernel.org>,
Stephen Hemminger <stephen@networkplumber.org>,
Davide Caratti <dcaratti@redhat.com>,
Pedro Tammela <pctammela@mojatatu.com>,
Marcelo Leitner <mleitner@redhat.com>,
Phil Sutter <psutter@redhat.com>,
Hangbin Liu <liuhangbin@gmail.com>,
Andrea Claudi <aclaudi@redhat.com>
Subject: [PATCHv2 iproute2 2/2] tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum
Date: Thu, 16 Mar 2023 11:52:42 +0800 [thread overview]
Message-ID: <20230316035242.2321915-3-liuhangbin@gmail.com> (raw)
In-Reply-To: <20230316035242.2321915-1-liuhangbin@gmail.com>
We can't use TCA_EXT_WARN_MSG directly in tc action as it's using different
enum with filter. Let's use a new TCA_ROOT_EXT_WARN_MSG for tc action
specifically.
Fixes: 6035995665b7 ("tc: add new attr TCA_EXT_WARN_MSG")
Reviewed-by: Andrea Claudi <aclaudi@redhat.com>
Reported-and-tested-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
v2: rename TCA_ACT_EXT_ to TCA_ROOT_EXT_
---
include/uapi/linux/rtnetlink.h | 1 +
tc/m_action.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 217b25b9..2132e941 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -787,6 +787,7 @@ enum {
TCA_ROOT_FLAGS,
TCA_ROOT_COUNT,
TCA_ROOT_TIME_DELTA, /* in msecs */
+ TCA_ROOT_EXT_WARN_MSG,
__TCA_ROOT_MAX,
#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
};
diff --git a/tc/m_action.c b/tc/m_action.c
index 0400132c..a446cabd 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -586,7 +586,13 @@ int print_action(struct nlmsghdr *n, void *arg)
open_json_object(NULL);
tc_dump_action(fp, tb[TCA_ACT_TAB], tot_acts ? *tot_acts:0, false);
- print_ext_msg(tb);
+
+ if (tb[TCA_ROOT_EXT_WARN_MSG]) {
+ print_string(PRINT_ANY, "warn", "%s",
+ rta_getattr_str(tb[TCA_ROOT_EXT_WARN_MSG]));
+ print_nl();
+ }
+
close_json_object();
return 0;
--
2.38.1
next prev parent reply other threads:[~2023-03-16 3:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 3:52 [PATCHv2 iproute2 0/2] tc: fix parsing of TCA_EXT_WARN_MSG Hangbin Liu
2023-03-16 3:52 ` [PATCHv2 iproute2 1/2] Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG" Hangbin Liu
2023-03-16 3:52 ` Hangbin Liu [this message]
2023-03-19 2:26 ` [PATCHv2 iproute2 2/2] tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum Stephen Hemminger
2023-03-20 9:18 ` Hangbin Liu
2023-03-16 15:18 ` [PATCHv2 iproute2 0/2] tc: fix parsing of TCA_EXT_WARN_MSG Andrea Claudi
2023-03-19 2:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230316035242.2321915-3-liuhangbin@gmail.com \
--to=liuhangbin@gmail.com \
--cc=aclaudi@redhat.com \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=mleitner@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pctammela@mojatatu.com \
--cc=psutter@redhat.com \
--cc=stephen@networkplumber.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.