aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/neta/if_mvneta.c
Commit message (Collapse)AuthorAgeFilesLines
* neta: improve TCP LROMichael Tuexen2024-10-311-7/+1
| | | | | | | | | | | | Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46433 (cherry picked from commit 5203dcce2527fd235648e2b855a13f62247eb2de)
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-10-081-5/+0
| | | | | | | | | | | | | | | | | | 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 MFC note: This is only a partial MFC, as some drivers do not exist in stable/13 branch. The if_epair(4) drifts too much from stable/14 so not included in this MFC. (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc) (cherry picked from commit 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3)
* 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)
* neta: Fix MTU change sequenceKornel Dulęba2022-09-011-2/+6
| | | | | | | | | | | | | | | | | The IFF_DRV_RUNNING flag is used to see if the interface needs to be temporarily brought down during MTU change sequence. The problem here is that this flag is cleared in mvneta_stop_locked, resulting in the reinitialization logic never being executed after MTU has been changed. Fix that by saving the flag value before the interface is brought down. Reported by: Jérôme Tomczyk <jerome.tomczyk@stormshield.eu> Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Stormshield MFC after: 2 weeks (cherry picked from commit 97ecdc00ac5ac506f4119be9570d13de2d3a003a)
* neta: Fix a typo in a source code commentGordon Bergling2022-04-141-1/+1
| | | | | | - s/maintance/maintenance/ (cherry picked from commit 19ae05aad3dadb0963161b948166d7eee19b3fce)
* neta: Fix a typo in a source code commentGordon Bergling2022-04-091-1/+1
| | | | | | - s/immediatly/immediately/ (cherry picked from commit 592fcf6c455508b39342dbbf5725c85af9623245)
* neta: split fixed and in-band link status configurationSebastien Bini2022-03-291-5/+5
| | | | | | | | | | | | | Fixed-link mode requires different handling than the in-band managed connection. Update interrupt, link-up/down and autonegotiation settings for the former. Reviewed by: mw MFC after: 1 week Obtained from: Stormshield Differential Revision: https://reviews.freebsd.org/D34394 (cherry picked from commit 231237bbb0e803f9047c235cd6b5878f70e6c5eb)
* mvneta: Unconditionally print an error message if mii_attach() failsMark Johnston2022-01-111-4/+2
| | | | | | The error message is useful for diagnosing mvneta_attach() failures. (cherry picked from commit ed166a0173247e267c507ebd0ec03cb04aaf49ee)
* mvneta: Fix MTU update sequenceKornel Duleba2021-09-281-19/+18
| | | | | | | | | | | | | | After MTU is updated we might start using allocating RX buffers from different pool. (MJUM9BYTES vs MCLBYTES) Because of that we need to update the RX buffer size in hardware. Previously it was done only when the interface was up, which is incorrect since MTU can be changed at any time. Differential revision: https://reviews.freebsd.org/D31724 Sponsored by: Stormshield Obtained from: Semihalf MFC after: 2 weeks Reviewed by: wma (cherry picked from commit 5438ef47e377d659acf7f97a66fe418223f2c847)
* mvneta: Acquire the softc lock before clearing the MIBMark Johnston2021-01-091-0/+2
| | | | | Reported by: Andrei Martin <andrei.cos.martin@gmail.com> MFC with: caf552a60719
* mvneta: Fix 64-bit MIB readsMark Johnston2021-01-041-18/+18
| | | | | | | | | | | | It appears we must read MIB values as 2 4-byte words, lower address first. A single 8-byte MIB read returns the value with the lower 4 bytes copied into the upper 4 bytes, resulting in bogus byte counter values. Reviewed by: mw MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D27870
* Fix TX csum handling in if_mvnetaMarcin Wojtas2020-08-011-5/+2
| | | | | | | | | | | | | | | The mvneta device requires MVNETA_TX_CMD_L4_CHECKSUM_NONE bit to be set in the tx descriptor is checksum not required. However, mvneta_tx_set_csumflag() is not setting this flag currently, causing the hardware to randomly corrupt IP header during transmission. This affects injected IPv4 packets that skips kernel IP stack processing (e.g. DHCP), as well as all IPv6 packets, since the driver currently does not offload csum for IPv6. The fix is to remove all the early return paths from mvneta_tx_set_csumflag() which do not set the MVNETA_TX_CMD_L4_CHECKSUM_NONE flag. PR: 248306 Submitted by: Mike Cui <cuicui@gmail.com> Reported by: Mike Cui <cuicui@gmail.com> Notes: svn path=/head/; revision=363759
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-8/+9
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=358333
* Implement jumbo frame support in mvneta driverMarcin Wojtas2020-02-081-10/+40
| | | | | | | | | | | | | | | | This patch introduces processing of the frames up to 9kB by the mvneta driver. Some versions of this NIC limit TX checksum offloading, depending on the frame size, so add appropriate handling of this feature. Submitted by: Kornel Duleba Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D23225 Notes: svn path=/head/; revision=357676
* Destroy RX DMA tag on detach in mvneta driverMarcin Wojtas2020-02-081-0/+2
| | | | | | | | | | | | | This patch fixes deinitialization sequence of the mvneta driver by adding missing bus_dma_tag_destroy call. Submitted by: Kornel Duleba <mindal@semihalf.com> Obtained from: Semihalf MFC after: 1 week Sponsored by: Stormshield Notes: svn path=/head/; revision=357675
* Update mvneta/e6000sw for new DSA Device Tree BindingsMarcin Wojtas2019-03-231-12/+31
| | | | | | | | | | | | | | | | | | | In the latest Linux kernel revisions the DSA (Distributed Switch Architecture) device tree binding was changed. Instead of the top level dsa@ node, the switch and its ports is represented as a child node of the mdio bus. With that other modifications were added, such as relation with the ethernet port of the SoC. Adjust e6000sw etherswitch and mvneta drivers to that. Tested on Armada 3720 EspressoBin and Armada 388 Clearfog Pro boards. Submitted by: Bert JW Regeer <xistence@0x58.com> Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D19036 Notes: svn path=/head/; revision=345432
* Disable the auto negotiation if the port is set to fixed-link.Luiz Otavio O Souza2018-08-141-0/+1
| | | | | | | | | | Tested on SG-3100 (ARMADA38X) and Espresso.bin (A37x0). Fixes the network on espresso.bin. Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=337811
* Make this compile if NO_SYSCTL_DESCR is defined.Nick Hibma2017-09-281-4/+5
| | | | | | | | | Defining a variable with the description and then only use it in the SYSCTL declaration led to an unused variable warning. In the SYSCTL the passed value is discarded using __DESCR. Notes: svn path=/head/; revision=324089
* Fix gcc compilation issues in the mvneta driverMarcin Wojtas2017-09-251-12/+13
| | | | | | | | | | | Compiling mvneta driver with gcc unveiled two issues, that required fixing. Reported by: andrew Obtained from: Semihalf Notes: svn path=/head/; revision=323983
* Add support for Armada 3700 in the NETA driverMarcin Wojtas2017-09-091-6/+25
| | | | | | | | | | | | | | | This patch enables using NETA driver on Marvell Armada 3700 SoC by introducing new compatible string, modifying clock source obtaining and also excluding unnecessary parts. The driver is added as a build option for arm64 platforms as well. Submitted by: Patryk Duda <pdk@semihalf.com> Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12258 Notes: svn path=/head/; revision=323362
* Store virtual address of buffer in mvneta_rx_ringMarcin Wojtas2017-09-091-2/+2
| | | | | | | | | | | | | | Now the virtual address of received buffer is taken from a software ring. Thanks to this, we can use the NETA driver on 64 bits architecture and avoid 32-bit buf_cookie descriptor field limitation. Submitted by: Patryk Duda <pdk@semihalf.com> Obtained from: Semihalf Sponsored by: Semihalf Differential Revision: https://reviews.freebsd.org/D12257 Notes: svn path=/head/; revision=323361
* Allow the use of extended media types with if_mvneta, so it can report 2.5GLuiz Otavio O Souza2017-06-201-2/+3
| | | | | | | | | | | speeds properly. While here remove a couple of stray white spaces. Sponsored by: Rubicon Communications, LLC (Netgate) Notes: svn path=/head/; revision=320158
* Introduce Armada 38x/XP network controller supportZbigniew Bodek2017-06-131-0/+3570
This patch contains a new driver for the network unit of Marvell Armada 38x/XP SoCs, called NETA. This support was thoroughly tested and optimised in terms of stability and performance. Additional hardware features, like Buffer Management (BM) or Parser and Classifier (PnC) will be progressively supported as needed. Submitted by: Fabien Thomas <fabien.thomas@stormshield.eu> Arnaud Ysmal <arnaud.ysmal@stormshield.eu> Zbigniew Bodek <zbb@semihalf.com> Michal Mazur <mkm@semihalf.com> Bartosz Szczepanek <bsz@semihalf.com> Marcin Wojtas <mw@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield (main development) Netgate (cleanup and upstreaming) Differential revision: https://reviews.freebsd.org/D10706 Notes: svn path=/head/; revision=319907