Commit graph

150428 commits

Author SHA1 Message Date
Jose Luis Duran
65ae1d493e msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE
PR:	281033

(cherry picked from commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880)
2024-09-01 03:53:36 +03:00
Rick Macklem
cfcf0db909 nfsproto.h: Define the new mode_umask attribute
RFC8275 defines a new attribute as an extension to NFSv4.2
called MODE_UMASK.  This patch adds the attribute number
to nfsproto.h.

Future patches will add optional support for the attribute.
This patch does not cause any semantics change.

(cherry picked from commit 10d5b43424da7fadfbdcc41bbffe40d130af1e1d)
2024-08-30 18:53:55 -07:00
Michael Tuexen
2dcd21ddab tcp: fix format of sysctl variable
The format for CTLTYPE_UINT is "IU" instead of "UI" as specified
in sysctl.9.

Reviewed by:		cc, zlei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46408

(cherry picked from commit 498286d4e807d6b9e4caad22b96ebca7f16e9b18)
2024-08-30 08:32:11 +02:00
Michael Tuexen
bb31f15d17 sctp: fix format of sysctl variables
(cherry picked from commit a1d9ce19b13f220c5738e6aa58cf0c3750a05526)
2024-08-30 08:31:35 +02:00
Michael Tuexen
6c0fb6c5ac tcp: improve consistency of SYN-cache handling
Originally, a SYN-cache entry was always allocated and later freed,
when not needed anymore. Then the allocation was avoided, when no
SYN-cache entry was needed, and a copy on the stack was used.
But the logic regarding freeing was not updated.
This patch doesn't re-check conditions (which may have changed) when
deciding to insert or free the entry, but uses the result of
the earlier check.
This simplifies the code and improves also consistency.

Reviewed by:		glebius
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46410

(cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d)
2024-08-30 08:30:54 +02:00
Michael Tuexen
e0bcb3aa4f tcp: initialize the LRO hash table with correct size
There will at most lro_entries entries in the LRO hash table. So no
need to take lro_mbufs into account, which only results in the
LRO hash table being too large and therefore wasting memory.

Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46378

(cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa)
2024-08-30 08:29:50 +02:00
Michael Tuexen
118ab70d57 tcp: fix list iteration in tcp_lro_flush_active()
Use LIST_FOREACH_SAFE(), since the list element is removed from
the list in the loop body, zero out and inserted in the free list.

Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46383

(cherry picked from commit 64443828bbe7c571db8d8731758ec8c4b8364c86)
2024-08-30 08:29:03 +02:00
Konstantin Belousov
43605618aa amd64: use INVLPGB for kernel pmap invalidations
(cherry picked from commit 47656cc1ef1cac307f24de88a4fe23a1389af44e)
2024-08-28 03:26:34 +03:00
Konstantin Belousov
23117748f2 amd64: add variables indicating INVLPGB works
(cherry picked from commit bc4ffcadf2681c954444e1853200dca3f5e65676)
2024-08-28 03:26:34 +03:00
Konstantin Belousov
c3cd4db461 amd64: add convenience wrappers for INVLPGB and TBLSYNC
(cherry picked from commit 111c7fc2fe21356a637f89fa58c407958f05ad93)
2024-08-28 03:26:34 +03:00
Konstantin Belousov
d66c4853b8 DMAR: clear dmar_devs[unit] if attach failed
PR:	280817

(cherry picked from commit 45543d3424d46f84a5399879e190fc359dcefbd4)
2024-08-28 03:26:33 +03:00
Kristof Provost
485bd16308 pf: cope with SCTP port re-use
Some SCTP implementations will abort connections and then later re-use the same
port numbers (i.e. both src and dst) for a new connection, before pf has fully
purged the old connection.

Apply the same hack we already have for similarly misbehaving TCP
implementations and forcibly remove the old state so we can create a new one.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 82e021443a76b1f210cfb929a495185179606868)
2024-08-27 10:09:10 +02:00
Warner Losh
1dac152478 nvme: Eliminate intel_log_temp_stats_swapbytes
We can't post a AER for this page, so there's no need to be able to swap
it to host byte order. It's not one of the standard defined pages that
can post via AER, and the vendor's public docs for this temperature page
don't suggest it's possible to get over or under event changes. Since
nvmecontrol no longer needsd the swap routine, remove it since it's
now unused.

Sponsored by:		Netflix
Reviewed by:		chuck
Differential Revision:	https://reviews.freebsd.org/D44659

