Re: [PATCH v2] smsc95xx: Use skb_cow_head to deal with cloned skbs

2017-04-19 Thread James Hughes
On 19 April 2017 at 09:33, James Hughes wrote: > On 18 April 2017 at 23:46, Eric Dumazet wrote: >> On Tue, 2017-04-18 at 22:09 +, woojung@microchip.com wrote: >>> > > @@ -2067,13 +2067,9 @@ static struct sk_buff *smsc95xx_tx_fixup(struct >>> > usbnet *dev, >>> > > /* We do not advertise

Re: [PATCH v2] smsc95xx: Use skb_cow_head to deal with cloned skbs

2017-04-19 Thread James Hughes
On 18 April 2017 at 23:46, Eric Dumazet wrote: > On Tue, 2017-04-18 at 22:09 +, woojung@microchip.com wrote: >> > > @@ -2067,13 +2067,9 @@ static struct sk_buff *smsc95xx_tx_fixup(struct >> > usbnet *dev, >> > > /* We do not advertise SG, so skbs should be already linearized */ >> > >

RE: [PATCH v2] smsc95xx: Use skb_cow_head to deal with cloned skbs

2017-04-18 Thread Woojung.Huh
> if (info->tx_fixup) { >skb = info->tx_fixup (dev, skb, GFP_ATOMIC); > >if (!skb) { // Note that skb is NULL now You are right. skb is return value of tx_fixup(). - Woojung

Re: [PATCH v2] smsc95xx: Use skb_cow_head to deal with cloned skbs

2017-04-18 Thread Eric Dumazet
On Tue, 2017-04-18 at 22:09 +, woojung@microchip.com wrote: > > > @@ -2067,13 +2067,9 @@ static struct sk_buff *smsc95xx_tx_fixup(struct > > usbnet *dev, > > > /* We do not advertise SG, so skbs should be already linearized */ > > > BUG_ON(skb_shinfo(skb)->nr_frags); > > > > > > - if (s

RE: [PATCH v2] smsc95xx: Use skb_cow_head to deal with cloned skbs

2017-04-18 Thread Woojung.Huh
> > @@ -2067,13 +2067,9 @@ static struct sk_buff *smsc95xx_tx_fixup(struct > usbnet *dev, > > /* We do not advertise SG, so skbs should be already linearized */ > > BUG_ON(skb_shinfo(skb)->nr_frags); > > > > - if (skb_headroom(skb) < overhead) { > > - struct sk_buff *skb2 = skb_

Re: [PATCH v2] smsc95xx: Use skb_cow_head to deal with cloned skbs

2017-04-18 Thread Eric Dumazet
On Tue, 2017-04-18 at 18:17 +0100, James Hughes wrote: > The driver was failing to check that the SKB wasn't cloned > before adding checksum data. > Replace existing handling to extend/copy the header buffer > with skb_cow_head. > > Signed-off-by: James Hughes > --- > Changes in v2 > - Changed s