Skip to contentSkip to conversation

tc: fix parsing of TCA_EXT_WARN_MSG

PATCH In review Hangbin Liu 4 participants 7 messages Mar 16, 2023 – Mar 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover tc: fix parsing of TCA_EXT_WARN_MSG

The TCA_EXT_WARN_MSG enum belongs to __TCA_MAX namespace. We can't use it in tc action as it use TCA_ROOT_MAX enum. Fix it by adding a new TCA_ROOT_EXT_WARN_MSG enum.

Hangbin Liu (2):
Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG"
tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum

 include/uapi/linux/rtnetlink.h | 1 +
 tc/m_action.c                  | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.38.1
#1 lore raw

PATCH v2 1/2 Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG"

This reverts commit 70b9ebae63ce7e6f9911bdfbcf47a6d18f24159a.

The TCA_EXT_WARN_MSG is not sit within the TCA_ACT_TAB hierarchy. It's belong to the TCA_MAX namespace. I will fix the issue in another patch.

---
 tc/m_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tc/m_action.c +1 -1
index 6c91af2c..0400132c 100644
@@ -586,7 +586,7 @@ 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[TCA_ACT_TAB]);
+	print_ext_msg(tb);
 	close_json_object();
 
 	return 0;
Signature · 1 line
2.38.1
#2 lore raw

PATCH v2 2/2 tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum

In reply to Hangbin Liu

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")

---
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(-)
include/uapi/linux/rtnetlink.h +1 -0
index 217b25b9..2132e941 100644
@@ -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)
 };
tc/m_action.c +7 -1
index 0400132c..a446cabd 100644
@@ -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;
Signature · 1 line
2.38.1
#3 lore raw

Re: [PATCHv2 iproute2 2/2] tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum

Quoted 9 lines · On Thu, 16 Mar 2023 11:52:42 +0800 Hangbin Liu <[email protected]> wrote:

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")

---

Applied but all headers files get done separately by a script that uses sanitized kernel headers.

#4 lore raw

Re: [PATCHv2 iproute2 2/2] tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum

Quoted 2 lines · Stephen Hemminger

Applied but all headers files get done separately by a script that uses sanitized kernel headers.

Got it, I will drop the header file changes in future.

Thanks
Hangbin

Reviewed-by on the v2 series
#5 lore raw
In reply to Hangbin Liu
Quoted 4 lines · Hangbin Liu

The TCA_EXT_WARN_MSG enum belongs to __TCA_MAX namespace. We can't use it in tc action as it use TCA_ROOT_MAX enum. Fix it by adding a new TCA_ROOT_EXT_WARN_MSG enum.

Quoted 11 lines

Hangbin Liu (2):
Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG"
tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum

 include/uapi/linux/rtnetlink.h | 1 +
 tc/m_action.c                  | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.38.1
#6 lore raw
In reply to Hangbin Liu
This series was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This series was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 9 lines · On Thu, 16 Mar 2023 11:52:40 +0800 you wrote:

The TCA_EXT_WARN_MSG enum belongs to __TCA_MAX namespace. We can't use it in tc action as it use TCA_ROOT_MAX enum. Fix it by adding a new TCA_ROOT_EXT_WARN_MSG enum.

Hangbin Liu (2):
Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG"
tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum

[...]

Here is the summary with links:
- [PATCHv2,iproute2,1/2] Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG"

    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=0012881f3499

- [PATCHv2,iproute2,2/2] tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum (no matching commit)

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html