History log of /freebsd-current/sys/dev/usb/net/if_ure.c
Revision Date Author Comments
# 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.

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


# f17b69fd 11-Oct-2023 Poul-Henning Kamp <phk@FreeBSD.org>

Move (LENOVO, TBT3LAN) from if_ure til if_cdce where it works much better


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 53a03e31 04-Jul-2023 Joerg Pulz <Joerg.Pulz@frm2.tum.de>

ure(4): add support for Thinkpad Hybrid USB-C with USB-A dock

Add support for LAN port found on Thinkpad Hybrid USB-C with USB-A dock.
While here fix a small typo
- s/UBS/USB/

Sponsored by: Technical University of Munich
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/791


# 935b194d 07-Feb-2023 Justin Hibbits <jhibbits@FreeBSD.org>

Mechanically convert usb ethernet drivers to DrvAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37812


# e5b9b5ee 04-Jan-2023 Andrew Turner <andrew@FreeBSD.org>

Add Windows Dev Kit 2023 support to if_ure

The Windows Dev Kit 2023 has an if_ure NIC with custom vendor and
procuct IDs. Add them to the driver.

Tested by: Robert Clausecker <fuz@fuz.su>
Obtained from: OpenBSD
Sponsored by: Arm Ltd


# 31937f7e 28-Aug-2022 Poul-Henning Kamp <phk@FreeBSD.org>

USB id of yet another Lenovo USB-C ethernet dongle.


# bc9372d7 06-May-2022 John Baldwin <jhb@FreeBSD.org>

usb: Remove unused devclass arguments to DRIVER_MODULE.


# 3e38757d 19-Apr-2022 John Baldwin <jhb@FreeBSD.org>

Remove unused miibus_devclass and miibus_fdt_devclass.


# c6df6f53 09-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 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


# dab84426 04-Jun-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Narrow down the probe range for if_ure(4) compatible devices
to only match the first vendor specific interface, if any.

PR: 253374
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking


# d4cf41a9 04-Jun-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4).

Submitted by: fbbz@synack.eu
PR: 253374
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking


# 6e5baec3 12-Jan-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for use-after-free in if_ure(4) driver.

When detaching the if_ure(4) driver, the TX active USB transfer array may
point to freed USB transfers. Given that the number of USB transfers is
very low, simply start all transfers every time there is a packet to
keep safe from use-after-free.

PR: 252608
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking


# a8261b70 23-Dec-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for USB-C and TB3 Gen2 to if_ure(4).

Add support for LAN found on Thinkpad USB-C and Thunderbolt Gen 2
docking stations.

Submitted by: ali.abdallah@suse.com
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking


# 7d0368ee 19-Dec-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Ensure a minimum packet length before creating a mbuf in if_ure.

Sponsored by: Mellanox Technologies // NVIDIA Networking


# 412bbd08 19-Dec-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Move SYSCTL_ADD_PROC() to unlocked context in if_ure to avoid lock order reversal.

MFC after: 1 week
Reported by: Mark Millard <marklmi@yahoo.com>
Sponsored by: Mellanox Technologies // NVIDIA Networking


# 7d5522e1 11-Sep-2020 John-Mark Gurney <jmg@FreeBSD.org>

A major update to the ure driver.

This update adds support for:
HW VLAN tagging
HW checksum offload for IPv4 and IPv6
tx and rx aggreegation (for full gige speeds)
multiple transactions

In my testing, I am able to get 900-950Mbps depending upon
TCP or UDP, which is a significant improvement over the previous
91Mbps (~8kint/sec*1500bytes/packet*1packet/int).

Reviewed by: hselasky
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D25809


# 0b39e344 10-Sep-2020 John-Mark Gurney <jmg@FreeBSD.org>

Don't clear reserved bits per RealTek

MFC after: 3 days


# 46da523a 25-Jul-2020 John-Mark Gurney <jmg@FreeBSD.org>

clean up whitespace...


# 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 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


# 74954211 04-Nov-2019 Eric Joyner <erj@FreeBSD.org>

net: add ETHER_IS_ZERO macro similar to ETHER_IS_BROADCAST

Some places in network code may need to verify that an ethernet address
is not the 'zero' address. Provide a standard macro ETHER_IS_ZERO for
this purpose, similar to the ETHER_IS_BROADCAST macro already available.

This patch also removes previous ETHER_IS_ZERO definitions in several
USB ethernet drivers, in favor of this centrally-located macro.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D21240


# a433f711 14-Oct-2019 Gleb Smirnoff <glebius@FreeBSD.org>

Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky


# 31c484ad 20-Aug-2019 Justin Hibbits <jhibbits@FreeBSD.org>

Unbreak USB ethernet module builds

Sponsored by: Juniper Networks, Inc.


# cef38d45 09-Apr-2019 Ganbold Tsagaankhuu <ganbold@FreeBSD.org>

In some cases like NanoPI R1, its second USB ethernet
RTL8152 (chip version URE_CHIP_VER_4C10) doesn't
have hardwired MAC address, in other words, it is all zeros.
This commit fixes it by setting random MAC address
when MAC address is all zeros.

Reviewed by: kevlo
Differential Revision: https://reviews.freebsd.org/D19856


# afa9b036 06-Feb-2019 Gavin Atkinson <gavin@FreeBSD.org>

Support the Lenovo OneLink in ure(4).

MFC after: 1 week


# 146ebc76 21-Oct-2018 Poul-Henning Kamp <phk@FreeBSD.org>

Recognize LAN in Lenovo USB-C and TB3 docks


# 72851e85 30-Sep-2018 Allan Jude <allanjude@FreeBSD.org>

Use PNP metadata to allow devmatch to autoload ure(4)

Reviewed by: manu imp
Approved by: re (kib)
X-MFC-with: devmatch
Sponsored by: Klara Systems


# 23242e7a 13-Aug-2018 Michal Meloun <mmel@FreeBSD.org>

Add USB ID for rebranded RTL8153 found on NVIDIA Jetson TX1 board.

MFC after: 3 days


# d7c5a620 18-May-2018 Matt Macy <mmacy@FreeBSD.org>

ifnet: Replace if_addr_lock rwlock with epoch + mutex

Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree
4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32
4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32
4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32
4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32
4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32
4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32
4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32

After the patch

InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree
5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51
5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51
5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51
5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51
5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52
5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15366


# ccaf7ad4 13-Nov-2017 Kevin Lo <kevlo@FreeBSD.org>

Add TP-LINK UE300.

Submitted by: Kris G <netsick@gmail.com>


# 21d36c96 28-Sep-2017 Kevin Lo <kevlo@FreeBSD.org>

Add ThinkPad USB 3.0 Ethernet Adapter.

Submitted by: jh


# a24d62b5 30-Oct-2016 Kevin Lo <kevlo@FreeBSD.org>

Add preliminary support for the RTL8153.

Reviewed by: hselasky


# 74b8d63d 10-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

Cleanup unnecessary semicolons from the kernel.

Found with devel/coccinelle.


# e1b74f21 30-Nov-2015 Kevin Lo <kevlo@FreeBSD.org>

Add initial support for RTL8152 USB Fast Ethernet. RTL8152 supports
IPv4/IPv6 checksum offloading and VLAN tag insertion/stripping.

Since uether doesn't provide a way to announce driver specific offload
capabilities to upper stack, checksum offloading support needs more work
and will be done in the future.

Special thanks to Hayes Wang from RealTek who gave input.