[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM0EoM=mcejihaG5KthJyXqjPiPiTWvhgLFNqZCthE8VJ23Q9w@mail.gmail.com>
Date: Tue, 14 Mar 2023 18:35:29 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
David Ahern <dsahern@...nel.org>,
Stephen Hemminger <stephen@...workplumber.org>,
Davide Caratti <dcaratti@...hat.com>,
Pedro Tammela <pctammela@...atatu.com>,
Marcelo Leitner <mleitner@...hat.com>,
Phil Sutter <psutter@...hat.com>
Subject: Re: [PATCH net 2/2] net/sched: act_api: add specific EXT_WARN_MSG for
tc action
On Tue, Mar 14, 2023 at 2:58 AM Hangbin Liu <liuhangbin@...il.com> wrote:
>
> 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_ACT_EXT_WARN_MSG for tc action specifically and put this
> param before going to the TCA_ACT_TAB nest.
>
> Fixes: 0349b8779cc9 ("sched: add new attr TCA_EXT_WARN_MSG to report tc extact message")
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> ---
> include/uapi/linux/rtnetlink.h | 1 +
> net/sched/act_api.c | 8 ++++----
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
> index 25a0af57dd5e..5ad3448a1fa7 100644
> --- a/include/uapi/linux/rtnetlink.h
> +++ b/include/uapi/linux/rtnetlink.h
> @@ -789,6 +789,7 @@ enum {
> TCA_ROOT_FLAGS,
> TCA_ROOT_COUNT,
> TCA_ROOT_TIME_DELTA, /* in msecs */
> + TCA_ACT_EXT_WARN_MSG,
> __TCA_ROOT_MAX,
> #define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
> };
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index fce522886099..f960cb534ca0 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -1589,6 +1589,10 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
> t->tca__pad1 = 0;
> t->tca__pad2 = 0;
>
> + if (extack && extack->_msg &&
> + nla_put_string(skb, TCA_ACT_EXT_WARN_MSG, extack->_msg))
> + goto out_nlmsg_trim;
> +
> nest = nla_nest_start_noflag(skb, TCA_ACT_TAB);
> if (!nest)
> goto out_nlmsg_trim;
> @@ -1598,10 +1602,6 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
>
> nla_nest_end(skb, nest);
>
> - if (extack && extack->_msg &&
> - nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg))
> - goto out_nlmsg_trim;
> -
> nlh->nlmsg_len = skb_tail_pointer(skb) - b;
>
> return skb->len;
Sorry, only thing i should have mentioned earlier - not clear from here:
Do you get two ext warns now in the same netlink message? One for the
action and one for the cls?
Something to check:
on terminal1 > tc monitor
on terminal2 > run a command which will get the offload to fail and
see what response you get
My concern is you may be getting two warnings in one message.
cheers,
jamal
> --
> 2.38.1
>
Powered by blists - more mailing lists