aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/net/if_axge.c
Commit message (Collapse)AuthorAgeFilesLines
* axge: Add support for AX88179ADamien Broka2023-10-111-8/+31
| | | | | | | | | | | | | | | The AX88179A has two firmware modes, one of which is backward compatible with existing AX88178A/179 driver. The active firmware mode can be controlled through a register. Update axge(4) man page to mention 179A support and ensure that, when bound to a AX88179A, the driver activates the compatible firmware mode. Reviewed by: markj Pull Request: https://github.com/freebsd/freebsd-src/pull/854 MFC after: 1 week (cherry picked from commit 6962da914dd511349b219241e92b32329be76fc6)
* axge: Skip dummy packet headersDamien Broka2023-09-251-1/+18
| | | | | | | | | | | | | | | | | Newer versions of the AX88179 interweave dummies alongside valid packet headers in bulk IN transfer data. This was probably done for backward compatibility with existing drivers. However current driver records these dummy headers as dropped frames, leading to stats misreporting one Ierr per Ipkt. This skips those dummy headers silently, thereby not generating Ierrs for them. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/842 (cherry picked from commit 70fbcd451b68b7f6038d8a602cd8d5e1bb890f1d)
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in current: (cherry picked from commit 685dc743dc3b)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | 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 (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* Create wrapper for Giant taken for newbusWarner Losh2022-06-211-2/+2
| | | | | | | | | | | | | 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 (cherry picked from commit c6df6f5322f7004c71216391e1c0b374d853704a)
* axge: Fix a -Wunused-but-set-variable warningMark Johnston2022-03-071-2/+0
| | | | (cherry picked from commit 9218449b98fdd176b9df1542551d0996aaa31f51)
* Add support to BELKIN B2B128 USB3 Ethernet Adapter to axge(4)Li-Wen Hsu2020-09-081-0/+1
| | | | | | | | | Github PR: https://github.com/freebsd/freebsd/pull/439 Submitted by: https://github.com/jdpc86 MFC after: 2 weeks Notes: svn path=/head/; revision=365444
* usb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-2/+0
| | | | Notes: svn path=/head/; revision=365084
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)Pawel Biernacki2020-02-151-1/+2
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=357972
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-141-12/+13
| | | | | | | Reviewed by: hselasky Notes: svn path=/head/; revision=353516
* Use mbuf queue instead of ifqueue in USB network drivers.Gleb Smirnoff2019-08-301-1/+1
| | | | | | | Reviewed by: stevek Notes: svn path=/head/; revision=351616
* Unbreak USB ethernet module buildsJustin Hibbits2019-08-201-0/+6
| | | | | | | Sponsored by: Juniper Networks, Inc. Notes: svn path=/head/; revision=351250
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=333813
* Fix race when detach is called right after attach in if_axge, that theHans Petter Selasky2018-02-241-1/+6
| | | | | | | | | | | network device pointer might be NULL. Wait for any pending tasks to complete before calling axge_stop(). MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329904
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* When device is detached make sure to stop the controller and makePyun YongHyeon2016-08-181-0/+18
| | | | | | | it return zero-length USB packet. Notes: svn path=/head/; revision=304336
* In axge_stop(), clear medium receive enable bit which will stop RXPyun YongHyeon2016-08-181-0/+5
| | | | | | | MAC operation. Notes: svn path=/head/; revision=304335
* When usbd_transfer_setup() fails, don't callPyun YongHyeon2016-08-181-1/+2
| | | | | | | usbd_transfer_unsetup(). Notes: svn path=/head/; revision=304333
* Introduce axge_rxfilter() which configures RX filtering and replacePyun YongHyeon2016-08-181-76/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | axge_setmulti()/axge_setpromisc() with axge_rxfilter(). Multicast filter programming and promiscuous mode requires access to a common RX configuration register so there is no need to use separate functions with added complexity. axge_rxfilter() does not read back AXGE_RCR register since accessing a register in USB is too slow and we already have all knowledge of required configuration. Rebuilding RX filter configuration is simpler and faster than manipulating every bits after reading back the register. Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on 32bit boundary) to disable extra padding bytes insertion. The extra padding wastes ethernet to USB host bandwidth as well as complicating RX handling logic. Current USB framework requires copying RX frames to mbufs so there is no need to worry about alignment. Previously axge_rx_frame() performed wrong bound check due to the extra padding and it was broken when RX checksum offloading is disabled. See added comment in axge_rx_frame () for actual RX packet layout. In axge_init(), disable WOL. It's meaningless to enable WOL in normal operation. In axge_rxeof(), use properly sized mbuf rather than blindly allocating a mbuf cluster. Use RX H/W checksum offloading only when administrator requested RX checksum offloading. Previously it always used RX H/W checksum offloading result regardless of RX checksum offloading state. Separate L4 checksum offloading validation from L3 one and properly set required offloading bits for each layer. This is to fix setting L4 checksum offloading bits for L3 packets. There are still lots of RX errors(probably RX FIFO overflows) under moderate load. Users are strongly recommended to enable ethernet flow control. Reviewed by: kevlo (initial version), hselasky Notes: svn path=/head/; revision=304332
* Switch to TX header format rather than directly manipulating headerPyun YongHyeon2016-08-181-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | structures. This simplifies mbuf copy operation to USB buffers as well as improving readability. The controller supports Microsoft LSOv1(aka TSO) but this change set does not include the support due to copying overhead to USB buffers and large amount of memory waste. Remove useless ZLP padding which seems to come from Linux. Required bits the code tried to set was not copied into USB buffer so it had no effect. Unlike Linux, FreeBSD USB stack automatically generates ZLP so no explicit padding is required in driver.[1] Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out of TX loop since updating counter is not cheap operation as it did long time ago and we already know how many number of packets were queued after exiting the loop. While here, fix a checksum offloading bug which will happen when upper stack computes checksum while H/W checksum offloading is active. The controller should be notified to not recompute the checksum in this case. Reviewed by: kevlo (initial version), hselasky Pointed out by: hselasky [1] Notes: svn path=/head/; revision=304326
* Rename cryptic RX filter constants with more readable ones.Pyun YongHyeon2016-08-181-7/+7
| | | | | | | No functional change. Notes: svn path=/head/; revision=304325
* Don't explicitly call MIIBUS_STATCHG() method handler. Link statePyun YongHyeon2016-08-181-5/+0
| | | | | | | | change should be handled by PHY driver. Some broken PHY H/Ws may need that workaround but it seems axge(4) don't use such PHYs. Notes: svn path=/head/; revision=304324
* Pass PHY location information and remove PHY access hack.Pyun YongHyeon2016-08-181-4/+1
| | | | Notes: svn path=/head/; revision=304323
* Create a USB_PNP_INFO and use it to export the existing PNPWarner Losh2015-12-111-0/+1
| | | | | | | | | | | | | | tables. Some drivers needed some slight re-arrangement of declarations to accommodate this. Change the USB pnp tables slightly to allow better compatibility with the system by moving linux driver info from start of each entry to the end. All other PNP tables in the system have the per-device flags and such at the end of the elements rather that at the beginning. Differential Review: https://reviews.freebsd.org/D3458 Notes: svn path=/head/; revision=292080
* Add Lenovo ThinkPad OneLink GigaLAN.Kevin Lo2015-04-071-0/+1
| | | | | | | | PR: 199184 Submitted by: Robin Karlsson Notes: svn path=/head/; revision=281183
* Make a bunch of USB debug SYSCTLs tunable, so that their value(s) canHans Petter Selasky2015-01-051-1/+1
| | | | | | | be set before the USB device(s) are probed. Notes: svn path=/head/; revision=276701
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-181-6/+6
| | | | Notes: svn path=/head/; revision=271832
* Fix performance problems with AXGE network adapter in RX direction:Hans Petter Selasky2014-07-131-9/+8
| | | | | | | | | | | | | - Remove 4 extra bytes from the ethernet payload. - The maximum RX buffer was incorrectly set. Increase it to 64K for now, until the exact limit is understood. - Enable hardware checksumming again. - Make hardware data structure packed. MFC after: 3 days Notes: svn path=/head/; revision=268582
* - Disable hardware checksumming until it is properly tested.Hans Petter Selasky2014-07-031-34/+29
| | | | | | | | | | | | - Don't discard frames if the dropped or error flag is set. - Don't remove the last 4-bytes of every packet. - Add extra range check for data position offset when receiving data. MFC after: 1 day PR: 191432 Notes: svn path=/head/; revision=268209
* Add proper rangechecks in "axge_rx_frame()" function andHans Petter Selasky2014-06-271-12/+21
| | | | | | | | | | fix receive loop header parsing. MFC after: 3 days PR: 191432 Notes: svn path=/head/; revision=267955
* - Improve performance by fixing incorrect Rx/Tx handlingKevin Lo2014-05-271-106/+91
| | | | | | | | - Rename definition of AXGE_* to reflect reality - Add new USB IDs Notes: svn path=/head/; revision=266738
* - Configure Rx bulkKevin Lo2014-05-211-16/+45
| | | | | | | - Announce flow control capability to PHY drivers Notes: svn path=/head/; revision=266490
* Remove some unused variables.Christian Brueffer2014-05-161-2/+0
| | | | | | | | Found with: Clang Static Analyzer MFC after: 2 weeks Notes: svn path=/head/; revision=266270
* Import the axge(4) driver for the ASIX AX88178A and AX88179 USB EthernetMark Johnston2013-11-191-0/+1023
adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179 supports USB 3.0. The driver was written by kevlo@ and lwhsu@, with a few bug fixes from me. MFC after: 2 months Notes: svn path=/head/; revision=258331