| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
HFSC on a vlan(4) (or similar) interface caused all packets over
that interface to get marked with the highest packet priority, no
matter what the rest of the system said about it. Leaving
the prio alone lets the rest of the network still do something
useful, not matter whether the local system queues packets in a
particular way.
Reported by and fix tested by Adrian Close
ok claudio@ kn@ mikeb@
|
|
|
|
| |
No objections from henning, OK visa
|
|
|
|
|
|
|
|
|
|
|
|
| |
When hfsc_deq_begin can't obtain an mbuf from the queue which can
happen with fq_codel, the hfsc_deq_commit isn't called and HFSC
doesn't get to update the active queue list of the parent class.
To successfully purge and destroy such class, we need to make
sure to run the service curve update routine even if we haven't
dequeued anything so that the parent class doesn't accumulate
stale child classes on its active list.
Reported by Atanas Vladimirov, OK visa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since NET_LOCK no longer protects the ioctl path from timeouts
running while ifq configuration is happening, the hfsc_deferred
timeout needs to make sure that the underlying HFSC object is
locked before attempting to reference it. This prevents the race
happening after we release the ifq mutex in ifq_attach but before
hfsc_free disables the timeout.
The second race is possible after hfsc_alloc but before the ifq
mutex gets locked in ifq_attach and a new set of ifq operations
is installed. If hfsc_deferred fires in between, it wouldn't be
able to reschedule itself and will no longer be executed. To
prevent this, the timeout can be established when packets are
enqueued instead of the moment the queue is created.
With input and OK visa
|
|
|
|
|
|
|
|
|
| |
Classes are considered "active" when they have packets assigned to them.
Active classes are tracked on various lists and during the purge operation
must be dissociated from them. During factoring out of the HFSC internal
FIFO operations, the check for whether the class is empty got lost.
Issue reported and fix tested by abieber@ and myself.
|
| |
|
|
|
|
|
|
|
| |
HFSC internal queue becomes accessible via pf queueing ops. It will
also select an alternative queue manager based on the queue spec.
Discussed with and OK henning@ at d2k17 as a part of a larger diff.
|
|
|
|
| |
Discussed with and OK henning@ at d2k17 as a part of a larger diff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hfsc schedules a timeout to keep traffic moving if somethings has been
delayed an no other tx activity has occurred. that timeout was calling
(*ifp->if_qstart)(ifq) rather than ifq_start. the latter prevents
concurrent calls to if_qstart.
without this change bjorn ketelaars on misc@ was experiencing weird
pauses in traffic and lockups because the tx ring was corrupted
because re_start was run concurrently, once from the stack and once
from hfsc.
thanks to bjorn ketelaars for debugging, and mikeb@ for most of the
legwork in diagnosing the problem.
ok mikeb@
|
|
|
|
| |
Found by and input from dlg@, OK sthen, tedu, henning
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By hiding H-FSC behind pfq_ops structure similar to the ifq_ops,
we provide a possibility to plug alternative queueing interfaces
for use in pf. This reduces amount of H-FSC specific code in the
pf ioctl handler
While here, change the the order of elements in hfsc_class_stats
to provide some compatibility between queue stat structures of
different traffic conditioners.
No objections from henning@, ok sthen@
|
|
|
|
|
|
|
|
|
| |
Since only leaf queues can have packets assigned to them,
H-FSC requires the user specified root queue to have a
parent. To simplify userland tools and the configuration
interface, the kernel can be leveraged to set it up.
ok henning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mikeb@ wants priq to be able to drop lower priority packets if the
current one is high. because ifq avoids freeing an mbuf while an
ifq mutex is held, he needs a way for a backend to return an arbitrary
mbuf to drop rather than signal that the current one needs to be
dropped.
this lets the backends return the mbuf to be dropped, which may or
may not be the current one.
to support this ifq_enqueue_try has to be dropped because it can
only signal about the current mbuf. nothing uses it (except
ifq_enqueue), so we can get rid of it. it wasnt even documented.
this diff includes some tweaks by mikeb@ around the statistics
gathered in ifq_enqueue when an mbuf is dropped.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
|
|
|
|
|
|
|
| |
hfsc needed a rollback ifqop to requeue the mbuf because it used
ml_dequeue in the begin op. now it uses MBUF_LIST_FIRST to get a
ref to the first mbuf in deq_begin.
now the disciplines dont need a rollback op, so ifq_deq_rollback
can be simplified to just releasing the mutex.
based on a discussion with kenjiro cho
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
make cl_actc in hfsc_class a TAILQ rather than a pointer to a TAILQ
that gets allocated seaprately.
|
|
|
|
|
|
|
| |
make hif_eligible in hfsc_if a TAILQ rather than a pointer to a
TAILQ that gets allocated separately.
"look ma, i saved 4 or 8 bytes"
|
|
|
|
|
| |
the ifqueue struct has the same information, and hif_packets is never
read separately. trim it.
|
|
|
|
|
|
|
|
|
| |
you get to hfsc_class via a hfsc_if, so just pass the hfsc_if around
on the stack when we need it rather than following the pointer back.
most of this change is passing the hif on the stack.
ok mpi@ henning@
|
|
|
|
|
|
|
|
| |
this avoids confusion with the public functions (hfsc_enqueue,
hfsc_dequeue, etc), and maps almost 1:1 to the mbuf list ops they
now use.
ok mpi@ henning@ mikeb@
|
|
|
|
|
|
|
|
|
|
| |
this will allow packets to taken off an interfaces send queue, and
requeued if space didnt exist on the hardware.
the internal names are a bit ugly, i want to change them in the
next commit.
ok henning@ mpi@
|
|
|
|
|
|
| |
the mbuf in both the hfsc and priq error paths.
ok mikeb@ mpi@ claudio@ henning@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mbuf_list.
hfsc lists are very clever because they manage a fifo with a single
pointer by abusing the m_next pointer of the tail mbuf to point to
the head. clever but hard to read.
mbuf_lists are slightly bigger because they explicitely track the
head mbuf, but i got us that space back by inlining hfsc_classq
into hfsc_class and removing the unnecessary classq field.
ok henning@
|
|
|
|
|
|
|
|
| |
its value to userland which will always be 0.
drop the member. lie to userland.
ok henning@
|
|
|
|
|
|
|
|
|
| |
instances, so maintaining separate pools for them and pointing
between them is overhead.
this drops the hfsc_classq pool and inlines it into hfsc_class.
ok henning@
|
|
|
|
|
|
| |
and into the .c file.
ok henning@
|
|
|
|
|
|
| |
there instead of pf_ioctl.c.
ok henning@
|
|
|
|
|
|
| |
hfsc_qstats cope with a NULL ifp. Can happen when refering to nonexistant
interfaces from pf.conf. Problem noticed and fix tested by Kevin Chadwick
<ma1l1ists at yahoo.co.uk>, ok phessler benno
|
|
|
|
|
|
| |
if we ever do sth like RED again it almost certainly won't be RED; the code
isn't even in a state to be useful as documentation/hint, and even if it
was it could be retrieved from the attic.
|
|
|
|
|
| |
especially given that these are the only users of these macros.
ok claudio
|
|
|
|
| |
ok deraadt@ tedu@
|
|
|
|
| |
ok mikeb@, krw@, bluhm@, tedu@
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
| |
This fixes the "integer divide fault trap" bug caused by the second malloc
skipping a beat and leaving the amount of allocated queues equal to zero.
tested by me, ok henning mikeb
|
| |
|
|
|
|
|
|
| |
The limit is because in places, queue IDs are being stored as u_int16_t's.
tested by me, discussed at length with (and ok) claudio henning
|
|
|
|
| |
ok millert
|
|
|
|
| |
ok henning, "looks fine" mikeb, input from guenther.
|
|
|
|
| |
ok henning
|
|
|
|
|
|
|
| |
This is a modified version of oldtbr_timeout() with a timeout for each
HFSC enabled interface. We can now safely include <sys/timeout.h> in
net/hfsc.h without breaking the build.
tested by naddy, ok henning claudio deraadt
|
| |
|
|
|
|
|
|
| |
This is a modified version of oldtbr_timeout() with a timeout for each
HFSC enabled interface.
ok henning claudio
|
|
the new bandwidth shaping subsystem. looked over & tested by many,
ok phessler sthen
|