aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vnic
Commit message (Collapse)AuthorAgeFilesLines
* vnic nicvf: Program the common RSS key in network word orderKevin Bowling2026-09-181-6/+8
| | | | | | | | | | | | | | | | | | | | Replace the repeated hardware-reset key with rss_getkey(). Decode each eight-byte chunk with be64dec() into the register-word array before programming the five key registers. This matches the key serialization in DPDK's nicvf_rss_set_key(), added by commit 7694fab264ac666d62a4cae04f2979991ce64259 ("net/thunderx/base: add RSS and RETA configuration"). A raw copy into the word array on little-endian hosts would reverse bytes within each register relative to that convention. Preserve the CPI-algorithm gate, enabled hash fields, and round-robin indirection table. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59806
* vnic: Add missing #includeJohn Baldwin2026-05-191-0/+1
| | | | | | Reported by: bz, olivier Fixes: 6dc813301a17 ("sys: Use is_pci_device instead of direct comparisons to devclasses") Sponsored by: Chelsio Communications
* sys: Use is_pci_device instead of direct comparisons to devclassesJohn Baldwin2026-05-181-7/+2
| | | | | | Reviewed by: bz Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56997
* PHYS_TO_DMAP: Return a void * instead of a vm_offset_tJohn Baldwin2026-04-231-1/+2
| | | | | | | | | | Add a new PHYS_TO_DMAP_ADDR that still returns an address for use in places that only need an address and not a pointer. Effort: CHERI upstreaming Reviewed by: kib Sponsored by: AFRL, DARPA Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-091-3/+3
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* vnic: Fix a typo in a device messsageGordon Bergling2025-10-311-1/+1
| | | | | | - s/interrups/interrupts/ MFC after: 5 days
* bus_generic_detach: Delete children after detaching themJohn Baldwin2025-01-021-1/+0
| | | | | | | | | | | | | | | | | This provides better semantics as a standalone DEVMETHOD for device_attach as bus drivers should remove child devices they created as part of detach cleanup. The implementation calls bus_detach_children() first to permit child devices an opportunity to veto the detach operation. If that succeeds, device_delete_children() is used to delete the child devices. This requires fixing various drivers that were deleting devices explicitly (via a device_t pointer cached in the softc) after calling bus_generic_detach to stop doing that and just rely on bus_generic_detach to remove child devices. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47959
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-062-2/+4
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-252-2/+2
| | | | Sponsored by: Netflix
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-282-18/+3
| | | | | | | | | | | 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
* vnic: fix compilation of an IPv6 only kernelMichael Tuexen2024-02-061-1/+6
| | | | | MFC after: 1 week Sponsored by: Netflix, Inc.
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-276-6/+0
| | | | | | | | | | | | | | | | 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
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-168-16/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1611-22/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* vnic: Fix a typo in a source code commentGordon Bergling2023-08-021-1/+1
| | | | | | - s/Enabele/Enable/ MFC after: 3 days
* thunderx: fix potential sign extension issueEd Maste2023-03-011-1/+1
| | | | | | | | | | | Coverity reported a sign extension issue on rq->caching << 26 in the Linux ThunderX driver. (It appears Coverity Scan doesn't build arm64 objects in FreeBSD.) As done in Linux, add a cast. Fixes: 3c0086b81391 ("Raw import of ThunderX VNIC networking driver...") Sponsored by: The FreeBSD Foundation
* Mechanically convert vnic to IfAPIJustin Hibbits2023-02-076-26/+29
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37827
* vnic: work_done here only used for debugWarner Losh2022-10-251-1/+6
| | | | Sponsored by: Netflix
* vnic: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-095-22/+10
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-061-1/+1
|
* vnic: Use __diagused for variables only used in KASSERT().John Baldwin2022-04-132-5/+5
|
* vnic: Fix a typo in a commentGordon Bergling2021-10-021-1/+1
| | | | | | - s/setings/settings/ MFC after: 3 days
* Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste2021-08-085-5/+0
| | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
* vnic: add TODO list item for multicast filter supportEd Maste2021-07-281-0/+1
| | | | PR: 223573
* Fix the spelling of '*/' in the vnic driverAndrew Turner2021-07-271-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* vnic: add TODO list item for non-promisc modeEd Maste2021-07-282-4/+13
| | | | | | | Also drop ARM64TODO comments; this is an issue with this specific driver, not a general arm64 issue. PR: 223575
* vnic: clean up empty lines in .c and .h filesMateusz Guzik2020-09-013-4/+0
| | | | Notes: svn path=/head/; revision=365136
* remove extraneous double ;s in sys/Ed Maste2020-03-301-1/+1
| | | | Notes: svn path=/head/; revision=359441
* Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that processGleb Smirnoff2020-02-111-2/+2
| | | | | | | | | | incoming packets in taskqueue context. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D23518 Notes: svn path=/head/; revision=357772
* vnic: Relax PHY node matching after r336281.Mark Johnston2019-12-181-4/+7
| | | | | | | | | | | | | The phy name may apparently be followed by a number in some systems. Allow that. PR: 242654 Reported and tested by: Marcel <marcel@brickporch.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355887
* vnic: correct and simplify SIOCSIFFLAGSEd Maste2019-09-011-6/+6
| | | | | | | | | PR: 223573, 223575 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13028 Notes: svn path=/head/; revision=351664
* vnic: avoid NULL deref in error caseEd Maste2019-08-291-3/+2
| | | | | | | | | Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351603
* Fix vnic fallback PHY name matching after r334880.Mark Johnston2018-07-141-1/+2
| | | | | | | | | | | | | | In some cases it seems that the PHY mode can only be identified by matching against the corresponding device node name in the FDT. r334880 broke this for the case where the node name contains a unit address. Fix the problem by allowing a match in that case. Reviewed by: andrew, sbruno Tested by: sbruno Differential Revision: https://reviews.freebsd.org/D16259 Notes: svn path=/head/; revision=336281
* In the ThunderX BGX network driver we were skipping the NULL terminatorAndrew Turner2018-06-091-16/+16
| | | | | | | | | | | | when parsing the phy type, however this is included in the length returned by OF_getprop. To fix this stop ignoring the terminator. PR: 228828 Reported by: sbruno Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=334880
* Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_allocOleksandr Tymoshenko2018-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size. Notes: svn path=/head/; revision=332341
* Clean up OF_getprop_alloc APIOleksandr Tymoshenko2018-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | OF_getprop_alloc takes element size argument and returns number of elements in the property. There are valid use cases for such behavior but mostly API consumers pass 1 as element size to get string properties. What API users would expect from OF_getprop_alloc is to be a combination of malloc + OF_getprop with the same semantic of return value. This patch modifies API signature to match these expectations. For the valid use cases with element size != 1 and to reduce modification scope new OF_getprop_alloc_multi function has been introduced that behaves the same way OF_getprop_alloc behaved prior to this patch. Reviewed by: ian, manu Differential Revision: https://reviews.freebsd.org/D14850 Notes: svn path=/head/; revision=332310
* [ofw] fix errneous checks for OF_finddevice(9) return valueOleksandr Tymoshenko2018-03-201-1/+1
| | | | | | | | | | | | | | | OF_finddevices returns ((phandle_t)-1) in case of failure. Some code in existing drivers checked return value to be equal to 0 or less/equal to 0 which is also wrong because phandle_t is unsigned type. Most of these checks were for negative cases that were never triggered so trhere was no impact on functionality. Reviewed by: nwhitehorn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14645 Notes: svn path=/head/; revision=331229
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-211-1/+1
| | | | | | | | | | | | | | | | | | Uses of mallocarray(9). The use of mallocarray(9) has rocketed the required swap to build FreeBSD. This is likely caused by the allocation size attributes which put extra pressure on the compiler. Given that most of these checks are superfluous we have to choose better where to use mallocarray(9). We still have more uses of mallocarray(9) but hopefully this is enough to bring swap usage to a reasonable level. Reported by: wosch PR: 225197 Notes: svn path=/head/; revision=328218
* dev: make some use of mallocarray(9).Pedro F. Giffuni2018-01-131-1/+1
| | | | | | | | | | | | | | Focus on code where we are doing multiplications within malloc(9). None of these is likely to overflow, however the change is still useful as some static checkers can benefit from the allocation attributes we use for mallocarray. This initial sweep only covers malloc(9) calls with M_NOWAIT. No good reason but I started doing the changes before r327796 and at that time it was convenient to make sure the sorrounding code could handle NULL values. Notes: svn path=/head/; revision=327949
* Do pass removing some write-only variables from the kernel.Alexander Kabaev2017-12-253-7/+1
| | | | | | | | | | | | This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports. Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385 Notes: svn path=/head/; revision=327173
* vnic: apply hardware L3 checksum only for IPv4Ed Maste2017-12-051-3/+2
| | | | | | | | | | | | | | | Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4 should have header checksumming applied. Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379. Reviewed by: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13366 Notes: svn path=/head/; revision=326597
* Unbreak IPv6.Bjoern A. Zeeb2017-11-141-59/+68
| | | | | | | | | | | | | | | | No longer return ENXIO when trying to send an IPv6 packet in nicvf_sq_add_hdr_subdesc(). Restructure the code so that the upper layer protocol parts are agnostic of the L3 protocol (and no longer specific to IPv4). With this basic IPv6 packets go through. We are still seeing weird behaviour which needs further diagnosis. PR: 223669 In collaboration with: emaste MFC after: 3 days Notes: svn path=/head/; revision=325813
* vnic: report that the driver supports multicastEd Maste2017-11-141-1/+1
| | | | | | | | | | | | | The driver is currently hardcoded to force promiscuous mode, so all of the MAC filtering code is presently unused and multicast should "just work." Report to the higher layers that multicast is supported. PR: 223573 Reported by: bz Sponsored by: The FreeBSD Foundation, Packet.net (hardware) Notes: svn path=/head/; revision=325811
* vnic: apply BPF tap before passing packet to hardwareEd Maste2017-11-101-2/+3
| | | | | | | | | | | | | | Previously we passed tx packets to hardware via nicvf_tx_mbuf_locked and then to the BPF tap, with a possibly invalid mbuf which would result in a panic. PR: 223600 Discussed with: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation, Packet.net (hardware) Notes: svn path=/head/; revision=325683
* Rework BGX detection to support both new and old firmwareZbigniew Bodek2017-03-311-33/+156
| | | | | | | | | | | | | Improve existing BGX detection and adjust it to support both new and older ThunderX firmwares. Match BGX FDT nodes by name and reg. Match PHY instances by qlm-mode and name. Tested on Firmware Version: 2016-09-30 09:12:11 Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D9863 Notes: svn path=/head/; revision=316336
* Add the folowing set accessor functions for recently-added members of ifnetStephen J. Kiernan2017-01-311-14/+14
| | | | | | | | | | | | | | | | | | | structure: if_gethwtsomax(), if_sethwtsomax() - if_hw_tsomax if_gethwtsomaxsegcount(), if_sethwtsomaxsegcount() - if_hw_tsomaxsegcount if_gethwtsomaxsegsize(), if_sethwtsomaxsegsize() - if_hw_tsomaxsegsize Update em and vnic drivers which had already been coverted to use accessor functions for the other ifnet structure members. Reviewed by: erj Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8544 Notes: svn path=/head/; revision=313019
* INTRNG: Rework handling with resources. Partially revert r301453.Michal Meloun2016-08-192-4/+0
| | | | | | | | | | | | | | | | | | | | - Read interrupt properties at bus enumeration time and store it into global mapping table. - At bus_activate_resource() time, given mapping entry is resolved and connected to real interrupt source. A copy of mapping entry is attached to given resource. - At bus_setup_intr() time, mapping entry stored in resource is used for delivery of requested interrupt configuration. - For MSI/MSIX interrupts, mapping entry is created within pci_alloc_msi()/pci_alloc_msix() call. - For legacy PCI interrupts, mapping entry must be created within pcib_route_interrupt() by pcib driver itself. Reviewed by: nwhitehorn, andrew Differential Revision: https://reviews.freebsd.org/D7493 Notes: svn path=/head/; revision=304459
* INTRNG - change the way how an interrupt mapping data are providedSvatopluk Kraus2016-06-052-0/+4
| | | | | | | | | | | to the framework in OFW (FDT) case. This is a follow-up to r301451. Differential Revision: https://reviews.freebsd.org/D6634 Notes: svn path=/head/; revision=301453
* Fix VNIC module unloadingWojciech Macek2016-05-202-6/+26
| | | | | | | | | | | | Fix panics which were present when BGX and PF module were unloaded. Reviewed by: zbb Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6346 Notes: svn path=/head/; revision=300295