Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto
From: Xie He
Date: Thu Oct 22 2020 - 22:25:53 EST
On Thu, Oct 22, 2020 at 6:56 PM Xie He <xie.he.0141@xxxxxxxxx> wrote:
>
> My patch isn't complete. Because there are so many drivers with this
> problem, I feel it's hard to solve them all at once. So I only grepped
> "skb_padto" under "drivers/net/ethernet". There are other drivers
> under "ethernet" using "skb_pad", "skb_put_padto" or "eth_skb_pad".
> There are also (fake) Ethernet drivers under "drivers/net/wireless". I
> feel it'd take a long time and also be error-prone to solve them all,
> so I feel it'd be the best if there are other solutions.
BTW, I also see some Ethernet drivers calling skb_push to prepend
strange headers to the skbs. For example,
drivers/net/ethernet/mellanox/mlxsw/switchx2.c prepends a header of
MLXSW_TXHDR_LEN (16).
We can't send shared skbs to these drivers either because they modify the skbs.
It seems to me that many drivers have always assumed that they can
modify the skb whenever needed. They've never considered there might
be shared skbs. I guess adding IFF_TX_SKB_SHARING to ether_setup was a
bad idea. It not only made the code less clean, but also didn't agree
with the actual situations of the drivers.