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

Pyun YongHyeon yongari at FreeBSD.org
Sat Feb 20 23:21:07 UTC 2010


Author: yongari
Date: Sat Feb 20 23:21:06 2010
New Revision: 204151
URL: http://svn.freebsd.org/changeset/base/204151

Log:
  Add TSO support on VLAN. Controller requires VLAN hardware tagging
  to make TSO work on VLAN. So if VLAN hardware tagging is disabled
  explicitly clear TSO on VLAN. While I'm here remove duplicated
  VLAN_CAPABILITIES call.

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

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Sat Feb 20 23:01:09 2010	(r204150)
+++ head/sys/dev/bge/if_bge.c	Sat Feb 20 23:21:06 2010	(r204151)
@@ -2816,7 +2816,7 @@ bge_attach(device_t dev)
 	    IFCAP_VLAN_MTU;
 	if ((sc->bge_flags & BGE_FLAG_TSO) != 0) {
 		ifp->if_hwassist |= CSUM_TSO;
-		ifp->if_capabilities |= IFCAP_TSO4;
+		ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
 	}
 #ifdef IFCAP_VLAN_HWCSUM
 	ifp->if_capabilities |= IFCAP_VLAN_HWCSUM;
@@ -4526,9 +4526,6 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 				ifp->if_hwassist |= BGE_CSUM_FEATURES;
 			else
 				ifp->if_hwassist &= ~BGE_CSUM_FEATURES;
-#ifdef VLAN_CAPABILITIES
-			VLAN_CAPABILITIES(ifp);
-#endif
 		}
 
 		if ((mask & IFCAP_TSO4) != 0 &&
@@ -4546,16 +4543,21 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 			bge_init(sc);
 		}
 
-		if (mask & IFCAP_VLAN_HWTAGGING) {
+		if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
+		    (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
+			ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
+		if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
+		    (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
 			ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+			if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
+				ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
 			BGE_LOCK(sc);
 			bge_setvlan(sc);
 			BGE_UNLOCK(sc);
+		}
 #ifdef VLAN_CAPABILITIES
-			VLAN_CAPABILITIES(ifp);
+		VLAN_CAPABILITIES(ifp);
 #endif
-		}
-
 		break;
 	default:
 		error = ether_ioctl(ifp, command, data);


More information about the svn-src-all mailing list