summaryrefslogtreecommitdiffstats
path: root/sys/net/netmap.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2011-12-05 12:06:53 +0000
committerluigi <luigi@FreeBSD.org>2011-12-05 12:06:53 +0000
commit298ffde66596a12229df0898bab02aa491f70535 (patch)
treea556ee936d46b8051dced8959c9019517fa2c641 /sys/net/netmap.h
parent07781bc7da6c5ba99f27277e39b9a1a47d52ce0e (diff)
downloadFreeBSD-src-298ffde66596a12229df0898bab02aa491f70535.zip
FreeBSD-src-298ffde66596a12229df0898bab02aa491f70535.tar.gz
1. Fix the handling of link reset while in netmap more.
A link reset now is completely transparent for the netmap client: even if the NIC resets its own ring (e.g. restarting from 0), the client will not see any change in the current rx/tx positions, because the driver will keep track of the offset between the two. 2. make the device-specific code more uniform across different drivers There were some inconsistencies in the implementation of the netmap support routines, now drivers have been aligned to a common code structure. 3. import netmap support for ixgbe . This is implemented as a very small patch for ixgbe.c (233 lines, 11 chunks, mostly comments: in total the patch has only 54 lines of new code) , as most of the code is in an external file sys/dev/netmap/ixgbe_netmap.h , following some initial comments from Jack Vogel about making changes less intrusive. (Note, i have emailed Jack multiple times asking if he had comments on this structure of the code; i got no reply so i assume he is fine with it). Support for other drivers (em, lem, re, igb) will come later. "ixgbe" is now the reference driver for netmap support. Both the external file (sys/dev/netmap/ixgbe_netmap.h) and the device-specific patches (in sys/dev/ixgbe/ixgbe.c) are heavily commented and should serve as a reference for other device drivers. Tested on i386 and amd64 with the pkt-gen program in tools/tools/netmap, the sender does 14.88 Mpps at 1050 Mhz and 14.2 Mpps at 900 MHz on an i7-860 with 4 cores and 82599 card. Haven't tried yet more aggressive optimizations such as adding 'prefetch' instructions in the time-critical parts of the code.
Diffstat (limited to 'sys/net/netmap.h')
-rw-r--r--sys/net/netmap.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/sys/net/netmap.h b/sys/net/netmap.h
index be9c686..4dec1fd 100644
--- a/sys/net/netmap.h
+++ b/sys/net/netmap.h
@@ -32,7 +32,7 @@
/*
* $FreeBSD$
- * $Id: netmap.h 9662 2011-11-16 13:18:06Z luigi $
+ * $Id: netmap.h 9753 2011-11-28 15:10:43Z luigi $
*
* This header contains the definitions of the constants and the
* structures needed by the ``netmap'' module, both kernel and
@@ -186,13 +186,6 @@ struct netmap_ring {
const uint16_t nr_buf_size;
uint16_t flags;
- /*
- * When a ring is reinitialized, the kernel sets kflags.
- * On exit from a syscall, if the flag is found set, we
- * also reinitialize the nr_* variables. The kflag is then
- * unconditionally copied to nr_flags and cleared.
- */
-#define NR_REINIT 0x0001 /* ring reinitialized! */
#define NR_TIMESTAMP 0x0002 /* set timestamp on *sync() */
struct timeval ts; /* time of last *sync() */
OpenPOWER on IntegriCloud