#
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, release/13.1.0, release/12.3.0 |
|
#
402810d3 |
| 20-Oct-2021 |
Justin Hibbits <jhibbits@FreeBSD.org> |
Convert iflib(4) and iflib-based drivers to the DrvAPI
Summary: Convert iflib(4) and the following drivers: * axgbe * em * ice * ixl * vmxnet
Sponsored by: Juniper Networks, Inc. Reviewed by: kbowl
Convert iflib(4) and iflib-based drivers to the DrvAPI
Summary: Convert iflib(4) and the following drivers: * axgbe * em * ice * ixl * vmxnet
Sponsored by: Juniper Networks, Inc. Reviewed by: kbowling, #iflib Differential Revision: https://reviews.freebsd.org/D37768
show more ...
|
#
9c950139 |
| 17-Oct-2022 |
Eric Joyner <erj@FreeBSD.org> |
iflib: Introduce v2 of TX Queue Select Functionality
For v2, iflib will parse packet headers before queueing a packet.
This commit also adds a new field in the structure that holds parsed header in
iflib: Introduce v2 of TX Queue Select Functionality
For v2, iflib will parse packet headers before queueing a packet.
This commit also adds a new field in the structure that holds parsed header information from packets; it stores the IP ToS/traffic class field found in the IPv4/IPv6 header.
To help, it will only partially parse header packets before queueing them by using a new header parsing function that does less than the current parsing header function; for our purposes we only need up to the minimal IP header in order to get the IP ToS infromation and don't need to pull up more data.
For now, v1 and v2 co-exist in this patch; v1 still offers a less-invasive method where none of the packet is parsed in iflib before queueing.
This also bumps the sys/param.h version.
Signed-off-by: Eric Joyner <erj@FreeBSD.org> Tested by: IntelNetworking MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D34742
show more ...
|
#
0294e95d |
| 21-Jul-2022 |
Dimitry Andric <dim@FreeBSD.org> |
Fix unused variable warning in iflib.c
With clang 15, the following -Werror warning is produced:
sys/net/iflib.c:993:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
Fix unused variable warning in iflib.c
With clang 15, the following -Werror warning is produced:
sys/net/iflib.c:993:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable] u_int n; ^
The 'n' variable appears to have been a debugging aid that has never been used for anything, so remove it.
MFC after: 3 days
show more ...
|
#
d08cb453 |
| 09-Apr-2022 |
John Baldwin <jhb@FreeBSD.org> |
iflib: Use empty inline functions for prefetch*() on non-x86.
This avoids warnings about unused variables in expressions passed to prefetch*().
|
#
213e9139 |
| 30-Jul-2021 |
Eric Joyner <erj@FreeBSD.org> |
iflib: Allow drivers to determine which queue to TX on
Adds a new function pointer to struct if_txrx in order to allow drivers to set their own function that will determine which queue a packet shou
iflib: Allow drivers to determine which queue to TX on
Adds a new function pointer to struct if_txrx in order to allow drivers to set their own function that will determine which queue a packet should be sent on.
Since this includes a kernel ABI change, bump the __FreeBSD_version as well.
(This motivation behind this is to allow the driver to examine the UP in the VLAN tag and determine which queue to TX on based on that, in support of HW TX traffic shaping.)
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@, stallamr@netapp.com Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D31485
show more ...
|
#
e0e12405 |
| 14-Jan-2022 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: fix LOR in iflib_netmap_register
In iflib_device_register(), the CTX_LOCK is acquired first and then IFNET_WLOCK is acquired by ether_ifattach(). However, in netmap_hw_reg() we do the opposi
netmap: fix LOR in iflib_netmap_register
In iflib_device_register(), the CTX_LOCK is acquired first and then IFNET_WLOCK is acquired by ether_ifattach(). However, in netmap_hw_reg() we do the opposite: IFNET_RLOCK is acquired first, and then CTX_LOCK is acquired by iflib_netmap_register(). Fix this LOR issue by wrapping the CTX_LOCK/UNLOCK calls in iflib_device_register with an additional IFNET_WLOCK. This is safe since the IFNET_WLOCK is recursive.
MFC after: 1 month
show more ...
|
#
618d49f5 |
| 10-Jan-2022 |
Alexander Motin <mav@FreeBSD.org> |
Revert "iflib: Relax timer period from 0.5 to 0.5-0.75s."
I've noticed relations between iflib_timer() vs ixl_admin_timer(). Both scheduled at the same 2Hz rate, but the second is rescheduling the f
Revert "iflib: Relax timer period from 0.5 to 0.5-0.75s."
I've noticed relations between iflib_timer() vs ixl_admin_timer(). Both scheduled at the same 2Hz rate, but the second is rescheduling the first each time, so if the first get any slower, it won't be executed at all. Revert this until deeper investigation.
This reverts commit 90bc1cf65778aafb1f226c8fe08218cfed5e40b2.
show more ...
|
#
90bc1cf6 |
| 10-Jan-2022 |
Alexander Motin <mav@FreeBSD.org> |
iflib: Relax timer period from 0.5 to 0.5-0.75s.
While there switch it from hardclock ticks to milliseconds.
MFC after: 2 weeks
|
#
e2650af1 |
| 30-Dec-2021 |
Stefan Eßer <se@FreeBSD.org> |
Make CPU_SET macros compliant with other implementations
The introduction of <sched.h> improved compatibility with some 3rd party software, but caused the configure scripts of some ports to assume t
Make CPU_SET macros compliant with other implementations
The introduction of <sched.h> improved compatibility with some 3rd party software, but caused the configure scripts of some ports to assume that they were run in a GLIBC compatible environment.
Parts of sched.h were made conditional on -D_WITH_CPU_SET_T being added to ports, but there still were compatibility issues due to invalid assumptions made in autoconfigure scripts.
The differences between the FreeBSD version of macros like CPU_AND, CPU_OR, etc. and the GLIBC versions was in the number of arguments: FreeBSD used a 2-address scheme (one source argument is also used as the destination of the operation), while GLIBC uses a 3-adderess scheme (2 source operands and a separately passed destination).
The GLIBC scheme provides a super-set of the functionality of the FreeBSD macros, since it does not prevent passing the same variable as source and destination arguments. In code that wanted to preserve both source arguments, the FreeBSD macros required a temporary copy of one of the source arguments.
This patch set allows to unconditionally provide functions and macros expected by 3rd party software written for GLIBC based systems, but breaks builds of externally maintained sources that use any of the following macros: CPU_AND, CPU_ANDNOT, CPU_OR, CPU_XOR.
One contributed driver (contrib/ofed/libmlx5) has been patched to support both the old and the new CPU_OR signatures. If this commit is merged to -STABLE, the version test will have to be extended to cover more ranges.
Ports that have added -D_WITH_CPU_SET_T to build on -CURRENT do no longer require that option.
The FreeBSD version has been bumped to 1400046 to reflect this incompatible change.
Reviewed by: kib MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D33451
show more ...
|
#
4561c4f0 |
| 28-Dec-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
net: iflib: sync isc_capenable to if_capenable
On SIOCSIFCAP, some bits in ifp->if_capenable may be toggled. When this happens, apply the same change to isc_capenable, which is the iflib private cop
net: iflib: sync isc_capenable to if_capenable
On SIOCSIFCAP, some bits in ifp->if_capenable may be toggled. When this happens, apply the same change to isc_capenable, which is the iflib private copy of if_capenable (for a subset of the IFCAP_* bits). In this way the iflib drivers can check the bits using isc_capenable rather than if_capenable. This is convenient because the latter access requires an additional indirection through the ifp, and it is also less likely to be in cache.
PR: 260068 Reviewed by: kbowling, gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33156
show more ...
|
#
1bfdb812 |
| 19-Nov-2021 |
Andriy Gapon <avg@FreeBSD.org> |
iflib_stop: drain rx tasks to prevent any data races
iflib_stop modifies iflib data structures that are used by _task_fn_rx, most prominently the free lists. So, iflib_stop has to ensure that the r
iflib_stop: drain rx tasks to prevent any data races
iflib_stop modifies iflib data structures that are used by _task_fn_rx, most prominently the free lists. So, iflib_stop has to ensure that the rx task threads are not active.
This should help to fix a crash seen when iflib_if_ioctl (e.g., SIOCSIFCAP) is called while there is already traffic flowing.
The crash has been seen on VMWare guests with vmxnet3 driver.
My guess is that on physical hardware the couple of 1ms delays that iflib_stop has after disabling interrupts are enough for the queued work to be completed before any iflib state is touched.
But on busy hypervisors the guests might not get enough CPU time to complete the work, thus there can be a race between the taskqueue threads and the work done to handle an ioctl, specifically in iflib_stop and iflib_init_locked.
PR: 259458 Reviewed by: markj MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D32926
show more ...
|
#
66fa12d8 |
| 18-Aug-2021 |
Stephan de Wit <stephan.dewt@yahoo.co.uk> |
iflib: emulate counters in netmap mode
When iflib devices are in netmap mode the driver counters are no longer updated making it look from userspace tools that traffic has stopped.
Reported by: Fra
iflib: emulate counters in netmap mode
When iflib devices are in netmap mode the driver counters are no longer updated making it look from userspace tools that traffic has stopped.
Reported by: Franco Fichtner <franco@opnsense.org> Reviewed by: vmaffione, iflib (erj, gallatin) Obtained from: OPNsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31550
show more ...
|
#
a5688853 |
| 06-Jul-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
iflib: use m_gethdr_raw
Reviewed by: gallatin Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31081
|
#
bad5f0b6 |
| 30-Jun-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
iflib: switch bare zone_mbuf use to m_free_raw
Reviewed by: kbowling Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30961
|
#
58632fa7 |
| 19-May-2021 |
Marcin Wojtas <mw@FreeBSD.org> |
iflib: Add a new quirk
ENETC NIC found in LS1028A has a bug where clearing TX pidx/cidx causes the ring to hang after being re-enabled. Add a new flag, if set iflib will preserve the indices during
iflib: Add a new quirk
ENETC NIC found in LS1028A has a bug where clearing TX pidx/cidx causes the ring to hang after being re-enabled. Add a new flag, if set iflib will preserve the indices during restart.
Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: gallatin, erj Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30728
show more ...
|
#
cd945dc0 |
| 27-Apr-2021 |
Marcin Wojtas <mw@FreeBSD.org> |
iflib: Take iri_pad into account when processing small frames
Drivers can specify padding of received frames with iri_pad field. This can be used to enforce ip alignment by hardware. Iflib ignored t
iflib: Take iri_pad into account when processing small frames
Drivers can specify padding of received frames with iri_pad field. This can be used to enforce ip alignment by hardware. Iflib ignored that padding when processing small frames, which rendered this feature inoperable. I found it while writing a driver for a NIC that can ip align received packets. Note that this doesn't change behavior of existing drivers as they all set iri_pad to 0.
Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: gallatin Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30009
show more ...
|
#
ca7005f1 |
| 26-Apr-2021 |
Patrick Kelsey <pkelsey@FreeBSD.org> |
iflib: Improve mapping of TX/RX queues to CPUs
iflib now supports mapping each (TX,RX) queue pair to the same CPU (default), to separate CPUs, or to a pair of physical and logical CPUs that share th
iflib: Improve mapping of TX/RX queues to CPUs
iflib now supports mapping each (TX,RX) queue pair to the same CPU (default), to separate CPUs, or to a pair of physical and logical CPUs that share the same L2 cache. The mapping mechanism supports unequal numbers of TX and RX queues, with the excess queues always being mapped to consecutive physical CPUs. When the platform cannot distinguish between physical and logical CPUs, all are treated as physical CPUs. See the comment on get_cpuid_for_queue() for the entire matrix.
The following device-specific tunables influence the mapping process: dev.<device>.<unit>.iflib.core_offset (existing) dev.<device>.<unit>.iflib.separate_txrx (existing) dev.<device>.<unit>.iflib.use_logical_cores (new)
The following new, read-only sysctls provide visibility of the mapping results: dev.<device>.<unit>.iflib.{t,r}xq<n>.cpu
When an iflib driver allocates TX softirqs without providing reference RX IRQs, iflib now binds those TX softirqs to CPUs using the above mapping mechanism (that is, treats them as if they were TX IRQs). Previously, such bindings were left up to the grouptaskqueue code and thus fell outside of the iflib CPU mapping strategy.
Reviewed by: kbowling Tested by: olivier, pkelsey MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D24094
show more ...
|
#
3183d0b6 |
| 23-Apr-2021 |
Andrew Gallatin <gallatin@FreeBSD.org> |
iflib: initialize LRO unconditionally
Changes to the LRO code have exposed a bug in iflib where devices which are not capable of doing LRO are still calling tcp_lro_flush_all(), even when they have
iflib: initialize LRO unconditionally
Changes to the LRO code have exposed a bug in iflib where devices which are not capable of doing LRO are still calling tcp_lro_flush_all(), even when they have not initialized the LRO context. This used to be mostly harmless, but the LRO code now sets the VNET based on the ifp in the lro context and will try to access it through a NULL ifp resulting in a panic at boot.
To fix this, we unconditionally initializes LRO so that we have a valid LRO context when calling tcp_lro_flush_all(). One alternative is to check the device capabilities before calling tcp_lro_flush_all() or adding a new state flag in the ctx. However, it seems unwise to add an extra, mostly useless test for higher performance devices when we can just initialize LRO for all devices.
Reviewed by: erj, hselasky, markj, olivier Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29928
show more ...
|
Revision tags: release/13.0.0 |
|
#
361e9501 |
| 05-Apr-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
iflib: add support for netmap offsets
Follow-up change to a6d768d845c173823785c71bb18b40074e7a8998. This change adds iflib support for netmap offsets, enabling applications to use offsets on any dri
iflib: add support for netmap offsets
Follow-up change to a6d768d845c173823785c71bb18b40074e7a8998. This change adds iflib support for netmap offsets, enabling applications to use offsets on any driver backed by iflib.
show more ...
|
#
21d0c012 |
| 29-Mar-2021 |
you@x <you@x> |
netmap: iflib: add nm_config callback
This per-driver callback is invoked by netmap when it wants to align the number of TX/RX netmap rings and/or the number of TX/RX netmap slots to the actual stat
netmap: iflib: add nm_config callback
This per-driver callback is invoked by netmap when it wants to align the number of TX/RX netmap rings and/or the number of TX/RX netmap slots to the actual state configured in the hardware. The alignment happens when netmap mode is switched on (with no active netmap file descriptors for that netmap port), or when collecting netmap port information.
MFC after: 1 week
show more ...
|
#
09c3f04f |
| 03-Mar-2021 |
Marcin Wojtas <mw@FreeBSD.org> |
iflib: add support for admin completion queues
For interfaces with admin completion queues, introduce a new devmethod IFDI_ADMIN_COMPLETION_HANDLE and a corresponding flag IFLIB_HAS_ADMINCQ.
This p
iflib: add support for admin completion queues
For interfaces with admin completion queues, introduce a new devmethod IFDI_ADMIN_COMPLETION_HANDLE and a corresponding flag IFLIB_HAS_ADMINCQ.
This provides an option for handling any admin cq logic, which cannot be run from an interrupt context.
Said method is called from within iflib's admin task, making it safe to sleep.
Reviewed by: mmacy Submitted by: Artur Rojek <ar@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28708
show more ...
|
#
ef567155 |
| 25-Feb-2021 |
Marcin Wojtas <mw@FreeBSD.org> |
Fix powerpc build after 6dd69f0064f1
Commit 6dd69f0064f1 ("iflib: introduce isc_dma_width") failed to build on powerpc due to implicit type conversion error. Fix that.
Submitted by: Artur Rojek <ar
Fix powerpc build after 6dd69f0064f1
Commit 6dd69f0064f1 ("iflib: introduce isc_dma_width") failed to build on powerpc due to implicit type conversion error. Fix that.
Submitted by: Artur Rojek <ar@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc.
show more ...
|
#
6dd69f00 |
| 24-Feb-2021 |
Marcin Wojtas <mw@FreeBSD.org> |
iflib: introduce isc_dma_width
Some DMA controllers are unable to address the full host memory space and are instead limited to a subset of address range (e.g. 48-bit).
Allow the driver to specify
iflib: introduce isc_dma_width
Some DMA controllers are unable to address the full host memory space and are instead limited to a subset of address range (e.g. 48-bit).
Allow the driver to specify the maximum allowed DMA addressing width (in bits) for the NIC hardware, by introducing a new field in if_softc_ctx.
If said field is omitted (set to 0), the lowaddr of DMA window bounds defaults to BUS_SPACE_MAXADDR.
Submitted by: Artur Rojek <ar@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28706
show more ...
|
#
b6999635 |
| 24-Feb-2021 |
Mark Johnston <markj@FreeBSD.org> |
iflib: Avoid double counting in rxeof
iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes befor
iflib: Avoid double counting in rxeof
iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes before the pfil hooks are executed, so remove the counter adjustments that are executed after.
PR: 253583 Reviewed by: gallatin, erj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28900
show more ...
|