(cherry picked from commit 97b77de2d951b4946fb3219a99c98f2dd4c0120f)
2024-08-26 14:31:03 -04:00
John Baldwin
46c77392cb nvme: Add NVMe over Fabrics fields to nvme_controller_data
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44448

(cherry picked from commit 21d3a84db481e84cf240f6802b1a4110854eaec5)
2024-08-26 14:31:00 -04:00
John Baldwin
9541862de7 nvme: Add constants for the Controller Attributes field in cdata
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44447

(cherry picked from commit 7fa8adb8c5cd46979b76770794ac1b6584e8baa7)
2024-08-26 14:27:59 -04:00
John Baldwin
759864ad7a nvme: Add constants and types for the discovery log page
This is used in NVMe over Fabrics to enumerate a list of available
controllers.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44446

(cherry picked from commit 88ecf154c7c5a2e413a81ae1b0511b0295265b99)
2024-08-26 14:27:53 -04:00
John Baldwin
41f61bf230 nvme: Add constants for fields in AER completion dword 0
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44445

(cherry picked from commit b354bb04cb51f373e997cb8911c32dc93243c1d7)
2024-08-26 14:27:48 -04:00
John Baldwin
ae2a9307b5 nvme: Add constants for the extended data for Get Log Page command flag
nvme(4) doesn't check this flag, but Fabrics implementations may need
to set this flag in the log page attributes cdata field.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44444

(cherry picked from commit cbda1886ab1cd3ec2847b7da5136d3bb68d56101)
2024-08-26 14:27:42 -04:00
John Baldwin
da548abbc3 nvme: Add constants for the PSDT field in cdw0
This is not used in nvme(4) but is used in NVMe over Fabrics
transports which use SGLs to describe buffers instead of PRPs.

While here, adjust the shift value for the FUSE field to be relative
to the 'fuse' member of 'struct nvme_command'.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44443

(cherry picked from commit b8cb8dd3625d7396ea98152d89e1e64b16e77bc6)
2024-08-26 14:27:36 -04:00
John Baldwin
1e066e4604 nvme: Add SGL structure and constants for use in NVMe commands
Fabrics capsules use an SGL structure instead of prp1/2 addresses to
describe the data buffer used for a command.  The SGL structure is
added to a union with the existing prp1/2 fields.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44442

(cherry picked from commit f21a54d19080510bce279183f4bf07d5315bd179)
2024-08-26 14:27:28 -04:00
John Baldwin
94feb21059 nvme: Export constants for min and max queue sizes
These are useful for NVMe over Fabrics.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44441

(cherry picked from commit 1931b75e004f25cf1d2db809bfd9baba40c04521)
2024-08-26 14:27:21 -04:00
John Baldwin
4d2e2e1b44 nvme: Use the NVMEF macro to construct fields
Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43605

(cherry picked from commit 5650bd3fe8eff1043ef3df33b5bdd7b24b5f2bc0)
2024-08-26 13:27:08 -04:00
John Baldwin
7566b99458 nvme: Add NVMEF helper macro as the inverse of NVMEV
This macro accepts a field name and a value for the field and
constructs the shifted field value.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43604

(cherry picked from commit 3a477a9b70a34dc0686630599c27f022b1e07bd8)
2024-08-26 13:27:01 -04:00
John Baldwin
2208f2c156 nvme: Use the NVMEM macro instead of expanded versions
A few of these omitted a shift of 0, but this is more consistent.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43602

(cherry picked from commit 8488fc417fc24af37fa6f1e880f09a5023670950)
2024-08-26 13:26:47 -04:00
John Baldwin
80a92f1b91 nvme: Rename NVMEB helper macro to NVMEM
The current macro always builds a full mask for a named field, so use
the M suffix for mask.

Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43601

(cherry picked from commit 1dade1f255ee535ad357211395b46188bece52dc)
2024-08-26 13:26:38 -04:00
John Baldwin
e8edea1b4c nda: Use the NVMEV macro instead of expanded versions
Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43596

(cherry picked from commit 2cb78e71503ec9a73054a6f70908c5f20c2ceb73)
2024-08-26 13:26:00 -04:00
John Baldwin
215c376694 nvme: Use the NVMEV macro instead of expanded versions
Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43595

(cherry picked from commit 479680f235dd89cdabe0503312b3d23f322f4000)
2024-08-26 13:25:49 -04:00
Kristof Provost
88e1bc0669 mcast: fix leaked igmp packets on multicast cleanup
When we release a multicast address (e.g. on interface shutdown) we may
still have packets queued in inm_scq. We have to free those, or we'll
leak memory.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43033

