Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Nov 2008 04:33:02 +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: r185286 - head/sys/dev/fxp
Message-ID:  <200811250433.mAP4X2uv008649@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Tue Nov 25 04:33:02 2008
New Revision: 185286
URL: http://svn.freebsd.org/changeset/base/185286

Log:
  Simplify Tx checksum offload configuration. Also clear CSUM_IP if
  we've computed IP checksum with software method.

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Tue Nov 25 04:16:16 2008	(r185285)
+++ head/sys/dev/fxp/if_fxp.c	Tue Nov 25 04:33:02 2008	(r185286)
@@ -1295,14 +1295,10 @@ fxp_encap(struct fxp_softc *sc, struct m
 	 * in the TCP header. The stack should have
 	 * already done this for us.
 	 */
-	if (m->m_pkthdr.csum_flags) {
-		if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
-			txp->tx_cb->ipcb_ip_schedule =
-			    FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
-			if (m->m_pkthdr.csum_flags & CSUM_TCP)
-				txp->tx_cb->ipcb_ip_schedule |=
-				    FXP_IPCB_TCP_PACKET;
-		}
+	if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) {
+		txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
+		if (m->m_pkthdr.csum_flags & CSUM_TCP)
+			txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET;
 
 #ifdef FXP_IP_CSUM_WAR
 		/*
@@ -1334,6 +1330,7 @@ fxp_encap(struct fxp_softc *sc, struct m
 				ip = mtod(m, struct ip *);
 				ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
 				m->m_data -= ETHER_HDR_LEN;
+				m->m_pkthdr.csum_flags &= ~CSUM_IP;
 			} else {
 				txp->tx_cb->ipcb_ip_activation_high =
 				    FXP_IPCB_HARDWAREPARSING_ENABLE;



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