From patchwork Thu Mar 16 03:52:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13176976 X-Patchwork-Delegate: stephen@networkplumber.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9AA6C6FD1F for ; Thu, 16 Mar 2023 03:53:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229597AbjCPDxH (ORCPT ); Wed, 15 Mar 2023 23:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjCPDxF (ORCPT ); Wed, 15 Mar 2023 23:53:05 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6419A2F790 for ; Wed, 15 Mar 2023 20:53:04 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id f6-20020a17090ac28600b0023b9bf9eb63so290649pjt.5 for ; Wed, 15 Mar 2023 20:53:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678938783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sy3GnLeg1f9ESa+bJT9WD8iP0VWI4Mmd6mvhOwvaHOU=; b=I5+PHHtrao2GTvR8MVY7smlGBkz+aklLyCZmRXBfgiUAOzoBGMGZyoNjLx7PHQntJY DMcOwsXUEwknybu8nzv6VOaTwFA8J8ZlqiYRlwTaKfwfYJ5oreh3v0cy+6OKu1nwyMRk TzSW2sG/9qM31lAzJ4TmskPteHmWp5nFjZqSDkcmXPf7/5Y9nYSsjEk/LMZ/mmf+yYO9 gsLMs0OjunyggJzjm/iz2YwKPXsQN680kZSnsuBDIzcE+PwvXzUzhngEwHXf1hhD8+X6 ohZBUC6Wtvmef8OxpjHozZsJrSqmwSXROY6KIardjjC/wPQmsrhHcZu/ShISf/0kYFA/ l1Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678938783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sy3GnLeg1f9ESa+bJT9WD8iP0VWI4Mmd6mvhOwvaHOU=; b=RY1Lel+f9E43CKOIjtFkPenoG1w4MYZTmDyIpuCbHMR9bTO3cHYO7TdVxd43m8cSMH NsVjzsKAUHPaAtaVwJ5PywUhu8VPZzLqMfbpC0WJLRVcRmBPPy2euzRVGlWY0Oo9QdIQ tqk/zTNiAtZF9UL4u0MyYKzok4GgUPbhXb8Wke2ICuVvpNOy9qp19l/5w4tMEgUwYqiP dbxOM4vMhRTqK98TgtjkWUwdpwYxIPRJPTteTuALnvKzX+TpzAcZroib4rRRPdYzixp6 BYsai1em+h7yVI0EmwjTnF/4+LQbASfB6Vp6EIRy9fomFhNIRyTLRt0kneP81KsACO/+ fDMQ== X-Gm-Message-State: AO0yUKXUo76px+7kUcfTsJJBZnokZwGeIN/Xz30/9Mqe/ImNQIJVo195 qfaFluuoml7+BSNBdvruvAg1XN1JYq4XP3Kd X-Google-Smtp-Source: AK7set+aY3gAxfkqYUL/+Nl35c7D9eFOEiLtTSZE4mls0w75pM6Yi6/ZZDRag8jgL1nXx4efo7L59A== X-Received: by 2002:a17:903:41cb:b0:1a0:69e6:bb32 with SMTP id u11-20020a17090341cb00b001a069e6bb32mr2025414ple.54.1678938783324; Wed, 15 Mar 2023 20:53:03 -0700 (PDT) Received: from Laptop-X1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id kb14-20020a170903338e00b001990028c0c9sm4393923plb.68.2023.03.15.20.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 20:53:02 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Stephen Hemminger , Davide Caratti , Pedro Tammela , Marcelo Leitner , Phil Sutter , Hangbin Liu , Andrea Claudi Subject: [PATCHv2 iproute2 1/2] Revert "tc: m_action: fix parsing of TCA_EXT_WARN_MSG" Date: Thu, 16 Mar 2023 11:52:41 +0800 Message-Id: <20230316035242.2321915-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230316035242.2321915-1-liuhangbin@gmail.com> References: <20230316035242.2321915-1-liuhangbin@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com 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. Reviewed-by: Andrea Claudi Signed-off-by: Hangbin Liu --- tc/m_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_action.c b/tc/m_action.c index 6c91af2c..0400132c 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -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; From patchwork Thu Mar 16 03:52:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13176977 X-Patchwork-Delegate: stephen@networkplumber.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36EDFC6FD1F for ; Thu, 16 Mar 2023 03:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbjCPDxP (ORCPT ); Wed, 15 Mar 2023 23:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjCPDxL (ORCPT ); Wed, 15 Mar 2023 23:53:11 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC9754DE1B for ; Wed, 15 Mar 2023 20:53:09 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id om3-20020a17090b3a8300b0023efab0e3bfso3891779pjb.3 for ; Wed, 15 Mar 2023 20:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678938789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sU26Dg4ggrvhrzGmTqPw5WDInv7gXZb5PSIjlbyR27g=; b=fmW9r8tmcSypD9sAFMAMtB5IKkRJJSVevb+huYTGs6MOVX5/ZM7JoAAtAayoQGgm0I IdVpQU+y4aaSEQZyhlHsT/je5Lf2VmRviyoi6ZpxEd1K46tN+X2ZNphD71DhApoTJ+BO CM4uMNfhQE6r0+p1rL6HZ/3In5zcxsz2p3P5N0ThCRMcNaQ8JbbFQs943u7JyFnqxehT NQw8TDNOyGGU9iDILWXojyJOr1Q15A7ARBZz+TH/C6gJ1Dz+pC1WvXqOCZnVH28PqZ7K uiPzXMv/prCp2wR4sQbDKZA7YAPAn8AymRW8+r5VzgqOsWiJDVOwmLCvKUwFNUx4TYGi VQ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678938789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sU26Dg4ggrvhrzGmTqPw5WDInv7gXZb5PSIjlbyR27g=; b=oMg0vgMcYIItHqxNW+An5AnfmPdrl2j4F10cZHpYHPrTgO84hPeXlalyBHzH7s+7Q5 OElGMxpkFCrB/Nmo+Ln6eyR/yvFtaEiS0TJAoTwfAlFSLwJcNQ+yFGiddEnKxuRpL+6c tyrWDN2fNjtldEhveHGSD0Pr0NnCIzAvTyIlU5gbMORfdDArO7ZiDBND7AO2B/dzna4t hQKvZNfpwQAZ5Bst6Me98NoYYSr8ACdBzHO2KDc2dhIbng6FzmpDa4pb463+CoRi631U lb/hpn7EH2npFEiCNV9mpr3Yzm7sys649djlH4IbVCeiM4tMfS8SDzrd493XmNCabTKi YypA== X-Gm-Message-State: AO0yUKUELCVPJChyV+J42z4Fh2JD3pm3F2srzS5hTP5B4qdFD9vWREaB C8+4nU9EDe8Q4ElBIxeb+2rA0F1NMXkFDTAL X-Google-Smtp-Source: AK7set99E2g5WL/6wM7tBV8oqgRdwmXobbKT0ahYnVLWfgQPYvGMa4WrKn9x7lzGl1osgPanjzAPmg== X-Received: by 2002:a17:903:1c6:b0:19e:6659:90db with SMTP id e6-20020a17090301c600b0019e665990dbmr1759528plh.45.1678938788923; Wed, 15 Mar 2023 20:53:08 -0700 (PDT) Received: from Laptop-X1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id kb14-20020a170903338e00b001990028c0c9sm4393923plb.68.2023.03.15.20.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 20:53:08 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Stephen Hemminger , Davide Caratti , Pedro Tammela , Marcelo Leitner , Phil Sutter , Hangbin Liu , Andrea Claudi 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 Message-Id: <20230316035242.2321915-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230316035242.2321915-1-liuhangbin@gmail.com> References: <20230316035242.2321915-1-liuhangbin@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@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 Reported-and-tested-by: Davide Caratti Signed-off-by: Hangbin Liu --- 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;