diff options
author | luigi <luigi@FreeBSD.org> | 2012-04-11 15:02:14 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2012-04-11 15:02:14 +0000 |
commit | bef4cb5b9bc38241d1692821b5876d91afff62a7 (patch) | |
tree | 355d590a1c4027d523dfad3e3b23a0f3128a20fd | |
parent | 5aa865afa50a2b97e5a4ad1f19def0b2e61ebccf (diff) | |
download | FreeBSD-src-bef4cb5b9bc38241d1692821b5876d91afff62a7.zip FreeBSD-src-bef4cb5b9bc38241d1692821b5876d91afff62a7.tar.gz |
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
-rw-r--r-- | sys/dev/ixgbe/ixgbe.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index bbaacc4..32a2884 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -1143,6 +1143,14 @@ ixgbe_init_locked(struct adapter *adapter) 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); } |