| #
09a18933
|
| 06-Mar-2022 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: fix refcount bug in netmap allocator
Symptom: when a single extmem memory region is provided to netmap multiple times, for multiple interfaces, the memory region is never released by netmap
netmap: fix refcount bug in netmap allocator
Symptom: when a single extmem memory region is provided to netmap multiple times, for multiple interfaces, the memory region is never released by netmap once all the existing file descriptors are closed.
Fix the relevant condition in netmap_mem_drop(): release the memory when the last user of netmap_adapter is gone, rather then when the last user of netmap_mem_d is gone.
MFC after: 2 weeks
show more ...
|
| #
98399ab0
|
| 22-Aug-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: import changes from upstream
- make sure rings are disabled during resets - introduce netmap_update_hostrings_mode(), with support for multiple host rings - always initialize ni_bufs_h
netmap: import changes from upstream
- make sure rings are disabled during resets - introduce netmap_update_hostrings_mode(), with support for multiple host rings - always initialize ni_bufs_head in netmap_if ni_bufs_head was not properly initialized when no external buffers were requestedx and contained the ni_bufs_head from the last request. This was causing spurious buffer frees when alternating between apps that used external buffers and apps that did not use them. - check na validitity under lock on detach - netmap_mem: fix leak on error path - nm_dispatch: fix compilation on Raspberry Pi
MFC after: 2 weeks
show more ...
|
| #
f4a54f43
|
| 18-Apr-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: use safer defaults for hwbuf_len
We must make sure that incoming packets will never overflow the netmap buffers, even when the user is using the offset feature. In the typical scenario, the
netmap: use safer defaults for hwbuf_len
We must make sure that incoming packets will never overflow the netmap buffers, even when the user is using the offset feature. In the typical scenario, the netmap buffer is 2KiB and, with an MTU of 1500, there are ~500 bytes available for user offsets.
Unfortunately, some NICs accept incoming packets even when they are larger then the MTU. This means that the only way to stop DMA from overflowing the netmap buffers, when offsets are allowed, is to choose a hardware buffer length which is smaller than the netmap buffer length. For most NICs and for 2KiB netmap buffers, this means 1024 bytes, which is unconveniently small.
The current code will select the small hardware buf size even when offsets are not in use. The main purpose of this change is to fix this bug by returning to the normal behavior for the no-offsets case.
At the same time, the patch pushes the handling of the offset case to the lower level driver code, so that it can be made NIC-specific (in future patches).
show more ...
|
| #
b51f459a
|
| 17-Apr-2021 |
Cy Schubert <cy@FreeBSD.org> |
wpa: Import wpa_supplicant/hostapd commit f91680c15
This is the April update to vendor/wpa committed upstream 2021/04/07.
This is MFV efec8223892b3e677acb46eae84ec3534989971f.
Suggested by: phili
wpa: Import wpa_supplicant/hostapd commit f91680c15
This is the April update to vendor/wpa committed upstream 2021/04/07.
This is MFV efec8223892b3e677acb46eae84ec3534989971f.
Suggested by: philip Reviewed by: philip MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D29744
show more ...
|
| #
13c46411
|
| 17-Apr-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: make sure rings are disabled during resets
Explicitly disable ring synchronization before calling callbacks that may result in a hardware reset.
Before this patch we relied on capturing the
netmap: make sure rings are disabled during resets
Explicitly disable ring synchronization before calling callbacks that may result in a hardware reset.
Before this patch we relied on capturing the down/up events which, however, may not be issued by all drivers.
show more ...
|
| #
45c67e8f
|
| 02-Apr-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: several typo fixes
No functional changes intended.
|
| #
66671ae5
|
| 02-Apr-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: fix typo bug in netmap_compute_buf_len
|
| #
a6d768d8
|
| 29-Mar-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: add kernel support for the "offsets" feature
This feature enables applications to ask netmap to transmit or receive packets starting at a user-specified offset from the beginning of the netm
netmap: add kernel support for the "offsets" feature
This feature enables applications to ask netmap to transmit or receive packets starting at a user-specified offset from the beginning of the netmap buffer. This is meant to ease those packet manipulation operations such as pushing or popping packet headers, that may be useful to implement software switches, routers and other packet processors. To use the feature, drivers (e.g., iflib, vtnet, etc.) must have explicit support. This change does not add support for any driver, but introduces the necessary kernel changes. However, offsets support is already included for VALE ports and pipes.
show more ...
|
| #
0ab5902e
|
| 15-Mar-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: fix memory leak in NETMAP_REQ_PORT_INFO_GET
The netmap_ioctl() function has a reference counting bug in case of NETMAP_REQ_PORT_INFO_GET command. When `hdr->nr_name[0] == '\0'`, the function
netmap: fix memory leak in NETMAP_REQ_PORT_INFO_GET
The netmap_ioctl() function has a reference counting bug in case of NETMAP_REQ_PORT_INFO_GET command. When `hdr->nr_name[0] == '\0'`, the function does not decrease the refcount of "nmd", which is increased by netmap_mem_find(), causing a refcount leak.
Reported by: Xiyu Yang <sherllyyang00@gmail.com> Submitted by: Carl Smith <carl.smith@alliedtelesis.co.nz> MFC after: 3 days PR: 254311
show more ...
|
| #
fef84509
|
| 05-Mar-2021 |
Mark Johnston <markj@FreeBSD.org> |
netmap: Stop printing a line to the dmesg in netmap_init()
netmap is compiled into the kernel by default so initialization was always reported, and netmap uses a formatting convention not used in th
netmap: Stop printing a line to the dmesg in netmap_init()
netmap is compiled into the kernel by default so initialization was always reported, and netmap uses a formatting convention not used in the rest of the kernel.
Reviewed by: vmaffione MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29099
show more ...
|
| #
ee0005f1
|
| 24-Jan-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: simplify parameter passing
Changes imported from the netmap github.
|
| #
55f0ad5f
|
| 10-Jan-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: restore hwofs and support it in iflib
Restore the hwofs functionality temporarily disabled by 7ba6ecf216fb15e8b147db2 to prevent issues with iflib. This patch brings the necessary changes to
netmap: restore hwofs and support it in iflib
Restore the hwofs functionality temporarily disabled by 7ba6ecf216fb15e8b147db2 to prevent issues with iflib. This patch brings the necessary changes to iflib to enable howfs to allow interface restarts without disrupting netmap applications actively using its rings. After this change, it becomes possible for multiple non-cooperating netmap applications to use non-overlapping subsets of the available netmap rings without clashing with each other.
PR: 252453 MFC after: 1 week
show more ...
|
| #
bb714db6
|
| 10-Jan-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: vtnet: enable/disable krings on any interface reinit
See 3d65fd97e85ab807f3b for a detailed explanation.
PR: 252453 MFC after: 1 week
|
| #
7ba6ecf2
|
| 09-Jan-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: refactor netmap_reset
The netmap_reset() function is meant to be called by the driver when they initialize (or re-initialize) a hardware ring. However, since the introduction of support for
netmap: refactor netmap_reset
The netmap_reset() function is meant to be called by the driver when they initialize (or re-initialize) a hardware ring. However, since the introduction of support for opening (in netmap mode) a subset of the available rings, netmap_reset() may be called multiple times on actively used rings, causing both kring and netmap ring to transition to an inconsistent state. This changes improves the situation by resetting all the indices fields of the kring to 0, as expected after the reinitialization of a hardware ring.
PR: 252518 MFC after: 1 week
show more ...
|
| #
1d238b07
|
| 09-Jan-2021 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: iflib: stop krings during interface reset
When different processes open separate subsets of the available rings of a same netmap interface, a device reset may be performed while one of the p
netmap: iflib: stop krings during interface reset
When different processes open separate subsets of the available rings of a same netmap interface, a device reset may be performed while one of the processes is actively using some rings (e.g., caused by another process executing a nmport_open()). With this patch, such situation will cause the active process to get a POLLERR, so that it can have a chance to detect the situation. We also guarantee that no process is running a txsync or rxsync (ioctl or poll) while an iflib device reset is in progress.
PR: 252453 MFC after: 1 week
show more ...
|
| #
e2515283
|
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
| #
b7d69138
|
| 24-Aug-2020 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: use FreeBSD guards for epoch calls
EPOCH calls are FreeBSD specific. Use guards to protect these, so that the code can compile under Linux.
MFC after: 1 week
|
| #
75dfc66c
|
| 27-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r358269 through r358399.
|
| #
7029da5c
|
| 26-Feb-2020 |
Pawel Biernacki <kaktus@FreeBSD.org> |
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags.
Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT
Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718
show more ...
|
| #
051669e8
|
| 25-Jan-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r356931 through r357118.
|
| #
a4470078
|
| 23-Jan-2020 |
Gleb Smirnoff <glebius@FreeBSD.org> |
In netmap() call ether_input() within the network epoch.
|
| #
760fa2ab
|
| 20-Oct-2019 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: minor misc improvements
- use ring->head rather than ring->cur in lb(8) - use strlcat() rather than strncat() - fix bandwidth computation in pkt-gen(8)
MFC after: 1 week
|
| #
c5c3ba6b
|
| 03-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r351317 through r351731.
|
| #
253b2ec1
|
| 01-Sep-2019 |
Vincenzo Maffione <vmaffione@FreeBSD.org> |
netmap: import changes from upstream (SHA 137f537eae513)
- Rework option processing. - Use larger integers for memory size values in the memory management code.
MFC after: 2 weeks
|
| #
2aaf9152
|
| 18-Mar-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345275
|