summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bnx.c
AgeCommit message (Collapse)Author
2011-06-22kill a few more casts that aren't helpful. ok krw miodTed Unangst
2011-04-18ido not disable interrupts in the isr and then enable them againDavid Gwynne
when leaving. when you're handling an interrupt it is masked. whacking the chip is work for no gain. modify the interrupt handler so it only processes the rings once rather than looping over them until it runs out of work to do 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@
2011-04-13to quote from the gospel of bus_dma.9:David Gwynne
Synchronization operations are expressed from the perspective of the host RAM, e.g., a device -> memory operation is a READ and a memory -> device operation is a WRITE. the status block that the isr reads is written to by the device. the chip writes to memory, it is therefore a READ. this also adds the preread sync when the map is set up and the postread sync when the map is torn down for better symmetry. there are probably more issues like this in the code, but this is a start. discovered while discussing another diff with claudio@
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-09-20Stop doing shutdown hooks in network drivers where possible. We alreadyTheo de Raadt
take all interfaces down, via their xxstop routines. Claudio and I have verified that none of the shutdown hooks do much extra beyond what xxstop was already doing; it is largely a pile of junk. ok claudio, some early comments by sthen; also read by matthew, jsg
2010-08-03Correct use of logical and where binary and was intended.Jonathan Gray
Spotted by lint, but mirrors a similiar change in the original FreeBSD code from over a year ago. ok deraadt@
2010-05-24Support fibre PHY on BCM5709S. From FreeBSD via Brad.Stuart Henderson
Tested by Brad on: BCM5706, BCM5708C Tested by me on: BCM5716 (BCM5709 PHY)
2010-05-19BUS_DMA_ZERO instead of alloc, map, bzero.Owain Ainsworth
ok krw@
2009-11-23bnx(4) is a bit special. The chip itself is capable of swapping endianessClaudio Jeker
so there is no need for htoleXX calls. The only thing needed is the correct layout of the DMA-ed structures. Additionally it uses PAGE_SIZE but assumed that it is always 4k. Fix the macros that failed to respect that so that it works on 8k PAGE_SIZE systems. This makes bnx(4) work on sparc64. Tested on amd64 by dlg@. OK dlg@, deraadt@
2009-11-09Link state change interrupt was not generated due to a missing bit inDavid Gwynne
the MAC event register. fix from atte dot peltomaki at iki dot fi tested by me on 5708 and 5709
2009-08-13- consistify cfdriver for the ethernet drivers (0 -> NULL)Jasper Lievisse Adriaanse
ok dlg@
2009-08-09MCLGETI() will now allocate a mbuf header if it is not provided, thusTheo de Raadt
reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
2009-08-06Add device id for BCM5716S, tidy whitespace. From Brad.Stuart Henderson
2009-07-03this is a rather large change to add support for the BCM5709.David Gwynne
the 5709s use a the b09 firmwares, which is different to the b06 used by all the other chips supported by bnx. the majority of the diff comes from special handling for some indirect reads and writes, and because it needs more host memory to operate with. ive tried to keep the cosmetic changes to a minimum. "go for it" deraadt@
2009-07-03newer bnx chips use a separate firmware to the "old" ones. this updatesDavid Gwynne
the b06 firmware for the older chips, and adds the b09 firmware. there are three variants of the rv2p code thats loaded onto the chips, so this has been split out into separate firmware files as well. the driver has been updated to handle the split firmwares, and to easily allow loading of the different versions. this change only supports the loading of the firmwares for the currently supported chips. after this change you must build the new firmwares and install them as well as your new kernel. "go to it" deraadt@
2009-06-20Rewrite the interface flag handling case code and update the receiveChristian Weisgerber
filter handling to take advantage of ac_multirangecnt and have correct IFF_ALLMULTI handling. From Brad.
2009-04-22dont need to zero the tx pkt pool structure before initting it now thatDavid Gwynne
pool_init does its job properly.
2009-04-22replace arrays of dmamaps and mbuf pointers used to manage packetsDavid Gwynne
on the tx rings (one mbuf ptr/dmamap array entry was created for every tx descriptor slot at attach time) with a dynamically grown list of mbuf pointers and dmamaps. bnx used to have 512 dmamaps/mbuf pointers for the tx ring, now my system is running with 8 under moderate load. the big bonus from this is that the dmamap handling is greatly simplified. reyk@ likes this a lot
2009-04-20when transmitting packets, put the dmamap we used for the packet into theDavid Gwynne
last descriptor slot in the ring. the tx completion code expects the dmamap to be there so it can unload it. ok reyk@
2009-04-20fix dma map unmapping and unloading in the tx cleanup path.Reyk Floeter
ok dlg@
2009-04-14Don't free an mbuf that's still on the TX queue. While there sanitize theMark Kettenis
function signature of bnx_tx_encap() such that people don't get weird ideas like this again. ok dlg@
2009-04-09white space fixesDavid Gwynne
2009-03-30switch to MCLGETI.David Gwynne
this conversion is the easiest ive done so far. the mbuf allocation wrapper in the driver already had code to handle a failing cluster allocator as part of a test harness, now we test that code all the time with MCLGETI. ok kettenis@ tested by phessler@
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-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-19Re-add support for RX VLAN tag stripping.Brad Smith
2008-10-16Switch the existing TX VLAN hardware support over to having theChristian Weisgerber
tag in the header. Convert TX tagging in the drivers. Help and ok brad@
2008-10-16Convert RX tag stripping to storing the tag in the mbuf header andChristian Weisgerber
enable RX tag stripping for re(4). ok brad@
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-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-06-24Fixed a problem that would cause errors (especially when in low memoryBrad Smith
systems) because the RX chain was corrupted when an mbuf was mapped to an unexpected number of buffers. From davidch@FreeBSD
2008-06-13fix compilation with BNX_DEBUG.Brad Smith
2008-06-13Remove slack space for RX/TX chains since it only covers sloppy coding.Brad Smith
From davidch @ FreeBSD
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-05-29- Add a debug message to mention when a 2.5Gb adapter is found.Brad Smith
- Change invalid PHY address debug message in bnx_miibus_write_reg() from warn level to verbose. - Add two new softc fields and store the shared and port hw config data. From FreeBSD ok dlg@
2008-05-23Simplify the combination use of pci_mapreg_type()/pci_mapreg_map() asBrad Smith
suggested by dlg@ awhile ago. ok dlg@
2008-02-28Add initial bits for fiber support with the BCM5706/BCM5708 chipsets.Brad Smith
Tested with copper adapters by brad@, johan@ and Jung <moorang at gmail dot com> ok dlg@
2008-02-22Avoid unaligned PCI config space access.Mark Kettenis
ok brad@
2008-02-17Remove the check for non-production bnx(4) chipsets. These chipsets areBrad Smith
not officially "supported" and could have errata which the driver does not workaround but they should more or less work. Tested by marco@ with a BCM5708 B0 chipset. ok marco@ dlg@
2007-11-25IF_Gbps(2.5) is wrong.David Gwynne
ok claudio@
2007-08-28unify firmware load failure messages; ok mglockerTheo de Raadt
2007-07-04Revert r1.42 of if_bnx.c, "Enable IPv4 transmit TCP/UDP checksumKenneth R Westerback
offload", and associated man page change. To use IPv4 transmit TCP/UDP checksum offloading you must again define BNX_CSUM. As requested by mbalmer@ via deraadt@ on suggestion of reyk@ in response to PR #5437.
2007-05-22Add the BCM5709 PCI device Id. It is disabled for now since we do notReyk Floeter
support SerDes-based (1000base-SX fibre) bnx(4) devices yet. The reason is simple - we do not have any fibre bnx(4) to test and port the SerDes changes from the other bnx drivers. From brad found in the Linux driver
2007-05-22adress -> addressJasper Lievisse Adriaanse
from brad ok claudio@
2007-05-22Use BNX_PRINTF instead of printf with missing argument.Ray Lai
OK reyk@, earlier version OK tedu@, dlg@, and miod@.
2007-05-21fix bnx vlan tagging in the rx path; do not attach the vlan tag twiceReyk Floeter
if the firmware has been told to keep it and copy the tag in network byte order in the other case. ok mcbride@ dlg@
2007-03-05remove jumbo frame support by replacing MEXTALLOC with MCLGET, andReyk Floeter
simplify the VLAN code. this will close PR 5356 (system panics under high load). From claudio@ who is currently not around to commit this fix tested and ok by mcbride@, reyk@, todd@, Paul Hirsch, and brad
2007-03-03instead of establishing the interrupt in the mounthook, move it backReyk Floeter
to the attach function and set a flag in the mounthook to start accepting interrupts (there are possible problems with establishing interrupts after the ioapics are enabled in i386 GENERIC.MP). also suggested by kettenis tested by mcbride, me, and some others ok dlg@
2007-03-03Replacing some spaces with tabs and some typo fixesTodd T. Fries
from brad@