aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixgbe
Commit message (Collapse)AuthorAgeFilesLines
* Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 GbitGleb Smirnoff2014-03-131-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface, in the r241616 a crutch was provided. It didn't work well, and finally we decided that it is time to break ABI and simply make if_baudrate a 64-bit value. Meanwhile, the entire struct if_data was reviewed. o Remove the if_baudrate_pf crutch. o Make all fields of struct if_data fixed machine independent size. The notion of data (packet counters, etc) are by no means MD. And it is a bug that on amd64 we've got a 64-bit counters, while on i386 32-bit, which at modern speeds overflow within a second. This also removes quite a lot of COMPAT_FREEBSD32 code. o Give 16 bit for the ifi_datalen field. This field was provided to make future changes to if_data less ABI breaking. Unfortunately the 8 bit size of it had effectively limited sizeof if_data to 256 bytes. o Give 32 bits to ifi_mtu and ifi_metric. o Give 64 bits to the rest of fields, since they are counters. __FreeBSD_version bumped. Discussed with: emax Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=263102
* It is 2014 and we have a new version of netmap.Luigi Rizzo2014-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most relevant features: - netmap emulation on any NIC, even those without native netmap support. On the ixgbe we have measured about 4Mpps/core/queue in this mode, which is still a lot more than with sockets/bpf. - seamless interconnection of VALE switch, NICs and host stack. If you disable accelerations on your NIC (say em0) ifconfig em0 -txcsum -txcsum you can use the VALE switch to connect the NIC and the host stack: vale-ctl -h valeXX:em0 allowing sharing the NIC with other netmap clients. - THE USER API HAS SLIGHTLY CHANGED (head/cur/tail pointers instead of pointers/count as before). This was unavoidable to support, in the future, multiple threads operating on the same rings. Netmap clients require very small source code changes to compile again. On the plus side, the new API should be easier to understand and the internals are a lot simpler. The manual page has been updated extensively to reflect the current features and give some examples. This is the result of work of several people including Giuseppe Lettieri, Vincenzo Maffione, Michio Honda and myself, and has been financially supported by EU projects CHANGE and OPENLAB, from NetApp University Research Fund, NEC, and of course the Universita` di Pisa. Notes: svn path=/head/; revision=260368
* Fix build broken in r259644.Gleb Smirnoff2013-12-201-0/+2
| | | | | | | | Submitted by: tuexen Pointy hat to: glebius Notes: svn path=/head/; revision=259646
* ixgbe(4) takes packet counters from hardware in ixgbe_update_stats_counters(),Gleb Smirnoff2013-12-201-2/+0
| | | | | | | | | so we don't need to do a per packet increment, which trashes cache line. Submitted by: oleg Notes: svn path=/head/; revision=259644
* - Fix link loss on vlan reconfiguration.Oleg Bulyzhin2013-11-051-17/+19
| | | | | | | | | | - Fix issues with 'vlanhwfilter'. MFC after: 1 week Silence from: jfv 5 weeks Notes: svn path=/head/; revision=257695
* update to the latest netmap snapshot.Luigi Rizzo2013-11-011-7/+4
| | | | | | | | | | | | | | | | | | | | | | | This includes the following: - use separate memory regions for VALE ports - locking fixes - some simplifications in the NIC-specific routines - performance improvements for the VALE switch - some new features in the pkt-gen test program - documentation updates There are small API changes that require programs to be recompiled (NETMAP_API has been bumped so you will detect old binaries at runtime). In particular: - struct netmap_slot now is 16 bytes to support an extra pointer, which may save one data copy when using VALE ports or VMs; - the struct netmap_if has two extra fields; MFC after: 3 days Notes: svn path=/head/; revision=257529
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-262-0/+6
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* There are some high performance NICs that count statistics in hardware,Gleb Smirnoff2013-10-091-1/+2
| | | | | | | | | | | | | and there are ifnets, that do that via counter(9). Provide a flag that would skip cache line trashing '+=' operation in ether_input(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Reviewed by: melifaro, adrian Approved by: re (marius) Notes: svn path=/head/; revision=256218
* Expose system level ixgbe sysctls.Hiren Panchasara2013-10-051-0/+26
| | | | | | | | | | | | | | Device level sysctls are already exposed as dev.ix.<device> Fixing the case where number of queues for igb is auto-tuned and hw.igb.num_queues does not return current/updated value. Reviewed by: jfv Approved by: re (delphij) MFC after: 2 weeks Notes: svn path=/head/; revision=256069
* Restructure the mbuf pkthdr to make it fit for upcoming capabilities andAndre Oppermann2013-08-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | features. The changes in particular are: o Remove rarely used "header" pointer and replace it with a 64bit protocol/ layer specific union PH_loc for local use. Protocols can flexibly overlay their own 8 to 64 bit fields to store information while the packet is worked on. o Mechanically convert IP reassembly, IGMP/MLD and ATM to use pkthdr.PH_loc instead of pkthdr.header. o Extend csum_flags to 64bits to allow for additional future offload information to be carried (e.g. iSCSI, IPsec offload, and others). o Move the RSS hash type enumerator from abusing m_flags to its own 8bit rsstype field. Adjust accessor macros. o Add cosqos field to store Class of Service / Quality of Service information with the packet. It is not yet supported in any drivers but allows us to get on par with Cisco/Juniper in routing applications (plus MPLS QoS) with a modernized ALTQ. o Add four 8 bit fields l[2-5]hlen to store the relative header offsets from the start of the packet. This is important for various offload capabilities and to relieve the drivers from having to parse the packet and protocol headers to find out location of checksums and other information. Header parsing in drivers is a lot of copy-paste and unhandled corner cases which we want to avoid. o Add another flexible 64bit union to map various additional persistent packet information, like ether_vtag, tso_segsz and csum fields. Depending on the csum_flags settings some fields may have different usage making it very flexible and adaptable to future capabilities. o Restructure the CSUM flags to better signify their outbound (down the stack) and inbound (up the stack) use. The CSUM flags used to be a bit chaotic and rather poorly documented leading to incorrect use in many places. Bring clarity into their use through better naming. Compatibility mappings are provided to preserve the API. The drivers can be corrected one by one and MFC'd without issue. o The size of pkthdr stays the same at 48/56bytes (32/64bit architectures). Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254804
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-7/+1
| | | | | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day Notes: svn path=/head/; revision=254263
* Improve the MSIX setup code in the drivers, thanks to Marius forJack F Vogel2013-08-122-2/+10
| | | | | | | | | | | the changes. Make sure that pci_alloc_msix() does give us the vectors we need and fall back to MSI when it doesn't, also release any that were allocated when insufficient. MFC after: 3 days Notes: svn path=/head/; revision=254262
* Make the various driver MSIX setup routines fallback to MSI moreJack F Vogel2013-08-062-27/+26
| | | | | | | | | | gracefully. This change was suggested by Marius Strobl, thank you. PR: kern/181016 MFC after: ASAP Notes: svn path=/head/; revision=254008
* Correct a fat-finger in the last delta.Jack F Vogel2013-08-051-1/+1
| | | | | | | MFC after: ASAP Notes: svn path=/head/; revision=253965
* A number of important fixes:Jack F Vogel2013-08-011-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - mbuf reused after an RX_COPY optimized operation can sometimes have a bogus cached address, resulting in TCP hangs. Add critical save points to the cached address. Thanks to Michael and the team at Verisign for finding this problem. - A couple more spots where the rxbuf->flags member should be cleared just to be sure no incorrect RX_COPY state is left around. Thanks to Adrian for tracking these down. - Remove the rearm_queues function from the driver, this was found to be responsible for some out-of-order packets by Verisign, and was always a bandaid, with the other fixes in this delta the bandaid can finally be removed. - In the other/link interrupt handler the entire state of the EICS register was being writen back into EICR (which clears causes and thus re-enables those interrupts), this was wrong, so now mask off the queue portion of the register value, so we only clear the other/link interrupt we intend. Marc from Verisign found this. - Make the SFP+ unsupported option tuneable now, by customer request. - Finally, just a couple of minor DEBUG string fixes. I want to call out and thank all the participants in the 10G community/Intel calls for helping track down these problems and make the driver better for everyone! MFC after: 3 days, these are critical fixes for 9.2! Notes: svn path=/head/; revision=253865
* Opps, need to change the VF code as well.Jack F Vogel2013-07-121-3/+0
| | | | | | | MFC after: ASAP Notes: svn path=/head/; revision=253285
* Remove the conditional define around the option headers,Jack F Vogel2013-07-121-3/+0
| | | | | | | | | | | | when building the driver as a module the result of the present system results in INET and INET6 being undefined, and will cause the panic in ixgbe_tso_setup(). The Makefile in the module directory now renders the conditional in the source unnecessary and wrong. MFC after: ASAP - the panic as a module must not get into 9.2 Notes: svn path=/head/; revision=253284
* Fix my last commit, flags rather than flag... duh.Jack F Vogel2013-07-111-1/+1
| | | | | | | MFC after: 2 days Notes: svn path=/head/; revision=253179
* Fix to a panic found internally, bad pointer during rxeofJack F Vogel2013-07-101-0/+1
| | | | | | | | | | | processing. Thanks for John Baldwin for catching this. Not clearing the flag member of the rxbuf could result in a NULL mbuf pointer being used. MFC after: 2 days (this needs to get into 9.2!) Notes: svn path=/head/; revision=253176
* Add quad port probe support, this gives the admin proper information about ↵Jack F Vogel2013-06-1822-454/+3135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the slot (which should be a PCIE Gen 3 slot for this adapter) by looking back thru the PCI parent devices to the slot device. The fix above also corrects the bandwidth display to GT/s rather than the incorrect Gb/s Next, allow the use of ALTQ if you select the compile option IXGBE_LEGACY_TX. Allow the use of 'unsupported' optic modules by a compile option as well. Add a phy reset capability into the stop code, this is so a static configured driver will still behave properly when taken down (not being able to unload it). This revision synchronizes the shared code with Intel internal current code, and note that it now includes DCB supporting code, this was necessitated by some internal changes with the code, but it also will provide the opportunity to develop this feature in the core driver down the road. I have edited the README to get rid of some of the worse anachronisms in it as well, its by no means as robust as I might wish at this point however. Oh, I also have included some conditional stuff in the code so it will be compatible in both the 9.X and 10 environments. Performance has been a focus in recent changes and I believe this revision driver will perform very well in most workloads. MFC after: 2 weeks Notes: svn path=/head/; revision=251964
* use netmap_rx_irq() / netmap_tx_irq() to handle interrupts inLuigi Rizzo2013-04-301-23/+4
| | | | | | | | | netmap mode, removing the logic from individual drivers. (note: if_lem.c not updated yet due to some other pending modifications) Notes: svn path=/head/; revision=250108
* Two small fixes:Jack F Vogel2013-03-291-8/+36
| | | | | | | | | | | | | Set promiscuous code was unconditionally turning off multicast when turning off promiscuous mode, this should only be done when there are less than MAX groups. Thanks to Mike Karels for this correction. Second, the overtmp interrupt setup/detection was wrong, correcting it. MFC after: one week Notes: svn path=/head/; revision=248901
* Fix a small, but important bug, a task drain was mistakenlyJack F Vogel2013-03-041-1/+1
| | | | | | | | | | | being compiled only when setting LEGACY_TX, this means you would not get the drain when needed on detach!! Thanks to Bryan Venteicher (bryanv@freebsd.org) for catching this little gremlin!! :) Notes: svn path=/head/; revision=247823
* First, sync to internal shared code, and thenJack F Vogel2013-03-0419-292/+1005
| | | | | | | | | | | | | | | | | | Fixes: - flow control - don't override user value on re-init - fix to make 1G optics work correctly - change to interrupt enabling - some bits were incorrect for certain hardware. - certain stats fixes, remove a duplicate increment of ierror, thanks to Scott Long for pointing these out. - shared code link interface changed, requiring some core code changes to accomodate this. - add an m_adj() to ETHER_ALIGN on the recieve side, this was requested by Mike Karels, thanks Mike. - Multicast code corrections also thanks to Mike Karels. Notes: svn path=/head/; revision=247822
* revert 247035Dag-Erling Smørgrav2013-02-201-16/+18
| | | | Notes: svn path=/head/; revision=247056
* Reduce excessive nesting.Dag-Erling Smørgrav2013-02-201-18/+16
| | | | Notes: svn path=/head/; revision=247035
* This fixes a out-of-order problem with severalRandall Stewart2013-02-072-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the newer drivers. The basic problem was that the driver was pulling the mbuf off the drbr ring and then when sending with xmit(), encounting a full transmit ring. Thus the lower layer xmit() function would return an error, and the drivers would then append the data back on to the ring. For TCP this is a horrible scenario sure to bring on a fast-retransmit. The fix is to use drbr_peek() to pull the data pointer but not remove it from the ring. If it fails then we either call the new drbr_putback or drbr_advance method. Advance moves it forward (we do this sometimes when the xmit() function frees the mbuf). When we succeed we always call advance. The putback will always copy the mbuf back to the top of the ring. Note that the putback *cannot* be used with a drbr_dequeue() only with drbr_peek(). We most of the time, in putback, would not need to copy it back since most likey the mbuf is still the same, but sometimes xmit() functions will change the mbuf via a pullup or other call. So the optimial case for the single consumer is to always copy it back. If we ever do a multiple_consumer (for lagg?) we will need a test and atomic in the put back possibly a seperate putback_mc() in the ring buf. Reviewed by: jhb@freebsd.org, jlv@freebsd.org Notes: svn path=/head/; revision=246482
* Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez2013-01-302-2/+4
| | | | | | | | | | device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
* Clean some 'svn:executable' properties in the tree.Pedro F. Giffuni2013-01-264-0/+0
| | | | | | | | Submitted by: Christoph Mallon MFC after: 3 days Notes: svn path=/head/; revision=245952
* rename the 'tag' and 'map' fields used the rx ring to theirLuigi Rizzo2012-12-202-23/+23
| | | | | | | | | | | | 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
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-042-4/+4
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* Remove the sysctl process_limit interface, after someJack F Vogel2012-12-031-43/+7
| | | | | | | | | | | | | thought I've decided its overkill,a simple tuneable for each RX and TX limit, and then init sets the ring values based on that, should be sufficient. More importantly, fix a bug causing a panic, when changing the define style to IXGBE_LEGACY_TX a taskqueue init was inadvertently set #ifdef when it should be #ifndef. Notes: svn path=/head/; revision=243833
* Patch #12 OK, I said there was only 11 patches, but unfortunatelyJack F Vogel2012-12-011-22/+42
| | | | | | | | | the revamped sysctl code did not work, and needed a change. This makes the limit get set at the time that all sysctl stats are created and is actually more elegant imho anyway. Notes: svn path=/head/; revision=243741
* Patch #11 - The final patch: this one greatly improves theJack F Vogel2012-12-012-84/+86
| | | | | | | | | | | | | TX hot path by getting rid of index calculations and simply managing pointers. Much of the creative code is due to my coworker here at Intel, Alex Duyck, thanks Alex! Also, this whole series of patches was given the critical eye of Gleb Smirnoff and is all the better for it, thanks Gleb! Notes: svn path=/head/; revision=243736
* Patch #10 Performance - this changes the protocol offloadJack F Vogel2012-12-011-52/+46
| | | | | | | | interface and code in the TX path,making it tighter and hopefully more efficient. Notes: svn path=/head/; revision=243735
* Patch #9 Performance - improve the tx dma failureJack F Vogel2012-11-301-25/+22
| | | | | | | path, similar to a change done in igb long ago. Notes: svn path=/head/; revision=243733
* Patch #8 Performance changes - this one improves locality,Jack F Vogel2012-11-302-57/+58
| | | | | | | | | moving some counters and data to the ring struct from the adapter struct, also compressing some data in the move. Notes: svn path=/head/; revision=243729
* Patch #7 This is primarily about processing limit control.Jack F Vogel2012-11-302-17/+28
| | | | | | | | | | | | | | | - add a limit for both RX and TX, change the default to 256 - change the sysctl usage to be common, and now to be called during init for each ring. - the TX limit is not yet used, but the changes in the last patch in this series uses the value. - the motivation behind these changes is to improve data locality in the final code. - rxeof interface changes since it now gets limit from the ring struct Notes: svn path=/head/; revision=243728
* Patch #6 Whitespace cleanup, and removal of some very oldJack F Vogel2012-11-302-44/+36
| | | | | | | | | | | defines (at Gleb's request). Also, change the defines around the old transmit code to IXGBE_LEGACY_TX, I do this to make it possible to define this regardless of the OS level (it is not defined by default). There are also a couple changed comments for clarity. Notes: svn path=/head/; revision=243725
* Patch #5 Cleanup unused IEEE1588 code fragments, the day mayJack F Vogel2012-11-302-11/+1
| | | | | | | | come when this feature gets implemented, but its not here yet and I see no reason to leave this laying around. Notes: svn path=/head/; revision=243724
* Patch #4 - this does two things, it removes a number of statistics,Jack F Vogel2012-11-301-28/+7
| | | | | | | | | | | | these are FCOE stats (fiber channel over ethernet), something that FreeBSD does not yet have, they were mistaken for flow control by the implementor I believe. Secondly, the real flow control stats are oddly named with a 'link' tag on the front, it was requested by my validation engineer to make these stats have the same name as the igb driver for clarity and that seemed reasonable to me. Notes: svn path=/head/; revision=243721
* Patch #3 - Add a new ioctl to access SFP+ module diagnosticJack F Vogel2012-11-302-2/+28
| | | | | | | data via the I2C routines in shared code. Notes: svn path=/head/; revision=243718
* Patch #2 - remove OACTIVE and DEPLETED notions from theJack F Vogel2012-11-302-44/+13
| | | | | | | | | multiqueue code, this functionality has proven to be more trouble than it was worth. Thanks to Gleb for a second critical look over my code and help in the patches! Notes: svn path=/head/; revision=243716
* First of a series of 11 patches leading to new ixgbe version 2.5.0Jack F Vogel2012-11-302-310/+107
| | | | | | | This removes the header split and supporting code from the driver. Notes: svn path=/head/; revision=243714
* A few important fixes:Jack F Vogel2012-10-311-11/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Testing TSO6 has led me to discover that HW RSC is a problematic feature, it is ONLY designed to work with IPv4 in the first place, and if IP forwarding is done it can't be disabled as LRO in the stack, also initial testing we've done at Intel shows an equal performance using TSO[46] on the TX and LRO on RX, if you ran older code on 82599 or later hardware you actually could have detrimental performance for this reason. So I am disabling the feature by default and all our adapters will now use LRO instead. - If you have flow control off and multiple queues it was possible when the buffer of one queue becomes full that all RX movement is stalled, to eliminate this problem a feature bit is now set that will allow packets to be dropped when full rather than stall. Note, the default is to have flow control on, and this keeps this from happening. - Because of the recent fixes in the stack, LRO is now auto-disabled when problematic, so I have decided to enable it by default in the capabilities in the driver. - There are some 1G modules used by some customers, a couple small tweaks to properly support those in the media code. - A note: we have now done some testing of TSO6 and using LRO with IPv6 and it all works great!! Seeing line rate in both directions in best cases. Thanks bz for your excellent work!! Notes: svn path=/head/; revision=242421
* Correct code that was lost somewhere in the past,Jack F Vogel2012-10-311-1/+1
| | | | | | | | | this was designed to keep duplicate null vlan tags from being added. When doing vlans purely via the switch this problem will occur. Reported by external customer. Notes: svn path=/head/; revision=242403
* Now that device disabling is generic, remove extraneous code from theEitan Adler2012-10-222-10/+0
| | | | | | | | | | | | | device drivers that used to provide this feature. This is a subset of 241856 (which was reverted) Reviewed by: des Approved by: cperciva (implicit) MFC after: 1 week Notes: svn path=/head/; revision=241917
* This isn't functionally identical. In some cases a hint to disableEitan Adler2012-10-222-0/+10
| | | | | | | | | | | unit 0 would in fact disable all units. This reverts r241856 Approved by: cperciva (implicit) Notes: svn path=/head/; revision=241885
* Now that device disabling is generic, remove extraneous code from theEitan Adler2012-10-222-10/+0
| | | | | | | | | | | device drivers that used to provide this feature. Reviewed by: des Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241856
* provide helper if_initbaudrate() to set if_baudrate_pf and if_baudrate_pf.Maksim Yevmenkin2012-10-171-2/+1
| | | | | | | | | | again, use ixgbe(4) as an example of how to use new helper function. Reviewed by: jhb MFC after: 1 week Notes: svn path=/head/; revision=241646