(cherry picked from commit c2e340452c147b551180f2a1600ae76491342b0e)
2024-08-26 09:46:21 -06:00
Kristof Provost
31ad232d85 Revert "mcast: fix memory leak in imf_purge()"
This reverts commit fa03d37432caf17d56a931a9e6f5d9b06f102c5b.

This commit caused us to not send IGMP leave messages if the inpcb went
away. In other words: we freed pending packets whenever the socket
closed rather than when the interface (or address) goes away.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43032

(cherry picked from commit c196e43243b83840cc9f3d1dadc7dacb3b0f556f)
2024-08-26 09:45:58 -06:00
Christos Margiolis
8156d8598f sound: Improve sndstat nvlist feederchain format
- Use snd_afmt2str() to display format conversions in feeder_format,
  instead of the plain hex value.
- Simplify feeder_rate contents.
- Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix.
- Use snd_afmt2str() instead of a plain hex for the the rest of the
  feeder classes.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46309

(cherry picked from commit 0864dfe6299b75e424b845c0d0e1a593da905ae3)
2024-08-26 16:53:01 +03:00
Ed Maste
131b7dcb2f ctl: avoid heap info leak in ctl_request_sense
Previously 3 bytes of data from the heap could be leaked to ctl
consumers.

Reported by:	Synacktiv
Reviewed by:	asomers, mav
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46091

(cherry picked from commit db87c98168b1605f067d283fa36a710369c3849d)
2024-08-26 09:23:37 -04:00
Oliver Fromme
c7d5163a13 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors
Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19,
model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This
enables temperature readings of these CPUs via sysctl.

The sensors function identically to those for the "Raphael" processors
(model 0x60-0x6f); only the PCI device ID differs.

PR:		kern/280942
Relnotes:	yes
MFC after:	3 days

(cherry picked from commit ef3f8aa0a0492487ac7db839de078b1913f61b4c)
2024-08-25 22:15:43 -07:00
Eugene Grosbein
2441180265 libalias: fix subtle racy problem in outside-inside forwarding
sys/netinet/libalias/alias_db.c has internal static function UseLink()
that passes a link to CleanupLink() to verify if the link has expired.
If so, UseLink() may return NULL.

_FindLinkIn()'s usage of UseLink() is not quite correct.

Assume there is "redirect_port udp" configured to forward incoming
traffic for specific port to some internal address.
Such a rule creates partially specified permanent link.

After first such incoming packet libalias creates new fully specifiled
temporary LINK_UDP with default timeout of 60 seconds.
Also, in case of low traffic libalias may assign "timestamp"
for this new temporary link way in the past because
LibAliasTime is updated seldom and can keep old value
for tens of seconds, and it will be used for the temporary link.

It may happen that next incoming packet for redirected port
passed to _FindLinkIn() results in a call to UseLink()
that returns NULL due to detected expiration.
Immediate return of NULL results in broken translation:
either a packet is dropped (deny_incoming mode) or delivered to
original destination address instead of internal one.

Fix it with additional check for NULL to proceed with a search
for original partially specified link. In case of UDP,
it also recreates temporary fully specified link
with a call to ReLink().

Practical examples are "redirect_port udp" rules for unidirectional
SYSLOG protocol (port 514) or some low volume VPN encapsulated in UDP.

Thanks to Peter Much for initial analysis and first version of a patch.

Reported by:	Peter Much <pmc@citylink.dinoex.sub.org>
PR:		269770

(cherry picked from commit 8132e959099f0c533f698d8fbc17386f9144432f)
(cherry picked from commit e5b85380836378c9e321a4e6d300591e6faf622a)
2024-08-25 13:31:24 +07:00
Kristof Provost
46c4fc50d3 pf: invert direction for inner icmp state lookups
(e.g. traceroute with icmp)
ok henning, jsing

Also extend the test case to cover this scenario.

PR:		280701
Obtained from:	OpenBSD
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 89f6723288b0d27d3f14f93e6e83f672fa2b8aca)
2024-08-20 17:15:10 +02:00
Kristof Provost
27a1a56b0d pf: fix icmp-in-icmp state lookup
In 534ee17e6 pf state checking for ICMP(v6) was made stricter. This change
failed to correctly set the pf_pdesc for ICMP-in-ICMP lookups, resulting in ICMP
error packets potentially being dropped incorrectly.
Specially, it copied the ICMP header into a separate variable, not into the
pf_pdesc.

Populate the required pf_pdesc fields for the embedded ICMP packet's state lookup.

