aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mxge
Commit message (Collapse)AuthorAgeFilesLines
* MFC r329295:Ravi Pokala2018-02-221-6/+2
| | | | | | | | | | | | | | | | | | | Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when the NIC is not a member of a lagg. This came as a surprise, because the SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the laggX interface, rather than a physical port) or EINVAL (if run against a non-member physical port). This behavior was not seen with other drivers, such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl handlers, I found that they all called ether_ioctl() for the default (i.e. unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two specific cases, and returns ENOTTY for the default case. Remove the two cases which explicitly call ether_ioctl(), and let the default case call it instead. This matches what the vast majority of the NIC drivers do. Notes: svn path=/stable/10/; revision=329834
* MFC 299506Sepherosa Ziehau2016-06-211-11/+10
| | | | | | | | | | | | mxge: Setup mbuf flowid before calling tcp_lro_rx(). Reviewed by: gallatin MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6320 Notes: svn path=/stable/10/; revision=302052
* MFC r275358 r275483 r276982 - Removing M_FLOWID by hps@Hiren Panchasara2015-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r275358: Start process of removing the use of the deprecated "M_FLOWID" flag 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. r275483: Remove M_FLOWID from SCTP code. r276982: Remove no longer used "M_FLOWID" flag from mbuf.h and update the netisr manpage. Note: The FreeBSD version has been bumped. Reviewed by: hps, tuexen Sponsored by: Limelight Networks Notes: svn path=/stable/10/; revision=281955
* MFC r263710, r273377, r273378, r273423 and r273455:Hans Petter Selasky2014-10-271-3/+3
| | | | | | | | | | - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=273736
* MFC r258779,r258780,r258787,r258822:Eitan Adler2014-02-041-1/+1
| | | | | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Notes: svn path=/stable/10/; revision=261455
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-4/+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
* - Correct mispellings of word resourceGabor Kovesdan2013-04-171-1/+1
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=249586
* Several cleanups and fixes to mxge:Andrew Gallatin2013-02-251-46/+25
| | | | | | | | | | | | | | | | | | | | | | | - Remove vestigial null pointer tests after malloc(..., M_WAITOK). - Remove vestigal qualhack union - Use strlcpy() instead of the error-prone strncpy() when parsing EEPROM and copying strings - Check the MAC address in the EEPROM strings more strictly. - Expand the macro MXGE_NEXT_STRING() at its only user. Due to a typo, the macro was very confusing. - Remove unnecessary buffer limit check. The buffer is double-NUL terminated per construction. PR: kern/176369 Submitted by: Christoph Mallon <christoph.mallon gmx.de> Notes: svn path=/head/; revision=247268
* Bump mxge copyright.Andrew Gallatin2013-02-222-2/+2
| | | | | | | | | Sponsored by: Myricom MFC After: 7 days Notes: svn path=/head/; revision=247160
* Improvements for newer mxge nics:Andrew Gallatin2013-02-221-4/+12
| | | | | | | | | | | | | | | | - Some mxge nics may store the serial number in the SN2 field of the EEPROM. These will also have an SN=0 field, so parse the SN2 field, and give it precedence. - Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it. This saves roughly 10ms per port at device attach time. Sponsored by: Myricom MFC After: 7 days Notes: svn path=/head/; revision=247159
* Try harder to make mxge safe for all combinations of INET and INET6Andrew Gallatin2013-02-221-2/+5
| | | | | | | | | | | | | | | | | | | | - Re-fix build by restoring local removed in r247151, but protected by #if defined(INET) || defined(INET6) so that the compile succeeds in the !(INET||INET6) case. - Protect call to in_pseudo() with an #ifdef INET, to allow a kernel to link with mxge when INET is not compiled in. - Also remove an errant (improperly commented) obsolete debugging printf Thanks to Glebius for pointing out the !(INET||INET6) build issue. Sponsored by: Myricom MFC After: 7 days Notes: svn path=/head/; revision=247152
* Fix build.Gleb Smirnoff2013-02-221-1/+0
| | | | Notes: svn path=/head/; revision=247151
* Improve mxge's receive performance for IPv6:Andrew Gallatin2013-02-213-530/+148
| | | | | | | | | | | | - Add support for IPv6 rx csum offload - Finally switch mxge from using its own driver lro, to using tcp_lro MFC after: 7 days Sponsored by: Myricom Inc. Notes: svn path=/head/; revision=247133
* Add support to mxge for IPv6 TX csum offload & IPv6 TSO.Andrew Gallatin2013-02-192-52/+226
| | | | | | | | Sponsored by: Myricom, Inc. MFC after: 7 days Notes: svn path=/head/; revision=247011
* Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez2013-01-301-1/+2
| | | | | | | | | | device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* Utilize new macro to initialize if_baudrate.Gleb Smirnoff2012-10-181-2/+2
| | | | Notes: svn path=/head/; revision=241687
* Revert previous commit...Kevin Lo2012-10-104-4/+4
| | | | | | | Pointyhat to: kevlo (myself) Notes: svn path=/head/; revision=241394
* Prefer NULL over 0 for pointersKevin Lo2012-10-094-4/+4
| | | | Notes: svn path=/head/; revision=241370
* The drbr(9) API appeared to be so unclear, that most drivers inGleb Smirnoff2012-09-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tree used it incorrectly, which lead to inaccurate overrated if_obytes accounting. The drbr(9) used to update ifnet stats on drbr_enqueue(), which is not accurate since enqueuing doesn't imply successful processing by driver. Dequeuing neither mean that. Most drivers also called drbr_stats_update() which did accounting again, leading to doubled if_obytes statistics. And in case of severe transmitting, when a packet could be several times enqueued and dequeued it could have been accounted several times. o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between ALTQ queueing or buf_ring(9) queueing. - It doesn't touch the buf_ring stats any more. - It doesn't touch ifnet stats anymore. - drbr_stats_update() no longer exists. o buf_ring(9) handles its stats itself: - It handles br_drops itself. - br_prod_bytes stats are dropped. Rationale: no one ever reads them but update of a common counter on every packet negatively affects performance due to excessive cache invalidation. - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since we no longer account bytes. o Drivers handle their stats theirselves: if_obytes, if_omcasts. o mlx4(4), igb(4), em(4), vxge(4), oce(4) and ixv(4) no longer use drbr_stats_update(), and update ifnet stats theirselves. o bxe(4) was the most correct driver, it didn't call drbr_stats_update(), thus it was the only driver accurate under moderate load. Now it also maintains stats itself. o ixgbe(4) had already taken stats from hardware, so just - drop software stats updating. - take multicast packet count from hardware as well. o mxge(4) just no longer needs NO_SLOW_STATS define. o cxgb(4), cxgbe(4) need no change, since they obtain stats from hardware. Reviewed by: jfv, gnn Notes: svn path=/head/; revision=241037
* Update mxge(4) firmware to the latest version available fromAndrew Gallatin2012-05-294-34836/+34187
| | | | | | | | | | Myricom (1.4.55). MFC after: 3 days Sponored by: Myricom, Inc. Notes: svn path=/head/; revision=236212
* More conversions of drivers to use the PCI parent DMA tag.Scott Long2012-03-121-1/+1
| | | | Notes: svn path=/head/; revision=232874
* Use strchr() and strrchr().Ed Schouten2012-01-021-1/+1
| | | | | | | | | | | It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel. Notes: svn path=/head/; revision=229272
* Update mxge(4) firmware to the latest version available fromAndrew Gallatin2011-07-124-34013/+34835
| | | | | | | | | | Myricom (1.4.53a). MFC after: 7 days Sponored by: Myricom, Inc. Notes: svn path=/head/; revision=223958
* Fix media reporting for dual port CX4 myri10ge NICsAndrew Gallatin2011-07-121-1/+1
| | | | | | | | MFC after: 7 days Sponsored by: Myricom, Inc. Notes: svn path=/head/; revision=223957
* Fix a bug in mxge's LRO which can cause dup acks toAndrew Gallatin2011-04-071-2/+4
| | | | | | | | | | | | get aggregated & hence prevent TCP from entering fast retransmit. Pointed out by: jeff Reviewed by: gnn MFC after: 7 days Notes: svn path=/head/; revision=220424
* Implement mxge_init()Andrew Gallatin2011-04-061-0/+8
| | | | | | | | | | | | | | This fixes a long standing bug in mxge(4) where "ifconfig mxge0 $IP" did not bring the interface into a RUNNING state, like it does on most (all?) other FreeBSD NIC drivers. Thanks to gnn for mentioning the bug, and yongari for pointing out that ether_ioctl() invokes ifp->if_init() in SIOCSIFADDR. MFC after: 7 days Notes: svn path=/head/; revision=220385
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls toJohn Baldwin2011-03-231-3/+3
| | | | | | | pci_find_cap() instead. Notes: svn path=/head/; revision=219902
* Use a regular taskqueue rather than a fast taskqueue for mxge(4).John Baldwin2011-01-071-3/+2
| | | | | | | Reviewed by: gallatin Notes: svn path=/head/; revision=217104
* Fix a TSO checksum bug on mxge(4):Andrew Gallatin2010-11-221-1/+12
| | | | | | | | | | | | | | | | | | | | The Myri10GE NIC will assume all TSO frames contain partial checksum, and will emit TSO segments with bad TCP checksums if a TSO frame contains a full checksum. The mxge driver takes care to make sure that TSO is disabled when checksum offload is disabled for this reason. However, modules that modify packet contents (like pf) may end up completing a checksum on a TSO frame, leading to the NIC emitting TSO segments with bad checksums. To workaround this, restore the partial checksum in the mxge driver when we're fed a TSO frame with a full checksum. Reported by: Bob Healey MFC after: 3 days Notes: svn path=/head/; revision=215686
* Add interrupt descriptions for mxge's msi-x vectorsAndrew Gallatin2010-05-211-0/+2
| | | | Notes: svn path=/head/; revision=208379
* Correctly identify some twinax cables, which reportAndrew Gallatin2010-05-191-1/+2
| | | | | | | a media type of 1. Notes: svn path=/head/; revision=208312
* Update mxge firmware to latest available from Myricom.Andrew Gallatin2010-05-194-33887/+34014
| | | | Notes: svn path=/head/; revision=208309
* Add a fastpath to allocate from packet zone when using m_getjcl.Fabien Thomas2010-05-071-4/+1
| | | | | | | | | | This will add support for packet zone for at least igb and ixgbe and will avoid to check for that in bce and mxge. MFC after: 1 week Notes: svn path=/head/; revision=207761
* Add missing IFCAP_LINKSTATE to mxgeAndrew Gallatin2010-04-151-1/+1
| | | | | | | Submitted by: yongari Notes: svn path=/head/; revision=206663
* Cleanup if_media handling in mxge(4)Andrew Gallatin2010-04-152-44/+79
| | | | | | | | | | | | | | - Re-probe xfp / sfp+ socket on link events, in case user has changed transceiver - correctly report current media to avoid confusing lagg (reported by Panasas) - Report link speed (submitted by yongari) Reviewed by: yongari (earlier version) MFC after: 7 days Notes: svn path=/head/; revision=206662
* Fix 2 bugs in mxge_attach()Andrew Gallatin2010-03-171-3/+3
| | | | | | | | | | | | | | - Don't leak slice resources when mxge_alloc_rings() fails - Start taskq threads only after we know attach will succeed. At boot time, taskqueue_terminate() will loop infinately, waiting for the threads to exit, and hang the system. Submitted by: Panasas MFC After: 3 days Notes: svn path=/head/; revision=205255
* Update mxge to support IFCAP_VLAN_HWTSO.Andrew Gallatin2010-02-221-0/+12
| | | | | | | | Note: If/when FreeBSD supports TSO over IPv6, the minimal mxge fw rev to enable IFCAP_VLAN_HWTSO will need to be increased to 1.4.37 Notes: svn path=/head/; revision=204212
* Fix drbr and altq interaction:Max Laier2010-02-131-1/+1
| | | | | | | | | | | | | | | | | | - introduce drbr_needs_enqueue that returns whether the interface/br needs an enqueue operation: returns true if altq is enabled or there are already packets in the ring (as we need to maintain packet order) - update all drbr consumers - fix drbr_flush - avoid using the driver queue (IFQ_DRV_*) in the altq case as the multiqueue consumer does not provide enough protection, serialize altq interaction with the main queue lock - make drbr_dequeue_cond work with altq Discussed with: kmacy, yongari, jfv MFC after: 4 weeks Notes: svn path=/head/; revision=203834
* Use better default RSS hash (src + dst, rather than just src port)Andrew Gallatin2010-01-111-2/+2
| | | | | | | MFC after:3 days Notes: svn path=/head/; revision=202121
* Update mxge(4) firmware to 1.4.48b (latest available) from Myricom.Andrew Gallatin2010-01-114-32936/+33883
| | | | | | | | | | | | | | | | | | | | | | | | Pertinant highlights from Myricom CHANGES file include: - Make sure invalid external smbus activity cannot affect performance - Fix to avoid a bug where the link could sometimes stay reported as up on after unplugging the cable. - For 8B NIC, make smbus connection passive at init to avoid possible address conflicts - Increase number of slices to 17 for multi-slice fw - Fix a bug where packets dropped because of link_overflow could be occasionally reported as bad_crc32 - Add selectable failover strategy for dual-port chip: symmetric or primary/backup - On failover, send RARP broadcast to make the change immediately known to the network - Change endianess for PCI Device Serial Number - For dual-port NICs, time to failover is now a few microsecs instead of a few millisecs. MFC after: 3 days Notes: svn path=/head/; revision=202120
* Fix reporting of 10G Twinax mediaAndrew Gallatin2010-01-111-1/+2
| | | | | | | | Reported by: mjacob MFC after: 3 days Notes: svn path=/head/; revision=202119
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-15/+15
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Don't take the driver mutex in mxge_tick(), as itAndrew Gallatin2009-12-221-2/+0
| | | | | | | | | | is run with the mutex held. Submitted by: rwatson MFC after: 3 days Notes: svn path=/head/; revision=200845
* Make mxge do a better job recovering from NIC h/w faultsAndrew Gallatin2009-10-201-13/+37
| | | | | | | | | | by checking PCI config space when the NIC is not transmitting. Previously, a h/w fault would not have been detected if the NIC was down, or handling an RX only workload. Notes: svn path=/head/; revision=198303
* Move mxge(4)'s NIC watchdog reset handler fromAndrew Gallatin2009-10-192-22/+66
| | | | | | | a callout to a taskqueue Notes: svn path=/head/; revision=198250
* Two more mxge watchdog fixes:Andrew Gallatin2009-09-302-4/+14
| | | | | | | | | | | | | | | 1) Restore the PCI Express control register after a watchdog reset. This is required because the device will come out of watchdog reset with the pectl reg at its default state, and important BIOS configuration (like max payload size) could be lost. 2) Call mxge_start_locked() for every tx queue before dropping the lock in the watchdog handler. This is required, as the queue's buf ring may have filled during the reset. Notes: svn path=/head/; revision=197645
* Improve mxge watchdog routine's ability to reliably reset a failed NIC:Andrew Gallatin2009-09-211-27/+72
| | | | | | | | | | | | | | | | | | - Mark the link as down, so if watchdog reset fails, link watching failover software can notice it - Don't send MXGEFW_CMD_ETHERNET_DOWN if the NIC has been reset, it is not needed, and will fail on a freshly reset NIC. - Ensure the transmit routines aren't attempting to PIO write to doorbells while the NIC is being reset. - Download the correct f/w, rather than using the EEPROM f/w after reset. - Export a count of the number of watchdog resets via sysctl - Zero all f/w stats at reset. This will lead to less confusing diagnostic output when investigating NIC failures. MFC after: 3 days Notes: svn path=/head/; revision=197395
* Add support for throttling transmit bandwidth. This is most commonlyAndrew Gallatin2009-09-212-2/+60
| | | | | | | | used to reduce packet loss on high delay (WAN) paths with a slow link. Notes: svn path=/head/; revision=197391
* mxge's tunable hw.mxge.rss_hash_type cannot be set from theAndrew Gallatin2009-07-221-0/+1
| | | | | | | | | | | | | | | loader, because it uses a reserved suffix (_type). Fix this by removing the "_" and renaming the tunable to hw.mxge.rss_hashtype. The old (rss_hash_type) tunable is still fetched, in case people load the driver via scripts. When both are present in the kernel environment, the new value (hw.mxge.rss_hashtype) overrides the old value. Approved by: re (kib) Notes: svn path=/head/; revision=195818