aboutsummaryrefslogtreecommitdiff
path: root/sys/net/altq
Commit message (Collapse)AuthorAgeFilesLines
* altq: mark callouts as mpsafeKristof Provost2021-09-042-11/+2
| | | | | | | | | | | | There's no reason to acquire the Giant lock while executing the ALTQ callouts. While here also remove a few backwards compatibility defines for long obsolete FreeBSD versions. Reviewed by: mav Suggested by: mav Differential Revision: https://reviews.freebsd.org/D31835
* altq: Fix panics on rmc_restart()Kristof Provost2021-08-231-0/+5
| | | | | | | | | | | | rmc_restart() is called from a timer, but can trigger traffic. This means the curvnet context will not be set. Use the vnet associated with the interface we're currently processing to set it. We also have to enter net_epoch here, for the same reason. Reviewed by: mjg MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31642
* altq: Increase maximum number of CBQ and HFSC classesKristof Provost2021-03-042-2/+2
| | | | | | | | | | | | | | | In some configurations we need more classes than ALTQ supports by default. Increase the maximum number of classes we allow. This will only cost us a comparatively trivial amount of memory, so there's little reason not to do so. If ever we find we want even more we may want to consider turning these defines into a tunable, but for now do the easy thing. Reviewed by: donner@ MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29034
* net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macrosKristof Provost2021-03-041-1/+1
| | | | | | | | | | | | Introduce convenience macros to retrieve the DSCP, ECN or traffic class bits from an IPv6 header. Use them where appropriate. Reviewed by: ae (previous version), rscheff, tuexen, rgrimes MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29056
* altq: Fix typo in features sysctl descriptionKristof Provost2021-01-271-1/+1
| | | | Reported by: Jose Luis Duran
* altq: Remove unused arguments from altq_attach()Kristof Provost2021-01-257-24/+9
| | | | | | | Minor cleanup, no functional change. Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28304
* Add FEATURE sysctls for ALTQ disciplinesKristof Provost2021-01-251-0/+32
| | | | | | | | This will allow userspace to more easily figure out if ALTQ is built into the kernel and what disciplines are supported. Reviewed by: donner@ Differential Revision: https://reviews.freebsd.org/D28302
* net: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0116-50/+5
| | | | Notes: svn path=/head/; revision=365071
* Use a void * argument to callout handlers instead of timeout_t casts.John Baldwin2019-12-051-4/+4
| | | | | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22684 Notes: svn path=/head/; revision=355426
* Reduce the time it takes the kernel to install a new PF config containing a ↵Patrick Kelsey2019-02-118-34/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | large number of queues In general, the time savings come from separating the active and inactive queues lists into separate interface and non-interface queue lists, and changing the rule and queue tag management from list-based to hash-bashed. In HFSC, a linear scan of the class table during each queue destroy was also eliminated. There are now two new tunables to control the hash size used for each tag set (default for each is 128): net.pf.queue_tag_hashsize net.pf.rule_tag_hashsize Reviewed by: kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D19131 Notes: svn path=/head/; revision=343995
* Mechanical cleanup of epoch(9) usage in network stack.Gleb Smirnoff2019-01-091-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | - Remove macros that covertly create epoch_tracker on thread stack. Such macros a quite unsafe, e.g. will produce a buggy code if same macro is used in embedded scopes. Explicitly declare epoch_tracker always. - Unmask interface list IFNET_RLOCK_NOSLEEP(), interface address list IF_ADDR_RLOCK() and interface AF specific data IF_AFDATA_RLOCK() read locking macros to what they actually are - the net_epoch. Keeping them as is is very misleading. They all are named FOO_RLOCK(), while they no longer have lock semantics. Now they allow recursion and what's more important they now no longer guarantee protection against their companion WLOCK macros. Note: INP_HASH_RLOCK() has same problems, but not touched by this commit. This is non functional mechanical change. The only functionally changed functions are ni6_addrs() and ni6_store_addrs(), where we no longer enter epoch recursively. Discussed with: jtl, gallatin Notes: svn path=/head/; revision=342872
* altq: manual cleanup after r341507Eric van Gyzen2018-12-044-60/+3
| | | | | | | | | | Remove a file that became practically empty. Fix indentation. Like r341507, I do not plan to MFC, but anyone else can. Notes: svn path=/head/; revision=341508
* altq: remove ALTQ3_COMPAT codeEric van Gyzen2018-12-0414-4686/+0
| | | | | | | | | | | | | | | | | | | This code has apparently never compiled on FreeBSD since its introduction in 2004 (r130365). It has certainly not compiled since 2006, when r164033 added #elsif [sic] preprocessor directives. The code was left in the tree to reduce the diff from upstream (KAME). Since that upstream is no longer relevant, remove the long-dead code. This commit is the direct result of: unifdef -m -UALTQ3_COMPAT sys/net/altq/* A later commit will do some manual cleanup. I do not plan to MFC this. If that would help you, go for it. Notes: svn path=/head/; revision=341507
* Fix flags collision causing inability to enable CBQ in ALTQMike Karels2018-11-162-3/+12
| | | | | | | | | | | | | | | | | | | | | | The CBQ BORROW flag conflicts with the RMCF_CODEL flag; the two sets of definitions actually define the same things. The symptom is that a kernel with CBQ support and not CODEL fails to load a QoS policy with the obscure error "pfctl: DIOCADDALTQ: Cannot allocate memory." If ALTQ_DEBUG is enabled, the error becomes a little clearer: "rmc_newclass: CODEL not configured for CBQ!" is printed by the kernel. There really shouldn't be two sets of macros that have to be defined consistently, but the include structure isn't right for exporting CBQ flags to altq_rmclass.h. Re-align the definitions, and add CTASSERTs in the kernel to ensure that the definitions are consistent. PR: 215716 Reviewed by: pkelsey MFC after: 2 weeks Sponsored by: Forcepoint LLC Differential Revision: https://reviews.freebsd.org/D17758 Notes: svn path=/head/; revision=340474
* Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths ofPatrick Kelsey2018-08-2213-87/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2^32 bps or greater to be used. Prior to this, bandwidth parameters would simply wrap at the 2^32 boundary. The computations in the HFSC scheduler and token bucket regulator have been modified to operate correctly up to at least 100 Gbps. No other algorithms have been examined or modified for correct operation above 2^32 bps (some may have existing computation resolution or overflow issues at rates below that threshold). pfctl(8) will now limit non-HFSC bandwidth parameters to 2^32 - 1 before passing them to the kernel. The extensions to the pf(4) ioctl interface have been made in a backwards-compatible way by versioning affected data structures, supporting all versions in the kernel, and implementing macros that will cause existing code that consumes that interface to use version 0 without source modifications. If version 0 consumers of the interface are used against a new kernel that has had bandwidth parameters of 2^32 or greater configured by updated tools, such bandwidth parameters will be reported as 2^32 - 1 bps by those old consumers. All in-tree consumers of the pf(4) interface have been updated. To update out-of-tree consumers to the latest version of the interface, define PFIOC_USE_LATEST ahead of any includes and use the code of pfctl(8) as a guide for the ioctls of interest. PR: 211730 Reviewed by: jmallett, kp, loos MFC after: 2 weeks Relnotes: yes Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D16782 Notes: svn path=/head/; revision=338209
* ALTQ support for iflib.Patrick Kelsey2018-07-251-0/+4
| | | | | | | | Reviewed by: jmallett, mmacy Differential Revision: https://reviews.freebsd.org/D16433 Notes: svn path=/head/; revision=336727
* UDP: further performance improvements on txMatt Macy2018-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cumulative throughput while running 64 netperf -H $DUT -t UDP_STREAM -- -m 1 on a 2x8x2 SKL went from 1.1Mpps to 2.5Mpps Single stream throughput increases from 910kpps to 1.18Mpps Baseline: https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg - Protect read access to global ifnet list with epoch https://people.freebsd.org/~mmacy/2018.05.11/udpsender3.svg - Protect short lived ifaddr references with epoch https://people.freebsd.org/~mmacy/2018.05.11/udpsender4.svg - Convert if_afdata read lock path to epoch https://people.freebsd.org/~mmacy/2018.05.11/udpsender5.svg A fix for the inpcbhash contention is pending sufficient time on a canary at LLNW. Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15409 Notes: svn path=/head/; revision=334118
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* Remove register keyword from sys/ and ANSIfy prototypesEd Maste2017-05-172-3/+3
| | | | | | | | | | | | | | | A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today. ANSIfy related prototypes while here. Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10193 Notes: svn path=/head/; revision=318389
* Remove an alias if_list, use if_link consistently.Kevin Lo2016-10-061-1/+1
| | | | | | | | Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D8075 Notes: svn path=/head/; revision=306745
* Hide the boottime and bootimebin globals, provide the getboottime(9)Konstantin Belousov2016-07-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | and getboottimebin(9) KPI. Change consumers of boottime to use the KPI. The variables were renamed to avoid shadowing issues with local variables of the same name. Issue is that boottime* should be adjusted from tc_windup(), which requires them to be members of the timehands structure. As a preparation, this commit only introduces the interface. Some uses of boottime were found doubtful, e.g. NLM uses boottime to identify the system boot instance. Arguably the identity should not change on the leap second adjustment, but the commit is about the timekeeping code and the consumers were kept bug-to-bug compatible. Tested by: pho (as part of the bigger patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Notes: svn path=/head/; revision=303382
* Don't repeat the the word 'the'Eitan Adler2016-05-171-1/+1
| | | | | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix) Notes: svn path=/head/; revision=300050
* sys/net*: minor spelling fixes.Pedro F. Giffuni2016-05-034-5/+5
| | | | | | | No functional change. Notes: svn path=/head/; revision=298995
* Fix the spelling of eri's name.Luiz Otavio O Souza2015-08-242-2/+2
| | | | | | | | Pointy hat to: loos MFC with: r287009 Notes: svn path=/head/; revision=287120
* Add ALTQ(9) support for the CoDel algorithm.Luiz Otavio O Souza2015-08-2116-11/+825
| | | | | | | | | | | | | | | | CoDel is a parameterless queue discipline that handles variable bandwidth and RTT. It can be used as the single queue discipline on an interface or as a sub discipline of existing queue disciplines such as PRIQ, CBQ, HFSC, FAIRQ. Differential Revision: https://reviews.freebsd.org/D3272 Reviewd by: rpaulo, gnn (previous version) Obtained from: pfSense Sponsored by: Rubicon Communications (Netgate) Notes: svn path=/head/; revision=287009
* Another attempt to make this compile on more architectures after r284777.Bjoern A. Zeeb2015-06-251-2/+2
| | | | Notes: svn path=/head/; revision=284863
* Correct r284777 to use proper includes and remove dead code to unbreak ↵Ermal Luçi2015-06-251-19/+4
| | | | | | | | | kernel builds. Differential Revision: https://reviews.freebsd.org/D2847 Notes: svn path=/head/; revision=284814
* ALTQ FAIRQ discipline import from DragonFLYErmal Luçi2015-06-245-1/+1065
| | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2847 Reviewed by: glebius, wblock(manpage) Approved by: gnn(mentor) Obtained from: pfSense Sponsored by: Netgate Notes: svn path=/head/; revision=284777
* - Format copyright notices, VCS ids.Gleb Smirnoff2015-04-1714-267/+53
| | | | | | | - Run through unifdef(1). Notes: svn path=/head/; revision=281642
* Move ALTQ from contrib to net/altq. The ALTQ code is for many yearsGleb Smirnoff2015-04-1621-0/+14654
discontinued by its initial authors. In FreeBSD the code was already slightly edited during the pf(4) SMP project. It is about to be edited more in the projects/ifnet. Moving out of contrib also allows to remove several hacks to the make glue. Reviewed by: net@ Notes: svn path=/head/; revision=281613