summaryrefslogtreecommitdiffstats
path: root/sys/dev/mxge
Commit message (Collapse)AuthorAgeFilesLines
* Fix cut/paste error in previous commit and use thegallatin2009-02-171-1/+1
| | | | | | correct value for SFP+ reserved media type. MFC after: 1 week
* Better support for recent Myricom 10GbE NICsgallatin2009-02-177-32827/+32798
| | | | | | | | | | | | | | | | | - Update to firmware 1.4.39 for dual-chip NIC (10G-PCIE2-xxx) support, and SFP+ i2c support - Identify newer "B" NICs (10G-PCIEx-8B-x) correctly, rather than mis-identifying them as "A" NICs (cosmetic only) - Identify the IFM_10G_LRM ifmedia type, where applicable. - Identify ifmedia types for SFP+ based NICs - Update copyright Sponsored by: Myricom MFC after: 1 week
* Remove obsolete C preprocessor assertions.rdivacky2009-02-121-1/+1
| | | | Approved by: kib (mentor)
* Restore sfence semantics in mxge after the introductiongallatin2008-11-242-25/+25
| | | | of a global mfence based mb() in r185162
* - bump __FreeBSD version to reflect added buf_ring, memory barriers,kmacy2008-11-221-0/+4
| | | | | | | | | | | | | | | | | and ifnet functions - add memory barriers to <machine/atomic.h> - update drivers to only conditionally define their own - add lockless producer / consumer ring buffer - remove ring buffer implementation from cxgb and update its callers - add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to allow drivers to efficiently manage multiple hardware queues (i.e. not serialize all packets through one ifq) - expose if_qflush to allow drivers to flush any driver managed queues This work was supported by Bitgravity Inc. and Chelsio Inc.
* Update to Myri10GE Firmware 1.4.36.gallatin2008-10-234-32592/+32702
| | | | | | | | | | This update fixes a transmit bug in the multi-queue (MSI-X) firmware which happens when RDMAs complete out of order, and provides improved support for the new Myri10GE NIC models (10G-PCIE-8Bx) Sponsored by: Myricom Inc. MFC after:3 days
* Update to Myri10GE firmware version 1.4.33 from 1.4.29. Relevant changes ↵gallatin2008-10-015-56663/+32655
| | | | | | | | | | | | | | include: - Support for Myricom 10G-PCIE-8B NICs - multi-slice firmware: fix a bug when the presence of 32-bit or 64-bit DMA addresses for interrupt queues and data is not uniform across slices. - Improves automatic selection between ethp_z8e/eth_z8e Sponsored by: Myricom Inc.
* Adapt mxge shims to detect phys contig jumbo framesgallatin2008-08-211-1/+2
| | | | | | in RELENG_7 MFC after: 3 days
* Clean up mxge's use of callouts as pointed out by jhb,gallatin2008-07-171-36/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | and handle NIC hardware watchdog resets. - remove buggy code at the top of mxge_tick() which tried to detect a race which is already detected in the kernel's callout code. - move callout_stop() and callout_reset() into mxge_close() mxge_open() rather than doing the callout manipulation all over the place. - use callout_drain(), rather than callout_stop() to prevent a potential race between mxge_tick() and mxge_detach() which could lead to softclock using a destroyed mutex - restructure the mxge_tick() and mxge_watchdog_reset() routines to avoid resetting a callout, and then immediately stopping it if the watchdog reset routine is called, and fails. - enable the driver to handle NIC hardware watchdog resets by restoring the NIC's PCI config space, which is lost when the NIC hardware watchdog triggers. Reviewed by: jhb (previus version)
* Initialize if_baudrate using IF_Gbps() macro.gallatin2008-04-021-1/+1
| | | | | | | Note that if_baudrate is a long, and 32-bits isn't enough to properly represent 10Gb/s. Pointed out by: dwhite
* Remove dead code which makes a call to mem_range_attr_set().gallatin2008-03-121-18/+2
| | | | | | | This fixes a bug where mxge did not declare a dependancy on mem(4), and failed to load with options nomem. Pointed out by: antoine
* Now that mxge supports MSI-X interrupts, reverse the logic and flaggallatin2008-02-142-8/+10
| | | | | | | | legacy interrupts rather than MSI as a special case. Prior to this commit, the interrupt handler was doing the slow handshaking with the device to ensure the legacy interrupt was lowered in both the legacy and MSI-X case. This handshaking was not required for MSI-X.
* Add minimally invasive shims to ease MFCs of mxge back as fargallatin2008-02-143-10/+68
| | | | | | as RELENG_6 Sponsored by: Myricom, Inc.
* Make the type of the firmware arrays match thosegallatin2008-02-132-6/+6
| | | | in the other eth*_z8e.h files.
* Only reset driver state when a hardware error is detected.gallatin2008-01-281-5/+6
| | | | | Preserve warning but do not reset if we enter the routine without seeing a hardware error.
* Take advantage of the new physically contiguous 9K jumbos in 8.gallatin2008-01-222-3/+29
|
* Add optional support to mxge for MSI-X interrupts and multiple receivegallatin2008-01-158-516/+31649
| | | | | | | | | | queues (which we call slices). The NIC will steer traffic into up to hw.mxge.max_slices different receive rings based on a configurable hash type (hw.mxge.rss_hash_type). Currently the driver defaults to using a single slice, so the default behavior is unchanged. Also, transmit from non-zero slices is disabled currently.
* Fix accidental swap of "const" for "static" in mxge firmware byte arraysgallatin2008-01-152-6/+6
| | | | caused by running my import script with the wrong args.
* Update to firmware version 1.4.29 from 1.4.25. Relevant changes include:gallatin2008-01-152-25570/+26369
| | | | | | | | | | | | - Fix a bug introduced in 1.4.20 where speculative read by the processor in the write-only doorbell region would cause a target-abort (as opposed to simply returning random data). This could manifest itself as NMI or machine freeze depending on how the BIOS/OS/chipset configuration handles target-abort. - Add support for new revisions of -R cards (with AEL1002/AEL1010 xaui->xfi) - Increase an internal timing (dispatch engine): fix possible spurious reset (seen on very few cards).
* Add support for a new device id (9). Mxge NICs with the newgallatin2007-09-132-1/+3
| | | | | | device id support MSI-X. Approved by: re (bmah)
* - Fix a bug which could cause a panic when enabling LROgallatin2007-08-225-24755/+25813
| | | | | | | | | | | on an down mxge interface - Fix a bug where mxge reported the link state as active when it wasn't (after ifconfig down). - Prevent spurious watchdog resets when link partner is not consuming - Add support for CX4 and popular XFP media detection - Update the firmware and associated header files to 1.4.25 Approved by: re (kensmith)
* - Enable static building of mxge(4) and its firmware.gallatin2007-07-197-2188/+24998
| | | | | | | | | | | | | | | | | | - Add custom .c wrappers for the firmware, rather than the standard firmware(9) generated firmware objects to work around toolchain problems on ia64 involving linking objects produced by ld -b -binary into the kernel. - Move from using Myricom's ".dat" firmware blobs to using Myricom's zlib compressed ".h" firmware header files. This is done to facilitate the custom wrappers, and saves a fair amount of wired memory in the case where the firmware is built in, or preloaded. - Fix two compile issues in mxge which only appear on non-i386/amd64. Reviewed by: mlaier, mav (earlier version with just zlib support) Glanced at by: sam Approved by: re (kensmith)
* Update the mxge(4) driver's copyright to 2007, and dropgallatin2007-07-127-41/+13
| | | | | | the binary distribution clause. Approved by: re (bmah)
* Also mark writecombine as enabled when PAT is used to enablegallatin2007-06-171-2/+2
| | | | it rather than MTRRs.
* correct some limits on interrupt proccessing so thatgallatin2007-06-141-7/+2
| | | | fast forwarding back out the same mxge interface works nicely.
* Use the new IFCAP_LRO to enable/disable LRO.gallatin2007-06-121-8/+35
|
* Back out the previous commit which added an M_LRO mbuf flaggallatin2007-06-111-1/+0
| | | | | to defeat the mtu check in ether_input. Mbuf flags are too scarce. Discussed with: sam
* Allow drivers, such as cxgb and mxge, which support LRO to bypassgallatin2007-06-111-0/+1
| | | | | | the MTU check in ether_input() on LRO merged frames. Discussed with: kmacy
* Small LRO related fixes for mxge:gallatin2007-06-112-5/+39
| | | | | | | - Allow LRO to be enabled / disabled at runtime - Fix a double-free at module unload time. - Only update timestamp in lro merge when it is present in the frame Sponsored by: Myricom
* Use pmap_change_attr() to setup a write combine attribute for ourgallatin2007-06-051-1/+14
| | | | | | | device memory, rather than relying on the less reliable MTRR method used by mem_range_attr_set(). Glanced at by: jhb
* - Use m_getcl() rather than m_getjcl() when we're allocating 2KBgallatin2007-05-251-1/+10
| | | | | | | | | clusters. This helps quite a bit on my low end machines (improves performance by about 300Kpps when being blasted by a hardware packet generator). - Include one extended f/w counter forgotten in earlier commit Sponsored by: Myricom Inc.
* Add support for "hardware" vlan tag insertion & removal emulationgallatin2007-05-232-34/+131
| | | | | in the mxge driver so as to be able to do checksum offload on vlans. This is good enough to achieve 10GbE line rate on vlans.
* mxge cleanups:gallatin2007-05-222-117/+93
| | | | | | | | | | | | | | | | | | | | | | - Remove code to use the special wc_fifo. It has been disabled by default in our other drivers as it actually slows down transmit by a small amount - Dynamically determine the amount of space required for the rx_done ring rather than hardcoding it. - Compute the number of tx descriptors we are willing to transmit per frame as the minimum of 128 or 1/4 the tx ring size. - Fix a typo in the tx dma tag setup which could lead to unnecessary defragging of TSO packets (and potentially even dropping TSO packets due to EFBIG being returned). - Add a counter to keep track of how many times we've needed to defragment a frame. It should always be zero. - Export new extended f/w counters via sysctl Sponsored by: Myricom, Inc.
* Improve mxge receive performance:gallatin2007-05-216-2216/+2717
| | | | | | | | | | | | | | | - Update to the latest (1.4.18) f/w. This f/w introduces a new receive mode which allows us to use FreeBSD's physically discontinuous MJUM9BYTES clusters. - Switch the driver from chaining MJUMPAGESIZE clusters to using MJUM9BYTES clusters to avoid mbuf chaining overheads. Due to this change, people running obsolete f/w images will be limited to an MTU of PAGE_SIZE - 16. - Add (disabled by default) support for Large Receive Offload. Sponsored by: Myricom, Inc.
* - Add handling of MXGEFW_CMD_UNKNOWN in mxge_send_cmd().gallatin2007-05-081-23/+30
| | | | | | | - Convert mxge_send_cmd result handling to a switch rather than adding a new elseif for MXGEFW_CMD_UNKNOWN Sponsored by: Myricom Inc.
* Firmware update & improvements to firmware selection:gallatin2007-05-084-2051/+2273
| | | | | | | | | | | | | | | | | | | | | - Update to latest (1.4.17) firmware. - Use the new MXGEFW_CMD_UNALIGNED_TEST (added in firmare 1.4.16) to have the firmware tell us if the PCIe chipset supports aligned PCIe completions. - Hard to maintain, and frequently out of date whitelist of PCIe chipsets known to produce aligned completions removed, as it has been replaced in its role of selecting the correct firmware to run by the use of MXGEFW_CMD_UNALIGNED_TEST. - Break the dma test out of mxge_reset() and into its own function (mxge_dma_test()) so it can be used by both the normal DMA test, and to run the unaligned test. - Improved support for enabling ECRCs Sponsored by: Myricom Inc.
* -Fix an mbuf leak caused by a cut&paste bug where the small ring's mbufsgallatin2007-04-271-19/+35
| | | | | | | | | were never freed, but the big ring was freed twice. -Don't supply rx hw csums for frames which are padded beyond the length specified in the ip header. If the padding is non-zero, the hw csum will be incorrect for such frames. Sponsored by: Myricom
* - Fix a bug in the TSO transmit routine where frames which hadgallatin2007-04-031-1/+3
| | | | | | | | | | | been defragged and had their headers in the same cluster as their payload would be fed to the NIC in header-sized chunks, and would likely exceed the number of available transmit descriptors. - If a TSO frame exceeds the number of available transmit descriptors, don't leak busdmma resources when freeing it. Sponsored by: Myricom Inc.
* Optimize sx locks to use simple atomic operations for the common cases ofjhb2007-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that rwlocks. This patch also adds support for exclusive locks using the same algorithm as mutexes. A new sx_init_flags() function has been added so that optional flags can be specified to alter a given locks behavior. The flags include SX_DUPOK, SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature to the similar flags for mutexes. Adaptive spinning on select locks may be enabled by enabling the ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN flag via sx_init_flags() will adaptively spin. The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock() are now performed inline in non-debug kernels. As a result, <sys/sx.h> now requires <sys/lock.h> to be included prior to <sys/sx.h>. The new kernel option SX_NOINLINE can be used to disable the aforementioned inlining in non-debug kernels. The size of struct sx has changed, so the kernel ABI is probably greatly disturbed. MFC after: 1 month Submitted by: attilio Tested by: kris, pjd
* Fix a bug which could lead to receive side lockup when WC is disabled.gallatin2007-03-271-0/+1
| | | | | | | When submitting rx buffers and not using WC fifo, always replace the invalid DMA address with the real one, otherwise allocation failures could lead to the invalid DMA address being given to the NIC, and that would cause the receive side to lockup.
* Update mxge's firmware from a fairly old version (1.4.6) to the mostgallatin2007-03-082-1721/+1959
| | | | | | | | | recent version (1.4.12). Firmware changelogs are available on Myricom's web site at: http://www.myri.com/scs/CHANGES/CHANGES.myri10ge-firmware Sponsored by: Myricom Inc.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Work around a firmware bug where broadcast frames would be incorrectlygallatin2007-02-212-5/+27
| | | | | | | treated as multicast frames and filtered, but when only when "adopting" running firmware. By "adopting", I mean using pre-existing firmware loaded from eeprom at PCI reset, rather than firmware loaded by the driver.
* Cleanup and document the implementation of firmware(9) based onluigi2007-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a version that i posted earlier on the -current mailing list, and subsequent feedback received. The core of the change is just in sys/firmware.h and kern/subr_firmware.c, while other files are just adaptation of the clients to the ABI change (const-ification of some parameters and hiding of internal info, so this is fully compatible at the binary level). In detail: - reduce the amount of information exported to clients in struct firmware, and constify the pointer; - internally, document and simplify the implementation of the various functions, and make sure error conditions are dealt with properly. The diffs are large, but the code is really straightforward now (i hope). Note also that there is a subtle issue with the implementation of firmware_register(): currently, as in the previous version, we just store a reference to the 'imagename' argument, but we should rather copy it because there is no guarantee that this is a static string. I realised this while testing this code, but i prefer to fix it in a later commit -- there is no regression with respect to the past. Note, too, that the version in RELENG_6 has various bugs including missing locks around the module release calls, mishandling of modules loaded by /boot/loader, and so on, so an MFC is absolutely necessary there. I was just postponing it until this cleanup to avoid doing things twice. MFC after: 1 week
* - Add 99% of a callout based watchdog. The remaining 1% is waitinggallatin2007-01-312-30/+168
| | | | | | | | | | | | | | for pci_cfg_restore() to be exported. It was tested using a hackily accessed pci_cfg_restore(). - Add ifmedia_removeall() to mxge_detach() in order to stop leaking an ifaddr - Fix a small acounting bug introduced by the locking code shuffle which could cause spurious watchdog resets now that we have a watchdog. Sponsored by: Myricom
* destroy busdma maps even if they are NULL, so as to avoid leakinggallatin2007-01-311-18/+16
| | | | busdma tags.
* Abandon using sleepable locks in favor of mutexes for mxge's if_ioctlgallatin2007-01-312-72/+83
| | | | | | | locking in preparation for adding a watchdog handler (callouts must not use sleepable locks). This required shuffling memory and interrupt allocation to the attach routine rather than if_ioctl so as to avoid potential sleeps while bringing up the interface.
* Minor updates:gallatin2007-01-302-3/+20
| | | | | | | - initialize ifq_drv_maxlen correctly - mark the interface as jumbo capable - keep stats on the number of times the hw transmit queue filled and was restarted.
* Fix mxge_submit_8rx() to behave like the comments says it does,gallatin2006-11-291-1/+3
| | | | and ensure that it copies at most 32 bytes at a time.
* Fix transposition of width and value arguments to pci_config_write()gallatin2006-11-221-1/+1
| | | | | | when setting up the read request size. Pointed out by: kmacy
OpenPOWER on IntegriCloud