tc: fix parsing of TCA_EXT_WARN_MSG
Subsystems (2)
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
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
@@ -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
PATCH v2 2/2 tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum
In reply to Hangbin LiuWe 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.
---
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
@@ -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
@@ -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
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_MSGdirectly in tc action as it's using different enum with filter. Let's use a newTCA_ROOT_EXT_WARN_MSGfor tc action specifically.Fixes 6035995665b7 ("tc: add new attr TCA_EXT_WARN_MSG")Reviewed-by Andrea Claudi <[email protected]>Reported-and-tested-by Davide Caratti <[email protected]>Signed-off-by Hangbin Liu <[email protected]>---
Applied but all headers files get done separately by a script that uses sanitized kernel headers.
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
Quoted 4 lines · Hangbin Liu
The
TCA_EXT_WARN_MSGenum belongs to__TCA_MAXnamespace. We can't use it in tc action as it useTCA_ROOT_MAXenum. Fix it by adding a newTCA_ROOT_EXT_WARN_MSGenum.
Quoted 11 lines
Hangbin Liu (2):
Revert "tc:m_action: fix parsing ofTCA_EXT_WARN_MSG"
tc:m_action: fix parsing ofTCA_EXT_WARN_MSGby using different enuminclude/uapi/linux/rtnetlink.h | 1 + tc/m_action.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-)Signature · 1 line
2.38.1
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_MSGenum belongs to__TCA_MAXnamespace. We can't use it in tc action as it useTCA_ROOT_MAXenum. Fix it by adding a newTCA_ROOT_EXT_WARN_MSGenum.Hangbin Liu (2):
Revert "tc:m_action: fix parsing ofTCA_EXT_WARN_MSG"
tc:m_action: fix parsing ofTCA_EXT_WARN_MSGby 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