summaryrefslogtreecommitdiff
path: root/sys/dev/oce
AgeCommit message (Collapse)Author
2025-12-13oce(4): Fix a typo in a device debug messageGordon Bergling
- s/depricated/deprecated/ MFC after: 3 days
2025-10-31oce(4): Fix a couple of typos in a sysctl descriptionsGordon Bergling
- s/Fragements/Fragments/ - s/Recived/Received/ - s/Alignmnet/Alignment/ MFC after: 5 days
2025-01-27Revert "oce(4): deprecate"Ed Maste
These are reportedly still in fairly wide use. We strongly encourage folks with this hardware to post a dmesg on dmesgd.nycbug.org. This reverts commit 4591322980a37d6ee38a3ed70569366e16ca71f6. Discussed with: brooks Sponsored by: The FreeBSD Foundation
2024-11-29tcp: extend the use of the th_flags accessor functionRichard Scheffenegger
Formally, there are 12 bits for TCP header flags. Use the accessor functions in more (kernel) places. No functional change. Reviewed By: cc, #transport, cy, glebius, #iflib, kbowling Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D47063
2024-06-28net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang
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
2024-06-16oce: Use device_set_descf()Mark Johnston
No functional change intended. MFC after: 1 week
2024-04-18oce(4): Fix a typo in a source code commentGordon Bergling
- s/addres/address/ MFC after: 3 days
2023-08-16sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-06-15oce(4): deprecateBrooks Davis
The Emulex OneConnect NIC driver hasn't seen any commits other than ioctl bug fixes (some severe) and sweeping commits since 2016. There is no indication of new parts since 2014 or earlier. As such, deprecate the driver with the aim of removing it prior to FreeBSD 15. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40531
2023-06-15oce(4): Don't directly access usespaceBrooks Davis
Replace direct stores to userspace addresses (never safe and broken on modern CPUs) with a copyout. Use a static assert on the size to ensure we don't overflow the field. Reviewed by: markj, jhb Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D40519
2023-04-17net: replace IFF_KNOWSEPOCH with IFF_NEEDSEPOCHGleb Smirnoff
Expect that drivers call into the network stack with the net epoch entered. This has already been the fact since early 2020. The net interrupts, that are marked with INTR_TYPE_NET, were entering epoch since 511d1afb6bf. For the taskqueues there is NET_TASK_INIT() and all drivers that were known back in 2020 we marked with it in 6c3e93cb5a4. However in e87c4940156 we took conservative approach and preferred to opt-in rather than opt-out for the epoch. This change not only reverts e87c4940156 but adds a safety belt to avoid panicing with INVARIANTS if there is a missed driver. With INVARIANTS we will run in_epoch() check, print a warning and enter the net epoch. A driver that prints can be quickly fixed with the IFF_NEEDSEPOCH flag, but better be augmented to properly enter the epoch itself. Note on TCP LRO: it is a backdoor to enter the TCP stack bypassing some layers of net stack, ignoring either old IFF_KNOWSEPOCH or the new IFF_NEEDSEPOCH. But the tcp_lro_flush_all() asserts the presence of network epoch. Indeed, all NIC drivers that support LRO already provide the epoch, either with help of INTR_TYPE_NET or just running NET_EPOCH_ENTER() in their code. Reviewed by: zlei, gallatin, erj Differential Revision: https://reviews.freebsd.org/D39510
2023-02-07Mechanically convert oce(4) to IfAPIJustin Hibbits
Reviewed By: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37829
2022-05-09oce: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-04-20oce(4): Fix a typo in a sysctl descriptionGordon Bergling
- s/interupt/interrupt/ MFC after: 3 days
2022-04-07oce: Remove unused variables.John Baldwin
2021-12-18if_oce: fix epoch handlingMichael Tuexen
Thanks to gallatin@ for suggesting the patch. PR: 260330 Reported by: Vincent Milum Jr. Reviewed by: gallatin, glebius Tested by: Vincent Milum Jr. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D33395
2021-08-28Fix some common typos in source code commentsGordon Bergling
- s/priviledged/privileged/ - s/funtion/function/ - s/doens't/doesn't/ - s/sychronization/synchronization/ MFC after: 3 days
2021-05-26oce: Fix handling of m_pullup() errors in oce_tso_setup()Mark Johnston
m_pullup() frees the input mbuf chain upon a failure. Set *mpp to NULL in this case to ensure that the caller does not free the chain again. PR: 224928 Submitted by: Lv Yunlong <lylgood@foxmail.com> (original version) MFC after: 1 week
2020-09-01oce: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365187
2020-06-20oce(4): Account and trace mbufs before handing to hwConrad Meyer
Once tx mbufs have been handed to hardware, nothing serializes the tx path against completion and potential use-after-free of the outbound mbuf. Perform accounting and BPF tap before queueing to hardware to avoid this race. Submitted by: Steve Wirtz <steve_wirtz AT dell.com> Reviewed by: markj, rstone Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25364 Notes: svn path=/head/; revision=362439
2020-06-15Avoid trying to toggle TSO twiceRyan Moeller
Remove TSO from the toggle mask when automatically disabled by TXCKSUM* in various NIC drivers. Reviewed by: hselasky, np, gallatin, jpaetzel Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25120 Notes: svn path=/head/; revision=362201
2020-02-27Remove FreeBSD 7-9 support from oceWarner Losh
Use newer pci_find_cap API now that the need to remap the old API is gone. Notes: svn path=/head/; revision=358390
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
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
2019-12-26random(9): Deprecate random(9), remove meaningless srandom(9)Conrad Meyer
srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducible sequence of outputs on the basis of a specific srandom() seed because the global state was shared by all kernel contexts. As such, removing it is literally indistinguishable to random(9) consumers (as compared with retaining it). Mark random(9) as deprecated and slated for quick removal. This is not to say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. It/they just won't be random(9), as it exists today, in either name or implementation. Before random(9) is removed, a replacement will be provided and in-tree consumers will be converted. Note that despite the name, the random(9) interface does not bear any resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller LCG used in libc rand(3). Notes: svn path=/head/; revision=356097
2019-12-23oce: Disallow the passthrough ioctl for unprivileged users.Mark Johnston
A missing check meant that unprivileged users could send passthrough commands to the device firmware. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356047
2019-12-18oce: Tighten input validation in the SIOCGI2C handler.Mark Johnston
Missing validation meant that it was possible to read 8 bytes beyond the end of sfp_vpd_dump_buffer. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: delphij, ram MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22859 Notes: svn path=/head/; revision=355885
2019-11-04net: prefer ETHER_ADDR_LEN over ETH_ADDR_LENEric Joyner
A couple of drivers and one place in if.c use ETH_ADDR_LEN, even though net/ethernet.h provides an equivalent ETHER_ADDR_LEN definition. Cleanup all of the locations which refer to ETH_ADDR_LEN to use the standard ETHER_ADDR_LEN instead. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: erj@, jpaetzel@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21239 Notes: svn path=/head/; revision=354343
2019-10-21Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff
Notes: svn path=/head/; revision=353852
2019-08-06oce(4): potential out of bounds access before vector validationKyle Evans
Submitted by: Augustin Cavalier <waddlesplash@gmail.com> Obtained from: Haiku (ec2b89264cfc63e05e611cce82cc449197403aa4) MFC after: 3 days Notes: svn path=/head/; revision=350630
2019-05-28Fix array out of bound panic introduced in r306219.Alexander Motin
As I see, different NICs in different configurations may have different numbers of TX and RX queues. The code was assuming 1:1 mapping between event queues (interrupts) and TX/RX queues. Since number of interrupts is set to maximum of TX and RX queues, when those two are different, the system is doomed. I have no documentation or deep knowledge about this hardware, so this change is based on general observations and code reading. If some of my guesses are wrong, please do better. I just confirmed HP NC550SFP NICs are working now. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=348332
2019-01-08Added support for the SIOCGI2C ioctl.Xin LI
Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com> Obtained from: Broadcom MFC after: 2 weeks Notes: svn path=/head/; revision=342856
2018-09-26Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,Warner Losh
mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existing pci device tables, and has no probe / attach code changes. Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Approved by: re (glen) Notes: svn path=/head/; revision=338949
2018-05-18ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy
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
2018-05-01Add ability to perform a firmware reset during driver initialization.Josh Paetzel
Required by Lancer Gen 5 hardware. Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com> Obtained from: Broadcom Notes: svn path=/head/; revision=333146
2018-03-30Use an accessor function to access ifr_data.Brooks Davis
This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). This is believed to be sufficent to fully support ifconfig on 32-bit systems. Reviewed by: kib Obtained from: CheriBSD MFC after: 1 week Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900 Notes: svn path=/head/; revision=331797
2017-11-20sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
2016-09-22Update oce to version 11.0.50.0Josh Paetzel
Submitted by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Notes: svn path=/head/; revision=306219
2016-09-22Revert r306148 to fix buildConrad Meyer
Requested by: jpaetzel Reported by: Larry Rosenman <ler at lerctr.org>, Jenkins Notes: svn path=/head/; revision=306149
2016-09-21Update oce driver to 11.0.50.0Josh Paetzel
Submitted by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Notes: svn path=/head/; revision=306148
2016-04-10Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni
Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
2016-04-01tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplicationSepherosa Ziehau
And factor out tcp_lro_rx_done, which deduplicates the same logic with netinet/tcp_lro.c Reviewed by: gallatin (1st version), hps, zbb, np, Dexuan Cui <decui microsoft com> Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5725 Notes: svn path=/head/; revision=297482
2016-03-01Remove taskqueue_enqueue_fast().John Baldwin
taskqueue_enqueue() was changed to support both fast and non-fast taskqueues 10 years ago in r154167. It has been a compat shim ever since. It's time for the compat shim to go. Submitted by: Howard Su <howard0su@gmail.com> Reviewed by: sephe Differential Revision: https://reviews.freebsd.org/D5131 Notes: svn path=/head/; revision=296272
2016-02-27Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
2016-02-01These files were getting sys/malloc.h and vm/uma.h with header pollutionGleb Smirnoff
via sys/mbuf.h Notes: svn path=/head/; revision=295126
2015-05-22CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim
years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
2015-02-13srandom has no influence on read_random, at least not this late...John-Mark Gurney
Notes: svn path=/head/; revision=278695
2014-12-01Start process of removing the use of the deprecated "M_FLOWID" flagHans Petter Selasky
from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275358
2014-10-21Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky
- Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
2014-09-22Improve transmit sending offload, TSO, algorithm in general.Hans Petter Selasky
The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. Reviewed by: adrian, rmacklem Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=271946
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849