Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-23 Thread Jakub Kicinski
On Thu, 22 Oct 2020 19:25:40 -0700 Xie He wrote: > On Thu, Oct 22, 2020 at 6:56 PM Xie He 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

Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Xie He
On Thu, Oct 22, 2020 at 6:56 PM Xie He 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",

Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Xie He
On Thu, Oct 22, 2020 at 5:44 PM Jakub Kicinski wrote: > > On Thu, 22 Oct 2020 12:59:45 -0700 Xie He wrote: > > > > But I also see some drivers that want to pad the skb to a strange > > length, and don't set their special min_mtu to match this length. For > > example: > > > >

Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Jakub Kicinski
On Thu, 22 Oct 2020 12:59:45 -0700 Xie He wrote: > On Thu, Oct 22, 2020 at 8:22 AM Jakub Kicinski wrote: > > > > Are most of these drivers using skb_padto()? Is that the reason they > > can't be sharing the SKB? > > Yes, I think if a driver calls skb_pad / skb_padto / skb_put_padto / >

Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Xie He
On Thu, Oct 22, 2020 at 8:22 AM Jakub Kicinski wrote: > > Are most of these drivers using skb_padto()? Is that the reason they > can't be sharing the SKB? Yes, I think if a driver calls skb_pad / skb_padto / skb_put_padto / eth_skb_pad, the driver can't accept shared skbs because it may modify

Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Jakub Kicinski
On Thu, 22 Oct 2020 00:46:38 -0700 Xie He wrote: > It was very hard for me to attempt fixing. There are too many drivers > that need to be fixed. Fixing them is very time-consuming and may also > be error-prone. So I think it may be better to just remove > IFF_TX_SKB_SHARING from ether_setup.

Re: [PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Xie He
Sorry. I spotted some errors in this patch. Some drivers use "ndev" as the variable name but I mistakenly used "dev". It was very hard for me to attempt fixing. There are too many drivers that need to be fixed. Fixing them is very time-consuming and may also be error-prone. So I think it may be

[PATCH net RFC] net: Clear IFF_TX_SKB_SHARING for all Ethernet devices using skb_padto

2020-10-22 Thread Xie He
The ether_setup function adds the IFF_TX_SKB_SHARING flag to the device. This flag indicates that it is safe to transmit shared skbs to the device. However, this is not true for many Ethernet devices. Many Ethernet drivers would call skb_pad or skb_padto on the transmission path, which modify the