aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit a5fa4dba6e2e from llvm-project (by PiJoules):HEADmainDimitry Andric89 min.4-0/+70
| | | | | | | | | | [compiler-rt] Add interceptors for free_[aligned_]sized for asan+hwasan (#189109) This avoids a jemalloc assertion when running sanitized applications against glib, which uses free_sized(3). PR: 298943 MFC after: 1 week
* Merge commit 681c2ee4dfbf from llvm-project (by Justin King):Dimitry Andric89 min.7-60/+161
| | | | | | | | | | | | | | | | | | | | | asan: refactor interceptor allocation/deallocation functions (#145087) Do some refactoring to allocation/deallocation interceptors. Expose explicit per-alloc_type functions and stop accepting explicit AllocType. This ensures we do not accidentally mix. NOTE: This change rejects attempts to call `operator new(<some_size>, static_cast<std::align_val_t>(0))`. For https://github.com/llvm/llvm-project/issues/144435 Signed-off-by: Justin King <jcking@google.com> This a prerequisite for adding sanitizer interceptors for free_sized(3) and free_aligned_sized(3). PR: 298943 MFC after: 1 week
* compiler-rt: enable use of .preinit_array after ef758b59a44eDimitry Andric89 min.1-5/+2
| | | | | | | | | | After base ef758b59a44e6b5b2d2dc178b97c01cde1b34570 we can enable usage of .preinit_array in compiler-rt's sanitizers. The comment that stated "On FreeBSD, .preinit_array functions are called with rtld_bind_lock writer lock held. It will lead to dead lock ..." can also be removed. PR: 298943 MFC after: 1 week
* man.4: Create if_mgb.4 symlink on supported architectures only.Juraj Lutter2 hours2-2/+3
| | | | | | Fixes: 05c49e2aa643 ("man: Link mgb.4 to if_mgb.4") Fixes: e0a5aa37c1ef Differential revision: https://reviews.freebsd.org/D60551
* man4: Only link mgb.4 to if_mgb.4 where mgb.4 is installedLi-Wen Hsu3 hours1-1/+1
| | | | | | | | | mgb.4 is only installed on amd64 and i386, move the MLINKS entry into the amd64/i386 block next to _mgb.4. Fixes: 05c49e2aa643 ("man: Link mgb.4 to if_mgb.4") MFC after: 3 days Sponsored by: The FreeBSD Foundation
* contrib/bc: remove vs sub-directoryStefan Eßer3 hours9-1055/+1
| | | | | | | | Some of the files in the vs sub-directory are checked out with CRLF line breaks via .getattributes. This causes issues when checking out the source tree with other tools that operate on Git repositories like "got". Remove the vs sub-directory from the contrib tree, since it is not required on FreeBSD.
* netgraph/ng_ksocket: Enter epoch on NG_SEND_DATA_ONLYPouria Mousavizadeh Tehrani5 hours1-1/+8
| | | | | | | | | | | The work queued by ng_send_fn() is intentionally processed outside of the epoch in ngthread(). It is ng_ksocket's responsibility to enter epoch if it decides to send data from such work. Reviewed by: glebius Fixes: 104827151e2a ("ng_iface: don't recursively enter epoch ...") Differential Revision: https://reviews.freebsd.org/D60589
* LinuxKPI: use LINUXKPI_DEBUG to determine on witness lock tracingBjoern A. Zeeb6 hours10-13/+42
| | | | | | | | | | | | | | | | | | | | LinuxKPI by default tells witness to ignore the locks, which is unhelpful in case of panics like 'panic: sleeping thread holds lnxspin'. While I have edited the lock initialitzation manually in the past, make this dependent on both LINUXKPI_DEBUG and WITNESS. Define an internal _LKPI_MTX_NOWITNESS (and equivalent for other lock types used) and set them accordingly in kconfig.h, a file automatically included to all LinuxKPI compiled code (like global.h). (*) In addition, in the debug case, also define WITNESS_ALL to get file, line, and lock name as a lock name rather than just, e.g., lnxspin. (*) We will need another follow-up as -include ordering is currently wrong for LinuxKPI modules. See D60207. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D59231
* LinuxKPI: introduce LINUXKPI_DEBUG to enable LinuxKPI debuggingBjoern A. Zeeb6 hours5-2/+10
| | | | | | | | | | | | | | | | This allows us to build kernels which will (if the sysctl is enabled too) show pr_debug() and pr_devel() output. Enable it by default for debug kernels. This option can later also be used for other LinuxKPI parts, like skbuffs, netdevice, rcu, ... to conditionally compile in debugging support to further justify its existence beyond an in-code #define. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D54060
* LinuxKPI: re-implement pm_runtime.hBjoern A. Zeeb6 hours1-30/+134
| | | | | | | | | | | | | | | | | | | | | The original implementation was based on OpenBSD under public domain but just defined the functions to void. FreeBSD later extended the file with more inline functions or dealing with differences in Linux versions. This rework tries to group some functions, adds properly typed arguments and return values in some cases. It further adjusts return values based on the !CONFIG_PM expectations. Lastly pr_debug() calls are added so we could see if/how much these functions are used in new/other works rather than code just compiling but the functions entirely being ignored without the knowledge of the person porting code. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58169
* LinuxKPI; factor out parts of device.h into device/devres.hBjoern A. Zeeb6 hours2-52/+71
| | | | | | | | | | | | | | | | | In [1] it was pointed out that devm_kmemdup_* have moved apparently in Linux 7.0 into their own device/devres.h header file from device.h. Move them and other parts (some being dependencies) along. device/devres.h gets included from device.h so all that changes is prototype, macro, and inline function ordering. This should prepare us in case drivers start directly including the sub-header. It also helps to keep device.h more reasable. Suggested by: dumbbell (in D56396) [1] MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D60213
* lindebugfs: implement debugfs_create_devm_seqfile()Bjoern A. Zeeb6 hours2-0/+47
| | | | | | | | | | | | | | | | | | Implement debugfs_create_devm_seqfile() keyed by device and a read function. This was implemented months ago in order to support debugfs with mt76 but hasn't been exercised since. The code does not really seem to belong in lindebugfs, but also does not really fit into debugfs.h (rather fs.h?); leave it here with a comment for now as neither dumbbell nor I could come up with a better place. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D57524
* ng_ubt: ignore further MediaTek USB BT devicesBjoern A. Zeeb6 hours1-0/+10
| | | | | | | | | | Following 8b21c469dbd6 add more entries for various MT BT USB VPI combinations given we currently do not support any of them. Suggested by: thierry (while testing MT7920 wireless) MFC after: 3 days Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D60279
* tests/libc: only build brk_test where libc provides sbrkXiaoqiang Zhao6 hours1-1/+2
| | | | | | | | | | | | | | Replace the exclusion list with an allowlist of the architectures whose libc exports brk/sbrk: amd64, i386, arm and powerpc. On aarch64, riscv and loongarch libc does not export those symbols and the test cannot run, so do not build it there. New architectures now default to not building the test unless brk support is added. MFC after: 1 week Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com> Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D60357
* tests/libc: use an allowlist for sbrk in NetBSD-derived testsXiaoqiang Zhao6 hours2-7/+21
| | | | | | | | | | | sbrk is obsolete and libc only provides it on amd64, arm, i386 and powerpc. Replace the growing exclusion lists in t_dir.c and t_mlock.c with a single positive HAVE_SBRK definition per file, so architectures without sbrk need not be enumerated as they are added. Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com> Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D60358
* Revert "tests/libc: use an allowlist for sbrk in NetBSD-derived tests"Enji Cooper7 hours2-21/+7
| | | | | | Need to update the commit message. This reverts commit 36b849b5c76406bb6d9341bfb1a7f16ae5c189c9.
* tests/libc: use an allowlist for sbrk in NetBSD-derived testsXiaoqiang Zhao7 hours2-7/+21
| | | | | | | | | | | sbrk is obsolete and libc only provides it on amd64, arm, i386 and powerpc. Replace the growing exclusion lists in t_dir.c and t_mlock.c with a single positive HAS_SBRK definition per file, so architectures without sbrk need not be enumerated as they are added. Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com> Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D60358
* rtld: release rtld_bind_lock around calls to .preinit_array initializersKonstantin Belousov7 hours1-3/+5
| | | | | | | | | | | We unlock the bind lock around .init calls anyway. Also, the main object cannot be unloaded. Reported and reviewed by: dim PR: 298943 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60588
* if_gre(4): Cleanup unused RSS macrosPouria Mousavizadeh Tehrani9 hours1-15/+0
| | | | | | | | | RSS hash calculations no longer depend on RSS macro. Therefore, remove unused macros and its XOR fallback. Reviewed by: adrian Fixes: 9c55b2e8cd6b ("rss: Enable portions of RSS globally to ...") Differential Revision: https://reviews.freebsd.org/D60556
* rtld: fix indentKonstantin Belousov9 hours1-2/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* nmount: Introduce the "check_fsid" optionGleb Popov10 hours4-14/+316
| | | | | | | | See the manpage addition for rationale Reviewed by: ziaee, kib Approved by: ziaee, kib Differential Revision: https://reviews.freebsd.org/D59930
* if_me: Do not reuse gre(4)'s static sysctl OID numberR. Christian McDonald11 hours1-1/+1
| | | | | | | | | | | | | | | | | | | | | if_me(4) registers its net.link.me node with the static OID number IFT_TUNNEL, the same number if_gre(4) has used for net.link.gre since 2003, so the two tunnel drivers collide under net.link. Until d35c4cfad580 that only printed a warning and left two nodes with the same number; since then sysctl_register_oid() panics, so loading if_me after if_gre (or the other way round) takes the box down: kldload if_gre kldload if_me panic: sysctl: OID number(131) is already in use for 'me' Use OID_AUTO like the other tunnel drivers. Nothing addresses the node by number. Reviewed by: ae MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D60536
* riscv/pmap.c: Don't pass hartid map to 'smp_rendezvous_cpus'Bojan Novković12 hours4-14/+40
| | | | | | | | | | | | | | | | The pm_active bitmask is indexed by hart IDs which can differ from CPU IDs. `pmap_invalidate_range_svinval` assumes that the map is indexed by CPU IDs, which is wrong and causes remote TLB invalidations on unrelated CPUs. Fix this by adding a routine that converts a hart-indexed bitmask to a CPU ID-indexed bitmask. While we're here, fix a similar issue in `pmap_active_cpus`. Fixes: 99360212c739 ("riscv/pmap.c: Add an Svinval-aware variant of pmap_invalidate_range") Reported by: markj Reviewed by: markj, mhorne Differential Revision: https://reviews.freebsd.org/D60072
* man: Link mgb.4 to if_mgb.4Juraj Lutter12 hours1-0/+1
| | | | | | | | | For consistency, create a symbolic link from mgb.4 to also if_mgb.4 Reviewed by: #manpages, ziaee, emaste Differential Revision: https://reviews.freebsd.org/D60551 MFC after: 3 days
* acl(9): expound on NFSv4 constants' meaningsEnji Cooper17 hours1-1/+18
| | | | | | | | | | | This change adds missing documentation for various NFSv4 constants supported by acl(9). Bump `.Dd` for the change. MFC after: 1 week Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D58736
* zfs: drop duplicate `vfs.zfs.metaslab.condense_pct` sysctlChristos Longros17 hours1-13/+0
| | | | | | | | | | | | | | | | | `metaslab.c` already registers this tunable via `ZFS_MODULE_PARAM`, so the `SYSCTL_UINT` here is a second registration of the same leaf. This resulted in messages like: ``` sysctl_register_oid: can't re-use a leaf (vfs.zfs.metaslab.condense_pct) ``` Remove the duplicate sysctl registration, as upstream (OpenZFS) did. MFC after: 1 week Signed-off-by: Christos Longros <chris.longros@gmail.com> Reviewed by: imp, mm, ngie Differential Revision: https://reviews.freebsd.org/D57721
* libalias: index fully specified inbound links by remote endpointPaulo Fragoso22 hours3-43/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Inbound lookups find the (alias address, alias port, link type) group with a splay tree and then walk grp->full, a list of every fully specified link in that group, comparing the remote address and port. With redirect_addr in front of a busy server, every client connection to public:443 lands in the same group, so each inbound packet that is not near the head of the list walks all of it. TCP links live up to 24 hours unless libalias sees a clean close, so the list can grow to hundreds of thousands of entries and saturate a core at a few hundred packets per second. Keep the fully specified links of a group in an RB tree ordered by (dst_addr, dst_port). Links that share an endpoint are ordered newest first by a per-instance insertion counter, which keeps the "most recent link wins" behaviour of the list (tested by 3_natin:2_portoverlap). Lookups with an unknown remote address and a known port still scan the group. Each link grows by 16 bytes. With ~170,000 links in one group, LibAliasIn() took 1-2 ms per packet and one core saturated at ~720 packets/s. With this change it takes 2-4 us per packet and the offered 1,000 packets/s are handled with the thread nearly idle. Sponsored by: NLINK Differential Revision: https://reviews.freebsd.org/D60083
* libthr: Support disable spinloopShengYi Hung26 hours3-9/+8
| | | | | | | | | | Like yieldloops, we shoulde be able to set _thr_spinloops to zero. Originally, it makes us to enformce default spin time even if we try to disable it. Make MUTEX_ADAPTIVE_SPINS a one time initialization now. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60486
* hyperv: Fix single page invalidation pathShengYi Hung26 hours1-39/+43
| | | | | | | | | | | | | | A single page invalidation sets addr2 == 0. In the original code, it falsely flush the whole address in non global pmap. However, the kernel pmap are all PG_G, which means a single page flush will always be staled and thus become invalid. As a result, we set parameter based on their op in a new helper function instead of relying on args. This affects only on AMD platform as Intel has their PTI implementation. PR: 291577 Tested by: franco@opnsense.org MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60380
* amdgpio: Suspend routineAymeric Wibo26 hours1-0/+48
| | | | | | | | | | | | | | Mask all interrupts when suspending and warn when there are unserviced interrupts which might block entry to S0i3. In the future we won't want to mask wake interrupts. Once we can actually make use of GPIO interrupts on x86, we'll also want to unmask relevant pins when resuming. Reviewed by: aokblast, avg Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51589
* mgb: Correct TX interrupt bitEd Maste29 hours1-1/+1
| | | | | | | | | | | | | The TX interrupt handler checked MGB_INTR_STS_RX(qidx) instead of MGB_INTR_STS_TX(qidx) -- presumably a copy-paste issue. Because the driver does not use TX interrupts so there was no actual issue in practice. Reviewed by: adrian Sponsored by: The FreeBSD Foundation Fixes: 8890ab7758b8 ("Introduce if_mgb driver for Microchip LAN743x PCIe NIC") Differential Revision: https://reviews.freebsd.org/D60550
* bnxt_en: dcb: stop zeroing ETS and PFC config in bnxt_dcb_init()Sumit Saxena29 hours1-6/+0
| | | | | | | | | | | | | | | | bnxt_dcb_init() currently pushes all-zero ETS and PFC settings to the firmware at every attach. This reserves bandwidth allocation for RoCE traffic, which prevents L2 traffic from reaching line rate. These settings should only be updated with valid values when the RoCE driver is loaded. Therefore, we should stop programming them during bnxt_dcb_init(). Signed-off-by: Andy Gospodarek <gospo@broadcom.com> Reviewed by: chandrakanth.patil_broadcom.com, gallatin MFC after: 2 weeks Sponsored by: Broadcom Inc. Differential Revision: https://reviews.freebsd.org/D60516
* ctf*: exit with error upon terminate()Ed Maste30 hours1-10/+0
| | | | | | | | | | | | | | | The initial port of the CTF tools had a FreeBSD-specific patch to print the termination message but exit with a 0 status, with a goal of getting as much to build as possible and silently ignoring any issues. We're now past the point where silently ignoring failures makes sense. Any future issues need to be found and addressed. PR: 276826 PR: 276930 [exp-run] Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43743
* thunderbolt: Router suspend routineAymeric Wibo31 hours6-2/+113
| | | | | | | | | | Suspend routine for USB4 v1.0 NHIs. This will work on v2.0 NHIs too for now, but there's ideally a different method we should be using for those in fine. Reviewed by: imp, ngie, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49453
* bsd.dirs.mk: Improve "installing DIRS" messageEd Maste33 hours1-1/+1
| | | | | | | | | | Some of these messages looked at first glance like they were incorrectly concatenated, e.g. "installing DIRS testsFILESDIR". Add a colon to clarify. Reviewed by: brooks, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60525
* ncal: convert legacy TAP tests to ATFAlan Somers33 hours5-86/+153
| | | | | | | MFC after: 2 weeks Sponsored by: ConnectWise Pull Request: https://github.com/freebsd/freebsd-src/pull/2465 Reviewed by: imp
* Makefile.inc1: Don't unnecessarily ignore rm errorsEd Maste33 hours1-4/+4
| | | | | | | | | For rm -f it's not an error if the files do not exist. If there's any other error it's presumably a real issue, so avoid ignoring all errors. Reviewed by: brooks, adrian Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56714
* build: Emit a warning for build targets run as rootEd Maste33 hours1-0/+4
| | | | | | | | | Build targets should generally be run as an unprivileged user. Even though building as root is discouraged many users do so, so just start with a warning. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D50352
* bhyve: Use the new spelling of MPIDR_Aff*Andrew Turner33 hours1-3/+3
| | | | | Fixes: 6bf6fe1d70e7 ("arm64: Fix the MPIDR_EL1 field names") Sponsored by: Arm Ltd
* Makefile.inc1: Update comment wrt world build targetsEd Maste33 hours1-2/+2
| | | | | | | | | | The utility targets described by this comment are in fact related to building (buildworld), not installing (which is included in `make world`). Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56715
* x86: Fix retpoline capitalizationEd Maste33 hours1-1/+1
| | | | Fixes: 74d971fe1561 ("x86: Add external retpoline thunk")
* x86: Add external retpoline thunkEd Maste33 hours2-0/+20
| | | | | | | | | This allows use of -mindirect-branch=thunk-extern, and is only a few bytes of dead code if not used. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60524
* makefs/zfs: count "." in the link count and size of dataset rootsRenato Botelho33 hours2-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The root directory of a dataset is populated from an fsnode that is the "." entry of the staging directory, and its children are the siblings of that node, so the loop that computes the link count and the size of the directory (which expects "." among the children, as the nodes of the other directories have) never counts it. The link count of the root of every dataset is one less than it should be (1 for an empty dataset instead of 2, 19 instead of 20 for a root with 18 subdirectories), and so is its size. fts(3) trusts the link count of the directories of ZFS when called with FTS_NOSTAT and FTS_PHYSICAL: it stops looking for subdirectories once it has seen as many as the link count says, and does not descend into the ones it did not look at. As a result find(1), and rm(1) when it does not need to stat the entries, silently skip directories of a pool made by makefs. On a root filesystem made by makefs, find / does not list /etc at all. Start the loop at the "." node itself for the roots of datasets, so that it is counted the same way as in every other directory. Add a test that checks the link counts and the sizes of the dataset roots and of the other directories, with nested datasets and a dataset whose mountpoint is not in the staging tree, and that find(1) sees the whole tree. Fixes: 240afd8c1fc ("makefs: Add ZFS support") MFC after: 1 week Approved by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D60439
* arm64/vmm: vgic_v3: Fix missing free of vgic_cpu->private_irqsKajetan Puchalski36 hours1-0/+1
| | | | | | | | | | vgic_cpu->private_irqs is allocated but never freed, as a result leaking memory whenever the vmm module is unloaded. Add the missing free. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2439
* arm64/vmm: vgic_v3: Set EOI for level-triggered interruptsKajetan Puchalski36 hours1-5/+4
| | | | | | | | | | | | | | | ICH_LR_EL2 bit 41 (EOI) determines whether a maintenance interrupt will be asserted if the interrupt identified by the LR's vINTID is deactivated. For level-triggered interrupts, that maintenance interrupt is necessary for the host to resample the current level once the interrupt is deactivated. Set the EOI bit when flushing level-triggered interrupts into LRs. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2437
* arm64: Fix the MPIDR_EL1 field namesAndrew Turner36 hours3-19/+19
| | | | | | | | | | Use the field names from the Arm Documentation for the MPIDR_EL1 register. These will later be generated from a BSD Licensed JSON file so to reduce the diff for that rename now. Reviewed by: kajetan.puchalski_arm.com Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D59176
* arm64: Use sysinsn.h to generate tlbi instructionsAndrew Turner36 hours1-12/+5
| | | | | | | | Some toolchains may not understand the .arch_extension. Reviewed by: jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D59148
* arm64: Add a header for system instructionsAndrew Turner36 hours2-1/+42
| | | | | | | | | Like armreg.h for system registers add a header to hold macros for system instructions. Reviewed by: jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D59147
* ulimit(3): Improve UL_{GET,SET}FSIZE wordingAymeric Wibo37 hours1-12/+10
| | | | | | | | | | | | | Reword the UL_GETFSIZE and UL_SETFSIZE descriptions to say 512-byte blocks and make the setter's argument clearer. While here, improve mdoc markup and pull in other small improvements. Reviewed by: des MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D60467
* if_bnxt: dcb: serialize HWRM sends and avoid freeing DMA bufs on timeoutSumit Saxena40 hours1-8/+44
| | | | | | | | | | | | | | | | | | Every _hwrm_send_message() call in bnxt_dcb.c ran without BNXT_HWRM_LOCK, unlike the rest of the driver, letting concurrent HWRM commands race on the shared MMIO doorbell and response buffer. Route single-shot sends through the already-locked hwrm_send_message() wrapper, and wrap the remaining send+response-read sequences in explicit BNXT_HWRM_LOCK/UNLOCK. Also stop freeing the transient DMA buffers used for structured-data get/set on ETIMEDOUT: a host-side timeout doesn't guarantee firmware actually gave up, so a late completion could still DMA into memory that's since been freed and reused. Leak the buffer instead in that case. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Broadcom Inc. Differential Revision: https://reviews.freebsd.org/D60179