Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2012 13:35:54 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r243150 - user/andre/tcp_workqueue/sys/dev/fxp
Message-ID:  <201211161335.qAGDZsev095363@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andre
Date: Fri Nov 16 13:35:53 2012
New Revision: 243150
URL: http://svnweb.freebsd.org/changeset/base/243150

Log:
  Expand the scope of FXP_LOCK() again in fxp_ithread() to be on the
  safe side.
  
  Remove a call to fxp_txeof() from fxp_start_body().
  
  Remove duplicate struct ip and tcp assignments from fxp_encap().

Modified:
  user/andre/tcp_workqueue/sys/dev/fxp/if_fxp.c

Modified: user/andre/tcp_workqueue/sys/dev/fxp/if_fxp.c
==============================================================================
--- user/andre/tcp_workqueue/sys/dev/fxp/if_fxp.c	Fri Nov 16 12:31:43 2012	(r243149)
+++ user/andre/tcp_workqueue/sys/dev/fxp/if_fxp.c	Fri Nov 16 13:35:53 2012	(r243150)
@@ -1333,8 +1333,6 @@ fxp_start_body(struct ifnet *ifp)
 	    IFF_DRV_RUNNING)
 		return;
 
-	if (sc->tx_queued > FXP_NTXCB_HIWAT)
-		fxp_txeof(sc);
 	/*
 	 * We're finished if there is nothing more to add to the list or if
 	 * we're all filled up with buffers to transmit.
@@ -1444,8 +1442,6 @@ fxp_encap(struct fxp_softc *sc, struct m
 		 * Since 82550/82551 doesn't modify IP length and pseudo
 		 * checksum in the first frame driver should compute it.
 		 */
-		ip = (struct ip *)(mtod(m, char *) + ip_off);
-		tcp = (struct tcphdr *)(mtod(m, char *) + poff);
 		ip->ip_sum = 0;
 		ip->ip_len = htons(m->m_pkthdr.tso_segsz + (ip->ip_hl << 2) +
 		    (tcp->th_off << 2));
@@ -1897,6 +1893,8 @@ fxp_ithread(void *xsc)
 	struct mbuf *m, *n;
 	uint8_t statack;
 
+	FXP_LOCK(sc);
+
 	/*
 	 * Loop while the chip indicates work.
 	 * The control status register is contiguously updated,
@@ -1913,8 +1911,6 @@ fxp_ithread(void *xsc)
 		}
 		CSR_WRITE_1(sc, FXP_CSR_SCB_STATACK, statack);
 
-		FXP_LOCK(sc);
-
 		/*
 		 * Free any finished transmit mbuf chains.
 		 *
@@ -1956,7 +1952,9 @@ fxp_ithread(void *xsc)
 			(*ifp->if_input)(ifp, n);
 			maybe_yield();
 		}
+		FXP_LOCK(sc);
 	}
+	FXP_UNLOCK(sc);
 
 	/*
 	 * Enable interrupts again.



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