mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xie.he.0141@gmail.com
Cc: kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, willemdebruijn.kernel@gmail.com,
	ms@dev.tdt.de
Subject: Re: [PATCH net] drivers/net/wan: lapb: Replace the skb->len checks with pskb_may_pull
Date: Sun, 04 Oct 2020 15:15:35 -0700 (PDT)	[thread overview]
Message-ID: <20201004.151535.2244486201194283232.davem@davemloft.net> (raw)
In-Reply-To: <20201004004619.291065-1-xie.he.0141@gmail.com>

From: Xie He <xie.he.0141@gmail.com>
Date: Sat,  3 Oct 2020 17:46:19 -0700

> The purpose of these skb->len checks in these drivers is to ensure that
> there is a header in the skb available to be read and pulled.
> 
> However, we already have the pskb_may_pull function for this purpose.
> 
> The pskb_may_pull function also correctly handles non-linear skbs.
> 
> (Also delete the word "check" in the comments because pskb_may_pull may
> do things other than simple checks in the case of non-linear skbs.)
> 
> Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Cc: Martin Schiller <ms@dev.tdt.de>
> Signed-off-by: Xie He <xie.he.0141@gmail.com>

This is excessive.

On transmit the header will be in the linear area, especially
if it is only one byte in size.

You're adding a lot of extra checks, function calls, etc. which are
frankly unnecessary.

I'm not applying this unless you can prove that a non-linear single
header byte is possible in these code paths.  And you'll need to add
such proof to your commit message.

Thank you.

      reply	other threads:[~2020-10-04 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04  0:46 Xie He
2020-10-04 22:15 ` David Miller [this message]

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=20201004.151535.2244486201194283232.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ms@dev.tdt.de \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=xie.he.0141@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®