summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_ix.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* we need to always schedule another rx ring refill calloutmikeb2011-12-091-4/+4
| | | | | in case we fail to do it at the spot. prevents rx ring lockups under high load. ok dlg
* Bring back low latency interrupt moderation for 82599mikeb2011-11-271-7/+15
| | | | | | lost during update. Originally from claudio, rev1.46. ok claudio
* Checksum fix from reyk (rev1.31) that was lost during update:mikeb2011-11-271-4/+1
| | | | | | | | | | | 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
* Use MSI interrupts when available. Tested by deraadt@ and jsg@.claudio2011-06-181-2/+2
| | | | Removing a leftover M from my tree makes also my machine happy.
* if the system runs out of mbufs and cannot provide any when fillingdlg2011-06-151-5/+29
| | | | | | | | | | | | | | | | 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@
* Monster update of ix(4). This brings ix(4) close to what is currentlyclaudio2011-06-101-516/+937
| | | | | | | | | 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@
* Remove dead assignments and one newly created unused variable.chl2011-04-151-5/+2
| | | | | | Found by LLVM/Clang Static Analyzer. ok henning@ krw@ claudio@
* modify the interrupt handler so it only processes the rings once, ratherdlg2011-04-131-35/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Do not use NULL in integer comparisons. No functional change.miod2011-04-071-3/+3
| | | | ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
* mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUThenning2011-04-051-3/+3
| | | | ok claudio krw
* use nitems(); no binary change for drivers that are compiled on amd64.jasper2011-04-031-2/+2
| | | | ok claudio@
* Enable low latency interrupt moderation and set the LL intervalclaudio2010-11-101-2/+10
| | | | | | | 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@
* fix double ;;deraadt2010-10-271-2/+2
|
* These do not need powerhook functions.deraadt2010-08-271-17/+1
| | | | ok jsg
* Use the correct offsets when reading/writing to DCA_TXCTRL in the 82599jsg2010-08-111-3/+21
| | | | case. Adapted from Intel code in FreeBSD and tested on 82598/82599.
* Don't ask for ipv6 checksum offloading as we aren't ready for it.jsg2010-04-201-1/+5
| | | | | | | | 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@
* There is a workaround for a 82599 specific errata that could hang the rx dmajsg2010-03-221-2/+2
| | | | | unit, it just wasn't called. Problem is present in the FreeBSD driver (but not the Linux one).
* Use the correct number of max scatter gather segments for 82599,jsg2010-03-221-2/+8
| | | | adapted from FreeBSD.
* Remove support for preproduction 82598 revision A0,jsg2010-03-191-55/+1
| | | | it was removed from the equivalent FreeBSD code over a year ago.
* Set rx_ndescs to zero when initializing the rx ring. Otherwise we'llkettenis2010-03-161-1/+2
| | | | | | | | effectively lose receive descriptors each time we reset the interface, until we run out of descriptors and panic. Should fix the "em_rxeof: NULL mbuf in slot 0 (nrx 256, filled 255)" panic on em(4). ok jsing@ (for the em(4) bits), jsg@
* Add support for the 82599 ExpressModule (X520-P2) card.jsg2010-02-251-2/+4
|
* Add support for 82599 devices based on changes to the FreeBSD driver.jsg2010-02-231-67/+233
| | | | | | | Tested by deraadt on a HotLava card and myself with an Intel X520 and a CX4 82598. ok claudio@
* Partial sync to the latest version of ixgbe in FreeBSD leaving thingsjsg2010-02-191-15/+22
| | | | | | | | | | | | like if_ix.c mostly untouched for now. This brings in support for newer 82598 parts and adds several things that will be needed for 82599. Initially from claudio with some additions by me. Tested by claudio, dlg (earlier version) and myself on different cards and media types. ok claudio@
* IP checksum is still broken with fragments, turn it off for now.reyk2010-01-191-3/+4
| | | | ok dlg@
* Enable IP checksum offloading in ix(4).reyk2010-01-111-4/+3
| | | | | | | | | Note: it did not work before because the checksum offloading was taking care about TCP and UDP but forgot about IP fragments and other IP protocols. We need to take care that IP fragments are handled correctly when we do IP/TCP/UDP offloading. ok jsg@ deraadt@, discussed with others
* replace an #ifdef IX_CSUM_OFFLOAD with an IFCAP_CSUM_IPv4 capability check,reyk2010-01-091-4/+4
| | | | | this allows to enable/disable checksum offloading at one point in the driver without the need to care about stupid #defines. no functional change.
* Fix the IP ckecksum offloading logic that disables and breakes offloadingreyk2010-01-091-4/+1
| | | | | | | | 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). ok jsg@
* - consistify cfdriver for the ethernet drivers (0 -> NULL)jasper2009-08-131-2/+2
| | | | ok dlg@
* revert my change to m_cluncount which tries to prevent the systemdlg2009-08-121-5/+3
| | | | | | | | | | running out of mbufs for rx rings. if the system low watermark is lower than a rx rings low watermark, we'll never send a packet up the stack, we'll always recycle it. found by thib@ on a bge sadface
* ix currently relies on a gcc extension that removes a commajsg2009-08-121-5/+5
| | | | | | | | | if no arguments are passed to a variadic macro. Create a seperate non variadic macro for this fixed argument case. No binary change. ok reyk@
* if we get dangerously low on clusters during interrupts, we needdlg2009-08-121-3/+5
| | | | | | | | | | | | | to free some for use on the rx rings on network cards. this modifies m_cluncount to advise callers when we're in such a situation, and makes them responsible for freeing up the cluster for allocation by MCLGETI later. fixes an awesome lockup with sis(4) henning has been experiencing. this is not the best fix, but it is better than the current situation. yep deraadt@ tested by henning@
* A few more simple cases of shutdown hooks which only call xxstop, whenderaadt2009-08-101-17/+1
| | | | we now know the interface has already been stopped
* MCLGETI() will now allocate a mbuf header if it is not provided, thusderaadt2009-08-091-9/+3
| | | | | | reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
* rework link state handling a bit. this reports missing link correctly. thedlg2009-07-101-64/+41
| | | | | | | old code showed the nic as active all the time, which makes it suck as part of a trunk. testing and ok by reyk@
* Bring back rev 1.17, enable hardware vlan tagging/stripping.jsg2009-06-291-30/+30
| | | | ok deraadt@
* Now the tx dma mapping problem it was exposing is fixedjsg2009-06-281-337/+290
| | | | | bring back rev 1.16, em style MCLGETI based on a diff from reyk with critical fixes by me.
* Properly swap tx dma maps so we don't use invalid maps,jsg2009-06-281-1/+2
| | | | | | | | leak memory, lose maps or cause double frees. Problem courtesy of our good friends at Intel in the original FreeBSD driver. "awesome" dlg@
* Back out if_ix.c 1.16, 1.17 and 1.18 (and corresponding changes to toderaadt2009-06-251-449/+432
| | | | | | | if_ix.h) since it corrupts packets or the checksum flags or something upwards and breaks nfs. The 1.16 MCLGETI change does not cause this but has a double free on reboot, and the 1.18 fixes that double free but introduces the packet corruption.
* like I did for em(4) before, doubled error messages are sillyderaadt2009-06-241-4/+2
| | | | from brad
* switch to a bnx style dynamic pool backed tx so we don'tjsg2009-06-041-90/+154
| | | | | | have to allocate everything up front. Requested by reyk@, 'I'm fine with it' dlg@, 'commit it' deraadt@
* Enable hardware vlan tagging/stripping and disable thejsg2009-04-291-30/+30
| | | | | vlan filter so it will work properly. ok reyk@
* Switch ix over to em flavoured MCLGETI.jsg2009-04-241-337/+290
| | | | | Initial diff from reyk with a bunch of critical fixes from me. ok reyk@, 'put it in when you're confident with it' dlg@ on an earlier rev.
* Eliminate the redundant bits of code for MTU and multicast handlingbrad2008-11-281-21/+18
| | | | | | | | | | | | | | from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
* Introduce bpf_mtap_ether(), which for the benefit of bpf listenersnaddy2008-11-091-3/+4
| | | | | | | | | creates the VLAN encapsulation from the tag stored in the mbuf header. Idea from FreeBSD, input from claudio@ and canacar@. Switch all hardware VLAN enabled drivers to the new function. ok claudio@
* Fix up some of the code for VLAN tagging/stripping and checksum offloadbrad2008-10-281-37/+26
| | | | support.
* Switch the existing TX VLAN hardware support over to having thenaddy2008-10-161-19/+6
| | | | | | tag in the header. Convert TX tagging in the drivers. Help and ok brad@
* Convert RX tag stripping to storing the tag in the mbuf header andnaddy2008-10-161-16/+3
| | | | | | enable RX tag stripping for re(4). ok brad@
* Fix various printf constructs either missing arguments or format specifiers.miod2008-10-111-2/+2
|
* First step towards cleaning up the Ethernet driver ioctl handling.brad2008-10-021-9/+2
| | | | | | | | | | | | | | | | | | | | Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@
* Convert timeout_add() calls using multiples of hz to timeout_add_sec()blambert2008-09-101-4/+4
| | | | | | | Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@