svn commit: r211359 - stable/8/sys/dev/sk

Pyun YongHyeon yongari at FreeBSD.org
Sun Aug 15 21:51:10 UTC 2010


Author: yongari
Date: Sun Aug 15 21:51:10 2010
New Revision: 211359
URL: http://svn.freebsd.org/changeset/base/211359

Log:
  MFC r209865:
    Some revision of Yukon controller generates corrupted frame when TX
    checksum offloading is enabled.  The frame has a valid checksum
    value so payload might be modified during TX checksum calculation.
    Disable TX checksum offloading but give users chance to enable it
    when they know their controller works without problems with TX
    checksum offloading.
  
    Reported by:	Andrzej Tobola <ato <> iem dot pw dot edu dot pl>

Modified:
  stable/8/sys/dev/sk/if_sk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/sk/if_sk.c
==============================================================================
--- stable/8/sys/dev/sk/if_sk.c	Sun Aug 15 21:46:23 2010	(r211358)
+++ stable/8/sys/dev/sk/if_sk.c	Sun Aug 15 21:51:10 2010	(r211359)
@@ -1169,14 +1169,17 @@ sk_ioctl(ifp, command, data)
 			break;
 		}
 		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
-		if (mask & IFCAP_HWCSUM) {
-			ifp->if_capenable ^= IFCAP_HWCSUM;
-			if (IFCAP_HWCSUM & ifp->if_capenable &&
-			    IFCAP_HWCSUM & ifp->if_capabilities)
-				ifp->if_hwassist = SK_CSUM_FEATURES;
+		if ((mask & IFCAP_TXCSUM) != 0 &&
+		    (IFCAP_TXCSUM & ifp->if_capabilities) != 0) {
+			ifp->if_capenable ^= IFCAP_TXCSUM;
+			if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
+				ifp->if_hwassist |= SK_CSUM_FEATURES;
 			else
-				ifp->if_hwassist = 0;
+				ifp->if_hwassist &= ~SK_CSUM_FEATURES;
 		}
+		if ((mask & IFCAP_RXCSUM) != 0 &&
+		    (IFCAP_RXCSUM & ifp->if_capabilities) != 0) 
+			ifp->if_capenable ^= IFCAP_RXCSUM;
 		SK_IF_UNLOCK(sc_if);
 		break;
 	default:
@@ -1363,13 +1366,23 @@ sk_attach(dev)
 	 * SK_GENESIS has a bug in checksum offload - From linux.
 	 */
 	if (sc_if->sk_softc->sk_type != SK_GENESIS) {
-		ifp->if_capabilities = IFCAP_HWCSUM;
-		ifp->if_hwassist = SK_CSUM_FEATURES;
+		ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM;
+		ifp->if_hwassist = 0;
 	} else {
 		ifp->if_capabilities = 0;
 		ifp->if_hwassist = 0;
 	}
 	ifp->if_capenable = ifp->if_capabilities;
+	/*
+	 * Some revision of Yukon controller generates corrupted
+	 * frame when TX checksum offloading is enabled.  The
+	 * frame has a valid checksum value so payload might be
+	 * modified during TX checksum calculation. Disable TX
+	 * checksum offloading but give users chance to enable it
+	 * when they know their controller works without problems
+	 * with TX checksum offloading.
+	 */
+	ifp->if_capenable &= ~IFCAP_TXCSUM;
 	ifp->if_ioctl = sk_ioctl;
 	ifp->if_start = sk_start;
 	ifp->if_init = sk_init;


More information about the svn-src-stable mailing list