#
aa386085 |
| 28-Jun-2024 |
Zhenlei Huang <zlei@FreeBSD.org> |
net: Remove unneeded NULL check for the allocated ifnet
Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle().
No functiona
net: Remove unneeded NULL check for the allocated ifnet
Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle().
No functional change intended.
Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
show more ...
|
Revision tags: release/14.1.0, release/13.3.0 |
|
#
8cb9b68f |
| 09-Jan-2024 |
John Baldwin <jhb@FreeBSD.org> |
sys: Use mbufq_empty instead of comparing mbufq_len against 0
Reviewed by: bz, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43338
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
a9bfd080 |
| 02-Jun-2023 |
Kristof Provost <kp@FreeBSD.org> |
if_epair: do not transmit packets that exceed the interface MTU
While if_epair has no issues doing this we should drop those packets anyway, because it improves the fidelity of the automated tests.
if_epair: do not transmit packets that exceed the interface MTU
While if_epair has no issues doing this we should drop those packets anyway, because it improves the fidelity of the automated tests.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40397
show more ...
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
#
a6b55ee6 |
| 17-Apr-2023 |
Gleb Smirnoff <glebius@FreeBSD.org> |
net: replace IFF_KNOWSEPOCH with IFF_NEEDSEPOCH
Expect that drivers call into the network stack with the net epoch entered. This has already been the fact since early 2020. The net interrupts, that
net: replace IFF_KNOWSEPOCH with IFF_NEEDSEPOCH
Expect that drivers call into the network stack with the net epoch entered. This has already been the fact since early 2020. The net interrupts, that are marked with INTR_TYPE_NET, were entering epoch since 511d1afb6bf. For the taskqueues there is NET_TASK_INIT() and all drivers that were known back in 2020 we marked with it in 6c3e93cb5a4. However in e87c4940156 we took conservative approach and preferred to opt-in rather than opt-out for the epoch.
This change not only reverts e87c4940156 but adds a safety belt to avoid panicing with INVARIANTS if there is a missed driver. With INVARIANTS we will run in_epoch() check, print a warning and enter the net epoch. A driver that prints can be quickly fixed with the IFF_NEEDSEPOCH flag, but better be augmented to properly enter the epoch itself.
Note on TCP LRO: it is a backdoor to enter the TCP stack bypassing some layers of net stack, ignoring either old IFF_KNOWSEPOCH or the new IFF_NEEDSEPOCH. But the tcp_lro_flush_all() asserts the presence of network epoch. Indeed, all NIC drivers that support LRO already provide the epoch, either with help of INTR_TYPE_NET or just running NET_EPOCH_ENTER() in their code.
Reviewed by: zlei, gallatin, erj Differential Revision: https://reviews.freebsd.org/D39510
show more ...
|
#
c69ae841 |
| 10-Apr-2023 |
Kristof Provost <kp@FreeBSD.org> |
if_epair: also remove vlan metadata from mbufs
We already remove mbuf tags from packets transitting an if_epair, but we didn't remove vlan metadata. In certain configurations this could lead to unex
if_epair: also remove vlan metadata from mbufs
We already remove mbuf tags from packets transitting an if_epair, but we didn't remove vlan metadata. In certain configurations this could lead to unexpected vlan tags turning up on the rx side.
PR: 270736 Reviewed by: markj MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39482
show more ...
|
Revision tags: release/13.2.0 |
|
#
29c9b167 |
| 13-Mar-2023 |
Mark Johnston <markj@FreeBSD.org> |
epair: Remove unneeded includes and sort some of the rest
No functional change intended.
MFC after: 1 week
|
#
df7bbd8c |
| 01-Mar-2023 |
Mark Johnston <markj@FreeBSD.org> |
epair: Simplify the transmit path and address lost wakeups
epairs currently shuttle all transmitted packets through a single global taskqueue thread. To hand packets over to the taskqueue thread, e
epair: Simplify the transmit path and address lost wakeups
epairs currently shuttle all transmitted packets through a single global taskqueue thread. To hand packets over to the taskqueue thread, each epair maintains a pair of ring buffers and a lockless scheme for notifying the thread of pending work. The implementation can lead to lost wakeups, causing to-be-transmitted packets to end up stuck in the queue.
Rather than extending the existing scheme, simply replace it with a linked list protected by a mutex, and use the mutex to synchronize wakeups of the taskqueue thread. This appears to give equivalent or better throughput with >= 16 producer threads and eliminates the lost wakeups.
Reviewed by: kp MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D38843
show more ...
|
#
48227d1c |
| 06-Mar-2023 |
Mark Johnston <markj@FreeBSD.org> |
epair: Avoid loading m_flags into a short
The m_flags field of struct mbuf is 24 bits wide and so gets truncated in a couple of places in the epair code. Instead of preserving the entire flag set,
epair: Avoid loading m_flags into a short
The m_flags field of struct mbuf is 24 bits wide and so gets truncated in a couple of places in the epair code. Instead of preserving the entire flag set, just remember whether M_BCAST or M_MCAST is set.
MFC after: 1 week Sponsored by: Klara, Inc.
show more ...
|
#
2c2b37ad |
| 13-Jan-2023 |
Justin Hibbits <jhibbits@FreeBSD.org> |
ifnet/API: Move struct ifnet definition to a <net/if_private.h>
Hide the ifnet structure definition, no user serviceable parts inside, it's a netstack implementation detail. Include it temporarily
ifnet/API: Move struct ifnet definition to a <net/if_private.h>
Hide the ifnet structure definition, no user serviceable parts inside, it's a netstack implementation detail. Include it temporarily in <net/if_var.h> until all drivers are updated to use the accessors exclusively.
Reviewed by: glebius Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38046
show more ...
|
Revision tags: release/12.4.0 |
|
#
8a299958 |
| 03-Oct-2022 |
Kristof Provost <kp@FreeBSD.org> |
if_epair: fix build with RSS
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
04a32b80 |
| 27-Sep-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
if_epair: refactor interface creation and enqueue code.
* Factor out queue selection (epair_select_queue()) and mbuf preparation (epair_prepare_mbuf()) from epair_menq(). It simplifies epair_menq(
if_epair: refactor interface creation and enqueue code.
* Factor out queue selection (epair_select_queue()) and mbuf preparation (epair_prepare_mbuf()) from epair_menq(). It simplifies epair_menq() implementation and reduces the amount of dependencies on the neighbouring epair. * Use dedicated epair_set_state() instead of 2-lines copy-paste * Factor out unit selection code (epair_handle_unit()) from epair_clone_create(). It simplifies the clone creation logic.
Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D36689
show more ...
|
#
91ebcbe0 |
| 22-Sep-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
if_clone: migrate some consumers to the new KPI.
Convert most of the cloner customers who require custom params to the new if_clone KPI.
Reviewed by: kp Differential Revision: https://reviews.free
if_clone: migrate some consumers to the new KPI.
Convert most of the cloner customers who require custom params to the new if_clone KPI.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D36636 MFC after: 2 weeks
show more ...
|
#
12aeeb91 |
| 22-Sep-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
epair: deduplicate interface allocation code #1
Simplify epair_clone_create() and epair_clone_destroy() by factoring out epair softc allocation / desctruction and interface setup/teardown into sep
epair: deduplicate interface allocation code #1
Simplify epair_clone_create() and epair_clone_destroy() by factoring out epair softc allocation / desctruction and interface setup/teardown into separate functions.
Reviewed By: kp, zlei.huang_gmail.com Differential Revision: https://reviews.freebsd.org/D36614 MFC after: 2 weeks
show more ...
|
Revision tags: release/13.1.0 |
|
#
cbbce423 |
| 07-May-2022 |
Kristof Provost <kp@FreeBSD.org> |
epair: unbind prior to returning to userspace
If 'options RSS' is set we bind the epair tasks to different CPUs. We must take care to not keep the current thread bound to the last CPU when we return
epair: unbind prior to returning to userspace
If 'options RSS' is set we bind the epair tasks to different CPUs. We must take care to not keep the current thread bound to the last CPU when we return to userspace.
MFC after: 1 week Sponsored by: Orange Business Services
show more ...
|
#
a6b0c8d0 |
| 07-May-2022 |
Kristof Provost <kp@FreeBSD.org> |
epair: fix set but not used warning
If 'options RSS' is set.
MFC after: 1 week Sponsored by: Orange Business Services
|
#
0bf7acd6 |
| 17-Mar-2022 |
Kristof Provost <kp@FreeBSD.org> |
if_epair: build fix
66acf7685b failed to build on riscv (and mips). This is because the atomic_testandset_int() (and friends) functions do not exist there. Happily those platforms do have the long v
if_epair: build fix
66acf7685b failed to build on riscv (and mips). This is because the atomic_testandset_int() (and friends) functions do not exist there. Happily those platforms do have the long variant, so switch to that.
PR: 262571 MFC after: 3 days
show more ...
|
#
66acf768 |
| 16-Mar-2022 |
Michael Gmelin <grembo@FreeBSD.org> |
if_epair: fix race condition on multi-core systems
As an unwanted side effect of the performance improvements in 24f0bfbad57b9, epair interfaces stop forwarding traffic on higher load levels when ru
if_epair: fix race condition on multi-core systems
As an unwanted side effect of the performance improvements in 24f0bfbad57b9, epair interfaces stop forwarding traffic on higher load levels when running on multi-core systems.
This happens due to a race condition in the logic that decides when to place work in the task queue(s) responsible for processing the content of ring buffers.
In order to fix this, a field named state is added to the epair_queue structure. This field is used by the affected functions to signal each other that something happened in the underlying ring buffers that might require work to be scheduled in task queue(s), replacing the existing logic, which relied on checking if ring buffers are empty or not.
epair_menq() does: - set BIT_MBUF_QUEUED - queue mbuf - if testandset BIT_QUEUE_TASK: enqueue task
epair_tx_start_deferred() does: - swap ring buffers - process mbufs - clear BIT_QUEUE_TASK - if testandclear BIT_MBUF_QUEUED enqueue task
PR: 262571 Reported by: Johan Hendriks <joh.hendriks@gmail.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D34569
show more ...
|
#
52bcdc5b |
| 03-Mar-2022 |
Santiago Martinez <sm@codenetworks.net> |
if_epair: fix build with RSS and INET or INET6 disabled
Reviewed by: kp MFC after: 1 week
|
#
7442b632 |
| 15-Feb-2022 |
Li-Wen Hsu <lwhsu@FreeBSD.org> |
if_epair: Use ANSI C definition
This fixes -Werror=strict-prototypes from gcc9
Sponsored by: The FreeBSD Foundation
|
#
24f0bfba |
| 09-Dec-2021 |
Kristof Provost <kp@FreeBSD.org> |
if_epair: implement fanout
Allow multiple cores to be used to process if_epair traffic. We do this (if RSS is enabled) based on the RSS hash of the incoming packet. This allows us to distribute the
if_epair: implement fanout
Allow multiple cores to be used to process if_epair traffic. We do this (if RSS is enabled) based on the RSS hash of the incoming packet. This allows us to distribute the load over multiple cores, rather than sending everything to the same one.
We also switch from swi_sched() to taskqueues, which also contributes to better throughput.
Benchmark results: With net.isr.maxthreads=-1
Setup A: (cc0 - bridge0 - epair0a) (epair0b - bridge1 - cc1)
Before 627 Kpps After (no RSS) 1.198 Mpps After (RSS) 3.148 Mpps
Setup B: (cc0 - bridge0 - epaira0) (epair0b - vnet jail - epair1a) (epair1b - bridge1 - cc1)
Before 7.705 Kpps After (no RSS) 1.017 Mpps After (RSS) 2.083 Mpps
MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D33731
show more ...
|
Revision tags: release/12.3.0 |
|
#
73d41cc7 |
| 01-Dec-2021 |
Zhenlei Huang <zlei.huang@gmail.com> |
if_epair: Also mark the flag of pair b with IFF_KNOWSEPOCH
Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33210
|
#
2cedfc3f |
| 24-Nov-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
if_epair: ifdef vars only used with ALTQ
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
1a8f198f |
| 02-Nov-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
epair: remove "All rights reserved"
Remove "All rights reserved" from The FreeBSD Foundation owned copyrights on epair code and documentation.
Approved by: emaste (FreeBSD Foundation)
|