svn commit: r213316 - head/sys/dev/bge

Pyun YongHyeon yongari at FreeBSD.org
Thu Sep 30 22:34:15 UTC 2010


Author: yongari
Date: Thu Sep 30 22:34:15 2010
New Revision: 213316
URL: http://svn.freebsd.org/changeset/base/213316

Log:
  Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
  IFCAP_HWCSUM to know which capability should be changed such that
  disabling RX checksun offloading resulted in disabling TX checksum
  offloading.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Thu Sep 30 22:03:43 2010	(r213315)
+++ head/sys/dev/bge/if_bge.c	Thu Sep 30 22:34:15 2010	(r213316)
@@ -4630,15 +4630,19 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 			}
 		}
 #endif
-		if (mask & IFCAP_HWCSUM) {
-			ifp->if_capenable ^= IFCAP_HWCSUM;
-			if (IFCAP_HWCSUM & ifp->if_capenable &&
-			    IFCAP_HWCSUM & ifp->if_capabilities)
+		if ((mask & IFCAP_TXCSUM) != 0 &&
+		    (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
+			ifp->if_capenable ^= IFCAP_TXCSUM;
+			if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
 				ifp->if_hwassist |= sc->bge_csum_features;
 			else
 				ifp->if_hwassist &= ~sc->bge_csum_features;
 		}
 
+		if ((mask & IFCAP_RXCSUM) != 0 &&
+		    (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
+			ifp->if_capenable ^= IFCAP_RXCSUM;
+
 		if ((mask & IFCAP_TSO4) != 0 &&
 		    (ifp->if_capabilities & IFCAP_TSO4) != 0) {
 			ifp->if_capenable ^= IFCAP_TSO4;


More information about the svn-src-head mailing list