| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
macppc. Receiving packets stopped, ifconfig down/up made it work
again.
In the tick timeout handler refill the receive ring if it is empty.
The logic is taken from hme(4). Also protect the register access
and ifp counters with splnet().
In gem_rx_watchdog() is a workaround for a hardware bug. It resets
the hardware when there is no progress. If the fifo pointers
advanced a bit, it got stuck anyway. So restart the receive watchdog
timeout in that case.
OK mpi@
|
|
|
|
|
|
| |
this mostly follows the pattern in ifq.h
ok jmatthew@
|
|
|
|
|
|
|
| |
this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.
ok mpi@ deraadt@
|
| |
|
|
|
|
|
|
|
| |
drivers still set IFF_NOTRAILERS while others do not. Remove all usage of
the flag from the drivers which in ancient times used it (and the modern
drivers which blindly copied it from those drivers of yore).
suggested by guenther. ok mpi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dequeueing a packet, then drop the packet if it can't be sent, rather than
using two phase dequeue then commit.
Adjust sc_tx_cnt using atomic operations, take the kernel lock before
calling gem_start or gem_init from the interrupt handler, and use an
interrupt barrier when taking the interface down.
With all this done, we can mark the interrupt handler for pci (but not sbus)
attached gem(4) as mpsafe.
mpi@ wrote this initially, I fixed bugs to keep sparc64 happy and kept it up
to date with ifq changes.
ok mpi@ dlg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
there are two things shared between the network stack and drivers
in the send path: the send queue and the IFF_OACTIVE flag. the send
queue is now protected by a mutex. this diff makes the oactive
functionality mpsafe too.
IFF_OACTIVE is part of if_flags. there are two problems with that.
firstly, if_flags is a short and we dont have any MI atomic operations
to manipulate a short. secondly, while we could make the IFF_OACTIVE
operates mpsafe, all changes to other flags would have to be made
safe at the same time, otherwise a read-modify-write cycle on their
updates could clobber the oactive change.
instead, this moves the oactive mark into struct ifqueue and provides
an API for changing it. there's ifq_set_oactive, ifq_clr_oactive,
and ifq_is_oactive. these are modelled on ifsq_set_oactive,
ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd.
this diff includes changes to all the drivers manipulating IFF_OACTIVE
to now use the ifsq_{set,clr_is}_oactive API too.
ok kettenis@ mpi@ jmatthew@ deraadt@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the code is refactored so the IFQ macros call newly implemented ifq
functions. the ifq code is split so each discipline (priq and hfsc
in our case) is an opaque set of operations that the common ifq
code can call. the common code does the locking, accounting (ifq_len
manipulation), and freeing of the mbuf if the disciplines enqueue
function rejects it. theyre kind of like bufqs in the block layer
with their fifo and nscan disciplines.
the new api also supports atomic switching of disciplines at runtime.
the hfsc setup in pf_ioctl.c has been tweaked to build a complete
hfsc_if structure which it attaches to the send queue in a single
operation, rather than attaching to the interface up front and
building up a list of queues.
the send queue is now mutexed, which raises the expectation that
packets can be enqueued or purged on one cpu while another cpu is
dequeueing them in a driver for transmission. a lot of drivers use
IFQ_POLL to peek at an mbuf and attempt to fit it on the ring before
committing to it with a later IFQ_DEQUEUE operation. if the mbuf
gets freed in between the POLL and DEQUEUE operations, fireworks
will ensue.
to avoid this, the ifq api introduces ifq_deq_begin, ifq_deq_rollback,
and ifq_deq_commit. ifq_deq_begin allows a driver to take the ifq
mutex and get a reference to the mbuf they wish to try and tx. if
there's space, they can ifq_deq_commit it to remove the mbuf and
release the mutex. if there's no space, ifq_deq_rollback simply
releases the mutex. this api was developed to make updating the
drivers using IFQ_POLL easy, instead of having to do significant
semantic changes to avoid POLL that we cannot test on all the
hardware.
the common code has been tested pretty hard, and all the driver
modifications are straightforward except for de(4). if that breaks
it can be dealt with later.
ok mpi@ jmatthew@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.
Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.
There may be some MD fallout but that will be cleared up later.
ok deraadt miod
with help and suggestions from several sharks attending l2k15
|
|
|
|
|
|
|
| |
Note that pseudo-drivers not using if_input() are not affected by this
conversion.
ok mikeb@, kettenis@, claudio@, dlg@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
|
|
|
| |
of a single mbuf. this forces us to batch work between the hardware
rx handlers and the stack.
this includes a converstion of bge from ether_input to if_input.
ok claudio@ pelikan@ mpi@
|
|
|
|
| |
ok pelikan@, reyk@, blambert@, henning@
|
| |
|
|
|
|
| |
ok dlg@ mpi@ bcook@ millert@ miod@
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
examining higher protocol layers to adjust the checksum and calculate
the pseudo-header in the driver is too complex to be worthwhile.
ok henning@
|
|
|
|
|
| |
tested on sparc64 and powerpc with and without the MI backends for the
lem ops enabled.
|
|
|
|
| |
is responsible for the hangs seen by Henning. So put them back.
|
|
|
|
|
|
|
| |
support (rev 1.98). There is strong evidence that one of these causes hangs
on the Sun ERI as found on a v120.
ok henning@, deraadt@
|
|
|
|
|
|
| |
gem(4) on some PowerMac G5.
tested by kirby@, ok deraadt@
|
|
|
|
| |
ok naddy@ sthen@
|
|
|
|
|
|
|
| |
Tested with Apple/Sun gem(4) with and without flow control (Sun ERI/Apple GEM
with FastE PHY).
ok kettenis@
|
|
|
|
|
|
| |
operations in the detach function in the right order. Also ensure that the
interrupt handlers not trust registers that go away.
read over very carefully by dms, tested by me
|
|
|
|
|
|
| |
these cases the xxstop function is a bit more complicated and has a flag of
some sort, but the use of that flag does not matter; DMA is already ceased
ok dlg
|
|
|
|
|
|
| |
reducing the amount of splnet/splx dancing required.. especially in the
worst case (of m_cldrop)
ok dlg kettenis damien
|
|
|
|
| |
numeric values) from Brad. No binary change.
|
|
|
|
|
| |
and fix the appropriate code in gem_init_regs(). From Brad,
tested by Brad (sparc64), todd@ (macppc).
|
|
|
|
| |
Tested by Brad on sparc64, todd@ on macppc.
|
| |
|
|
|
|
| |
ok dlg@
|
|
|
|
| |
ok dlg@, jsg@
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
help from dlg@, tested by a few, ok dlg@
|
|
|
|
|
|
| |
the full mbuf chain is freed.
ok claudio@ kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
ok dlg@
|
| |
|
|
|
|
| |
disabled code that used to use this was removed 7 years ago.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff
for the Gigabit variants and 0x100 for the ERI in order to avoid TX
underruns.
- Turn on workarounds for silicon bugs in the Apple GMAC variants.
This was based on information obtained from the Darwin GMAC and Linux GEM
drivers.
- Turn on "infinite" (i.e. maximum 31 * 64 bytes in length) DMA bursts.
From FreeBSD
Tested by a few users with Apple GMAC's and Sun ERI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
| |
Really just the low-hanging fruit of (hopefully) forthcoming timeout
conversions.
ok art@, krw@
|
|
|
|
|
|
|
|
| |
drivers can report 2-3x times the number of actual packets being
transmitted by only incrementing the counter for descriptors with
buffers being freed.
ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. If bus_dmamap_load_mbuf() fails because there are not enough
segments in the map, defrag the mbuf.
2. If there are not enough free (hardware ring) descriptors, set
IFF_OACTIVE and keep the packet on the queue.
3. If there is some other resource starvation that makes
bus_dmamap_load_mbuf() or defragmentation fail, drop the packet.
Don't set IFF_OACTIVE, since the Tx ring could be empty and we'd be
stuck.
4. Only pass packets that are actually handed off to the hardware to
BPF. Do so before handing them off to the hardware to make sure
the packet isn't freed behind our back.
ok dlg@
|
|
|
|
|
|
| |
the TX ring and clear the flag when some have been freed.
ok dlg@ kettenis@
|
|
|
|
|
|
|
|
| |
- Count receive errors as input errors.
Based on similar change to the gem(4) driver from NetBSD.
ok kettenis@
|