[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220714213025.448faf8c@kernel.org>
Date: Thu, 14 Jul 2022 21:30:25 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Zhengchao Shao <shaozhengchao@...wei.com>
Cc: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <davem@...emloft.net>,
<edumazet@...gle.com>, <pabeni@...hat.com>, <hawk@...nel.org>,
<ast@...nel.org>, <daniel@...earbox.net>, <andrii@...nel.org>,
<martin.lau@...ux.dev>, <song@...nel.org>, <yhs@...com>,
<john.fastabend@...il.com>, <kpsingh@...nel.org>, <sdf@...gle.com>,
<bigeasy@...utronix.de>, <imagedong@...cent.com>,
<petrm@...dia.com>, <arnd@...db.de>, <dsahern@...nel.org>,
<talalahmad@...gle.com>, <keescook@...omium.org>,
<haoluo@...gle.com>, <jolsa@...nel.org>, <weiyongjun1@...wei.com>,
<yuehaibing@...wei.com>
Subject: Re: [PATCH v3,bpf-next] bpf: Don't redirect packets with invalid
pkt_len
On Fri, 15 Jul 2022 11:22:33 +0800 Zhengchao Shao wrote:
> +#ifdef CONFIG_DEBUG_NET
> + if (unlikely(!skb->len)) {
> + pr_err("%s\n", __func__);
> + skb_dump(KERN_ERR, skb, false);
> + WARN_ON_ONCE(1);
> + }
Is there a reason to open code WARN_ONCE() like that?
#ifdef CONFIG_DEBUG_NET
if (WARN_ONCE(!skb->len, "%s\n", __func__))
skb_dump(KERN_ERR, skb, false);
or
if (IS_ENABLED(CONFIG_DEBUG_NET) &&
WARN_ONCE(!skb->len, "%s\n", __func__))
skb_dump(KERN_ERR, skb, false);
Powered by blists - more mailing lists