Advertisement
devinteske

bge(4) local patch to disable TSO4 ifconfig property in src

May 24th, 2013
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.44 KB | None | 0 0
  1. --- sys/dev/bge/if_bge.c.orig   2010-06-13 19:09:06.000000000 -0700
  2. +++ sys/dev/bge/if_bge.c    2013-05-24 10:33:11.000000000 -0700
  3. @@ -32,14 +32,14 @@
  4.   */
  5.  
  6.  #include <sys/cdefs.h>
  7. -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.226.2.23.2.1 2010/06/14 02:09:06 kensmith Exp $");
  8. +__FBSDID("$FreeBSD: stable/8/sys/dev/bge/if_bge.c 250651 2013/05/15 01:22:55Z yongari $");
  9.  
  10.  /*
  11.   * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
  12.  [HUGE SNIP]
  13. @@ -2840,12 +3704,20 @@ bge_attach(device_t dev)
  14.     ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1;
  15.     IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
  16.     IFQ_SET_READY(&ifp->if_snd);
  17. -   ifp->if_hwassist = BGE_CSUM_FEATURES;
  18. +   ifp->if_hwassist = sc->bge_csum_features;
  19.     ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
  20.         IFCAP_VLAN_MTU;
  21. -   if ((sc->bge_flags & BGE_FLAG_TSO) != 0) {
  22. +   if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) {
  23.         ifp->if_hwassist |= CSUM_TSO;
  24. +/* TSO4 considered unstable as-of SVN stable/8 revision 250651.
  25. + * An extreme amount of TCP traffic (or heavy amount of UDP traffic
  26. + * according to smh) can act as a remote Denial-of-Service attack
  27. + * causing a RESET of the NIC, losing communicatin for 90s (dteske) */
  28. +#if 0
  29.         ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
  30. +#else
  31. +       ifp->if_capabilities |= IFCAP_VLAN_HWTSO;
  32. +# endif
  33.     }
  34.  #ifdef IFCAP_VLAN_HWCSUM
  35.     ifp->if_capabilities |= IFCAP_VLAN_HWCSUM;
  36.  [HUGE SNIP]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement