0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 43203ed1c397e88a087ef6d4cf79de24a89e1fef Mon Sep 17 00:00:00 2001
  2. From: popcornmix <popcornmix@gmail.com>
  3. Date: Wed, 20 Jan 2016 17:50:09 +0000
  4. Subject: [PATCH 158/381] smsx95xx: Add option to disable the crimes against
  5. truesize fix
  6. It may improve iperf numbers on Pi 1, but may generate dmesg warnings and possibly cause network issues
  7. See issue 1248.
  8. ---
  9. drivers/net/usb/smsc95xx.c | 8 ++++++++
  10. 1 file changed, 8 insertions(+)
  11. mode change 100755 => 100644 drivers/net/usb/smsc95xx.c
  12. --- a/drivers/net/usb/smsc95xx.c
  13. +++ b/drivers/net/usb/smsc95xx.c
  14. @@ -75,6 +75,10 @@ static bool turbo_mode = false;
  15. module_param(turbo_mode, bool, 0644);
  16. MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
  17. +static bool truesize_mode = false;
  18. +module_param(truesize_mode, bool, 0644);
  19. +MODULE_PARM_DESC(truesize_mode, "Report larger truesize value");
  20. +
  21. static char *macaddr = ":";
  22. module_param(macaddr, charp, 0);
  23. MODULE_PARM_DESC(macaddr, "MAC address");
  24. @@ -1841,6 +1845,8 @@ static int smsc95xx_rx_fixup(struct usbn
  25. if (dev->net->features & NETIF_F_RXCSUM)
  26. smsc95xx_rx_csum_offload(skb);
  27. skb_trim(skb, skb->len - 4); /* remove fcs */
  28. + if (truesize_mode)
  29. + skb->truesize = size + sizeof(struct sk_buff);
  30. return 1;
  31. }
  32. @@ -1858,6 +1864,8 @@ static int smsc95xx_rx_fixup(struct usbn
  33. if (dev->net->features & NETIF_F_RXCSUM)
  34. smsc95xx_rx_csum_offload(ax_skb);
  35. skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
  36. + if (truesize_mode)
  37. + ax_skb->truesize = size + sizeof(struct sk_buff);
  38. usbnet_skb_return(dev, ax_skb);
  39. }