Age | Commit message (Collapse) | Author |
|
be put on the ring couldnt be allocated.
this pulls the code that puts the mbufs on the ring out of myx_rx_fill
so it can return early if firstmb cant be allocated, which puts it
in the right place to return unused slots to the if_rxring.
this means myx rx wont lock up if you're DoSsed to the point where
you exhaust your mbuf pools and cant allocate mbufs for the ring.
ok jmatthew@
|
|
the number of contexts that are refilling the rx rings with atomic
ops.
this is borrowed from code i wrote for the scsi midlayer but cant
put in yet because i havent got atomic.h up to scrach on all archs
yet. the archs myx runs on do have enough atomic.h to be fine though.
|
|
|
|
and ether_input, queue all the mbufs onto an mbuf_list on the stack
and then take the biglock once outside the loop.
|
|
to ketenis.
move the if_ipacket and if_opacket increments out of biglock too.
theyre only updated from the interrupt handler, which is only run
on a single cpu so there's no chance of the update racing. everywhere
else only reads them.
|
|
|
|
the link state or to clear OACTIVE, just take it when we know we
really are going to do those things.
|
|
ok mpi@ kspillner@
|
|
while (space) {
IFQ_POLL;
myx_dequeue(free descr);
IFQ_DEQUEUE;
etc;
}
with
while (space && myx_dequeue(free descr)) {
IFQ_DEQUEUE;
etc;
}
|
|
ok miod@, who has offerred to help with any MD fallout
ok guenther@
|
|
after discussions with beck deraadt kettenis.
|
|
|
|
to using if_rxr.
cut the reporting systat did over to the rxr ioctl.
tested as much as i can on alpha, amd64, and sparc64.
mpi@ has run it on macppc.
ok mpi@
|
|
im sick of fixing this by hand on all my boxes while hacking on
other stuff and having it pollute my diffs.
no functional change.
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
int isnt necessary.
|
|
|
|
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@
|
|
|
|
myx maintains. this moves it away from relying on splnet to protect
them.
|
|
|
|
|
|
|
|
|
|
did at n2k13.
|
|
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@
|
|
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.
|
|
|
|
STREAMING them.
|
|
bus_space_write_raw_region_8. disabling it for now.
|
|
|
|
try and do write combining like the myx doco likes.
|
|
|
|
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@
|
|
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.
|
|
|
|
necessarily correct, there might not even be a link when attaching.
ok mikeb@ reyk@
|
|
either an mbuf leak or a NULL pointer dereference.
ok sthen@ claudio@ dlg@
testing claudio@ dlg@
|
|
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@
|
|
gets some packets onto the rings.
also annoying, but the hardware doesnt report empty rings, we have to
handle it ourselves.
|
|
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
|
|
by a previous use
ok claudio
|
|
ok kettenis@
|
|
ok dlg@
|
|
|
|
it now works on sparc64, too
ok dlg
|