aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/liquidio
Commit message (Collapse)AuthorAgeFilesLines
* lio: Avoid out-of-bounds read or write MAC addressZhenlei Huang8 days2-8/+6
| | | | | | | | | | | | While here, replace loop copying the MAC address with memcpy() for better readability. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54177 (cherry picked from commit 094626d3a5009a56bf1b763dbdfc681ce371dc99) (cherry picked from commit c162d7febbc83c1d877876b18ee864213dceca51)
* liquidio(4): Stop checking for failures from ↵Zhenlei Huang2024-09-304-20/+0
| | | | | | | | | malloc/taskqueue_create/buf_ring_alloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 (cherry picked from commit 57cd8f27b727e7a87312f6f141cfa13807dc81a0)
* ifnet: Remove if_getamcount()Mark Johnston2024-09-201-1/+1
| | | | | | | | | | | | | | | | All uses of this function were incorrect. if_amcount is a reference count which tracks the number of times the network stack internally set IFF_ALLMULTI. (if_pcount is the corresponding counter for IFF_PROMISC.) Remove if_getamcount() and fix up callers to get the number of assigned multicast addresses instead, since that's what they actually want. Sponsored by: Klara, Inc. Reviewed by: zlei, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46523 (cherry picked from commit 408c909dc64f77d2696d6fec77a2e0b00255cf96)
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-07-121-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 (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
* liquidio: Use device_set_descf()Mark Johnston2024-06-271-4/+2
| | | | | | | | No functional change intended. MFC after: 1 week (cherry picked from commit 1794a0a87e0cecee1ef63fcf4f0a8a6cf6945dc8)
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1631-31/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Mechanically convert liquidio(4) to IfAPIJustin Hibbits2023-02-078-62/+62
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37828
* kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.John Baldwin2022-09-221-2/+2
| | | | | | Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36549
* lio: Remove unneeded include.Zhenlei Huang2022-09-211-1/+0
| | | | | Reviewed by: adiran, imp Differential Revision: https://reviews.freebsd.org/D36501
* lio: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-091-2/+1
|
* lio: Quiet set but unused warnings.John Baldwin2022-04-064-15/+7
| | | | | | | | | - Remove unused variables. - Mark a value only used in debug traces as unused. - Remove variables only used for device register reads with side-effects with void casts on the read.
* Fix some common typos in source code commentsGordon Bergling2021-08-141-1/+1
| | | | | | | - s/struture/structure/ - s/structre/structure/ MFC after: 5 days
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-39/+36
| | | | | | | | | | | | | | | | | | | 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
* Mark lio taskqueue as requiring network epoch.Gleb Smirnoff2020-02-111-1/+1
| | | | Notes: svn path=/head/; revision=357773
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-211-23/+18
| | | | Notes: svn path=/head/; revision=353849
* Separate kernel crc32() implementation to its own header (gsb_crc32.h) andXin LI2019-06-171-0/+1
| | | | | | | | | | | | | rename the source to gsb_crc32.c. This is a prerequisite of unifying kernel zlib instances. PR: 229763 Submitted by: Yoshihiro Ota <ota at j.email.ne.jp> Differential Revision: https://reviews.freebsd.org/D20193 Notes: svn path=/head/; revision=349151
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* Eliminate the arena parameter to kmem_free(). Implicitly this corrects anAlan Cox2018-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | error in the function hypercall_memfree(), where the wrong arena was being passed to kmem_free(). Introduce a per-page flag, VPO_KMEM_EXEC, to mark physical pages that are mapped in kmem with execute permissions. Use this flag to determine which arena the kmem virtual addresses are returned to. Eliminate UMA_SLAB_KRWX. The introduction of VPO_KMEM_EXEC makes it redundant. Update the nearby comment for UMA_SLAB_KERNEL. Reviewed by: kib, markj Discussed with: jeff Approved by: re (marius) Differential Revision: https://reviews.freebsd.org/D16845 Notes: svn path=/head/; revision=338318
* Eliminate kmem_alloc_contig()'s unused arena parameter.Alan Cox2018-08-201-2/+2
| | | | | | | | | Reviewed by: hselasky, kib, markj Discussed with: jeff Differential Revision: https://reviews.freebsd.org/D16799 Notes: svn path=/head/; revision=338107
* Fix build of liquidio with base gcc on i386Dimitry Andric2018-06-131-2/+2
| | | | | | | | | | | | | Some casts from pointers to uint64_t and back in lio_main.c cause base gcc on i386 to warn "cast from pointer to integer of different size", and vice versa. Add additional casts to uintptr_t to suppress these. Reviewed by: sbruno MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15754 Notes: svn path=/head/; revision=335034
* tcp_lro.h requires <netinet/in.h>, include it directly instead ofAndrey V. Elsukov2018-06-051-0/+1
| | | | | | | indirect inclusion trough if_gif.h Notes: svn path=/head/; revision=334667
* 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
* Revert r327828, r327949, r327953, r328016-r328026, r328041:Pedro F. Giffuni2018-01-212-7/+7
| | | | | | | | | | | | | | | | | | 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-132-7/+7
| | | | | | | | | | | | | | 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
* Enable i386 build of the Cavium LiquidIO driver (lio) module.Sean Bruno2017-10-2510-90/+128
| | | | | | | | | | Submitted by: pkanneganti@cavium.com (Prasad V Kanneganti) MFC after: 1 week Sponsored by: Cavium Networks Differential Revision: https://reviews.freebsd.org/D12415 Notes: svn path=/head/; revision=324994
* The diff is the initial submission of Cavium Liquidio 2350/2360 10/25GSean Bruno2017-09-1231-0/+16122
Intelligent NIC driver. The submission conconsists of firmware binary file and driver sources. Submitted by: pkanneganti@cavium.com (Prasad V Kanneganti) Relnotes: Yes Sponsored by: Cavium Networks Differential Revision: https://reviews.freebsd.org/D11927 Notes: svn path=/head/; revision=323509