summaryrefslogtreecommitdiffstats
path: root/sys/net/hfsc.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Provide pluggable queueing interface for pfmikeb2017-05-021-15/+9
| | | | | | | | | | | | | 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@
* Perform H-FSC root queue allocation in the kernelmikeb2017-04-261-2/+2
| | | | | | | | | 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
* shuffle struct ifqueue so in flight mbufs are protected by a mutex.dlg2015-11-201-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* kenjiro cho points out that requeue is hard to support on queuedlg2015-11-091-2/+1
| | | | | | | | | | 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.
* provide a hfsc_requeue()dlg2015-09-301-1/+2
| | | | | | | | | | 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@
* pull structs and macros that are only used in hfsc.c out of the headerdlg2015-04-121-148/+5
| | | | | | and into the .c file. ok henning@
* the hfsc pools are only used in hfsc.c, so move the init of themdlg2015-04-111-1/+2
| | | | | | there instead of pf_ioctl.c. ok henning@
* disgusting altq compat hack goes awayhenning2014-04-191-7/+1
|
* Make the amount of classes limited by 64k, with automatic table growing.pelikan2014-01-271-3/+5
| | | | | | 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
* push the queues every 1/HZ using timeout(9)pelikan2013-11-011-1/+4
| | | | | | | 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
* revert previous, net/if.h exports bad things to userspace.pelikan2013-10-311-4/+1
|
* push the queues every 1/HZ using timeout(9)pelikan2013-10-311-1/+4
| | | | | | This is a modified version of oldtbr_timeout() with a timeout for each HFSC enabled interface. ok henning claudio
* standalone hfsc implementation with new interface to the consumers, forhenning2013-10-121-0/+273
the new bandwidth shaping subsystem. looked over & tested by many, ok phessler sthen