[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20201004.151535.2244486201194283232.davem@davemloft.net>
Date: Sun, 04 Oct 2020 15:15:35 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: xie.he.0141@...il.com
Cc: kuba@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, willemdebruijn.kernel@...il.com,
ms@....tdt.de
Subject: Re: [PATCH net] drivers/net/wan: lapb: Replace the skb->len checks
with pskb_may_pull
From: Xie He <xie.he.0141@...il.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@...il.com>
> Cc: Martin Schiller <ms@....tdt.de>
> Signed-off-by: Xie He <xie.he.0141@...il.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.
Powered by blists - more mailing lists