svn commit: r234137 - head/sys/dev/ixgbe

Luigi Rizzo luigi at FreeBSD.org
Wed Apr 11 15:02:15 UTC 2012


Author: luigi
Date: Wed Apr 11 15:02:14 2012
New Revision: 234137
URL: http://svn.freebsd.org/changeset/base/234137

Log:
  Enable prefetching of descriptors on the TX ring, using the same
  values as in the Intel driver 3.8.21 for linux.  The fact that it
  is standard in the above driver suggests that it has no bad side
  effects.
  
  But of course there must be a reason for enabling features, not
  just "it does not harm", so here it is a good one:
  
  Prefetching enables full line rate even using a single queue (14.88
  Mpps, compared to ~12 Mpps without prefetch).  This in turn is
  terribly useful when one wants to schedule traffic.
  
  For obvious reasons the difference is only visible with netmap
  or other high speed solutions, but presumably the advantage
  should be in the order of a fraction of a microsecond when
  starting transmission on an empty queue.
  
  Discussed with Jack Vogel.
  
  MFC after:	1 week

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Wed Apr 11 14:54:06 2012	(r234136)
+++ head/sys/dev/ixgbe/ixgbe.c	Wed Apr 11 15:02:14 2012	(r234137)
@@ -1143,6 +1143,14 @@ ixgbe_init_locked(struct adapter *adapte
 		txdctl |= IXGBE_TXDCTL_ENABLE;
 		/* Set WTHRESH to 8, burst writeback */
 		txdctl |= (8 << 16);
+		/*
+		 * When the internal queue falls below PTHRESH (32),
+		 * start prefetching as long as there are at least
+		 * HTHRESH (1) buffers ready. The values are taken
+		 * from the Intel linux driver 3.8.21.
+		 * Prefetching enables tx line rate even with 1 queue.
+		 */
+		txdctl |= (16 << 0) | (1 << 8);
 		IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl);
 	}
 


More information about the svn-src-all mailing list