Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Feb 2010 23:21:07 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r204151 - head/sys/dev/bge
Message-ID:  <201002202321.o1KNL7wB048425@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002202321.o1KNL7wB048425>