svn commit: r187078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/vge

Pyun YongHyeon yongari at FreeBSD.org
Sun Jan 11 19:32:56 PST 2009


Author: yongari
Date: Mon Jan 12 03:32:54 2009
New Revision: 187078
URL: http://svn.freebsd.org/changeset/base/187078

Log:
  MFC r184908:
    Fix Rx/Tx checksum offload ioctl handling. Now checksum offload
    can be controlled by ifconfig(8). Note, VLAN hardware tagging
    controls still lacks required handler but it requires more driver
    cleanups so I didn't touch that part.
  
    PR:   kern/128766

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/vge/if_vge.c

Modified: stable/7/sys/dev/vge/if_vge.c
==============================================================================
--- stable/7/sys/dev/vge/if_vge.c	Mon Jan 12 03:26:52 2009	(r187077)
+++ stable/7/sys/dev/vge/if_vge.c	Mon Jan 12 03:32:54 2009	(r187078)
@@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data)
 			}
 		}
 #endif /* DEVICE_POLLING */
-		if (mask & IFCAP_HWCSUM) {
-			ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM);
-			if (ifp->if_capenable & IFCAP_TXCSUM)
-				ifp->if_hwassist = VGE_CSUM_FEATURES;
+		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 |= VGE_CSUM_FEATURES;
 			else
-				ifp->if_hwassist = 0;
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-				vge_init(sc);
+				ifp->if_hwassist &= ~VGE_CSUM_FEATURES;
 		}
+		if ((mask & IFCAP_RXCSUM) != 0 &&
+		    (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
+			ifp->if_capenable ^= IFCAP_RXCSUM;
 	    }
 		break;
 	default:


More information about the svn-src-stable mailing list