All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Aaron Conole <aconole@bytheb.org>, netdev@vger.kernel.org
Cc: Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH next] net/core/dev: Warn on an impossibly short offload frame
Date: Sat, 02 Jan 2016 17:06:33 -0800	[thread overview]
Message-ID: <1451783193.4334.3.camel@perches.com> (raw)
In-Reply-To: <1451780713-4098-1-git-send-email-aconole@bytheb.org>

On Sat, 2016-01-02 at 19:25 -0500, Aaron Conole wrote:
> When signaling that a GRO frame is ready to be processed, the network stack
> correctly checks length and aborts processing when a frame is less than 14
> bytes. However, such a condition is really indicative of a broken driver,
> and should be loudly signaled, rather than silently dropped as the case is
> today.
> 
> Convert the condition to use WARN_ON() to ensure that the stack loudly
> complains about such broken drivers.
[]
> diff --git a/net/core/dev.c b/net/core/dev.c
[]
> @@ -4579,7 +4579,7 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
>  	eth = skb_gro_header_fast(skb, 0);
>  	if (unlikely(skb_gro_header_hard(skb, hlen))) {
>  		eth = skb_gro_header_slow(skb, hlen, 0);
> -		if (unlikely(!eth)) {
> +		if (WARN_ON(!eth)) {
>  			napi_reuse_skb(napi, skb);
>  			return NULL;
>  		}

It's generally a good idea to use
WARN_ON_RATELIMIT or WARN_ON_ONCE.

  reply	other threads:[~2016-01-03  1:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03  0:25 [PATCH next] net/core/dev: Warn on an impossibly short offload frame Aaron Conole
2016-01-03  1:06 ` Joe Perches [this message]
2016-01-05 18:36   ` Aaron Conole

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=1451783193.4334.3.camel@perches.com \
    --to=joe@perches.com \
    --cc=aconole@bytheb.org \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    /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.