summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_ix.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* have the ifrxr info stuff report the buffer size the hw handles.dlg2020-12-221-2/+2
| | | | this makes it more consistent with other drivers.
* Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan2020-12-121-2/+2
| | | | | | OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
* ix_txq_kstats_read() should look at a tx_ring struct, not rx_ring.dlg2020-12-091-2/+2
| | | | | | | luckily tx_rings and rx_rings have ix_softc pointers in the same place, so we got away with it. from Christiano Haesbaert
* fter ixgbe_stop() there will be no more link-state-changegerhard2020-11-241-1/+3
| | | | | | interrupts. Hence, update the link state manually. Tested and ok bluhm@
* There seems to be a silicon errata for 82598 ix(4) chips. When thebluhm2020-11-091-7/+21
| | | | | | | | | link state changes and an interrupt is fired for that, the MSI-X interrupt mask bits of the queues are cleared. During init while the queues are enabled by the driver, the hardware disabled them in the background. Then receiving packets did not work. In MSI-X mode, use the FreeBSD logic to read the cause from EICS register. from Christiano Haesbaert; tested with 82599 and X540T and OK jmatthew@
* Do not touch non existing queues. Allows to disable MSI-X in ix(4).bluhm2020-10-271-2/+3
| | | | OK jmatthew@
* replace stat collection with the kstat api.dlg2020-07-181-189/+364
| | | | | | before this the stats were always collected, but you could only see stats with gdb against the running kernel, or by enabling IX_DEBUG in the build. neither of these are supported by default.
* Revert r1.170. dlg and jmatthew simultaneously fixed this thetb2020-07-171-3/+1
| | | | correct way.
* This needs <net/toeplitz.h> for stoeplitz_to_key(9).tb2020-07-171-1/+3
|
* use the system stoeplitz key instead of a random one.dlg2020-07-171-2/+12
| | | | | while here, stash the rss hash value from rx descriptors in the mbuf as a flow id.
* enable multiq support for ix.dlg2020-07-171-57/+66
| | | | | | | | | | | | | this is an updated version of a diff from christiano haesbaert by way of mpi@ to enable the use of multiple tx and rx rings with msi-x. now that patrick@ got interrupts on multiple cpus working on arm64, i can commit this. the main changes are to use an intrmap pointer as the flag for whether msix has been enabled or not, and to use the intrmap to establish vectors on multiple cpus. tested by hrvoje popovski
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-2/+2
| | | | ok dlg@ tobhe@
* build on mpi's work toward ix multiq support.dlg2020-06-071-47/+53
| | | | | | | | | | | | | | | this calls if_attach_queues and if_attach_iqueues to allocate an ifq and ifiq per tx ring and rx ring respectivly, and then tie them together. ix rx rings deliver packets into ifiqs, and ifqs push packets onto ix tx rings. the return value from ifiq_input is also used to tell the if_rxr stuff to back off. this also makes the rx refill timeout per rx ring instead of per interface, and makes it only schedule the timeout when the ring is completely empty to avoid races with normal rx ring operation. tested by hrvoje popovski ok jmatthew@
* Print per queue stats when dumping hardware counters in IX_DEBUG kernels.mpi2020-04-241-5/+58
| | | | Tested by Hrvoje Popovski.
* Make it possible to use ix(4) with MSI-X, currently disabled by default.mpi2020-04-061-37/+180
| | | | | | | | | | | | | The current implementation still uses a single queue but already establishes a different handler for link interrupts. This is done in preparation for multi-queues support. The performance and i386 regression exposed by the last version of this diff have been fixed thanks to the help of Hrvoje Popovski. Based on a bigger diff from haesbaert@ and on the FreeBSD code. Tested by Sigi Rudzio, Hrvoje Popovski and jmatthew@, ok jmatthew@
* Revert introduction of MSI-X code, deraadt@ reported a regression on i386.mpi2020-03-251-176/+37
|
* Make it possible to use ix(4) with MSI-X, currently disabled by default.mpi2020-03-231-37/+176
| | | | | | | | | | The current implementation still uses a single queue but already establishes a different handler for link interrupts. This is done in preparation for multi-queues support. Based on a bigger diff from haesbaert@ and on the FreeBSD code. Tested by Hrvoje Popovski and jmatthew@, ok jmatthew@
* Update ix(4) from freebsd to add support for X553 controllers.jmatthew2020-03-021-83/+134
| | | | | | Tested on 82599 (sfp+) and X540 (baseT) by me and Hrvoje Popovski, and on X553 by sthen@ and abieber@, and possibly more via snapshots ok sthen@ mikeb@
* oops some snapshot tests fell inderaadt2020-02-281-134/+83
|
* syncderaadt2020-02-281-83/+134
|
* Enable TCP and UDP checksum offloading by default for ix(4).jan2019-08-191-3/+1
| | | | ok deraadt@
* add support for SIOCGIFSFFPAGE so userland can read sfp module infodlg2019-04-101-1/+57
| | | | | | | | | access to the ioctl is serialised by a per ifp rwlock so userland reads of different pages in the same device address do not confuse each other. this was pretty straightforward because a lot of the plumbing for accessing the i2c bus was already in place.
* bus_dmamap_sync when we fill the rx ring, not for ever slot on the ring.dlg2019-03-011-8/+9
|
* don't let rxr completely fill the rxr ring.dlg2019-02-261-2/+2
| | | | | at the moment there are 256 slots on the right. if rxr raises the high watermark to 256, we overwrite ring entries.
* put the rx buffer at the end of the mbufdlg2019-02-261-2/+2
| | | | | | | | this should give a bit of space if the packet needs an m_pullup. care is taken to ensure the packet is still aligned for the ip stack. ok and tweaks claudio@
* get rid of atomic_foo ops in the tx start and completion paths.dlg2019-02-211-126/+71
| | | | | | | | | | | | | | | | | | atomics were used to coordinate updates to the number of available slots on the tx ring. start would use what was available, and txeof (completion) would add back freed slots. start and completion update a producer and consumer index respectively, so we can use those with the size of the ring to calculate space instead. while here i simplified what txeof does a fair bit, which combined with the removal of the atomics gives us a bit of a speed improvement. hrvoje popovski reports up to a 20% improvement in one environment, but 5 to 10 is probably more realistic. ive had this in a tree since 2017, but mpi's "Faster vlan(4) forwarding?" post made me dig it out and clean it up. ok jmatthew@
* double ;;. xhci one found by geoffhillderaadt2017-06-221-2/+2
|
* Since rev 1.1 ix has attempted to require a 64 bit BAR, the test forjsg2017-04-241-3/+2
| | | | | | | | | | this was wrong and was corrected at the end of last year in rev 1.140. Before then a 64 bit BAR was not enforced as the test was wrong. It turns out there exist 82598 parts which have a 32 bit BAR so change the test to only require a memory BAR and not a 64 bit memory BAR. Problem reported by Robert Blacquiere. ok mikeb@
* add support for multiple transmit ifqueues per network interface.dlg2017-01-241-7/+8
| | | | | | | | | | | | | | | | | | | | | | | an ifq to transmit a packet is picked by the current traffic conditioner (ie, priq or hfsc) by providing an index into an array of ifqs. by default interfaces get a single ifq but can ask for more using if_attach_queues(). the vast majority of our drivers still think there's a 1:1 mapping between interfaces and transmit queues, so their if_start routines take an ifnet pointer instead of a pointer to the ifqueue struct. instead of changing all the drivers in the tree, drivers can opt into using an if_qstart routine and setting the IFXF_MPSAFE flag. the stack provides a compatability wrapper from the new if_qstart handler to the previous if_start handlers if IFXF_MPSAFE isnt set. enabling hfsc on an interface configures it to transmit everything through the first ifq. any other ifqs are left configured as priq, but unused, when hfsc is enabled. getting this in now so everyone can kick the tyres. ok mpi@ visa@ (who provided some tweaks for cnmac).
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-2/+1
| | | | | | | this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
* Update the media as the last step in the SFP module configurationmikeb2016-12-091-5/+5
| | | | The problem noticed, fix tested and OK procter@
* Improve error handling and don't fail if SFP module is not present;mikeb2016-12-061-6/+3
| | | | tested by Hrvoje Popovski, thanks!
* Disable the TX laser when interface is going down for all fiber modulesmikeb2016-12-021-4/+4
| | | | | | Previously only multi-rate fiber modules would disable the TX laser, but newer Intel driver does it for single rate modules as well. Reminded by kettenis@, tested by procter@ and Hrvoje Popovski. Thanks!
* Update media types upon SFP module changemikeb2016-11-301-1/+5
| | | | Tested by Hrvoje Popovski and myself.
* Enable support for the X550 family of 10 Gigabit controllersmikeb2016-11-241-1/+11
| | | | | | | | Code was obtained from FreeBSD. Make release testing by tb@ on i386 and mikeb@ on amd64 and sparc64. X552 SFP tested by Hrvoje Popovski, HUGE thanks! X550T tested by mikeb@ on amd64 and sparc64. ok kettenis, deraadt
* Fixup active media reporting for multi-speed fiber modulesmikeb2016-11-241-5/+7
| | | | | | | | | A gigabit fiber connection was mistakenly reported as 1000baseT when a mutli-speed 10GbaseSR/1000baseSX fiber optics module was set to the gigabit mode. Reported by and fix tested by Hrvoje Popovski <hrvoje at srce ! hr>, HUGE thanks!
* Add ability to change media typemikeb2016-11-211-19/+87
| | | | | | | | | | | | Tested with a X540 interconnected with a X550 via a CAT6 twisted pair cable, but is expected to work on multi-speed fiber modules as well to select between 10GbaseLR and 1000baseLX or 10GbaseSR and 1000baseSX, etc. This is largely required because X550 doesn't provide support for auto-negotiation and requires manual configuration. Obtained from FreeBSD.
* Factor out RSS initialization into a separate functionmikeb2016-11-211-33/+69
| | | | No functional change.
* Correct the test for requiring a 64 bit mem bar.jsg2016-11-211-3/+3
| | | | ok mikeb@ who tested on 82599, x540 and x550.
* Turn on the PHY power during attachmikeb2016-11-211-1/+13
| | | | | After a cold boot the PHY power might be disabled by another OS: https://svnweb.freebsd.org/base?view=revision&revision=295093
* Sync some changes for ixgbe_initialize_receive_unitsmikeb2016-11-181-8/+8
| | | | | | Call a chip specific method to disable RX unit; DPF (Drop [Unicast] Pause Frames) and PMCF (Pass MAC Control Frames) bits should only be enabled on 82598 since others don't document them.
* Recognize active SPF+ DA modules as IFM_10G_SFP_CUmikeb2016-11-181-5/+6
| | | | Reported and tested by Hrvoje Popovski, thanks!
* Support for new GPI signals, including X550 external PHY interruptmikeb2016-11-181-51/+135
| | | | | | This factors out the code configuring General Purpose Interrupts into a separate function and provides LASI (Link Alarm Status Interrupt) handler used by controllers in the X550 family lacking integrated PHY.
* Reduce difference in ixgbe_initialize_receive_units to FreeBSD;mikeb2016-11-181-14/+16
| | | | no binary change.
* Minor code restructuringmikeb2016-11-181-212/+60
| | | | | | | | | | - separate functions for delay value calculation and figuring out whether or not we're doing SFP. - MAC type detection is now done by ixgbe_set_mac_type; - call {enable,disable}_tx_laser conditionally; - unused TSO code bites the dust; - default to "IFM_ETHER | IFM_AUTO" when we can't select any other media type.
* tell ix and em to use 2k+ETHER_ALIGN clusters for rx on all archs.dlg2016-10-271-11/+1
| | | | | | | | | | | | | | | | | this means that the ethernet header and therefore its payload will be aligned correctly for the stack. without this em and ix are sufferring a 30 to 40 percent hit in forwarding performance because the ethernet stack expects to be able to prepend 8 bytes for an ethernet header so it can gaurantee its alignment. because em and ix only had 6 bytes where the ethernet header was, it always prepends an mbuf which turns out to be expensive. this way the prepend will be cheap because the 8 byte space will exist. 2k+ETHER_ALIGN clusters will end up using the newly created mcl2k2 pool. the regression was isolated and the fix tested by hrvoje popovski. ok mikeb@
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* Make ixgbe_start() mpsafe. This means the driver will no longer grab thekettenis2015-12-311-44/+20
| | | | | | | | | | | kernel lock in the rx and tx path anymore. While there seems to be a small decrease in forwarding performance with our default network stack settings, Performance whiel receiving manymore packets than we can handle is better. And this change opens the road for future improvements in the network stack. ok dlg@, mpi@
* Make ix(4) mpsafer. Take advantage of intr_barrier() to eliminate the mutexkettenis2015-12-181-73/+52
| | | | | | | introduced in the previous step, and use atomic instructions to make the tx completion path mpsafe as well. ok claudio@, mpi@
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@