summaryrefslogtreecommitdiffstats
path: root/sys/contrib/altq
Commit message (Collapse)AuthorAgeFilesLines
* Bulk sync of pf changes from head, in attempt to fixup broken build Iglebius2014-03-128-6/+25
| | | | | | | | | made in r263029. Merge r257186,257215,257349,259736,261797. These changesets split pfvar.h into several smaller headers and make userland utilities to include only some of them.
* Simplify TAILQ usage and avoid additional memory allocations.glebius2013-03-052-87/+30
| | | | | Tested by: Eugene M. Zheganin <emz norma.perm.ru> Sponsored by: Nginx, Inc
* Fix panic introduced by me in r240835, when zero weightglebius2012-09-251-4/+5
| | | | | | was passed to wtab_alloc(). Reported by: Kim Culhan <w8hdkim gmail.com>
* Use M_NOWAIT in wtab_alloc(), too. Convert panic() toglebius2012-09-221-6/+9
| | | | | | | a soft failure here. wtab_alloc() is used by red_alloc(), which can fail. Reported by: Kim Culhan <w8hdkim gmail.com>
* Convert more M_WAITOK malloc() to M_NOWAIT.glebius2012-09-223-8/+8
| | | | Reported by: Kim Culhan <w8hdkim gmail.com>
* Remove #ident macro.rpaulo2012-09-211-3/+2
| | | | | | | | | | | | | | | -This line, and those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M altq/altq/altq_rmclass.c
* Do more than r236298 did in the projects/pf branch: use M_NOWAIT inglebius2012-09-183-19/+11
| | | | | | | | | | | | | altq_add() and its descendants. Currently altq(4) in FreeBSD is configured via pf(4) ioctls, which can't configure altq(4) w/o holding locks. Fortunately, altq(4) code in spife of using M_WAITOK is ready to receive NULL from malloc(9), so change is mostly mechanical. While here, utilize M_ZERO instead of bzero(). A large redesign needed to achieve M_WAITOK usage when configuring altq(4). Or an alternative (not pf(4)) configuration interface should be implemented. Reported by: pluknet
* Merge the projects/pf/head branch, that was worked on for last six months,glebius2012-09-084-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into head. The most significant achievements in the new code: o Fine grained locking, thus much better performance. o Fixes to many problems in pf, that were specific to FreeBSD port. New code doesn't have that many ifdefs and much less OpenBSDisms, thus is more attractive to our developers. Those interested in details, can browse through SVN log of the projects/pf/head branch. And for reference, here is exact list of revisions merged: r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330, r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656, r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782, r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868, r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223, r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456, r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505, r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168, r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230, r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398, r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548, r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672, r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169, r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442, r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522, r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661, r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212. I'd like to thank people who participated in early testing: Tested by: Florian Smeets <flo freebsd.org> Tested by: Chekaluk Vitaly <artemrts ukr.net> Tested by: Ben Wilber <ben desync.com> Tested by: Ian FREISLICH <ianf cloudseed.co.za>
* Update packet filter (pf) code to OpenBSD 4.5.bz2011-06-281-8/+3
| | | | | | | | You need to update userland (world and ports) tools to be in sync with the kernel. Submitted by: mlaier Submitted by: eri
* Use atomic load & store for TSC frequency. It may be overkill for amd64 butjkim2011-04-071-2/+3
| | | | | | | | | safer for i386 because it can be easily over 4 GHz now. More worse, it can be easily changed by user with 'machdep.tsc_freq' tunable (directly) or cpufreq(4) (indirectly). Note it is intentionally not used in performance critical paths to avoid performance regression (but we should, in theory). Alternatively, we may add "virtual TSC" with lower frequency if maximum frequency overflows 32 bits (and ignore possible incoherency as we do now).
* Deprecate tsc_present as the last of its real consumers finally disappeared.jkim2011-03-151-3/+5
|
* Add a tunable "machdep.disable_tsc" to turn off TSC. Specifically, it turnsjkim2011-03-111-2/+2
| | | | | off boot-time CPU frequency calibration, DELAY(9) with TSC, and using TSC as a CPU ticker. Note tsc_present does not change by this tunable.
* Deprecate rarely used tsc_is_broken. Instead, we zero out tsc_freq becausejkim2011-03-101-5/+6
| | | | it is almost always used with tsc_freq any way.
* Remove alpha reminiscence from altq.jkim2011-03-101-47/+2
|
* Consistently add TSC support for amd64.jkim2011-03-101-6/+7
|
* Remove support for FreeBSD 4.x and below.jkim2011-03-1010-57/+8
|
* Fix two memory leaks in error cases.brueffer2009-11-051-2/+7
| | | | | | | PR: 138378 Submitted by: Patroklos Argyroudis <argp@census-labs.com> Approved by: mlaier MFC after: 1 week
* Rework global locks for interface list and index management, correctingrwatson2009-08-231-4/+4
| | | | | | | | | | | | | | several critical bugs, including race conditions and lock order issues: Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an sxlock. Either can be held to stablize the lists and indexes, but both are required to write. This allows the list to be held stable in both network interrupt contexts and sleepable user threads across sleeping memory allocations or device driver interactions. As before, writes to the interface list must occur from sleepable contexts. Reviewed by: bz, julian MFC after: 3 days
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-011-3/+0
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorrwatson2009-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith)
* After cleaning up rt_tables from vnet.h and cleaning up opt_route.hbz2009-06-231-1/+0
| | | | | a lot of files no longer need route.h either. Garbage collect them. While here remove now unneeded vnet.h #includes as well.
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onbz2009-06-081-1/+0
| | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c.
* tbr_timeout() is a timer driven function[1]. While the previous commitbz2009-05-181-10/+21
| | | | | | | | | made LINT happy this does the proper looping over all vnets as we are only called `globally' and not once per vnet instance. Reported by: zec [1] Missed by: bz [1] in r192264 Reviewed by: zec
* Add a missing INIT_VNET_NET() to get VIMAGE closer to full LINT again.bz2009-05-171-0/+1
|
* For all files including net/vnet.h directly include opt_route.h andbz2009-02-271-0/+4
| | | | | | | | | | | | | | net/route.h. Remove the hidden include of opt_route.h and net/route.h from net/vnet.h. We need to make sure that both opt_route.h and net/route.h are included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily.
* Shuffle the vimage.h includes or add where missing.bz2009-02-271-1/+3
|
* Change the functions to ANSI in those cases where it breaks promotionrdivacky2009-02-241-4/+1
| | | | | | | | to int rule. See ISO C Standard: SS6.7.5.3:15. Approved by: kib (mentor) Reviewed by: warner Tested by: silence on -current
* Change __FreeBSD_version to prepare for merging r184102.jkim2009-01-211-1/+1
|
* Rather than using hidden includes (with cicular dependencies),bz2008-12-021-0/+1
| | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation
* Fix a number of style issues in the MALLOC / FREE commit. I've tried todes2008-10-231-14/+16
| | | | | be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-238-99/+93
| | | | MFC after: 3 months
* Turn off CPU frequency change notifiers when the TSC is P-state invariantjkim2008-10-211-0/+6
| | | | | or it is forced by setting 'kern.timecounter.invariant_tsc' tunable to non-zero.
* I think we can remove the conditionals for freebsd 2.0 nowjulian2008-08-251-2/+0
|
* Commit step 1 of the vimage project, (network stack)bz2008-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* Fix a bug where the callout might not be initialized before being used.njl2007-07-121-6/+18
| | | | | | | | | | | | | Rev 1.9 introduced another path where machclk_freq would be initialized before the rest of setup was done (i.e. initializing the callout). Make the one-time initialization a separate function and make init_machclk() able to be called multiple times, any time. We depend on tsc_freq first being updated from the highest priority eventhandler, thus we run last and call init_machclk() to set machclk_freq. Also, don't initialize static variables to 0. Tested by: Eygene Ryabinkin Approved by: re
* Link pf 4.1 to the build:mlaier2007-07-034-16/+12
| | | | | | | | - move ftp-proxy from libexec to usr.sbin - add tftp-proxy - new altq mtag link Approved by: re (kensmith)
* Add an interface for drivers to be notified of changes to CPU frequency.njl2007-03-261-0/+19
| | | | | | | | | | | | | | | | | | cpufreq_pre_change is called before the change, giving each driver a chance to revoke the change. cpufreq_post_change provides the results of the change (success or failure). cpufreq_levels_changed gives the unit number of the cpufreq device whose number of available levels has changed. Hook in all the drivers I could find that needed it. * TSC: update TSC frequency value. When the available levels change, take the highest possible level and notify the timecounter set_cputicker() of that freq. This gets rid of the "calcru: runtime went backwards" messages. * identcpu: updates the sysctl hw.clockrate value * Profiling: if profiling is active when the clock changes, let the user know the results may be inaccurate. Reviewed by: bde, phk MFC after: 1 month
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-066-6/+21
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Do not use the TSC where its known to be broken, this will cause the queuethompsa2006-03-021-1/+2
| | | | | | | | | speeds to perform below the desired bitrate and throughput will be erratic. This makes queueing work on the Geode SC1100, K5 model 0 and IDT WinChip C6 processors. MFC after: 3 days
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-1/+1
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* Do not fail to initialize callouts (on SMP only) -- it leads to crashing.green2005-02-221-3/+4
|
* Don't use the static CALLOUT_INITIALIZER for __FreeBSD_version >= 600000. Itmlaier2005-02-212-1/+9
| | | | | | | | | | | was a bad idea, but since it is done like this in the vendor source we keep it around for older versions. As a safe guard against future misuse we don't even define CALLOUT_INITIALIZER anymore. This fixes ALTQ after callout_init_mtx() and takes altq_var.h off the vendor branch. Submitted by: Divacky Roman <xdivac02NOstud.fit.vutbrSPAMcz> (w/ changes)
* Disable "bulk dequeue" when enabling ALTQ so it does not irritate themlaier2004-06-151-0/+1
| | | | timing.
* Transform tbr_dequeue into a function pointer in order to build drivers withmlaier2004-06-152-3/+7
| | | | | | ALTQ enabled versions of IFQ_* macros by default, as requested by serveral others. This is a follow-up to the quick fix I committed yesterday which turned off the ALTQ checks for non-ALTQ kernels.
* #if out an old leftover in the KAME code. opt_cpu.h is no longer useful heremlaier2004-06-131-0/+2
| | | | | | and breaks build on some arch. Found-by: tinderbox
* Add an additional queue which will be "owned by the driver". This allows tomlaier2004-06-121-0/+7
| | | | | | | | | | | | | | | | | | | | rig a PREPEND macro for ALTQ as the POLL/DEQUEUE semantic is very bad in terms of locking. We make this a full functional queue to allow "bulk dequeue" which will further reduce the locking overhead (for non-altq enabled devices). Drivers will access this via the following macros, which will show up in <net/if_var.h> once we expose ALTQ to the build: IFQ_DRV_DEQUEUE(ifq, m) - takes a mbuf off the queue (driver queue first) IFQ_DRV_PREPEND(ifq, m) - pushes a mbuf back to the driver queue IFQ_DRV_PURGE(ifq) - drops all packets in both queues IFQ_DRV_IS_EMPTY(ifq) - checks for pending mbufs in either queue One has to make sure that the first three are protected by a driver mutex. At the moment most network drivers still require Giant, so this is not an issue. Even those that have thier own mutex usually hold it in if_start and the like, so this requirement is almost always satisfied. This evolved from a discussion with Andrew Gallatin.
* FreeBSD-ify ALTQ:mlaier2004-06-129-21/+164
| | | | | | | | | | | | | | | | | | - add locking - disable ALTQ3_COMPAT by default (do not remove the code to keep the diff towards KAME small) - put some more code under ALTQ3 conditional compilation as it should be - account for if_xname - some more minor compile fixes As people started wondering: The strange path layout "altq/altq" is there to avoid "-Isys/contrib" and make it "-Isys/contrib/altq" instead, as we will need at least <altq/altq.h> and <altq/if_altq.h> for kernel compilation. The "freebsd4_..." in the privious commit is just the best tag name in the KAME tree I could find to classify this in order to track its history. It does *not* mean that this will go to 4-STABLE or anything of that kind.
* Import parts of the ALTQ framework from latest KAME snapshot (which is up tomlaier2004-06-1221-0/+14567
HEAD at this point). This will not exactly live in a vendor branch, but have the vendor backing to make it easier to exchange diffs. This will be followed by a diff which takes most of the .c files off the vendor branch in order to: - add locking - disable ALTQ3_COMPAT code (which is outdated and "un-lockable") There is work in progress to refine the configuration API. Import this "as is" now to have more exposure time before 5-STABLE. This is only the import, it will be some more days until you will actually be able to compile ALTQ support into your kernel so don't hold your breath. HEADUPs will be posted on current@ and net@ before this is actually enabled. No-objection: re(scottl), core(rwatson)
OpenPOWER on IntegriCloud