Age | Commit message (Collapse) | Author |
|
The thread detaching an interface will sleep until all references to this
interface have been released. So we decided to only keep references for
a short period of time.
Keeping if_ref() private will hopefully help preserve this goal as long
as it makes sense.
Calling if_get()/if_put() in the same function also allows us to make
use of static analysis tools (thanks jsg@!) to catch our errors.
ok dlg@
|
|
destroyed during our sleep.
No objection from the slackers.
|
|
support for sppp with framing, simplifying things. Remove unused ifdefs while
there.
"sppp will go away before it gets used for something else" dlg@
|
|
once you enqueue an mbuf, you no longer own it. therefore you cant
read the length out of it. this reads the length first, then tries
to enq it.
also, call if_start instead of a bare call to the underlying start
routine.
ok mpi@ sthen@
|
|
fixing it now before i regret it more.
|
|
While here keep carp(4) bits under NCARP.
Tested by and ok sthen@, ok visa@
|
|
|
|
ok dlg@
|
|
only a driver sets or clears OACTIVE. clearing it without setting it is
a waste of time.
|
|
only a driver sets or clears it, and trunk never sets it. therefore it
never needs to clear it.
|
|
only a driver sets or clears this flag. pppx never sets it, so it
will never be set when it checks it.
|
|
only a driver sets or clears this flag. gif never sets it, so it
wont be set when it checks it.
|
|
found by and ok jsg@
|
|
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 only happens under KERNEL_LOCK() so we know for sure that the
interface attached to a route entry is valid.
|
|
attached to a carp(4) or bridge(4) member, to not dereference rt_ifp
directly.
ok visa@
|
|
fixed.
ok sthen@, dlg@
|
|
Fix a regression introduced by rtalloc(9) rewrite where only the
first route of a multipath chain had a valid next hop and could
be used.
ok sthen@, dlg@
|
|
When multiple gateways are in use, the next-hop entrie might not be
on the same interface. This is due to the fact that ARP entries are
unique and attached to their cloning interface.
Found the hard way by and ok dlg@
|
|
ok deraadt mpi phessler kettenis guenther
|
|
|
|
its descriptor. Get rid of a if_ref().
ok dlg@
|
|
With this change we no longer waste some precious Kb for unused
routing tables like the AF_MPLS one or those with rtableid != 0.
This will also simplify the SRP dance during lookups.
|
|
ok dlg@
|
|
as rt_ifa->ifa_ifp.
|
|
descriptor.
Allow to get rid of two if_ref() in the output paths.
ok dlg@
|
|
|
|
this avoids wall clock jumps skewing the idle times.
|
|
pool(9) to not waste most of the memory allocated.
This reduces the memory overhead of our ART routing table from 80M
to 70M compared to the existing radix-tree when loading ~550K IPv4
routes.
ART can now be used for huge tables without exhausting malloc(9)'s
limit.
claudio@ agrees with the direction, inputs from and ok dlg@
|
|
ok mpi@ uebayasi@
|
|
IF_DROP increments the drop counter on the send queue, it exists
to indicate a drop on the send queue. if there was an error sending
a packet be content incrementing if_oerrors.
ok mpi@ uebayasi@
|
|
bug found and fixed by Joonas Ruohonen, thanks
ok claudio@ phessler@
|
|
exhaustion.
Reported by benno@ and found thanks to his bgpd(8) test setup.
|
|
hop route as invalid.
Previously when such entrie was returned by rtalloc(9) a second route
lookup was done in rt_checkgate() very late in the journey of a packet.
In other words a single rtalloc(9) call can now result in multiple
route lookups if a RTF_GATEWAY entry is returned.
This is a step towards always calling L2 output functions with valid
destination information.
Tested by various including jmc@, naddy@, Hrvoje Popovski
|
|
|
|
disciplines
while i was simply concerned with the safety of the mbuf, requeue
is weird when it comes to how statistics are supposed to be handled
and ultimately isnt worth it.
this removes hfsc_requeue.
|
|
This allows more flexible configurations with vlan(4) and bridge(4) on
top of the same physical interface. In particular it allows to not feed
VLAN tagget packets into a bridge(4).
Fix regression reported by Armin Wolfermann on bugs@, ok dlg@
|
|
if_enqueue(). As pointed by dlg@, IF_QFULL on works in the priq
case.
Prompted by a diff from uebayasi@ to export ifi_oqdrops, ok dlg@
|
|
In such kernels multipath routing support is independant from the data
structure used to perform the binary lookup. Is is implemented as a
singly-listed list of route entries. This is possible because a "struct
rtentry" is no longer mapped 1:1 to a node in the tree.
|
|
implementation for ART based on the singly-linked list of route
entries.
|
|
|
|
does not find a matching node.
This currently never happens because we always do a route lookup before
calling rtable_delete(). Yes this is odd & due to the way multipath is
implemented in the radix tree.
|
|
ok claudio@
|
|
ok rzalamena@
|
|
i forgot to commit the change of the npqueue type in the header.
noticed by benoit lecocq
|
|
|
|
ok many
no objections from anyone
|
|
|
|
|
|
Needed by the regression tests.
|