aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/e1000/if_igb.c
Commit message (Collapse)AuthorAgeFilesLines
* Migrate e1000 to the IFLIB framework:Sean Bruno2017-01-101-6450/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - em(4) igb(4) and lem(4) - deprecate the igb device from kernel configurations - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko Devices tested: - 82574L - I218-LM - 82546GB - 82579LM - I350 - I217 Please report problems to freebsd-net@freebsd.org Partial review from jhb and suggestions on how to *not* brick folks who originally would have lost their igbX device. Submitted by: mmacy@nextbsd.org MFC after: 2 weeks Relnotes: yes Sponsored by: Limelight Networks and Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8299 Notes: svn path=/head/; revision=311849
* The igb driver currently requires a VF interface to have a non-zero MACSean Bruno2016-11-071-5/+14
| | | | | | | | | | | | | | address, but the associated PF is giving the VF an all zeros MAC address when one is not administratively assigned. The driver should check for this case and generate a random address, similar to how the linux igbvf driver does. Submitted by: skoumjian@juniper.net (Scott Koumjian) MFH: 2 weeks Differential Revision: https://reviews.freebsd.org/D8399 Notes: svn path=/head/; revision=308429
* Remove uneeded parens.Sean Bruno2016-07-201-1/+1
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=303110
* Do not initialize the adapter on MTU change when adapter status is down.Sean Bruno2016-07-071-1/+2
| | | | | | | | | | | | | | | This fixes long-standing problems when changing settings of the adapter. Discussed in: https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html Submitted by: arnaud.ysmal@stormshield.eu Reviewed by: erj@freebsd.org Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D7030 Notes: svn path=/head/; revision=302384
* net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash propertiesSepherosa Ziehau2016-06-071-1/+1
| | | | | | | | | Reviewed by: hps, erj, tuexen Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6688 Notes: svn path=/head/; revision=301538
* dev/e1000,ixgbe: minor spelling fixes.Pedro F. Giffuni2016-05-061-2/+2
| | | | | | | | | No functional change. Differential Revision: https://reviews.freebsd.org/D6177 Notes: svn path=/head/; revision=299200
* Since igb_detach() cleans up all the data structures that will beSean Bruno2016-05-061-1/+2
| | | | | | | | | | | | free'd by the functions following its call, we can simply return instead of crashing and burning in the event of igb_detach() failing. PR: 197139 Submitted by: rupavath@juniper.net MFC after: 2 weeks Notes: svn path=/head/; revision=299188
* Correct possible underflow conditions when checking for available spaceSean Bruno2016-04-181-1/+1
| | | | | | | | | | | | in the tx h/w ring buffer. Reviewed by: gnn jeb.j.cramer@intel.com MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5918 Notes: svn path=/head/; revision=298224
* tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplicationSepherosa Ziehau2016-04-011-5/+1
| | | | | | | | | | | | And factor out tcp_lro_rx_done, which deduplicates the same logic with netinet/tcp_lro.c Reviewed by: gallatin (1st version), hps, zbb, np, Dexuan Cui <decui microsoft com> Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5725 Notes: svn path=/head/; revision=297482
* Support checksum offloading for TCP/IPV6 and UDP/IPV6.Michael Tuexen2016-03-221-6/+48
| | | | | | | | | | | | Support SCTP checksum offloading for SCTP/IPV6. Support SCTP checksum offloading on all controllers except 82575. Reviewed by: sbruno@, erj@ MFC after: 4 weeks Differential Revision: D5193 Notes: svn path=/head/; revision=297187
* Fix and clean up usage of DMA and TSO segments:Marius Strobl2016-02-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - At Intel it is believed that most of their products support "only" 40 DMA segments so lower {EM,IGB}_MAX_SCATTER accordingly. Actually, 40 is more than plenty to handle full size TSO packets so it doesn't make sense to further distinguish between MAC variants that really can do 64 DMA segments. Moreover, capping at 40 DMA segments limits the stack usage of {em,igb}_xmit() that - given the rare use of more than these - previously hardly was justifiable, while still being sufficient to avoid the problems seen with em(4) and EM_MAX_SCATTER set to 32. - In igb(4), pass the actually supported TSO parameters up the stack. Previously, the defaults set in if_attach_internal() were applied, i. e. a maximum of 35 TSO segments, which made supporting more than these in the driver pointless. However, this might explain why no problems were seen with IGB_MAX_SCATTER at 64. - In em(4), take the 5 m_pullup(9) invocations performed by em_xmit() in the TSO case into account when reporting TSO parameters upwards. In the worst case, each of these calls will add another mbuf and, thus, the requirement for an additional DMA segment. So for best performance, it doesn't make sense to advertize a maximum of TSO segments that typically will require defragmentation in em_xmit(). Again, this leaves enough room to handle full size TSO packets. - Drop TSO macros from if_lem.h given that corresponding MACS don't support TSO in the first place. Reviewed by: erj, sbruno, jeffrey.e.pieper_intel.com Approved by: erj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D5238 Notes: svn path=/head/; revision=295906
* Update em(4) to 7.6.1; update igb(4) to 2.5.3.Eric Joyner2016-02-051-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major changes: - Add i219/i219(2) hardware support. (Found on Skylake generation and newer chipsets.) - Further to the last Skylake support diff, this one also includes support for the Lewisburg chipset (i219(3)). - Add a workaround to an igb hardware errata. All 1G server products need to have IPv6 extension header parsing turned off. This should be listed in the specification updates for current 1G server products, e.g. for i350 it's errata #37 in this document: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/ethernet-controller-i350-spec-update.pdf - Avoton (i354) PHY errata workaround added And a bunch of minor fixes, as well as #defines for things that the current em(4)/igb(4) drivers don't implement. Differential Revision: https://reviews.freebsd.org/D3162 Reviewed by: sbruno, marius, gnn Approved by: gnn MFC after: 2 weeks Sponsored by: Intel Corporation Notes: svn path=/head/; revision=295323
* Add optimizing LRO wrapper:Hans Petter Selasky2016-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add optimizing LRO wrapper which pre-sorts all incoming packets according to the hash type and flowid. This prevents exhaustion of the LRO entries due to too many connections at the same time. Testing using a larger number of higher bandwidth TCP connections showed that the incoming ACK packet aggregation rate increased from ~1.3:1 to almost 3:1. Another test showed that for a number of TCP connections greater than 16 per hardware receive ring, where 8 TCP connections was the LRO active entry limit, there was a significant improvement in throughput due to being able to fully aggregate more than 8 TCP stream. For very few very high bandwidth TCP streams, the optimizing LRO wrapper will add CPU usage instead of reducing CPU usage. This is expected. Network drivers which want to use the optimizing LRO wrapper needs to call "tcp_lro_queue_mbuf()" instead of "tcp_lro_rx()" and "tcp_lro_flush_all()" instead of "tcp_lro_flush()". Further the LRO control structure must be initialized using "tcp_lro_init_args()" passing a non-zero number into the "lro_mbufs" argument. - Make LRO statistics 64-bit. Previously 32-bit integers were used for statistics which can be prone to wrap-around. Fix this while at it and update all SYSCTL's which expose LRO statistics. - Ensure all data is freed when destroying a LRO control structures, especially leftover LRO entries. - Reduce number of memory allocations needed when setting up a LRO control structure by precomputing the total amount of memory needed. - Add own memory allocation counter for LRO. - Bump the FreeBSD version to force recompilation of all KLDs due to change of the LRO control structure size. Sponsored by: Mellanox Technologies Reviewed by: gallatin, sbruno, rrs, gnn, transport Tested by: Netflix Differential Revision: https://reviews.freebsd.org/D4914 Notes: svn path=/head/; revision=294327
* Given that em(4), lem(4) and igb(4) hardware doesn't require theMarius Strobl2016-01-131-4/+8
| | | | | | | | | | | | alignment guarantees provided by m_defrag(9), use m_collapse(9) instead for performance reasons. While at it, sanitize the statistics softc members, i. e. retire unused ones and add SYSCTL nodes missing for actually used ones. Differential Revision: https://reviews.freebsd.org/D4717 Notes: svn path=/head/; revision=293854
* Add support for sysctl knobs to live tune the tx packet processing limitsSean Bruno2015-12-231-2/+12
| | | | | | | | | | | | | in igb and fix a wrap-around bug. Reviewed by: hiren Obtained from: Jason (j@nitrology.com) MFC after: 2 weeks Sponsored by: LimeLight Networks Differential Revision: https://reviews.freebsd.org/D4039 Notes: svn path=/head/; revision=292670
* Add support for SCTP checksum offloading for the 82580 controllerMichael Tuexen2015-11-101-4/+7
| | | | | | | | | | | similar to the 82576 controller. Tested with Intel i340 cards. Reviewed by: erj@ MFC after: 1 week Notes: svn path=/head/; revision=290641
* Revert 287914,287762.Sean Bruno2015-09-191-4/+4
| | | | | | | | | | Reports of breakage on igb(4) have been narrowed down to 287762 and 287914 is an dependant change. Submitted by: erj Notes: svn path=/head/; revision=287990
* Update em(4) with D3162 after testing further on hardware that failedSean Bruno2015-09-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | to attach with the last version of this commit. This commit fixes attach failures on "ICH8" class devices via modifications to e1000_init_nvm_params_ich8lan() - Fix compiler warning in 80003es2lan.c - Add return value handler for e1000_*_kmrn_reg_80003es2lan - Fix usage of DEBUGOUT - Remove unnecessary variable initializations. - Removed unused variables (complaints from gcc). - Edit defines in 82571.h. - Add workaround for igb hw errata. - Shared code changes for Skylake/I219 support. - Remove unused OBFF and LTR functions. Tested by some of the folks that reported breakage in previous incarnation. Thanks to AllanJude, gjb, gnn, tijl for tempting fate with their machines. Submitted by: erj@freebsd.org MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3162 Notes: svn path=/head/; revision=287762
* Revert last two commits to em(4)/igb(4). Reports are coming in thatSean Bruno2015-09-051-4/+4
| | | | | | | | | this breaks initialization and reads from EEPROM on boot/driver load. r287469 is being reverted as a dependancy on r287467 Notes: svn path=/head/; revision=287492
* e1000: Shared code updatesSean Bruno2015-09-041-4/+4
| | | | | | | | | | | | | | | | | | | | - Fix compiler warning in 80003es2lan.c - Add return value handler for e1000_*_kmrn_reg_80003es2lan - Fix usage of DEBUGOUT - Remove unnecessary variable initializations. - Removed unused variables (complaints from gcc). - Edit defines in 82571.h. - Add workaround for igb hw errata. - Shared code changes for Skylake/I219 support. - Remove unused OBFF and LTR functions. Differential Revision: https://reviews.freebsd.org/D3162 Submitted by: erj MFC after: 1 month Sponsored by: Intel Corporation Notes: svn path=/head/; revision=287467
* igb(4): Update and fix HW errataSean Bruno2015-09-041-145/+57
| | | | | | | | | | | | | - HW errata workaround for IPv6 offload w/ extension headers - Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl Differential Revision: https://reviews.freebsd.org/D3165 Submitted by: erj MFC after: 1 month Sponsored by: Intel Corporation Notes: svn path=/head/; revision=287465
* Bump all copywrite dates to 2015Sean Bruno2015-08-161-1/+1
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D3160 Submitted by: erj MFC after: 2 weeks Sponsored by: Intel Corportation Notes: svn path=/head/; revision=286833
* Free mbufs when busdma loading fails.Hans Petter Selasky2015-08-011-3/+0
| | | | | | | | Reviewed by: erj, sbruno MFC after: 1 month Notes: svn path=/head/; revision=286162
* Sync netmap sources with the version in our private tree.Luigi Rizzo2015-07-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains large contributions from Giuseppe Lettieri and Stefano Garzarella, is partly supported by grants from Verisign and Cisco, and brings in the following: - fix zerocopy monitor ports and introduce copying monitor ports (the latter are lower performance but give access to all traffic in parallel with the application) - exclusive open mode, useful to implement solutions that recover from crashes of the main netmap client (suggested by Patrick Kelsey) - revised memory allocator in preparation for the 'passthrough mode' (ptnetmap) recently presented at bsdcan. ptnetmap is described in S. Garzarella, G. Lettieri, L. Rizzo; Virtual device passthrough for high speed VM networking, ACM/IEEE ANCS 2015, Oakland (CA) May 2015 http://info.iet.unipi.it/~luigi/research.html - fix rx CRC handing on ixl - add module dependencies for netmap when building drivers as modules - minor simplifications to device-specific routines (*txsync, *rxsync) - general code cleanup (remove unused variables, introduce macros to access rings and remove duplicate code, Applications do not need to be recompiled, unless of course they want to use the new features (monitors and exclusive open). Those willing to try this code on stable/10 can just update the sys/dev/netmap/*, sys/net/netmap* with the version in HEAD and apply the small patches to individual device drivers. MFC after: 1 month Sponsored by: (partly) Verisign, Cisco Notes: svn path=/head/; revision=285349
* Various fixes to the stats in igb(4), ixgbe(4), and ixl(4).John Baldwin2015-04-301-5/+74
| | | | | | | | | | | | | | | | | | | | | | - Use hardware counters for ifnet stats in igb(4) when possible. This ensures these stats include packets that bypass the regular stack via netmap. - Don't derefence values off the end of the igb(4) VF stats structure. Instead, add a dedicated if_get_counter method for igb(4) VF interfaces. - Report missed packets on igb(4) as input queue drops rather than an input error. - Report bug_ring drop counts as output queue drops for igb(4) and ixgbe(4). - Export the buf_ring drop stats for individual rings via sysctl on ixgbe(4). - Fix a typo that in ixl(4) that caused output queue drops to be reported as input queue drops and input queue drops to be unreported. Differential Revision: https://reviews.freebsd.org/D2402 Reviewed by: jfv, rstone (6) Sponsored by: Norse Corp, Inc. Notes: svn path=/head/; revision=282280
* For igb(4), when we are doing multiqueue, we are all setup to have full 32bitHiren Panchasara2015-04-211-38/+47
| | | | | | | | | | | | | | | | RSS hash from the card. We do not need to hide that under "ifdef RSS" and should expose that by default so others like lagg(4) can use that and avoid hashing the traffic by themselves. While here, improve comments and get rid of hidden/unimplemented RSS support code for UDP. Differential Revision: https://reviews.freebsd.org/D2296 Reviewed by: jfv, erj Discussed with: adrian Sponsored by: Limelight Networks Notes: svn path=/head/; revision=281838
* Migrate using CPU_ZERO() + CPU_SET() -> CPU_SETOF().Adrian Chadd2015-02-251-2/+1
| | | | | | | | | | | | Tested: * ixgbe, igb, RSS enabled Submitted by: jhb Sponsored by: Norse Corp, Inc. Notes: svn path=/head/; revision=279299
* Change uses of taskqueue_start_threads_pinned() -> ↵Adrian Chadd2015-02-241-2/+7
| | | | | | | | | | taskqueue_start_threads_cpuset() Differential Revision: https://reviews.freebsd.org/D1897 Reviewed by: jfv Notes: svn path=/head/; revision=279255
* Refactor / restructure the RSS code into generic, IPv4 and IPv6 specificAdrian Chadd2015-01-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | bits. The motivation here is to eventually teach netisr and potentially other networking subsystems a bit more about how RSS work queues / buckets are configured so things have a hope of auto-configuring in the future. * net/rss_config.[ch] takes care of the generic bits for doing configuration, hash function selection, etc; * topelitz.[ch] is now in net/ rather than netinet/; * (and would be in libkern if it didn't directly include RSS_KEYSIZE; that's a later thing to fix up.) * netinet/in_rss.[ch] now just contains the IPv4 specific methods; * and netinet/in6_rss.[ch] now just contains the IPv6 specific methods. This should have no functional impact on anyone currently using the RSS support. Differential Revision: D1383 Reviewed by: gnn, jfv (intel driver bits) Notes: svn path=/head/; revision=277331
* Revert r275136, it was not approved, it was sloppy, if a featureJack F Vogel2014-12-021-46/+8
| | | | | | | like this is needed please resubmit for Intel's approval. Notes: svn path=/head/; revision=275431
* Start process of removing the use of the deprecated "M_FLOWID" flagHans Petter Selasky2014-12-011-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275358
* Make igb and ixgbe check tunables at probe time.Alfred Perlstein2014-11-261-11/+46
| | | | | | | | | | | | | | | This allows one to make a kernel module to tune the number of queues before the driver loads. This is needed so that a module at SI_SUB_CPU can set tunables for these drivers to take. Otherwise getenv is called too early by the TUNABLE macros. Reviewed by: smh Phabric: https://reviews.freebsd.org/D1149 Notes: svn path=/head/; revision=275136
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-10-211-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
* Various fixes to stats:John Baldwin2014-10-101-7/+37
| | | | | | | | | | | | | | | - Read the counts of received, dropped, and transmitted management packets and add sysctl nodes for them. - Fix the total octets received/transmitted to read all 64 bits of the counters. - Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot. - Remove spurious spaces. Reviewed by: Eric Joyner @ Intel MFC after: 1 week Notes: svn path=/head/; revision=272897
* - Provide igb_get_counter() to return counters that are not collected,Gleb Smirnoff2014-09-191-17/+30
| | | | | | | | but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Notes: svn path=/head/; revision=271870
* Fix the handling of EOP in status descriptors for if_igb(4) and don'tAdrian Chadd2014-09-181-8/+8
| | | | | | | | | | | | | | | | double-free mbufs. Like ixgbe(4) chipsets, EOP is only set on the final descriptor in a chain of descriptors. So, to free the whole list of descriptors, we should free the current slot _and_ the assembled list of descriptors that make up the fragment list. The existing code was setting discard once it saw EOP + an error status; it then freed all the subsequent descriptors until the next EOP. That's totally the wrong order. Notes: svn path=/head/; revision=271784
* Set DROP_EN on each RX queue if transmit flow-control is disabled.Adrian Chadd2014-09-151-0/+13
| | | | | | | | | | | | | | | | | | | | | This allows the NIC to drop frames on the receive queue and not cause the MAC to block on receiving to _any_ queue. Tested: igb0@pci0:5:0:0: class=0x020000 card=0x152115d9 chip=0x15218086 rev=0x01 hdr=0x00 vendor = 'Intel Corporation' device = 'I350 Gigabit Network Connection' class = network subclass = ethernet Discussed with: Eric Joyner <eric.joyner@intel.com> MFC after: 1 week Sponsored by: Norse Corp, Inc. Notes: svn path=/head/; revision=271645
* Use define from if_var.h to access a field inside struct if_data,Gleb Smirnoff2014-08-301-1/+1
| | | | | | | | | that resides in struct ifnet. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270856
* Update to the current version of netmap.Luigi Rizzo2014-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly bugfixes or features developed in the past 6 months, so this is a 10.1 candidate. Basically no user API changes (some bugfixes in sys/net/netmap_user.h). In detail: 1. netmap support for virtio-net, including in netmap mode. Under bhyve and with a netmap backend [2] we reach over 1Mpps with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode. 2. (kernel) add support for multiple memory allocators, so we can better partition physical and virtual interfaces giving access to separate users. The most visible effect is one additional argument to the various kernel functions to compute buffer addresses. All netmap-supported drivers are affected, but changes are mechanical and trivial 3. (kernel) simplify the prototype for *txsync() and *rxsync() driver methods. All netmap drivers affected, changes mostly mechanical. 4. add support for netmap-monitor ports. Think of it as a mirroring port on a physical switch: a netmap monitor port replicates traffic present on the main port. Restrictions apply. Drive carefully. 5. if_lem.c: support for various paravirtualization features, experimental and disabled by default. Most of these are described in our ANCS'13 paper [1]. Paravirtualized support in netmap mode is new, and beats the numbers in the paper by a large factor (under qemu-kvm, we measured gues-host throughput up to 10-12 Mpps). A lot of refactoring and additional documentation in the files in sys/dev/netmap, but apart from #2 and #3 above, almost nothing of this stuff is visible to other kernel parts. Example programs in tools/tools/netmap have been updated with bugfixes and to support more of the existing features. This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline. A lot of this code has been contributed by my colleagues at UNIPI, including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella. MFC after: 3 days. Notes: svn path=/head/; revision=270063
* Fix the igb(4) redirection table to correctly populate.Adrian Chadd2014-07-231-10/+14
| | | | | | | | | | | This is similar to the ixgbe(4) fix. Tested: * Intel I350 gigabit adapter Notes: svn path=/head/; revision=269009
* The description is a bit misleading. Trying to make it more obvious.Hiren Panchasara2014-07-181-1/+1
| | | | | | | | Phabric: https://phabric.freebsd.org/D435 Reviewed by: gnn Notes: svn path=/head/; revision=268847
* Initialise these variables so gcc doesn't complain.Adrian Chadd2014-06-301-1/+1
| | | | | | | Submitted by: luigi Notes: svn path=/head/; revision=268067
* Add initial RSS awareness to the igb(4) driver.Adrian Chadd2014-06-301-45/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The igb(4) hardware is capable of RSS hashing RX packets and doing RSS queue selection for up to 8 queues. (I believe some hardware is limited to 4 queues, but I haven't tested on that.) However, even if multi-queue is enabled for igb(4), the RX path doesn't use the RSS flowid from the received descriptor. It just uses the MSIX queue id. This patch does a handful of things if RSS is enabled: * Instead of using a random key at boot, fetch the RSS key from the RSS code and program that in to the RSS redirection table. That whole chunk of code should be double checked for endian correctness. * Use the RSS queue mapping to CPU ID to figure out where to thread pin the RX swi thread and the taskqueue threads for each queue. * The software queue is now really an "RSS bucket". * When programming the RSS indirection table, use the RSS code to figure out which RSS bucket each slot in the indirection table maps to. * When transmitting, use the flowid RSS mapping if the mbuf has an RSS aware hash. The existing method wasn't guaranteed to align correctly with the destination RSS bucket (and thus CPU ID.) This code warns if the number of RSS buckets isn't the same as the automatically configured number of hardware queues. The administrator will have to tweak one of them for better performance. There's currently no way to re-balance the RSS indirection table after startup. I'll worry about that later. Additionally, it may be worthwhile to always use the full 32 bit flowid if multi-queue is enabled. It'll make things like lagg(4) behave better with respect to traffic distribution. Notes: svn path=/head/; revision=268028
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-10/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+10
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* - Don't compare bus_dma map pointers for static DMA allocations againstJohn Baldwin2014-06-121-3/+5
| | | | | | | | | | | NULL to determine if bus_dmamap_unload() or bus_dmamem_free() should be called. Instead, check the associated bus and virtual addresses. - Don't clear static DMA maps to NULL. Reviewed by: jfv Notes: svn path=/head/; revision=267385
* make sure if_transmit returns 0 if the mbuf is enqueued.Luigi Rizzo2014-06-061-2/+2
| | | | | | | | | | ixgbe/ixv.c still needs a similar fix but it takes a little more restructuring of the code. MFC after: 3 days Notes: svn path=/head/; revision=267187
* reference the correct variable in a commentLuigi Rizzo2014-05-281-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=266790
* Fix compilation with IGB_LEGACY_TX defined.Gleb Smirnoff2014-01-251-0/+2
| | | | | | | | PR: 185909 Submitted by: Aurelien Rougemont <beorn binaries.fr> Notes: svn path=/head/; revision=261169