[PATCH v8 3/3] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver

Jakub Kicinski kuba at kernel.org
Wed Dec 16 11:13:00 EST 2020

On Wed, 16 Dec 2020 13:21:52 +0100 Lukasz Stelmach wrote:
> So, the only thing that's left is pskb_expand_head(). I need to wrap my
> head around it. Can you tell me how a cloned skb is different and why
> there may be separate branch for it?

I think this driver needs to prepend and append some info to the packet
data, right? Cloned skb is sharing the data with another skb, the
metadata is separate but the packet data is shared, so you can't modify
the data, you need to do a copy of the data. pskb_expand_head() should
take care of cloned skbs so you can just call it upfront and it will
make sure the skb is the right geometry for you.

BTW you should set netdev->needed_headroom and netdev->needed_tailroom
to the correct values so the stack pre-allocates the needed spaces,
when it can.

More information about the linux-arm-kernel mailing list