summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_em.c
AgeCommit message (Collapse)Author
2009-01-27make drivers tell the mclgeti allocator what their maximum ring size isDavid Gwynne
to prevent the hwm growing beyond that. this allows the livelock mitigation to do something where the hwm used to grow beyond twice the rx rings size. ok kettenis@ claudio@
2008-12-23allow us to completely exhaust the rx ring now that we handle the RXO (rxDavid Gwynne
overflow) interrupt. Yes deraadt@
2008-12-21rework the programming of the multicast addresses onto the chip to use theDavid Gwynne
"new" multicast address and address range counters in the ifp. shrinks and simplifies that code a lot. ive had this diff since may 2007.
2008-12-21use the RXO (rx overflow) interrupt to try to refill the rx ring. this letsDavid Gwynne
us cope if the rx ring empties completely and the hardware tells us we're still getting packets.
2008-12-15revert 1.20 now that the new allocator is used to control the number ofBrad Smith
RX buffers allocated. ok dlg@
2008-12-06uncount clusters taken off the rx ring immediately. if those clusters wereDavid Gwynne
being chained into a jumbo we would not replace them when filling the rx ring again until they were passed up the stack.
2008-12-04Add initial support for the ICH9 IGP M and ICH9 IGP M AMT chipsets.Brad Smith
For now the chunk in em_detect_gig_phy() is a hack to get things going until it can be figured out why exactly the PHY id is not probed properly. Based on a diff from jcs@ via ckuethe@ ok kettenis@
2008-12-03recommit the use of the new mbuf cluster allocator.David Gwynne
this starts em up with 4 mbufs on the rx ring, which will then grow as usage demands. this also allows em to take advantage of the new livelock mitigation code as well as freeing up a boatload of kernel memory. this version of the diff makes sure we only ever post the last descriptor we filled to the hardware, rather than the whole ring when bringing the interface up. it has been tested by users who got panics with the previous diff without trouble.
2008-11-29revert 1.197 if_em.c, 1.38/1.39 if_em.h, requested by dlg, until a bugStuart Henderson
reported on misc@ can be tracked down. identical diff from jsing.
2008-11-28Eliminate the redundant bits of code for MTU and multicast handlingBrad Smith
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@
2008-11-26rework the filling of the rx ring. this switches us to having the clusterDavid Gwynne
allocation limited by per ifp statistics, ie, we're not guaranteed to have mbufs in every slot on the rx ring. instead of filling the ring with 256 mbufs all the time (about 512KB of kva) when em is brought up, we give it 4. as demand grows we increase the number of mbufs allowed on the ring. i will bet most users wont go above 50ish mbufs, so we're saving them 400KB of kva. tested by many, including one on sparc64 ok claudio@ deraadt@ henning@ krw@
2008-11-24some whitespace fixes in em_rxeofDavid Gwynne
2008-11-09Introduce bpf_mtap_ether(), which for the benefit of bpf listenersChristian Weisgerber
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@
2008-10-28Some tweaks for the usage of NVLAN > 0 checks in the code.Brad Smith
2008-10-19Re-add support TX VLAN tag insertion and RX VLAN tag stripping.Brad Smith
Tested by naddy@
2008-10-15Second pass of simple timeout_add -> timeout_add_sec conversionsBret Lambert
This should take care of the simpler ones (i.e., timeout values of integer multiples of hz). ok krw@, art@
2008-10-05Always update published link state even if the internal link state doesn'tMark Kettenis
change. Prevents us from getting stuck in LINK_STATE_UNKNOWN. Fixes PR 5914. tested by deraadt@, sthen@ ok deraadt@
2008-10-02First step towards cleaning up the Ethernet driver ioctl handling.Brad Smith
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@
2008-09-30style nits.Brad Smith
2008-09-24remove dead stores and newly created unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok henning@ brad@
2008-08-29Disable the use of Jumbo frames on the first generation chips (82542).Brad Smith
The exact details are unknown (possibly hw errata?) but the Windows and Linux drivers have never supported Jumbos on this chipset and since it is so old and rare it is not that big of a deal. From FreeBSD ok dlg@ awhile ago.
2008-07-15Backout rev 1.162. This change made us muck with with pci config space atMark Kettenis
address 0x1a and 0x1e, and that's not where the PCIe capability stuff lives. Potentially it was mucking with an IO BAR (super dangerous). But probably it was achieving nothing at all. ok dlg@, marco@, brad@
2008-06-15Don't see rx_abs_int_delay if rx_int_delay is not set. SettingTodd C. Miller
rx_abs_int_delay to be non-zero when rx_int_delay is zero appears to trigger a bug elsewhere in the kernel for certain em revisions. Based on a diff from beck@. OK beck@ marco@ henning@ brad@
2008-06-08don't declare foo_driver_version[] strings and turn them into defines,Reyk Floeter
nothing uses them and it saves a few bytes in the kernel. ok claudio@
2008-06-03put code to print periodic debug statistics in #ifdef EM_DEBUG, shrinksBrad Smith
the driver for about 292 bytes on i386. ok reyk@
2008-05-13Since Ethernet links can only be full duplex or half duplex the linkBrad Smith
state reporting code in the MII layer / em(4) and vge(4) will never fall back to the point of only reporting the link as being UP without the duplex setting being reported, so simplify the code a bit here. ok dlg@
2008-04-09dma sync the tx ring and post new packets to the chip once per call toDavid Gwynne
the start routine instead of once per packet. tested on various archs including amd64, i386, and sparc64.
2008-03-02At the moment em_flowstatus() does not deal with fiber interfaces andBrad Smith
will not return any flow control status so just return no status (0) instead of reading copper PHY registers and not returning anything anyway. ok kettenis@
2008-03-02If bus_dmamap_load_mbuf() fails in em_get_buf() use m_freem() intead ofBrad Smith
m_free() to free the mbuf cluster. ok krw@ mglocker@
2008-02-27Correct the watchdog timer by moving it out from under the condition checkBrad Smith
for the IFF_OACTIVE flag. Tested by brad@, johan@, krw@, wilfried@ From mickey
2008-02-20Add support for the Intel ICH9 chipsets.Brad Smith
Initial diff from Henry Precheur based on a commit from matthias@dragonflybsd which was derived from the FreeBSD driver. Additional Flash changes from sephe@dragonflybsd which was derived from the FreeBSD driver. Typo fixes in Henry's diff and a few other improvements from the FreeBSD driver from brad@. Tested on a variety of different em(4) adapters in addition to ICH8/9. ok dlg@
2008-02-04Add PCI ids for some 82571 based multi port adapters.Brad Smith
From FreeBSD ok dlg@
2008-02-02Move the current flow control status code out of em_media_status()Brad Smith
and into a separate function which was modeled after the MII frameworks mii_phy_flowstatus() function. This was done so as to make em_media_status() a little nicer looking and so that when flow control status is added for fiber adapters that em_media_status() won't look so ugly. No functional change. Tested by wilfried@ and brad@ ok dlg@
2007-10-21Allow for the adjustment of the number of RX descriptorsBrad Smith
for the newer generations of em(4) chipsets independently from the first two generations (82542/82543). The first two generations have hardware errata limiting the upper maximum to 256 descriptors. The number of RX descriptors has not been adjusted yet. ok beck@ henning@ dlg@
2007-10-01More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...' whereKenneth R Westerback
obvious.
2007-05-31only call em_init() when IFF_UP is set, not unconditional.Henning Brauer
prevents another round of autonegotiation (and thus, few seconds outage) with every address change that had to be reintroduced a few revs ago because of the watchdog timeout problems people were seeing. this gives the benifit from both with the problems of neither ;) tested by daniel polak on a system that saw the watchdog timeouts before ok theo
2007-05-311000 != 0x1000 (4096)Chris Kuethe
Bring the flow control delay time down to what the comment says it should be. By using a smaller flow control pause time when the buffer isn't full, my em(4) goes about 20Mbps faster.
2007-05-30Move the knob for the interrupt throttling register next to the knobs forChris Kuethe
the other interrupt moderation schemes. ok beck drahn
2007-05-09delete unused functions. typical vendor garbage driver..; ok kettenisTheo de Raadt
2007-05-09Revert rev 1.116. For some reason this caused the device to do DMA from/toMark Kettenis
random addresses in some cases, causing watchdog timeouts. tested by many; ok deraadt@
2007-03-16A new PCI id for Intel's PCIe quad port fiber adapter.Reyk Floeter
2007-01-26Workaround for an issue with em(4) interfaces on Lenovo X60/T60 laptops whereTobias Weingartner
the interface will fail to initialize with an EEPROM error if the interface does not have a link upon boot. Tested by mk@ and janek@ From Jack Vogel@Intel via brad
2007-01-21Fix typo. From brad@Mark Kettenis
2007-01-15Report flow control status.Mark Kettenis
From brad@
2006-12-27Set IFM_ETH_MASTER if local PHY configuration resolved to MASTER.Mark Kettenis
From brad@
2006-12-06Implement em_read_pcie_cap_reg(), where we set the max read size onReyk Floeter
PCIe to 4k. >From kmacy@FreeBSD Tested by mk@ and Johan Mson Lindman <tybollt at solace dot mh dot se> with the 82573 chipset. ok brad@ mglocker@ mk@
2006-12-04report full/half duplex state for non-MII interfacesReyk Floeter
ok brad@
2006-11-21Remove watchdog handler workaround introduced in rev 1.149 which is noBrad Smith
longer necessary.
2006-11-21style changes. no op.Brad Smith
2006-11-18fix commentsBrad Smith