summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ix.c
AgeCommit message (Collapse)Author
2013-08-05First stab at updating this monster to the Intel/FreeBSD current version.Mike Belopuhov
This syncs PHY and chip dependent parts as well as brings support for the flow control and additional (untested) bits for 1G fiber versions. Tested by Hrvoje Popovski <hrvoje at srce ! hr> on 82599/SFP+DA, florian@ and benno@ on 82599/SFP+SR and on 82598/CX4-BP, 82599/SFP+DA and X540/RJ45 by me.
2013-06-14Correct interrupt moderation setting for 82598; tested on the CX4 versionMike Belopuhov
2013-06-09adapt to a pcidevs name changeTheo de Raadt
2012-12-20report flow control mode in the media status callbackMike Belopuhov
2012-12-20max_frame_size must be set after ether_ifattach updates if_mtu;Mike Belopuhov
verified with the upstream driver
2012-12-17Sync up advanced transmitter descriptor setup code to the upstream.Mike Belopuhov
There are a number of bugs that this commit fixes. The main issue is that ixgbe_tx_ctx_setup sets up a descriptor for TCP and UDP checksum calculation, but not for IP, therefore it must use TXSM instead of IXSM. Which is what FreeBSD does now. I've tested this on 82599 with TCP, UDP, ICMP, ICMP6, VLANs and OSPF with TCP and UDP checksums turned on against oce(4). ixgbe_tso_setup is updated as well, albeit remains disabled (as well as checksums themselves). Parts of the change were obtained from brad's diff he sent me a while ago.
2012-12-17sync some comments and variable names in rxeof with freebsdMike Belopuhov
2012-12-17Catch up with upstream, where rxbuf->m_pack was renamed to rxbuf->bufMike Belopuhov
and rxbuf->pmap to rxbuf->map. Tested on 82599 and X540.
2012-12-17Don't forget to decrement a number of clusters on the ring in caseMike Belopuhov
of an error. Previous change made the problem evident.
2012-12-17Get rid of the split header code as it was never used inMike Belopuhov
OpenBSD and now is finally removed from the upstream. No real functional change (we've lost some weight though). Tested on 82599.
2012-12-17Implement SFP+ module hot-plug support for 82599 obtainedMike Belopuhov
from FreeBSD. This also adds untested and hence disabled support for multispeed fiber interrupts. With input from and ok jsg.
2012-12-17Fix a link autonegotiation bug on 10GbaseT controllers and improveMike Belopuhov
link information reporting in general. Obtained for the most part from FreeBSD, tested by mxb at alumni ! chalmers ! se on X540 and me on 82598 (XAUI, KR4), 82599 (SFP+) and X540 (baseT); ok jsg
2012-12-05fix from freebsd to correctly account rx errors; problem reportedMike Belopuhov
and fix tested on 82599 by tony sarendal tony@polarcap.org, tested on X540 and 82598 by me, ok jsg
2012-11-29Remove setting an initial assumed baudrate upon driver attach which is notBrad Smith
necessarily correct, there might not even be a link when attaching. ok mikeb@ reyk@
2012-11-29make ix complile with IX_DEBUG defined, based on the patch fromMike Belopuhov
mxb at alumni ! chalmers ! se. thanks!
2012-11-23- Remove return's at the end of void functionsBrad Smith
- Some minor tweaking of the use of braces in two spots ok mikeb@
2012-11-08Do not depend on IFCAP_CSUM flags when configuring rx checksummingMike Belopuhov
and correct an incorrect usage of IXGBE_RXCSUM_PCSD. ok henning
2012-11-06Remove Flow Director code that is not used, is outdated and tendsMike Belopuhov
to get in the way. ok krw, brad
2012-10-28Add braces to some code in ixgbe_setup_vlan_hw_support().Brad Smith
ok mikeb@
2012-08-13sync a comment with reality and remove an error path duplicate; from bradMike Belopuhov
2012-08-11Add support for another 82599 SFP+ card. Original diff and tests byMike Belopuhov
Chris Maxwell <chris ! maxwell () hootsuite.com> ok jsg
2012-08-10cleanup ixgbe_start routine; from brad, ok jsgMike Belopuhov
2012-08-08We're not going to loop in the rxeof refilling our ring as it wouldMike Belopuhov
work against the mclgeti algorithm and besides it doesn't make any difference if [repaired and] enabled since interrupt mitigation was fixed some time ago. So remove the leftovers altogether so that nobody would be tempted to use them. ok claudio, jsg
2012-08-06Add support for 10Gb ethernet cards based on the Intel X540 chipset.Mike Belopuhov
The code was obtained from FreeBSD and tested on the hardware kindly donated by Tony Sarendal <tony () polarcap ! org>. Thanks a lot! ok jsg
2012-07-29whitespace cleanup, no binary changeMike Belopuhov
2012-07-06rewrite the receive filter programming to look similar to otherMike Belopuhov
drivers - from brad; while here initialized a stack variable before usage as pointed out by david hill.
2012-07-05set the prefetch threshold for 99'er as well. provides some additionalMike Belopuhov
performance improvement. obtained from freebsd.
2012-07-05enable the code that forces a cleanup if number of tx descriptorsMike Belopuhov
is below the threshold. noticed by brad. tweak threshold values to get a bit of a performance increase.
2012-02-26rather than driving the card with 16k intr/s of low latency interrupts,Mike Belopuhov
rely on regular rx/tx queue interrupts moderated to 8k intr/s achieving best performance/latency ratio. this effectively doubles performance on 82599. tested on 82598 as well.
2012-02-26there's no need to rearm interrupts, we only need to reenable queues;Mike Belopuhov
no objections from claudio and deraadt; tested on 82598 and 82599
2012-01-20save content of the pci attach args, not the pointer; from Christian EhrhardtMike Belopuhov
2012-01-13Repair hw vlan tagging and stripping on 82599. Previously receiverMike Belopuhov
would prepend another vlan tag 0 to all frames containing 802.1Q tags rendering vlans unusable. ok jsg, deraadt
2011-12-12add missing m_freem's into the error code paths. there's no changeMike Belopuhov
in behavior since we don't do split headers; ok dlg, kettenis
2011-12-09we need to always schedule another rx ring refill calloutMike Belopuhov
in case we fail to do it at the spot. prevents rx ring lockups under high load. ok dlg
2011-11-27Bring back low latency interrupt moderation for 82599Mike Belopuhov
lost during update. Originally from claudio, rev1.46. ok claudio
2011-11-27Checksum fix from reyk (rev1.31) that was lost during update:Mike Belopuhov
Fix the IP ckecksum offloading logic that disables and breaks offloading if the packet is neither TCP nor UDP because of an erroneous "default" case. No functional change in the default build because IP checksum offloading is currently disabled in ix(4). Tested on 82598 and 82599 (though checksums are still disabled by default). ok claudio
2011-06-18Use MSI interrupts when available. Tested by deraadt@ and jsg@.Claudio Jeker
Removing a leftover M from my tree makes also my machine happy.
2011-06-15if the system runs out of mbufs and cannot provide any when fillingDavid Gwynne
the rx ring, schedule a timeout to keep trying until it gets some. a timeout is used here cos the chip doesnt have a way of reporting if its out of descriptors or when there's a ring overflow. we have to manage that ourselves in software. mikeb reported this issue on an ipsec gateway. ipsec would consume all the mbufs while they were stuck in crypto waiting for the cpu to catch up, by which time it was too late to give more to the hardware. without any rx descriptors the chip would never interrupt and we'd never try to fill the ring again. the fix was tested by and is ok mikeb@
2011-06-10Monster update of ix(4). This brings ix(4) close to what is currentlyClaudio Jeker
in FreeBSD. This seems to fix a lot of problems on 82599 based cards including the VLAN problems and the corrupted receives. Putting this in now to work on it in tree since a few additional things need to be merged. Tested by myself, deraadt@ and jsg@ on both 98er and 99er cards. OK jsg@, deraadt@
2011-04-15Remove dead assignments and one newly created unused variable.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok henning@ krw@ claudio@
2011-04-13modify the interrupt handler so it only processes the rings once, ratherDavid Gwynne
than looping over them until it runs out of work to do. in my testing i have found that under what i consider high pps (>160kpps) ix would loop 4 or 5 times in the interrupt handler, where each loop does a bus_space_read and the mclgeti loop (ie, rx dequeue followed by rx ring fill). looping in the isr is bad for several reasons: firstly, the chip does interrupt mitigation so you have a decent/predictable amount of work to do in the isr. your first loop will do that chunk of work (ie, it pulls off 50ish packets), and then the successive looping aggressively pull one or two packets off the rx ring. these extra loops work against the benefit that interrupt mitigation provides. bus space reads are slow. we should avoid doing them where possible (but we should always do them when necessary). doing the loop 5 times per isr works against the mclgeti semantics. it knows a nic is busy and therefore needs more rx descriptors by watching to see when the nic uses all of its descriptors between interrupts. if we're aggressively pulling packets off by looping in the isr then we're skewing this check. ok deraadt@ claudio@ testing by phessler@ bluhm@ and me in production
2011-04-07Do not use NULL in integer comparisons. No functional change.Miod Vallat
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
2011-04-05mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUTHenning Brauer
ok claudio krw
2011-04-03use nitems(); no binary change for drivers that are compiled on amd64.Jasper Lievisse Adriaanse
ok claudio@
2010-11-10Enable low latency interrupt moderation and set the LL intervalClaudio Jeker
to the maximum value to reduce the number of low latency interrupts hitting the card when the ring is getting full. Tested at least by deraadt@ on 99 and myself on 99 and 98 ix(4). OK mikeb@
2010-10-27fix double ;;Theo de Raadt
2010-08-27These do not need powerhook functions.Theo de Raadt
ok jsg
2010-08-11Use the correct offsets when reading/writing to DCA_TXCTRL in the 82599Jonathan Gray
case. Adapted from Intel code in FreeBSD and tested on 82598/82599.
2010-04-20Don't ask for ipv6 checksum offloading as we aren't ready for it.Jonathan Gray
Due to the messy context setup code this was breaking ipv6 forwarding when ipv4 offloading was enabled. All checksum offloading remains disabled for now. Debugged with and ok claudio@
2010-03-22There is a workaround for a 82599 specific errata that could hang the rx dmaJonathan Gray
unit, it just wasn't called. Problem is present in the FreeBSD driver (but not the Linux one).