Age | Commit message (Collapse) | Author |
|
this solves one probably with an re(4) going away.
|
|
Rename ifq_set_maxlen() to ifq_init_maxlen(). This function neither
uses WRITE_ONCE() nor a mutex and is called before the ifq mutex
is initialized. The new name expresses that it should be used only
during interface attach when there is no concurrency.
Protect ifq_len(), ifq_empty(), ifiq_len(), and ifiq_empty() with
READ_ONCE(). They can be used without lock as they only read a
single integer.
OK dlg@
|
|
|
|
setup
OK dlg@
|
|
unbreaks the build on bigendian archs.
found by deraadt@
|
|
some of them are 16 bit, so check frequently.
now i can see what packets my apu1 is dropping in hardware.
ok claudio@
|
|
Also, increment the error counter when an unexpected fragment is seen.
OK claudio@
|
|
ok jmc@ kevlo@
|
|
from Stephen Taylor who tested on a ThinkCenter M75n Nano IoT
with RTL8111FP-CG
|
|
OK dlg@, bluhm@
No Opinion mpi@
Not against it claudio@
|
|
OK deraadt@, mpi@
|
|
ok dlg@ tobhe@
|
|
this is a step toward deprecating softclock based livelock detection.
|
|
ok deraadt@
|
|
ok deraadt@
|
|
They cannot be serialized with the interrupt routine and are
useless because the driver is reinitialized right after.
Pointed by and ok mikeb@
|
|
an ifq to transmit a packet is picked by the current traffic
conditioner (ie, priq or hfsc) by providing an index into an array
of ifqs. by default interfaces get a single ifq but can ask for
more using if_attach_queues().
the vast majority of our drivers still think there's a 1:1 mapping
between interfaces and transmit queues, so their if_start routines
take an ifnet pointer instead of a pointer to the ifqueue struct.
instead of changing all the drivers in the tree, drivers can opt
into using an if_qstart routine and setting the IFXF_MPSAFE flag.
the stack provides a compatability wrapper from the new if_qstart
handler to the previous if_start handlers if IFXF_MPSAFE isnt set.
enabling hfsc on an interface configures it to transmit everything
through the first ifq. any other ifqs are left configured as priq,
but unused, when hfsc is enabled.
getting this in now so everyone can kick the tyres.
ok mpi@ visa@ (who provided some tweaks for cnmac).
|
|
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@
|
|
currently re appears to end up spinning on landisk. the most obvious
cause of this would be an inability to add entries on the rx ring
when we run out of mbufs. cope with this by calling rxeof from the
isr when the FIFO_OVERFLOW status bit is set. rxeof in turn
unconditionally tries to fill the rx ring, even if it doesnt dequeue
any packets off the ring.
while here limit the number of entries that can go on the rx ring
to 1 less than the size of the ring. a full ring looks the same as
an empty ring (cos the producer and consumer are the same in both
cases), so avoid letting this happen.
ok deraadt@ who hit problems on his landisk and tested this diff
|
|
the important change is to no longer account for packets and
descriptors separately, instead we just deal with available descriptors
on the ring.
this allows us to guarantee that oactive will only be set after
re_start has queued at least one packet, which in turn guarantees
that the chip will interrupt in the future and run re_txeof to clear
oactive.
without this change it was possible for a call of re_start to almost
fill the descriptor ring, followed by a second call that could fail
to post a packet because it had run out of descriptors and would
then set oactive. if re_txeof ran concurrently it could complete
all the previously posted packets without noticing that oactive had
been set and therefore needed to be cleared. in that situation
oactive would be set, but nothing would be set up to clear it
in the immediate future.
this fixes a lockup reported by haesbaert.
|
|
previously there was a limit of 64 packets on the tx ring. soon we
will use as many descriptors as we want to fill the ring.
|
|
|
|
previously you could have 64 packets on a ring with up to 1024
descriptors. this mismatch makes the accounting for free space
complicated and allows for a data race with OACTIVE being set.
it will also let us push more packets.
|
|
without this it is possible for re_txeof to let the chip look at
and complete tx descriptors that re_start has written to the ring
but not accounted for in the software producer index. in this
situation no future interrupts may be generated for packets on the
ring, and tx will stall.
the serialisation is implemented by only doing the writes from tasks
via ifq_serialize.
this is part of a bigger diff that fixes lockups reported by haesbaert.
|
|
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.
|
|
Normally this would be setup in the vendor-programmed eeprom, but in this case
it hasn't been done and the rather unfortunate default results in *only* a
normally-off light for network activity, nothing for ethernet link, so it's
too easy to mistake the machine for being powered down. hw.vendor/hw.machine
idea from naddy@, testing jasper@, ok deraadt@
|
|
|
|
all the local ones to ``nticks''.
ok stefan@, deraadt@
|
|
if there's lingering bugs we'll deal with them in tree.
ok jmatthew@
|
|
positions when deciding how much work to do, and to adjust rl_tx_free with
atomic operations; split the flag that indicates whether we're using
timer based interrupts or not out into a separate field so it can be
changed from interrupt context without needing a lock; take the kernel
lock when calling re_init and re_start from interrupt context; add an
interrupt barrier in re_stop; and finally mark the interrupt handler
as mpsafe.
started by Jim Smith a while ago, mostly finished up at n2k15
tested by dlg@, chris@ and Dimitris Papastamos on various hardware
ok 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@
|
|
|
|
You never need <netinet/ip_var.h> nor <netinet/in_systm.h>.
|
|
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@
|
|
Because of the VLAN hacks in mpw(4) this file still contains the definition
of "struct ifvlan" which depends on <sys/refcnt.h> which in turns pull
<sys/atomic.h>...
|
|
diff expands them so devices that need more packets per interrupt can
use them.
this is all from brad@
tested by jim smith and benjamin perrault on APUs
tested by me on 8139s (which dont support bit rings) on landisk, and
8169s
|
|
|
|
tedu tested an almost identical diff from brad that set the same flags.
|
|
Note that pseudo-drivers not using if_input() are not affected by this
conversion.
ok mikeb@, kettenis@, claudio@, dlg@
|
|
don't setup DMA correctly until more configuration has been done -
enabling RX too soon causes DMA to bad places. KVM corruption problems
reported by Adam Wolk on Lenovo G50-70 (RTL8111GU).
Diff derived by Brad from FreeBSD commit; see bz# 197535 and 193743, inspired by
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d6e572911a4cb2b9fcd1c26a38d5317a3971f2fd
Tested on the following by Brad, Adam Wolk, box963 at gmail, Jim Smith
re0 at pci4 dev 0 function 0 "Realtek 8168" rev 0x03: RTL8168D/8111D (0x2800), apic 2 int 16, address 00:0a:cd:1a:86:04
re0 at pci2 dev 0 function 0 "Realtek 8168" rev 0x0c: RTL8168G/8111G (0x4c00), msi, address 80:ee:73:76:8e:8a
re0 at pci0 dev 3 function 0 "Realtek 8169" rev 0x10: RTL8110S (0x0400), ivec 0x78c, address 00:22:3f:ee:fa:25
re0 at pci1 dev 0 function 0 "Realtek 8168" rev 0x06: RTL8168E/8111E (0x2c00), msi, address 00:0d:b9:31:2e:88
re0 at pci1 dev 0 function 0 "Realtek 8168" rev 0x10: RTL8168GU/8111GU (0x5080), msi, address 68:f7:28:18:35:8e
ok mpi@ dlg@
|
|
this uses hints from the freebsd driver, but the implementation
differs.
freebsd manages two lists of rx descriptors. one for "normal" packets
and the other for jumbos. this continues to use a single list and
uses a per softc variable and MCLGETI to always allocate what the
chip is capable and uses it unconditionally.
other than that, we just need to enable some bits in some registers
to be able to do jumbos.
this relies on the previous commit to properly deal with checksum
offload for packets of different sizes.
from jim smith
ok sthen@
|
|
packets.
rather than disable cksum offload for all packets, this sets things
up so we still advertise offload to the stack, but if the driver
gets a large packet it does the checksum itself in software.
small (normal sized) packets still get offloaded like now. if you're
doing a jumbo you'll be doing the cksum in software, but will
hopefully win overall cos you'll be doing a 6th of the work cos
you're doing more data in every packet.
diff from jim smith
ok sthen@
|
|
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@
|
|
|
|
|
|
to pad short frames.
|
|
From FreeBSD
|
|
support this interrupt. Link state changes are noticed via the PHY
status change callback or via the timeout for re_tick().
From FreeBSD
|
|
|
|
From Fabian Raetz <fabian dot raetz at gmail dot com>
|