PR:		280701
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 2da98eef1f352c496ffd458b4c68ddee972bb903)
2024-08-20 17:15:09 +02:00
Mark Johnston
04716d51ba ithread: Improve synchronization in ithread_destroy()
Previously, to destroy an ithread we would set IT_DEAD in its flags, and
then wake it up if it wasn't already running.  After doing this,
intr_event_destroy() would free the intr_event structure.  However, it
did not wait for the ithread to exit, so it was possible for the ithread
to access the intr_event after it was freed.

This use-after-free happens readily when running the pf tests in
parallel, since they frequently create and destroy VNET jails, and pf
registers several VNET-local swi handlers.

Fix the race by modifying ithread_destroy() to wait until the ithread
has signaled that it is about to exit by setting ie->ie_thread = NULL.
Existing callers of intr_event_destroy() are allowed to sleep.

Reported by:	KASAN
Reviewed by:	kib, jhb
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D45492

(cherry picked from commit 8381e9f49ec733437754a822ef2e8344115289ac)
2024-08-20 13:27:05 +00:00
Mark Johnston
7178003234 xen/netfront: Decouple XENNET tags from mbuf lifetimes
netmap's generic mode tries to improve performance by minimizing mbuf
allocations.  In service of this goal, it maintains an extra reference
to the mbuf and polls the counter to see if the driver has released its
reference by calling m_freem().  As a result, the extref destructor is
not called when expected by the netfront driver, and mbufs tags are not
freed.

Modify the tx path to release its mbuf tags promptly when reclaiming tx
descriptors.  They are drawn from a fixed-size pool, so otherwise are
quickly exhausted when a netfront interface is in netmap generic mode.

Co-authored by:	royger
MFC after:	2 weeks
Fixes:	dabb3db7a8 ("xen/netfront: deal with mbuf data crossing a page boundary")
Sponsored by:	Cloud Software Group
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor

(cherry picked from commit 2e4781cb12af2d13262ed5decf6fd95c8d58d9f5)
2024-08-20 13:27:05 +00:00
Mark Johnston
63398f3400 socket: Make the sopt_rights field a pointer to const
No functional change intended.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield

(cherry picked from commit 07f2ed5ce88293b5008a27d1868f47eb8cbd25e2)
2024-08-20 13:22:56 +00:00
Mark Johnston
b2cc25c8fb socket: Fix handling of listening sockets in sotoxsocket()
A lock needs to be held to ensure that the socket does not become a
listening socket while sotoxsocket() is loading fields from the socket
buffers, as the memory backing the socket buffers is repurposed when
transitioning to a listening socket.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield

(cherry picked from commit fc4365853f1c4b572d9fd643ea336508d9a6a0f7)
2024-08-20 13:22:56 +00:00
Stefan Eßer
8774fa749d msdosfs: fix cluster limit when mounting FAT-16 file systems
The maximum cluster number was calculated based on the number of data
cluters that fit in the givem partition size and the size of the FAT
area. This limit did not take into account that the highest 10 cluster
numbers are reserved and must not be used for files.

PR:		280347
Reported by:	pho@FreeBSD.org

(cherry picked from commit 45d4e82bf61f91792142a2b9e2af657dab8500fd)
2024-08-15 21:05:08 +02:00
Mark Johnston
b5ce60dffd zdb: Fix printf formatting of a uint64_t
This fixes the build on 32-bit platforms.

Fixes:	dc91e7452482 ("zdb: dump ZAP_FLAG_UINT64_KEY ZAPs properly (#16334)")
(cherry picked from commit f029f6277996760be4be42148295231af425cc2d)
2024-08-15 16:44:48 +02:00
Mark Johnston
c8d02c3763 ithread: Annotate a branch in ithread_execute_handlers()
No functional change intended.

Reviewed by:	kib, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45491

(cherry picked from commit c122d7ffad5efb31e1aa5035cb1a26ad2e479074)
2024-08-15 14:29:49 +00:00
Mark Johnston
665b21f583 intr: Remove dead code from intr_event_remove_handler()
We currently destroy the ithread in intr_event_destroy().  In
preparation for fixing a bug there, remove this dead code and reorganize
a bit to avoid some code duplication.  No functional change intended.

Reviewed by:	kib, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45490

(cherry picked from commit 177624f2f425901bb241789d639a16bded2247ae)
2024-08-15 14:29:49 +00:00
Keith Reynolds
a9376f5caf qlnxe: Allow MAC address override
The qlnxe driver always sets the NIC's rx mac address to the card's
default MAC, ignoring any MAC address set via ifconfig.

