summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_ix.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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@
* shuffle struct ifqueue so in flight mbufs are protected by a mutex.dlg2015-11-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the code is refactored so the IFQ macros call newly implemented ifq functions. the ifq code is split so each discipline (priq and hfsc in our case) is an opaque set of operations that the common ifq code can call. the common code does the locking, accounting (ifq_len manipulation), and freeing of the mbuf if the disciplines enqueue function rejects it. theyre kind of like bufqs in the block layer with their fifo and nscan disciplines. the new api also supports atomic switching of disciplines at runtime. the hfsc setup in pf_ioctl.c has been tweaked to build a complete hfsc_if structure which it attaches to the send queue in a single operation, rather than attaching to the interface up front and building up a list of queues. the send queue is now mutexed, which raises the expectation that packets can be enqueued or purged on one cpu while another cpu is dequeueing them in a driver for transmission. a lot of drivers use IFQ_POLL to peek at an mbuf and attempt to fit it on the ring before committing to it with a later IFQ_DEQUEUE operation. if the mbuf gets freed in between the POLL and DEQUEUE operations, fireworks will ensue. to avoid this, the ifq api introduces ifq_deq_begin, ifq_deq_rollback, and ifq_deq_commit. ifq_deq_begin allows a driver to take the ifq mutex and get a reference to the mbuf they wish to try and tx. if there's space, they can ifq_deq_commit it to remove the mbuf and release the mutex. if there's no space, ifq_deq_rollback simply releases the mutex. this api was developed to make updating the drivers using IFQ_POLL easy, instead of having to do significant semantic changes to avoid POLL that we cannot test on all the hardware. the common code has been tested pretty hard, and all the driver modifications are straightforward except for de(4). if that breaks it can be dealt with later. ok mpi@ jmatthew@
* replace while (ml_dequeue()) m_freem(); with ml_purge();dlg2015-11-041-3/+2
|
* arp_ifinit() is no longer needed.mpi2015-10-251-4/+1
|
* First step at making ix(4) MPSAVE. This is largely based on the em(4)claudio2015-09-111-27/+73
| | | | | changes done by kettenis@. Tested by Hrvoje Popovski and chris@ dlg@, mpi@ and kettenis@ agree on developping this further in tree.
* correct sizes for free(), sighderaadt2015-09-021-3/+3
|
* sizes for free(), mostly related to firmwares.deraadt2015-09-011-7/+11
| | | | ok dlg
* Set the rx mbuf size to MCLBYTES + ETHER_ALIGN for strict alignmentkettenis2015-08-291-4/+3
| | | | | | | architectures to communicate better what size is needed to mclgeti. Makes ix(4) consistent with em(4). ok mikeb@, dlg@
* Increment if_ipackets in if_input().mpi2015-06-241-2/+1
| | | | | | | Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
* Access to uninitialized variable fixed.gerhard2015-05-211-7/+6
| | | | ok mikeb@
* Set the correct media type for 1000baseLX SFPs.jsg2015-04-301-3/+12
| | | | Tested by/ok sthen@, ok mikeb@
* Re-apply -r1.115 that got accidentally reverted and brought to mymikeb2015-03-201-4/+18
| | | | | | | | | | | | | attention and fix re-tested by Kapetanakis Giannis. Thanks a lot! Original commit message: When setting up advanced TX descriptor use m_getptr to locate the IP or IPv6 header instead of assuming contiguousness of the target buffer across Ethernet and IP/IPv6 headers. Tested by Kapetanakis Giannis <bilias at edu ! physics ! uoc ! gr>, thanks! Problem analysis and initial diff by dlg@.
* convert to if_input.dlg2015-02-121-9/+5
| | | | ok mpi@ henning@
* Make ix(4) work on strict alignment architectures. The Intel networkingkettenis2015-01-201-22/+17
| | | | | | | | | | | | | | hardware is fairly retarded. While it allows receive buffers with an ETHER_ALIGN offset, it only allows the size of the buffers to be specified in multiples of 1K. This means that if we want to use standard mbuf clusters we will waste 1024 - ETHER_ALIGN bytes per cluster, which is a lot for the 2K clusters we use now. Compromise a bit by using 4K clusters on strict alignment architectures and tell the hardware to use 3K of those, reducing the spillage a bit. While this isn't optimal, at least on sparc64 where we have 8K pages, the pool page allocation overhead should be the same as on amd64/i386 where we have 4K pages and continue to use 2K mbuf clusters. ok mikeb@, dlg@
* When setting up advanced TX descriptor use m_getptr to locate the IPmikeb2015-01-121-4/+18
| | | | | | | | or IPv6 header instead of assuming contiguousness of the target buffer across Ethernet and IP/IPv6 headers. Tested by Kapetanakis Giannis <bilias at edu ! physics ! uoc ! gr>, thanks! Problem analysis and initial diff by dlg@.
* mallocarray() for the rx_buffer memoryderaadt2015-01-111-4/+5
|
* unifdef INETtedu2014-12-221-3/+1
|
* yet more mallocarray() changes.doug2014-12-131-2/+2
| | | | ok tedu@ deraadt@
* Another spot where the VLAN tag doesn't need swapping in the currentlybrad2014-11-271-2/+2
| | | | | | unused TSO code. ok mikeb@
* Use dv_xname instead of if_xname to establish our interrupt. The latter iskettenis2014-11-271-3/+2
| | | | | | | | | still unset when at this point, and some MD variants of pci_intr_establish(9) make a copy of the string instead of storing a pointer. Makes vmstat -i properly print the device name on sparc64. ok mikeb@, deraadt@
* dont swap the vlan tag twice on big endian archs for transmit.dlg2014-11-261-2/+2
| | | | ok mikeb@
* - Remove some unused #if 0'd code which does not pertain to OpenBSDbrad2014-11-201-9/+1
| | | | | | | - Remove a bogus if_ierrors++ which if the counter was incremented it would be overwritten by ixgbe_update_stats_counters() ok mikeb@