aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/netmap/ixgbe_netmap.h
Commit message (Collapse)AuthorAgeFilesLines
* Fixed up version of r294061 that was reverted due to breakage of featuresSean Bruno2016-01-281-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (netmap) and architectures(i386). <I'll take the pointyhat on that one> r283883 -- update to 3.1.0 r283893 -- update SRIOV API changes related to future possible MFC of SRIOV work r285590 -- Fix ixgbe(4) SRIOV VF initialization bugs r285591 -- Remove version check for FLOWID r285592 -- Update netmap support for ixgbe SRIOV VFs. r286238 -- Fixup MTU zeroing if INET/INET6 are undefined. Submitted by: kevin bowling <kevin.bowling@kev009.com> Differential Revision: https://reviews.freebsd.org/D4273 Notes: svn path=/stable/10/; revision=295008
* Unbreak the powerpc/powerpc64 tinderboxEnji Cooper2015-12-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | PR: 198805 Submitted by: sbruno MFC r280430: r280430 (by bz): Make ix_crcstrip a public symbol for the moment; it probably is not the right solution but I will leave it to experts to untangle this problem to properly stop the build failures. At the moment only if_ix.c includes dev/netmap/ixgbe_netmap.h which is good as ixgbe_netmap.h defines a couple of (file) static variables--thus local to if_ix.c. static int ix_crcstrip however now also got checked from ix_txrx.c (as an extern) and should not be visible there. In fact we do see powerpc and powerpc64 build failures because of this. It is unclear to me why on other (clang built?) architectures this does not lead to a reference of an undefined symbol and similar build breakage. Notes: svn path=/stable/10/; revision=292211
* MFC 270063: update of netmap codeLuigi Rizzo2014-08-201-13/+13
| | | | | | | (vtnet and cxgbe not merged yet because we need some other mfc first) Notes: svn path=/stable/10/; revision=270252
* MFH: sync the netmap code with the one in HEADLuigi Rizzo2014-02-181-320/+205
| | | | | | | | (enhanced VALE switch, netmap pipes, emulated netmap mode). See details in the log for svn 261909. Notes: svn path=/stable/10/; revision=262151
* whitespace changes:Luigi Rizzo2013-04-291-1/+0
| | | | | | | remove $Id$ lines, and add blank lines around some #if / #elif /#endif Notes: svn path=/head/; revision=250052
* explicitly mark some variables as constLuigi Rizzo2013-04-291-4/+4
| | | | Notes: svn path=/head/; revision=250049
* add some definition and driver changes in preparation forLuigi Rizzo2013-01-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | two upcoming features: semi-transparent mode: when a device is opened in this mode, the user program will be able to mark slots that must be forwarded to the "other" side (i.e. from NIC to host stack, or viceversa), and the forwarding will occur automatically at the next netmap syscall. This saves the need to open another file descriptor and do the forwarding manually. direct-forwarding mode: when operating with a VALE port, the user can specify in the slot the actual destination port, overriding the forwarding decision made by a lookup of the destination MAC. This can be useful to implement packet dispatchers. No API changes will be introduced. No new functionality in this patch yet. Notes: svn path=/head/; revision=245579
* remove an incorrect comment and debugging codeLuigi Rizzo2013-01-171-10/+1
| | | | Notes: svn path=/head/; revision=245570
* rename the 'tag' and 'map' fields used the rx ring to theirLuigi Rizzo2012-12-201-4/+4
| | | | | | | | | | | | previous names, 'ptag' and 'pmap' -- p stands for packet. This change reduces the difference between the code in stable/9 and head, and also helps using the same ixgbe_netmap.h on both branches. Approved by: Jack Vogel Notes: svn path=/head/; revision=244514
* First of a series of 11 patches leading to new ixgbe version 2.5.0Jack F Vogel2012-11-301-4/+4
| | | | | | | This removes the header split and supporting code from the driver. Notes: svn path=/head/; revision=243714
* Reword comment to try to improve clarity, and fix a typo.Ed Maste2012-08-131-5/+8
| | | | Notes: svn path=/head/; revision=239242
* fix some signed/unsigned warnings in the netmap code.Luigi Rizzo2012-08-021-1/+1
| | | | | | | | Unfortunately the original drivers still have a lot of sign conversion/comparison warnings. Notes: svn path=/head/; revision=238985
* Properly disable crc stripping when operating in netmap mode.Luigi Rizzo2012-04-131-4/+3
| | | | | | | | | | | Contrarily to what i wrote in my previous commit, the 82599 does include the CRC in the length. The operating mode is reset in ixgbe_init_locked() and so we need to hook into the places where the two registers (HLREG0 and RDRXCTL) are modified. Notes: svn path=/head/; revision=234229
* A bit of cleanup in the names of fields of netmap-related structures.Luigi Rizzo2012-04-131-1/+12
| | | | | | | | Use the name 'ring' instead of 'queue' in all fields. Bump NETMAP_API. Notes: svn path=/head/; revision=234227
* Apparently the length field in advanced descriptorsLuigi Rizzo2012-04-121-1/+6
| | | | | | | | | | does not include the CRC irrespective of the setting of CRCSTRIP. The 82599 data sheets (sec. 7.1.6) say differently. Very strange. Need to check what happens on legacy descriptors, but for the time being this restores functionality. Notes: svn path=/head/; revision=234185
* A couple of changes related to ixgbe operation in netmap mode:Luigi Rizzo2012-04-111-4/+81
| | | | | | | | | | | | | | | | | | | | | - add a sysctl, dev.netmap.ix_crcstrip, to control whether ixgbe should strip the CRC on received frames. Defaults to 0, which keeps the CRC. and improves performance when receiving min-sized (64-byte) frames. This matters because min-sized frames is one of the standard benchmarks for switches and routers, some chipsets seem to issue read-modify-write cycles for PCIe transactions that are not a full cache line, and a min-sized frame triggers the bug, resulting in reduced throughput -- 9.7 instead of 14.88 Mpps -- and heavy bus load. - for the time being, always look for incoming packets on a select/poll even if there has not been an interrupt in the meantime. This is only a temporary workaround for a probable race condition in keeping track of rx interrupts. Add a couple of diagnostic vars to help studying the problem. Notes: svn path=/head/; revision=234140
* A bunch of netmap fixes:Luigi Rizzo2012-02-271-85/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USERSPACE: 1. add support for devices with different number of rx and tx queues; 2. add better support for zero-copy operation, adding an extra field to the netmap ring to indicate how many buffers we have already processed but not yet released (with help from Eddie Kohler); 3. The two changes above unfortunately require an API change, so while at it add a version field and some spares to the ioctl() argument to help detect mismatches. 4. update the manual page for the two changes above; 5. update sample applications in tools/tools/netmap KERNEL: 1. simplify the internal structures moving the global wait queues to the 'struct netmap_adapter'; 2. simplify the functions that map kring<->nic ring indexes 3. normalize device-specific code, helps mainteinance; 4. start exploring the impact of micro-optimizations (prefetch etc.) in the ixgbe driver. Use 'legacy' descriptors on the tx ring and prefetch slots gives about 20% speedup at 900 MHz. Another 7-10% would come from removing the explict calls to bus_dmamap* in the core (they are effectively NOPs in this case, but it takes expensive load of the per-buffer dma maps to figure out that they are all NULL. Rx performance not investigated. I am postponing the MFC so i can import a few more improvements before merging. Notes: svn path=/head/; revision=232238
* Various cleanups for readability (no functional changes)Luigi Rizzo2012-02-171-40/+28
| | | | | | | | | | | | - remove the KEVENT code, which was incomplete and not compiled anyways; - change some while() loops into for() - adjust indentation - remove extra whitespace MFC after: 1 week Notes: svn path=/head/; revision=231881
* (This commit only touches code within the DEV_NETMAP blocks)Luigi Rizzo2012-02-151-9/+4
| | | | | | | | | | | | Introduce some functions to map NIC ring indexes into netmap ring indexes and vice versa. This way we can implement the bound checks only in one place (and hopefully in a correct way). On passing, make the code and comments more uniform across the various drivers. Notes: svn path=/head/; revision=231796
* - use struct ifnet as explicit type of the argument to theLuigi Rizzo2012-02-131-9/+9
| | | | | | | | | | | | | txsync() and rxsync() callbacks, removing some variables made useless by this change; - add generic lock and irq handling routines. These can be useful in case there are no driver locks that we can reuse; - add a few macros to reduce differences with the Linux version. Notes: svn path=/head/; revision=231594
* - change the buffer size from a constant to aLuigi Rizzo2012-02-081-12/+5
| | | | | | | | | | | | | | | | TUNABLE variable (hw.netmap.buf_size) so we can experiment with values different from 2048 which may give better cache performance. - rearrange the memory allocation code so it will be easier to replace it with a different implementation. The current code relies on a single large contiguous chunk of memory obtained through contigmalloc. The new implementation (not committed yet) uses multiple smaller chunks which are easier to fit in a fragmented address space. Notes: svn path=/head/; revision=231198
* ixgbe changes:Luigi Rizzo2012-01-261-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove experimental code for disabling CRC - use the correct constant for conversion between interrupt rate and EITR values (the previous values were off by a factor of 2) - make dev.ix.N.queueM.interrupt_rate a RW sysctl variable. Changing individual values affects the queue immediately, and propagates to all interfaces at the next reinit. - add dev.ix.N.queueM.irqs rdonly sysctl, to export the actual interrupt counts Netmap-related changes for ixgbe: - use the "new" format for TX descriptors in netmap mode. - pass interrupt mitigation delays to the user process doing poll() on a netmap file descriptor. On the RX side this means we will not check the ring more than once per interrupt. This gives the process a chance to sleep and process packets in larger batches, thus reducing CPU usage. On the TX side we take this even further: completed transmissions are reclaimed every half ring even if the NIC interrupts more often. This saves even more CPU without any additional tx delays. Generic Netmap-related changes: - align the netmap_kring to cache lines so that there is no false sharing (possibly useful for multiqueue NICs and MSIX interrupts, which are handled by different cores). It's a minor improvement but it does not cost anything. Reviewed by: Jack Vogel Approved by: Jack Vogel Notes: svn path=/head/; revision=230572
* small code cleanup in preparation for future modifications inLuigi Rizzo2012-01-101-9/+9
| | | | | | | | | | the memory allocator used by netmap. No functional change, two small bug fixes: - in if_re.c add a missing bus_dmamap_sync() - in netmap.c comment out a spurious free() in an error handling block Notes: svn path=/head/; revision=229939
* whitespace fixes (one missing newline, one extra tab)Luigi Rizzo2011-12-231-1/+2
| | | | Notes: svn path=/head/; revision=228844
* 1. Fix the handling of link reset while in netmap more.Luigi Rizzo2011-12-051-97/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=228276
* Bring in support for netmap, a framework for very efficient packetLuigi Rizzo2011-11-171-0/+376
I/O from userspace, capable of line rate at 10G, see http://info.iet.unipi.it/~luigi/netmap/ At this time I am bringing in only the generic code (sys/dev/netmap/ plus two headers under sys/net/), and some sample applications in tools/tools/netmap. There is also a manpage in share/man/man4 [1] In order to make use of the framework you need to build a kernel with "device netmap", and patch individual drivers with the code that you can find in sys/dev/netmap/head.diff The file will go away as the relevant pieces are committed to the various device drivers, which should happen in a few days after talking to the driver maintainers. Netmap support is available at the moment for Intel 10G and 1G cards (ixgbe, em/lem/igb), and for the Realtek 1G card ("re"). I have partial patches for "bge" and am starting to work on "cxgbe". Hopefully changes are trivial enough so interested third parties can submit their patches. Interested people can contact me for advice on how to add netmap support to specific devices. CREDITS: Netmap has been developed by Luigi Rizzo and other collaborators at the Universita` di Pisa, and supported by EU project CHANGE (http://www.change-project.eu/) The code is distributed under a BSD Copyright. [1] In my opinion is a bad idea to have all manpage in one directory. We should place kernel documentation in the same dir that contains the code, which would make it much simpler to keep doc and code in sync, reduce the clutter in share/man/ and incidentally is the policy used for all of userspace code. Makefiles and doc tools can be trivially adjusted to find the manpages in the relevant subdirs. Notes: svn path=/head/; revision=227614