From: Vladimir Oltean <olteanv@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Christian Eggers <ceggers@arri.de>,
Woojung Huh <woojung.huh@microchip.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: dsa: ksz: don't pad a cloned sk_buff
Date: Fri, 16 Oct 2020 17:06:34 +0300 [thread overview]
Message-ID: <20201016140634.acu6v5igxih2xukf@skbuf> (raw)
In-Reply-To: <20201016140036.GC456889@lunn.ch>
On Fri, Oct 16, 2020 at 04:00:36PM +0200, Andrew Lunn wrote:
> On Fri, Oct 16, 2020 at 09:35:27AM +0200, Christian Eggers wrote:
> > If the supplied sk_buff is cloned (e.g. in dsa_skb_tx_timestamp()),
> > __skb_put_padto() will allocate a new sk_buff with size = skb->len +
> > padlen. So the condition just tested for (skb_tailroom(skb) >= padlen +
> > len) is not fulfilled anymore. Although the real size will usually be
> > larger than skb->len + padlen (due to alignment), there is no guarantee
> > that the required memory for the tail tag will be available
> >
> > Instead of letting __skb_put_padto allocate a new (too small) sk_buff,
> > lets take the already existing path and allocate a new sk_buff ourself
> > (with sufficient size).
>
> Hi Christian
>
> What is not clear to me is why not change the __skb_put_padto() call
> to pass the correct length?
There is a second call to skb_put that increases the skb->len further
from the tailroom area. See Christian's other patch.
I would treat this patch as "premature" until we fully understand what's
going on there.
prev parent reply other threads:[~2020-10-16 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 7:35 [PATCH net] net: dsa: ksz: don't pad a cloned sk_buff Christian Eggers
2020-10-16 14:00 ` Andrew Lunn
2020-10-16 14:06 ` Vladimir Oltean [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=20201016140634.acu6v5igxih2xukf@skbuf \
--to=olteanv@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=ceggers@arri.de \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
--cc=woojung.huh@microchip.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