| #
40ad87e9
|
| 20-Apr-2025 |
Kyle Evans <kevans@FreeBSD.org> |
usb: if_ure: stop touching the mbuf accounting on rxq insertion
uether_rxmbuf() assumes the uether_newbuf() model where the caller has just set m_len to the entire size of the mbuf, and passed the f
usb: if_ure: stop touching the mbuf accounting on rxq insertion
uether_rxmbuf() assumes the uether_newbuf() model where the caller has just set m_len to the entire size of the mbuf, and passed the final size into uether_rxmbuf() for finalization.
In if_ure we're creating our own mbuf chains, and the accounting is all already accurate. uether_rxmbuf's logic won't work at all for a chain, so let's add an assertion to that effect (but I think the other callers were all OK).
This fixes a panic on my Windows DevKit when undergoing any kind of network stress that surfaces after the bogus mbuf is injected into the network stack (usually observed in `m_dup`).
markj and I had spent some time investigating it and decided there's some kind of buffer underrun happening; the rx packet descriptor reports a length longer than what's actually available. We discard the rest of the transfer, but then we end up fetching it in a subsequent transfer and end up casting packet data to a `struct ure_rxpkt` incorrectly. It would be better to fix the underlying root cause, but this is a reasonable mitigation in the interim.
Reviewed by: markj Fixes: 7d5522e16a ("A major update to the ure driver.") Differential Revision: https://reviews.freebsd.org/D43465
show more ...
|
| #
11a91178
|
| 02-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
Use bus_generic_detach to detach and delete child devices during detach
This is simpler and more robust than individual calls to device_delete_child.
Differential Revision: https://reviews.freebsd.
Use bus_generic_detach to detach and delete child devices during detach
This is simpler and more robust than individual calls to device_delete_child.
Differential Revision: https://reviews.freebsd.org/D47972
show more ...
|
| #
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 ...
|
| #
fdafd315
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
71625ec9
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
|
| #
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 ...
|
| #
2fda7967
|
| 01-Mar-2022 |
Justin Hibbits <jhibbits@FreeBSD.org> |
Mechanically convert usb_ethernet(4) to IfAPI
Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37802
|
| #
62d42655
|
| 07-Oct-2022 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword.
MFC after: 1 week Sponsored by: NVIDIA Networking
|
| #
c6df6f53
|
| 10-Dec-2021 |
Warner Losh <imp@FreeBSD.org> |
Create wrapper for Giant taken for newbus
Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlock
Create wrapper for Giant taken for newbus
Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that.
Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
show more ...
|
| #
4eac63af
|
| 12-Jan-2021 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Fix for use-after-free by if_ioctl() calls from user-space in USB drivers by detaching the ifnet before the miibus.
PR: 252608 Suggested by: jhb@ MFC after: 1 week Sponsored by: Mellanox Technologi
Fix for use-after-free by if_ioctl() calls from user-space in USB drivers by detaching the ifnet before the miibus.
PR: 252608 Suggested by: jhb@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
show more ...
|
| #
9dd3156e
|
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
usb: clean up empty lines in .c and .h files
|
| #
b33a8b38
|
| 16-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357966 through r357999.
|
| #
f8d2b1f3
|
| 15-Feb-2020 |
Pawel Biernacki <kaktus@FreeBSD.org> |
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 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 marke
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 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.
Reviewed by: hselasky, kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23632
show more ...
|
| #
8b3bc70a
|
| 08-Oct-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r352764 through r353315.
|
| #
b8a6e03f
|
| 07-Oct-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Widen NET_EPOCH coverage.
When epoch(9) was introduced to network stack, it was basically dropped in place of existing locking, which was mutexes and rwlocks. For the sake of performance mutex cover
Widen NET_EPOCH coverage.
When epoch(9) was introduced to network stack, it was basically dropped in place of existing locking, which was mutexes and rwlocks. For the sake of performance mutex covered areas were as small as possible, so became epoch covered areas.
However, epoch doesn't introduce any contention, it just delays memory reclaim. So, there is no point to minimise epoch covered areas in sense of performance. Meanwhile entering/exiting epoch also has non-zero CPU usage, so doing this less often is a win.
Not the least is also code maintainability. In the new paradigm we can assume that at any stage of processing a packet, we are inside network epoch. This makes coding both input and output path way easier.
On output path we already enter epoch quite early - in the ip_output(), in the ip6_output().
This patch does the same for the input path. All ISR processing, network related callouts, other ways of packet injection to the network stack shall be performed in net_epoch. Any leaf function that walks network configuration now asserts epoch.
Tricky part is configuration code paths - ioctls, sysctls. They also call into leaf functions, so some need to be changed.
This patch would introduce more epoch recursions (see EPOCH_TRACE) than we had before. They will be cleaned up separately, as several of them aren't trivial. Note, that unlike a lock recursion the epoch recursion is safe and just wastes a bit of resources.
Reviewed by: gallatin, hselasky, cy, adrian, kristof Differential Revision: https://reviews.freebsd.org/D19111
show more ...
|
| #
c5c3ba6b
|
| 03-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r351317 through r351731.
|
| #
f6549df6
|
| 02-Sep-2019 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Fix regression issue after r351616. Make sure the mbuf queue gets initialized.
Found by: gonzo@ MFC after: 1 week Sponsored by: Mellanox Technologies
|
| #
35d3dd8b
|
| 30-Aug-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Use mbuf queue instead of ifqueue in USB network drivers.
Reviewed by: stevek
|
| #
40ad87e9
|
| 20-Apr-2025 |
Kyle Evans <kevans@FreeBSD.org> |
usb: if_ure: stop touching the mbuf accounting on rxq insertion
uether_rxmbuf() assumes the uether_newbuf() model where the caller has just set m_len to the entire size of the mbuf, and passed the f
usb: if_ure: stop touching the mbuf accounting on rxq insertion
uether_rxmbuf() assumes the uether_newbuf() model where the caller has just set m_len to the entire size of the mbuf, and passed the final size into uether_rxmbuf() for finalization.
In if_ure we're creating our own mbuf chains, and the accounting is all already accurate. uether_rxmbuf's logic won't work at all for a chain, so let's add an assertion to that effect (but I think the other callers were all OK).
This fixes a panic on my Windows DevKit when undergoing any kind of network stress that surfaces after the bogus mbuf is injected into the network stack (usually observed in `m_dup`).
markj and I had spent some time investigating it and decided there's some kind of buffer underrun happening; the rx packet descriptor reports a length longer than what's actually available. We discard the rest of the transfer, but then we end up fetching it in a subsequent transfer and end up casting packet data to a `struct ure_rxpkt` incorrectly. It would be better to fix the underlying root cause, but this is a reasonable mitigation in the interim.
Reviewed by: markj Fixes: 7d5522e16a ("A major update to the ure driver.") Differential Revision: https://reviews.freebsd.org/D43465
show more ...
|
| #
11a91178
|
| 02-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
Use bus_generic_detach to detach and delete child devices during detach
This is simpler and more robust than individual calls to device_delete_child.
Differential Revision: https://reviews.freebsd.
Use bus_generic_detach to detach and delete child devices during detach
This is simpler and more robust than individual calls to device_delete_child.
Differential Revision: https://reviews.freebsd.org/D47972
show more ...
|
| #
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 ...
|
| #
fdafd315
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
71625ec9
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
|