#
c981cbbd |
| 15-Feb-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r343956 through r344177.
|
#
d178fee6 |
| 11-Feb-2019 |
Patrick Kelsey <pkelsey@FreeBSD.org> |
Place pf_altq_get_nth_active() under the ALTQ ifdef
MFC after: 1 week
|
#
8f2ac656 |
| 11-Feb-2019 |
Patrick Kelsey <pkelsey@FreeBSD.org> |
Reduce the time it takes the kernel to install a new PF config containing a large number of queues
In general, the time savings come from separating the active and inactive queues lists into separat
Reduce the time it takes the kernel to install a new PF config containing a 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
show more ...
|
#
c2c227a5 |
| 03-Feb-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r343571 through r343711.
|
#
d38ca329 |
| 02-Feb-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Return PFIL_CONSUMED if packet was consumed. While here gather all the identical endings of pf_check_*() into single function.
PR: 235411
|
#
b252313f |
| 01-Feb-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
New pfil(9) KPI together with newborn pfil API and control utility.
The KPI have been reviewed and cleansed of features that were planned back 20 years ago and never implemented. The pfil(9) intern
New pfil(9) KPI together with newborn pfil API and control utility.
The KPI have been reviewed and cleansed of features that were planned back 20 years ago and never implemented. The pfil(9) internals have been made opaque to protocols with only returned types and function declarations exposed. The KPI is made more strict, but at the same time more extensible, as kernel uses same command structures that userland ioctl uses.
In nutshell [KA]PI is about declaring filtering points, declaring filters and linking and unlinking them together.
New [KA]PI makes it possible to reconfigure pfil(9) configuration: change order of hooks, rehook filter from one filtering point to a different one, disconnect a hook on output leaving it on input only, prepend/append a filter to existing list of filters.
Now it possible for a single packet filter to provide multiple rulesets that may be linked to different points. Think of per-interface ACLs in Cisco or Juniper. None of existing packet filters yet support that, however limited usage is already possible, e.g. default ruleset can be moved to single interface, as soon as interface would pride their filtering points.
Another future feature is possiblity to create pfil heads, that provide not an mbuf pointer but just a memory pointer with length. That would allow filtering at very early stages of a packet lifecycle, e.g. when packet has just been received by a NIC and no mbuf was yet allocated.
Differential Revision: https://reviews.freebsd.org/D18951
show more ...
|
#
7e565c55 |
| 30-Jan-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r343320 through r343570.
|
#
59099cd3 |
| 28-Jan-2019 |
Patrick Kelsey <pkelsey@FreeBSD.org> |
Don't re-evaluate ALTQ kernel configuration due to events on non-ALTQ interfaces
Re-evaluating the ALTQ kernel configuration can be expensive, particularly when there are a large number (hundreds or
Don't re-evaluate ALTQ kernel configuration due to events on non-ALTQ interfaces
Re-evaluating the ALTQ kernel configuration can be expensive, particularly when there are a large number (hundreds or thousands) of queues, and is wholly unnecessary in response to events on interfaces that do not support ALTQ as such interfaces cannot be part of an ALTQ configuration.
Reviewed by: kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18918
show more ...
|
#
d9d146e6 |
| 25-Jan-2019 |
Kristof Provost <kp@FreeBSD.org> |
pf: Fix use-after-free of counters
When cleaning up a vnet we free the counters in V_pf_default_rule and V_pf_status from shutdown_pf(), but we can still use them later, for example through pf_purge
pf: Fix use-after-free of counters
When cleaning up a vnet we free the counters in V_pf_default_rule and V_pf_status from shutdown_pf(), but we can still use them later, for example through pf_purge_expired_src_nodes().
Free them as the very last operation, as they rely on nothing else themselves.
PR: 235097 MFC after: 1 week
show more ...
|
#
88148a07 |
| 22-Jan-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r343202 through r343319.
|
#
180b0dcb |
| 22-Jan-2019 |
Kristof Provost <kp@FreeBSD.org> |
pf: Validate psn_len in DIOCGETSRCNODES
psn_len is controlled by user space, but we allocated memory based on it. Check how much memory we might need at most (i.e. how many source nodes we have) and
pf: Validate psn_len in DIOCGETSRCNODES
psn_len is controlled by user space, but we allocated memory based on it. Check how much memory we might need at most (i.e. how many source nodes we have) and limit the allocation to that.
Reported by: markj MFC after: 1 week
show more ...
|
Revision tags: release/12.0.0 |
|
#
2a22df74 |
| 04-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339813 through r340125.
|
#
fbbf436d |
| 02-Nov-2018 |
Kristof Provost <kp@FreeBSD.org> |
pfsync: Handle syncdev going away
If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device.
Pass the ifnet detach event through pf to pfsync, and
pfsync: Handle syncdev going away
If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device.
Pass the ifnet detach event through pf to pfsync, and remove our multicast handle, and mark us as no longer having a syncdev.
Note that this callback is always installed, even if the pfsync interface is disabled (and thus it's not a per-vnet callback pointer).
MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17502
show more ...
|
#
5f6cf24e |
| 02-Nov-2018 |
Kristof Provost <kp@FreeBSD.org> |
pfsync: Make pfsync callbacks per-vnet
The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet.
MFC after: 2 week
pfsync: Make pfsync callbacks per-vnet
The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet.
MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17499
show more ...
|
#
7847e041 |
| 24-Aug-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r338026 through r338297, and resolve conflicts.
|
#
249cc75f |
| 22-Aug-2018 |
Patrick Kelsey <pkelsey@FreeBSD.org> |
Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of 2^32 bps or greater to be used. Prior to this, bandwidth parameters would simply wrap at the 2^32 boundary. The computations in th
Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of 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
show more ...
|
#
14b841d4 |
| 11-Aug-2018 |
Kyle Evans <kevans@FreeBSD.org> |
MFH @ r337607, in preparation for boarding
|
#
5f901c92 |
| 24-Jul-2018 |
Andrew Turner <andrew@FreeBSD.org> |
Use the new VNET_DEFINE_STATIC macro when we are defining static VNET variables.
Reviewed by: bz Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16147
|
#
3e603d1f |
| 14-Jul-2018 |
Kristof Provost <kp@FreeBSD.org> |
pf: Fix panic on vnet jail shutdown with synproxy
When shutting down a vnet jail pf_shutdown() clears the remaining states, which through pf_clear_states() calls pf_unlink_state(). For synproxy stat
pf: Fix panic on vnet jail shutdown with synproxy
When shutting down a vnet jail pf_shutdown() clears the remaining states, which through pf_clear_states() calls pf_unlink_state(). For synproxy states pf_unlink_state() will send a TCP RST, which eventually tries to schedule the pf swi in pf_send(). This means we can't remove the software interrupt until after pf_shutdown().
MFC after: 1 week
show more ...
|
#
cc535c95 |
| 04-Jul-2018 |
Will Andrews <will@FreeBSD.org> |
Revert r335833.
Several third-parties use at least some of these ioctls. While it would be better for regression testing if they were used in base (or at least in the test suite), it's currently no
Revert r335833.
Several third-parties use at least some of these ioctls. While it would be better for regression testing if they were used in base (or at least in the test suite), it's currently not worth the trouble to push through removal.
Submitted by: antoine, markj
show more ...
|
#
c1887e9f |
| 01-Jul-2018 |
Will Andrews <will@FreeBSD.org> |
pf: remove unused ioctls.
Several ioctls are unused in pf, in the sense that no base utility references them. Additionally, a cursory review of pf-based ports indicates they're not used elsewhere e
pf: remove unused ioctls.
Several ioctls are unused in pf, in the sense that no base utility references them. Additionally, a cursory review of pf-based ports indicates they're not used elsewhere either. Some of them have been unused since the original import. As far as I can tell, they're also unused in OpenBSD. Finally, removing this code removes the need for future pf work to take them into account.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D16076
show more ...
|
Revision tags: release/11.2.0 |
|
#
455969d3 |
| 30-May-2018 |
Kristof Provost <kp@FreeBSD.org> |
pf: Replace rwlock on PF_RULES_LOCK with rmlock
Given that PF_RULES_LOCK is a mostly read lock, replace the rwlock with rmlock. This change improves packet processing rate in high pps environments.
pf: Replace rwlock on PF_RULES_LOCK with rmlock
Given that PF_RULES_LOCK is a mostly read lock, replace the rwlock with rmlock. This change improves packet processing rate in high pps environments. Benchmarking by olivier@ shows a 65% improvement in pps.
While here, also eliminate all appearances of "sys/rwlock.h" includes since it is not used anymore.
Submitted by: farrokhi@ Differential Revision: https://reviews.freebsd.org/D15502
show more ...
|
#
c41420d5 |
| 11-Apr-2018 |
Kristof Provost <kp@FreeBSD.org> |
pf: limit ioctl to a reasonable and tuneable number of elements
pf ioctls frequently take a variable number of elements as argument. This can potentially allow users to request very large allocation
pf: limit ioctl to a reasonable and tuneable number of elements
pf ioctls frequently take a variable number of elements as argument. This can potentially allow users to request very large allocations. These will fail, but even a failing M_NOWAIT might tie up resources and result in concurrent M_WAITOK allocations entering vm_wait and inducing reclamation of caches.
Limit these ioctls to what should be a reasonable value, but allow users to tune it should they need to.
Differential Revision: https://reviews.freebsd.org/D15018
show more ...
|
#
1a125a2f |
| 06-Apr-2018 |
Kristof Provost <kp@FreeBSD.org> |
pf: Improve ioctl validation
Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations.
MFC after: 1 w
pf: Improve ioctl validation
Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations.
MFC after: 1 week
show more ...
|
#
02214ac8 |
| 06-Apr-2018 |
Kristof Provost <kp@FreeBSD.org> |
pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT
These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large alloc
pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT
These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow.
There's no obvious limit to the request size for these, so we limit the requests to something which won't overflow. Change the memory allocation to M_NOWAIT so excessive requests will fail rather than stall forever.
MFC after: 1 week
show more ...
|