svn commit: r204374 - head/sys/dev/bce

Pyun YongHyeon yongari at FreeBSD.org
Fri Feb 26 21:26:07 UTC 2010


Author: yongari
Date: Fri Feb 26 21:26:07 2010
New Revision: 204374
URL: http://svn.freebsd.org/changeset/base/204374

Log:
  Add TSO support on VLANs. bce(4) controllers require VLAN hardware
  tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
  if VLAN hardware tagging is disabled.
  
  Reviewed by:	davidch

Modified:
  head/sys/dev/bce/if_bce.c

Modified: head/sys/dev/bce/if_bce.c
==============================================================================
--- head/sys/dev/bce/if_bce.c	Fri Feb 26 21:19:46 2010	(r204373)
+++ head/sys/dev/bce/if_bce.c	Fri Feb 26 21:26:07 2010	(r204374)
@@ -1058,7 +1058,8 @@ bce_attach(device_t dev)
 
 	if (bce_tso_enable) {
 		ifp->if_hwassist = BCE_IF_HWASSIST | CSUM_TSO;
-		ifp->if_capabilities = BCE_IF_CAPABILITIES | IFCAP_TSO4;
+		ifp->if_capabilities = BCE_IF_CAPABILITIES | IFCAP_TSO4 |
+		    IFCAP_VLAN_HWTSO;
 	} else {
 		ifp->if_hwassist = BCE_IF_HWASSIST;
 		ifp->if_capabilities = BCE_IF_CAPABILITIES;
@@ -7176,6 +7177,9 @@ bce_ioctl(struct ifnet *ifp, u_long comm
 			    ifp->if_capabilities & IFCAP_VLAN_HWCSUM)
 				ifp->if_capenable ^= IFCAP_VLAN_HWCSUM;
 
+			if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
+			    (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
+				ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
 			/*
 			 * Don't actually disable VLAN tag stripping as
 			 * management firmware (ASF/IPMI/UMP) requires the
@@ -7184,8 +7188,12 @@ bce_ioctl(struct ifnet *ifp, u_long comm
 			 * appending stripped VLAN tag.
 			 */
 			if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
-			    (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING))
+			    (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) {
 				ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+				if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
+				    == 0)
+					ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
+			}
 			VLAN_CAPABILITIES(ifp);
 			break;
 		default:


More information about the svn-src-head mailing list