From: Jakub Kicinski <kuba@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
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>,
Paolo Abeni <pabeni@redhat.com>,
Voon Weifeng <weifeng.voon@intel.com>,
Vladimir Oltean <olteanv@gmail.com>,
Kurt Kanzenbach <kurt@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 net-next 7/7] net/sched: taprio: replace safety precautions with comments
Date: Tue, 20 Sep 2022 17:26:08 -0700 [thread overview]
Message-ID: <20220920172608.5cf6bac1@kernel.org> (raw)
In-Reply-To: <20220921001625.jwpr5r5tneyoxect@skbuf>
On Wed, 21 Sep 2022 00:16:26 +0000 Vladimir Oltean wrote:
> On Tue, Sep 20, 2022 at 02:01:19PM -0700, Jakub Kicinski wrote:
> > Another option is DEBUG_NET_WARN_ON_ONCE() FWIW, you probably know..
>
> Just for replacing WARN_ON_ONCE(), yes, maybe, but when you factor in
> that the code also had calls to qdisc_drop(), I suppose you meant
> replacing it with something like this?
>
> if (DEBUG_NET_WARN_ON_ONCE(unlikely(FULL_OFFLOAD_IS_ENABLED(q->flags))))
> return qdisc_drop(skb, sch, to_free);
>
> This won't work because DEBUG_NET_WARN_ON_ONCE() force-casts WARN_ON_ONCE()
> to void, discarding its evaluated value.
>
> We'd be left with something custom like below:
>
> if (IS_ENABLED(CONFIG_DEBUG_NET) && unlikely(FULL_OFFLOAD_IS_ENABLED(q->flags))) {
> WARN_ONCE(1, "Trying to enqueue skb into the root of a taprio qdisc configured with full offload\n");
> return qdisc_drop(skb, sch, to_free);
> }
>
> which may work, but it's so odd looking that it's just not worth the
> trouble, I feel?
I meant as a way of retaining the sanity check, a bare:
DEBUG_NET_WARN_ON_ONCE(FULL_OFFLOAD_IS_ENABLED(q->flags));
no other handling. Not sure how much sense it makes here,
it's best suited as syzbot fodder, perhaps the combination
with offload is pointless.
next prev parent reply other threads:[~2022-09-21 0:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 10:50 [PATCH v2 net-next 0/7] Small tc-taprio improvements Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 1/7] net/sched: taprio: taprio_offload_config_changed() is protected by rtnl_mutex Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 2/7] net/sched: taprio: taprio_dump and taprio_change are " Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 3/7] net/sched: taprio: use rtnl_dereference for oper and admin sched in taprio_destroy() Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 4/7] net/sched: taprio: remove redundant FULL_OFFLOAD_IS_ENABLED check in taprio_enqueue Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 5/7] net/sched: taprio: stop going through private ops for dequeue and peek Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 6/7] net/sched: taprio: add extack messages in taprio_init Vladimir Oltean
2022-09-15 10:50 ` [PATCH v2 net-next 7/7] net/sched: taprio: replace safety precautions with comments Vladimir Oltean
2022-09-20 21:01 ` Jakub Kicinski
2022-09-21 0:16 ` Vladimir Oltean
2022-09-21 0:26 ` Jakub Kicinski [this message]
2022-09-20 21:10 ` [PATCH v2 net-next 0/7] Small tc-taprio improvements 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=20220920172608.5cf6bac1@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kurt@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vinicius.gomes@intel.com \
--cc=vladimir.oltean@nxp.com \
--cc=weifeng.voon@intel.com \
--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.