summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_myx.c
AgeCommit message (Collapse)Author
2014-03-24nothing after the irq ack posting relies on it being ordered.David Gwynne
2014-02-10the mac addresses you program with MYXCMD_SET_MCASTGROUP are in a differentDavid Gwynne
format to the one used for MYXCMD_SET_LLADDR. for reasons. this lets ospf work if you dont happen to have PROMISC enabled on your interface like my production firewalls happen to have, which is why i never noticed this before.
2014-02-05after running myx(4) without biglock in production for a few daysDavid Gwynne
i discovered that there's a race between the interrupt code and myx_start which causes the count of free tx descriptors to get distorted, which eventually leads to a permanent setting of IFF_OACTIVE, which in turn prevents the driver from transmitting packets. fixing that went horribly wrong when i then discovered that there's a race between the interrupt handler and myx_down, where the interrupt can tell myx_down to wake up and free all the rings while the interrupt handler is still looking at them. free panics for all. this moves the handling of the tx free count under the biglock (for now), and moves myx_up and myx_down to managing a "driver state" variable independantly of the IFF_UP and IFF_RUNNING flags, and very very careful reordering of the checks of that state variable and the hardware state. as a bonus we get to avoid excessive calls to myx_txeof and myx_rxeof in the isr, and less stuff checked unconditionally. on the other hand, the sc_state handling added some more checks so it might not be a win overall. tested on smp sparc64 with msi and nonmsi interrupts, and on amd64 smp in production again.
2014-01-31sc_function is set, but never used for anything useful. clean it up...David Gwynne
2014-01-31sc_lladdr is never used, so we can get the space in the sc back.David Gwynne
2014-01-23a lot of people have pointed out to me that taking a lock just to read anDavid Gwynne
int isnt necessary.
2014-01-23factor the mutex/bus_space handling of the sts block out.David Gwynne
2014-01-21introduce fine grained locking.David Gwynne
this doesnt give up the big lock coming from process context, only from the interrupt side. it is excessively careful about when it takes the big lock again. notably it goes to a lot of effort to not hold a mutex while calling into other subsystems or before taking the big lock. ive been hitting it as hard as i can without problems. intensly read by mpi@ ok claudio@ kettenis@
2014-01-19white space fixDavid Gwynne
2014-01-19introduce fine grained locking around the lists of packet handlersDavid Gwynne
myx maintains. this moves it away from relying on splnet to protect them.
2014-01-19hwflags is never used, so clean it upDavid Gwynne
2014-01-19replace bcmp with memcmpDavid Gwynne
2014-01-19bcopy to memcpyDavid Gwynne
2014-01-19replace bzero with memset.David Gwynne
2014-01-19all 64bit archs myx runs on support bus_space 8 things because of work iDavid Gwynne
did at n2k13.
2013-01-29- Set ENETRESET within myx_ioctl() instead of calling myx_iff() directly, to beBrad Smith
consistent with other drivers. - Clear IFF_ALLMULTI flag early and at the top of myx_iff(). - Set IFF_ALLMULTI when in promisc mode. ok dlg@
2013-01-25we go to a lot of effort to post the first tx descriptor last, but weDavid Gwynne
really should be trying to post everything except the flags field in the first tx descriptor. this shuffles things around so the rest of that first txd is posted as part of the "everything else" before its flags field.
2013-01-25the myx_dmamem struct doesnt need a name.David Gwynne
2013-01-21myx does reads and writes in one direction to packet buffers. lets tryDavid Gwynne
STREAMING them.
2013-01-15dont use amd64 is currently broken cos it has noDavid Gwynne
bus_space_write_raw_region_8. disabling it for now.
2013-01-15use bus_space_write_raw_region_8 on 64bit archs when writing to the ringsDavid Gwynne
2013-01-14map the registers PREFETCHABLE so things that can do write combining canDavid Gwynne
try and do write combining like the myx doco likes.
2013-01-14avoid extra bus_space barriers in the interrupt handler.David Gwynne
2013-01-14when posting descriptors to the chips rings, avoid going write barrierDavid Gwynne
write barrier write barrier when using myx_write to post descriptors. instead let its go write write write barrier by using the appropriate bus_space write directly followed by a single bus_space barrier. the story above is mostly true, except that myx wants use to write all the descriptors except the first, barrier, and then write the first one out to signale that the chip can proceed. it is also worth noting that the barriers cover more address space than what we actually wrote to. this makes the code much simpler, and avoids generating extra fence operations (which is what barrier functions end up as on most of our archs) when we wrap around the end of the ring. the bus_space doco encourages this. bus_space use was discussed with krw@ kettenis@ deraadt@
2013-01-14the myri doco suggests its nice to post stuff by filling in everythingDavid Gwynne
in the rings except the first descriptor. once you've written as much as you can out, then you go back and post the first descriptor to signal that the chip should go ahead and work.
2013-01-14;; is a long way of saying ;David Gwynne
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@
2011-11-28Fix reversed error-handling gotos in myx_buf_fill(), which would lead toBret Lambert
either an mbuf leak or a NULL pointer dereference. ok sthen@ claudio@ dlg@ testing claudio@ dlg@
2011-08-08myx requires the driver pad short ethernet frames to 60 bytes byDavid Gwynne
adding a descriptor pointing at zeroed bytes onto the end of transmit chains. i was accounting for this extra descriptor when i was completing the chain, but not when i was setting this up. this meant the number of free descriptors kept growing until it overflowed. at this point the check for space in the ring failed and packets no longer flowed. this counts the pad descriptor in the tx chain setup too. ok deraadt@
2011-06-23cope with empty rx rings by scheduling a timeout to keep trying until itDavid Gwynne
gets some packets onto the rings. also annoying, but the hardware doesnt report empty rings, we have to handle it ourselves.
2011-06-23this chip has an annoying "feature" where it cannot report the linkDavid Gwynne
state unless the chip is up and handling packets. while its down it does not report the link state, so it is unknown. this tweaks the link state handling, in particular it adds code to myx_down so it moves the link state to unknown, ie, it correctly reflects reality. stupidity pointed out by deraadt
2011-06-22reset the tx_count on UP, since it may have been advanced from non-zeroTheo de Raadt
by a previous use ok claudio
2011-06-22msi support. this is a complicated one...David Gwynne
ok kettenis@
2011-06-22another myri10ge device matched by freebsd/linux driversJonathan Gray
ok dlg@
2011-06-22oops, handle refill like i said i was going to two revisions ago.David Gwynne
2011-06-22set the mac address on the chip correctly (repair the byte order)Theo de Raadt
it now works on sparc64, too ok dlg
2011-06-22deraadt plugged his myx into a sparc64 and discovered 3 problems:David Gwynne
1. we want to write raw values to registers all the time, so promote the myx_raw{read,write} to myx_{read,write} and use them everywhere. get rid of the raw funcs. 2. i was setting the watermarks on the rx ring before knowhing how big they were. 3. rxfill in the interrupt handler could lose data if you loop on sts_isvalid. almost working now... "please commit your diff" deraadt@
2011-06-21do the unaligned dma tests so we can figure out if we need to fallDavid Gwynne
back to the unaligned firmware. apparently this is only an issue on the "A" controllers which have been supersceded, but those are the chips we (openbsd devs) have.
2011-06-21report the controllers part number. eg, i now know i have aDavid Gwynne
10G-PCIE-8A-R. dmesg looks like this: myx0 at pci4 dev 0 function 0 "Myricom Z8E" rev 0x00: apic 1 int 8, model 10G-PCIE-8A-R, address 00:60:dd:47:c6:74
2011-06-21wire up jumbos properly. the hardware supports up to 9018 bytes offDavid Gwynne
the wire (9000 + ether header + vlan tag), but has some cool alignment requirements. if you want to use a single rx ring desc to point at a jumbo it needs to start on a 4k boundary and be physically contiguous. to ensure this im pulling frames from the 12k pool and waiting for arianes diff to ensure mbufs are contig. direction from andrew gallatin. tested locally.
2011-06-21minor cleanups; ok dlgTheo de Raadt
2011-06-20make the interrupt handler look more like what the doco suggests. seems toDavid Gwynne
fix a bad lockup i kept getting.
2011-06-20dont need debug, the myx_cmd stuff works fine.David Gwynne
2011-06-20i got myx working!David Gwynne
2011-05-02Do not check malloc return value against NULL, as M_WAITOK is used.Charles Longeau
ok dlg@ krw@
2010-05-19BUS_DMA_ZERO instead of alloc, map, bzero.Owain Ainsworth
ok krw@
2009-08-13- consistify cfdriver for the ethernet drivers (0 -> NULL)Jasper Lievisse Adriaanse
ok dlg@
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-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@