PR:		278085

(cherry picked from commit 792226e53023cb09566cb78b2135b052e9b62e0e)
2024-08-13 12:34:10 -07:00
Michael Tuexen
f18b9b2b95 ddb: update printing of t_flags and tflags2
Update the ddb printing of t_flags and t_flags2 to the current state of
definitions in tcp_var.h.

Reviewed by:		cc
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46222

(cherry picked from commit 093d9b46f4720392e53c171eaabfd7a6a8101170)
2024-08-13 19:05:06 +02:00
Michael Tuexen
b97b3dead5 Revert "ddb: update printing of t_flags and tflags2"
This reverts commit d3c1df53f5.
2024-08-13 19:02:20 +02:00
Michael Tuexen
d3c1df53f5 ddb: update printing of t_flags and tflags2
Update the ddb printing of t_flags and t_flags2 to the current state of
definitions in tcp_var.h.

Reviewed by:		cc
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46222

(cherry picked from commit 093d9b46f4720392e53c171eaabfd7a6a8101170)
2024-08-13 15:54:17 +02:00
Dimitry Andric
ae3598b7a1 Fix enum warnings in ath_hal's ar9300
This fixes a number of clang 19 warnings:

    sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:709:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
      709 |         freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
      148 |     (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
          |       ~~~ ^  ~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:745:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
      745 |         freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
      148 |     (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
          |       ~~~ ^  ~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:781:25: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_FREQ_BAND') [-Werror,-Wenum-compare]
      781 |         freq_array[i] = FBIN2FREQ(p_freq_bin[i], is_2ghz);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h:148:11: note: expanded from macro 'FBIN2FREQ'
      148 |     (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x))
          |       ~~~ ^  ~~~~~~~~~~~~~~~~~~

The `FBIN2FREQ()` and `FREQ2FBIN()` macros in `ar9300eep.h` are invoked
in most places around the `ath_hal` code with a (effectively) boolean
second argument, corresponding to "is this 2GHz?". But in the code that
is warned about, the value `HAL_FREQ_BAND_2GHZ` is of a different
non-boolean type, `HAL_FREQ_BAND`.

Update the `FBIN2FREQ()` and `FREQ2FBIN()` macros to interpret the
second argument as boolean value, and rename the macro parameter names
to better describe their meaning.

Reviewed by:	adrian, bz
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46201

(cherry picked from commit 82246ac5d890e031c9978052e5a431e0960182d5)
2024-08-13 11:24:12 +02:00
Martin Matuska
d27c973264 zfs: merge openzfs/zfs@33174af15 (zfs-2.2-release) into stable/14
OpenZFS release 2.2.5

Notable upstream pull request merges:
 #15609 566841171 Only provide execvpe(3) when needed
 #15940 9edf6af4a Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN
 #16038 0f1e8ba2f L2ARC: Cleanup buffer re-compression
 #16104 b474dfad0 Refactor dbuf_read() for safer decryption
 #16118 938d1588e Make more taskq parameters writable
 #16131 672474659 Slightly improve dnode hash
 #16138 4c0fbd8d6 FreeBSD: Add zfs_link_create() error handling
 #16159 fa4b1a404 ZAP: Fix leaf references on zap_expand_leaf() errors
 #16162 41f2a9c81 Fix scn_queue races on very old pools
 #16165 4c484d66b Fix ZIL clone records for legacy holes
 #16206 27cc6df76 Use memset to zero stack allocations containing unions
 #16207 2eab4f7b3 Fix assertion in Persistent L2ARC
 #16214 13ccbbb47 Some improvements to metaslabs eviction
 #16216 ba3c7692c Destroy ARC buffer in case of fill error
 #16258 4d2f7f983 vdev_open: clear async fault flag after reopen
 #16264 ef08cb26d Fix long_free_dirty accounting for small files
 #16273 54ef0fdf6 head_errlog: fix use-after-free
 #16284 14cce09a6 FreeBSD: Use a statement expression to implement
                  SET_ERROR()
 #16406 6f27c4cad Make 'rmmod zfs' work after zfs-2.2.4

Obtained from:	OpenZFS
OpenZFS commit:	33174af151
OpenZFS tag:	zfs-2.2.5
2024-08-13 09:52:28 +02:00
Gordon Bergling
36dc690bd1 ipfilter(4): Fix typos in source code comments
- s/inconsistancy/inconsistency/

(cherry picked from commit c90a206496fc431854e0c2989c2214b048e960d5)
2024-08-12 14:51:59 +02:00