Re: [PATCH net v2 1/2] gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP

Vladimir Oltean
2020-11-03T17:18:54Z

On Tue, Nov 03, 2020 at 06:36:30PM +0200, Julian Wiedmann wrote:
> Given the various skb modifications in its xmit path, I wonder why
> gianfar doesn't clear IFF_TX_SKB_SHARING.

Thanks for the hint Julian :) I'll try to see if it makes any
difference.

Just a wild guess, but maybe because the gianfar maintainer (or me) had
no idea about the existence of the flag, and because IFF_SKB_TX_SHARED
was added _after_ gianfar was already a thing (which it was since the
beginning of git), which is insane to begin with?

commit d8873315065f1f527c7c380402cf59b1e1d0ae36
Author: Neil Horman <nhorman@tuxdriver.com>
Date: Tue Jul 26 06:05:37 2011 +0000

net: add IFF_SKB_TX_SHARED flag to priv_flags

Pktgen attempts to transmit shared skbs to net devices, which can't be used by
some drivers as they keep state information in skbs. This patch adds a flag
marking drivers as being able to handle shared skbs in their tx path. Drivers
are defaulted to being unable to do so, but calling ether_setup enables this
flag, as 90% of the drivers calling ether_setup touch real hardware and can
handle shared skbs. A subsequent patch will audit drivers to ensure that the
flag is set properly

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Jiri Pirko <jpirko@redhat.com>
CC: Robert Olsson <robert.olsson@its.uu.se>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>