Commit graph

44513 commits

Author SHA1 Message Date
Sean Farley
bd5ce67416 sound: enforce MASTER volume mute during playback
MASTER mute (vol.mute) works while audio is playing. However, if a
stream is stopped and restarted (PCMTRIG_STOP -> PCMTRIG_START), the
audio will resume even though the mixer shows the MASTER volume as
muted. Other streams that are already playing remain silent. New streams
may also start playing audio regardless of the MASTER mute state.

The volume feeder now considers the MASTER mute when determining whether
a channel should be muted. This ensures MASTER mute is consistently
enforced for all streams and removes the dependency on trigger-driven
state propagation.

Tested with Creative Labs CA0132 card.

MFC after:	1 week
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D55605

(cherry picked from commit ac5ff2813027c385f9037b47b2b164d4c1bebd09)
2026-03-19 13:17:35 +01:00
Bjoern A. Zeeb
4c7dbe9f79 usb: umass: add SCSIEJECT quirk and fix RTW8821CU_CD (USB mode switch)
Several Realtek (and lots other) USB dongles present themselves as
CDROM device first.  Upon eject they do a mode switch and suddenly
are a different kind of device (sometimes even with different IDs),
e.g., a wireless dongle.

In order to avoid the CDROM stage and rather than adding the quirk
handling to more drivers, add support to umass and if enabled
automatically eject the "CDROM" to make it the real device.

Longer-term some other drivers could stop using their hand-rolled
support for this.  It is unclear as-to how much we need the list of
(eject) quirks from u3g here, or if these are very specific to that
kind of devices.

Sponsored by:	The FreeBSD Foundation
Fixes:		b3b6a959c8, 9c0cce3283
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D54901

(cherry picked from commit b4daeded66b5e950ed8e618d66915b863c2414b1)
2026-03-11 16:53:25 +00:00
Christos Margiolis
0b27b79f35 sound: Notify devd when no devices are connected
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55531

(cherry picked from commit 428517a7712e44b58e0687fbee4037a8ebe5bf5a)
2026-03-10 11:54:42 +01:00
Christos Margiolis
716773278a sound: Notify devd on hw.snd.default_unit change
If we have virtual_oss running, this devd notification will make sure to
automatically transfer sound to the new default unit, while also making
sure that we switch to it only for the supported directions (recording
and/or playback).

For more information, please refer to 2ffaca551eaf ("snd_hda: Implement
automatic redirection between associations").

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55530

(cherry picked from commit d40189f8259e3565c69a40194f7b603d0ca648de)
2026-03-10 11:54:42 +01:00
Bjoern A. Zeeb
ad85b6b7c7 dpaa2: improve error messages and log requested cluster size
If m_getjcl() fails we want to know the size we requested in order to
have a chance to evaluate the problem better.

Reviewed by:	tuexen
Differential Revision: https://reviews.freebsd.org/D55555

(cherry picked from commit c3577fcf3fd0494cc992021d4debbca09241a49e)
2026-03-09 11:03:09 +00:00
Olivier Certner
815fdbd497
iwx: Re-activate the 32-bit boundary cross check on 64-bit architectures
__SIZEOF_*__ is in bytes, not in bits...

Reported by:    brooks
Fixes:          35da55c28dbb ("iwx: Fix 32-bit compilation")
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit c1567d49a8320fd23dff9dbce1186f2331538253)
2026-03-06 18:19:59 +01:00
Olivier Certner
b4269beda1
iwx: Fix 32-bit compilation
- Avoid shifts wider than integer types, by wrapping the corresponding
  checks into '#if __SIZEOF_SIZE_T__ > 32' blocks.  'bus_addr_t'
  currently has the same width as 'size_t' on all architectures (and
  this is not going to change for 32-bit architectures).
- Use appropriate printf(3) format for 'wk_keytsc'.

Reviewed by:    adrian
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55667

(cherry picked from commit 35da55c28dbb56dd7056b7863efc5b547950d885)
2026-03-05 23:05:42 +01:00
Konstantin Belousov
b17655c95c mlx5: convert GET_TRUNK_IF() to function
(cherry picked from commit 87ca74de89e0ae96774674f7ae14d303fad5b780)
2026-03-04 03:15:59 +02:00
Konstantin Belousov
fad7cad82c mlx5: report IPSEC offload capabilities whenever IPSEC_OFFLOAD is configured
(cherry picked from commit de29fd0322254127c3ebaedbc91ee4f9620f5fdf)
2026-03-04 03:15:59 +02:00
Christos Margiolis
a9f454a9c7 sound: Detect unsupported formats
This way we can avoid edge-cases like
8af6aee96ed609456900c6dd92dafabac5e89c0a ("virtual_oss(8): Remove
floating point formats from preference list").

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55403

(cherry picked from commit 3deae7b786743193531f4e69527e789de52644c5)
2026-02-28 15:02:39 +01:00
Ruslan Bukin
e0dbeabeee iommu_gas: Fix assertion.
(cherry picked from commit 7e8284c6ad95bb7a0fc84d4d945ee98737efdd36)
2026-02-28 03:32:24 +02:00
Kevin Bowling
b24dc842e1 e1000: Increase FC pause/refresh time on PCH2 and newer
This corresponds to Linux f74dc880098b4a29f76d756b888fb31d81ad9a0c

That commit does not provide any public background detail, but it's been
in use for over 5 years and corresponds to previous chip bugs w.r.t.
automatic generation of PAUSE frames.

Reviewed by:	kgalazka
Differential Revision:	https://reviews.freebsd.org/D54555

(cherry picked from commit 2bdec2ee73be7dbafce9982b0dc5c273918a5443)
2026-02-27 16:09:28 -07:00
Sreekanth Reddy
bc9dad93ba bnxt_re/libbnxtre: Add support for Variable WQE on BCM576xx controllers
Variable size WQE means that each send Work Queue Entry to
HW can use different WQE sizes as opposed to the static WQE
size on the current devices. Set variable WQE mode for BCM576xx
devices. Depth of the Queue will be a multiple of slot which
is 16 bytes. The number of slots should be a multiple of 256
as per the HW requirement.
Initialize the Software shadow queue to hold requests equal to
the number of slots.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54525
MFC after: 3 days

(cherry picked from commit 823f158a01330484f83f69c31d695035c607f8ee)
2026-02-27 12:04:38 +00:00
Sreekanth Reddy
e680396808 bnxt_re: Add support to display board_id in ibv_devinfo output
Added support to display board_id in ibv_devinfo output.
ibv_devinfo util reads the board_id from below sysctl
attribute, so added this sysctl attribute.

sys.class.infiniband.bnxt_reX.board_id

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54524
MFC after: 3 days

(cherry picked from commit 3a9565c2a8e4f1b3da698bf6a8af5889dc4fefbd)
2026-02-27 12:04:38 +00:00
Sreekanth Reddy
b7c72909b4 bnxt_re: Fix active_speed value when two ports are aggregated
Currently driver is not considering the active_lanes while
displaying the speed & width of port and hence it showing
invalid active_speed and active_width values in the ibv_devinfo
command output when two ports are aggregated at hardware level.
Fixed the driver to consider the active_lanes while determining
the active_speed & active_width values.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54523
MFC after: 3 days

(cherry picked from commit b7d6334df61a559e98191f90fd5e611e0d077def)
2026-02-27 12:04:38 +00:00
Sreekanth Reddy
39d9a9c111 bnxt_en/re: Use FW defined resource limit for RoCE
Check FW flags for status of Resource Limits. If bit
FUNC_QCAPS_RESP_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED
is set, that means FW set the resource limit for L2 and RoCE.
We'll then do the following:

L2 driver would allocate context memory based on what FW reported.
RoCE driver uses FW reported values without capping. These values
are the total FW reported value minus L2 and other components shares.

For example:

FW reported max_qps = 137217 in L2 query, this includes:
5120 for L2
1025 for QP1
131072 for RoCE
L2 will allocate backing store memory for the total.
In RoCE query, we'll get max_qp = 131072 and use it
without further capping.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54522
MFC after: 3 days

(cherry picked from commit 913e454f306124c83797bfa71681dcdf806532c6)
2026-02-27 12:04:38 +00:00
Sreekanth Reddy
1ff252f0bb bnxt_re/libbnxtre: Add RoCE support for BCM576xx controllers
Added RoCE support for BCM576xx controllers with below changes,

1. Update the BAR offsets for handling BCM576xx controllers.
Use the values populated by the L2 driver for getting the
Doorbell offsets.

2. Use msn index instead of tail to pull psn table entry.

3. Temporarily disable dbr pacing feature untill it is
fully implemented.

4. Add support for 400G speed.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54521
MFC after: 3 days

(cherry picked from commit 92ba9b2fe58910b1d2cd6cd34b5ec093f0d9f700)
2026-02-27 12:04:37 +00:00
Bjoern A. Zeeb
2da96ce51c usb: indentation (whitespace change only)
No functional change.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 0762cf10fc5e426700e00f9060518241212e941f)
2026-02-26 23:00:12 +00:00
Alexander Motin
56a6305557 ahci: Restrict NVMe redirection by BAR size
Attempts to access vendor-specific registers on emulator of older
Intel hardware was reported to confuse one.  Since the redirection
obviously require BAR size bigger than normal 2KB of AHCI, add
the condition, similar to what Linux is doing.

Requested by:	kib
MFC after:	2 weeks

(cherry picked from commit b9d3945831fc7a60f2065c7a0afc747dc5653c9f)
2026-02-24 16:40:41 -05:00
Nathaniel Braun
3ca02a70f7 vt: Fix handling of backtab
PR: 292463
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2002

(cherry picked from commit 5fec99caff3ac4f476bb88078ebf85fbecf6afb3)
2026-02-23 09:22:55 -05:00
Enji Cooper
1459b69f04 asmc: unbreak build: add missing curly brace
Fixes:	d76bb14e022 ("chore: asmc: additional style(9) cleanup")
(cherry picked from commit 9ccdf3f36e014f0060ea192ffed91a7679003355)
2026-02-22 10:51:33 -08:00
Gordon Bergling
76f7f05558 qlnxe(4): Fix a typo in a source code comment
- s/segement/segment/

(cherry picked from commit ff08ad36c2acb3553b9f585a9bd01fd1306bfd7e)
2026-02-22 13:09:07 +01:00
Gordon Bergling
81672edc31 mlx(4): Fix a typo in a source code comment
- s/segements/segments/

(cherry picked from commit 3e46676638ac089c71e8424961449895c0babcfb)
2026-02-22 13:08:52 +01:00
Enji Cooper
cfd588aef5 chore: asmc: additional style(9) cleanup
Pick out non-gratuitous style(9) changes suggested by `clang-format` on
the driver. This helps eliminate minor stylistic issues with spaces,
braces, line lengths, etc, so future functional changes in the driver
will be easier to pick out.

Many of the other `clang-format` suggested changes were not taken because
they were considerably more gratuitous.

No functional change intended.

MFC after:	1 week

(cherry picked from commit d76bb14e0224e235209d8c07ec132d602b18648b)
2026-02-21 20:26:51 -08:00
Enji Cooper
df4cc7df45 chore: asmc: minor code cleanup
- Use symbolic names in Mac definitions in lieu of the unrolled values
  they represent.
- Delete trailing whitespace.
- Fix indentation.

No functional change intended.

MFC after:	1 week

(cherry picked from commit a8f3c3b5d4d9dac1dafe4094fe35b30ffdf26178)
2026-02-21 20:26:51 -08:00
Enji Cooper
9ecdc69d30 Unbreak the build
Add the missing comma in the `device_printf` statement.

MFC after:	1 week
MFC with:	9c666de5b
Fixes:	9c666de5b ("Make message added for Darwin OSI quirk more terse")

(cherry picked from commit cc702c78f70f972cf2f8ea008752d96df1989988)
2026-02-21 20:17:44 -08:00
Enji Cooper
a0d06f59e8 Make message added for Darwin OSI quirk more terse
The verbose message was way too verbose. Make it terse.

MFC after:	1 week
MFC with:	052a791b00 ("acpi: add Darwin OSI quirk for Apple Mac hardware")
Requested by:	kib

(cherry picked from commit 9c666de5b339d3c8f9bf3963691e4310e7d159cb)
2026-02-21 20:17:44 -08:00
Abdelkader Boudih
cd937141ac acpi: add Darwin OSI quirk for Apple Mac hardware
Mac firmware hides the Intel integrated GPU (iGPU) on dual GPU x86
systems, i.e., with AMD/NVIDIA dGPUs, when the Darwin OSI is not
installed via ACPI.

Prior to this change, FreeBSD always used the dGPU. This is fine in
practice, but consumed more power than when the iGPU is used,
resulting in reduced battery life.

Linux handles this in `drivers/acpi/osi.c` by detecting Apple
hardware via DMI, disabling all Windows OSI strings, and
by explicitly installing the Darwin OSI ACPI handler. This change
applies equivalent logic to the acpi(4) driver on FreeBSD.

This feature can be enabled/disabled using the
`hw.acpi.apple_darwin_osi` tunable. Setting this tunable to `0`
restores the previous behavior by explicitly disabling the added
support.

Reviewed by:	obiwac, ngie, adrian
Differential Revision:	https://reviews.freebsd.org/D54762

(cherry picked from commit 052a791b00555805f19ccc38a04d42d48b54104b)
2026-02-21 20:17:44 -08:00
Abdelkader Boudih
5111a75444 asmc: Add support for MacBookPro11,5
Add support for the MacBookPro11,5 (Mid 2015, 15-inch with AMD Radeon R9 M370X GPU)
  to the Apple SMC driver.

  Debug testing revealed this model lacks several SMC keys present on MacBookPro11,4
  (IBLC, ICMC, IC2C), that model-specific sensor definitions.

Differential Revision:	https://reviews.freebsd.org/D54665
Reviewed by:	adrian

(cherry picked from commit c498eaa2f9090d7bdc6456181d8bf74869288bbb)
2026-02-21 20:05:46 -08:00
Abdelkader Boudih
afa1058ff7 asmc: improve asmc_dumpall to read actual SMC key count
The asmc_dumpall debug function previously used a hardcoded loop limit
of 0x100 (256) keys with a "XXX magic number" comment.

This change improves asmc_dumpall to:

* Read the actual number of keys from the ASMC_NKEYS SMC key
* Print the key count being dumped for better debugging output
* Loop only up to the actual key count (e.g., 297 on Mac Mini 5,1)

This provides more accurate debug output and removes the magic number.

Tested on Mac Mini 5,1 (FreeBSD 16.0-CURRENT):

* Rebuild kernel with DEBUG enabled in asmc driver
* Boot with new kernel
* Verify dmesg shows "asmc_dumpall: dumping 297 keys" (or actual count)
* Verify all 297 keys are dumped

Differential Revision:	https://reviews.freebsd.org/D54436
Reviewed by:	markj, adrian

(cherry picked from commit 2a7c4685b7693bfa15e2bd4d5e82905a368b0030)
2026-02-21 20:05:39 -08:00
Enji Cooper
3eddfdd423 Add ASMC_DEBUG make option
This allows folks to enable debug statements in asmc(4) using kernel
configs via the `options ASMC_DEBUG` directive.

While here, remove a duplicate `device vt_efifb` directive in `NOTES`
as it's already handled in the `GENERIC` config

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54511

(cherry picked from commit f224591746bdaf14ad5f63de4738a3146cc2f55f)
2026-02-21 19:57:56 -08:00
Konstantin Belousov
1661d41cde dev/mfi: include sys/abi_compat.h unconditionally
(cherry picked from commit bf603dbbb2c9964bba3d5bf2ba2371a75a0cc521)
2026-02-21 23:34:08 +02:00
Konstantin Belousov
2d63a28811 sys/event.h: reduce namespace pollution from sys/abi_compat.h
(cherry picked from commit ecadac729a1b855fe0d77a682ee424c3da1eb3db)
2026-02-21 23:34:08 +02:00
Konstantin Belousov
c3b1a6ab18 sys/abi_compat.h: move freebsd32_uint64_t and FU64_CP() there
(cherry picked from commit e651c64bcab08c7b12d8ad6e3ad0b1ef3af3b875)
2026-02-21 23:34:07 +02:00
Olivier Certner
1d9cd70408
acpi: Use AcpiGbl_FACS even on ACPI_REDUCED_HARDWARE
This has been possible since ACPICA 20240827, and is actually
a requirement to get out of S3 on ACPI_REDUCED_HARDWARE (that said, we
don't implement S3 on arm64 yet).

Relevant ACPICA commit:
79cd933e7b.

Reviewed by:    obiwac
MFC after:      2 weeks
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54625

(cherry picked from commit 0cca6277499febef57149e8999ecd1a42ef1dfd3)
2026-02-19 13:28:50 +01:00
Olivier Certner
6d6eca79f0
acpi: Use only AcpiGetSleepTypeData() to determine Sx support
Previously, we would first call AcpiEvaluateObject() to execute \_Sx
before calling AcpiGetSleepTypeData().  This was unnecessary, as
AcpiGetSleepTypeData() performs the same call itself.  While doing so,
the latter function logs any other error than AE_NOT_FOUND (which
indicates that a particular sleep state is not supported), which most
probably is an added benefit of this change.

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54624

(cherry picked from commit 526c09a489295c96662d6c3d428f69672968ab80)
2026-02-19 13:28:50 +01:00
Olivier Certner
97490a7b32
ahc(4): Fix a warning on i386 compilation
Fixes:          cd036e891a ("ahc_pci.c: If bus_dma...")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit a9f7074e858fd7c8e07c164fc365afc0d0077735)
2026-02-19 13:28:50 +01:00
Dag-Erling Smørgrav
3562c80f41 nvme: Use size_t for payload size
Using uint32_t here can cause spurious compiler warnings.  I assume it
was done to constrain the range; use a KASSERT instead.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55279

(cherry picked from commit be7e4dc878eab090cd411c9ef28880e4f62116f5)
2026-02-18 00:15:34 +00:00
Dag-Erling Smørgrav
6458b1a2fd nvme: Use __diagused instead of __unused
Reviewed by:	imp
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.

(cherry picked from commit 1c09ae2be059da0b945a2543ac7dd0bd5198d0e3)
2026-02-18 00:15:34 +00:00
Vladimir Kondratyev
5bf02d480f evdev: Drop comments from input-event-codes.h
They were copied intact from the Linux GPL-only file.

Requested by:	imp, glebius
MFC after:	1 week

(cherry picked from commit 89aa8a94053fdd22ed716fdf424a2d10e70b3188)
2026-02-17 23:38:27 +03:00
Vladimir Kondratyev
09f1db900c evdev: Sync event codes with Linux kernel 6.18
MFC after:	1 month

(cherry picked from commit 8d9a5d44b155af7123893a6948ad7e86b48c57b3)
2026-02-17 23:38:27 +03:00
Robert Wahlberg
68ab942882 psm: Fix three finger tap on elantech v4 touchpads
Fix an issue where a three finger tap would generate additional events
when fingers moved slightly during the tap.

Signed-off-by:	Robert Wahlberg <freebsd@robertwahlberg.se>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1792
Reviewed by:	wulf
MFC after:	1 month

(cherry picked from commit e3201cec8381c0582374f93991eff4a71bb95e9b)
2026-02-17 23:38:26 +03:00
Vladimir Kondratyev
d0e1b3edee hid: Make game controllers accessible to members of the game group
Their events have to be accessible by unprivileged users via e.g. libsdl.

MFC after:	1 month

(cherry picked from commit b6cad334e649f49c57da52b139de353ad9078985)
2026-02-17 23:38:26 +03:00
Vladimir Kondratyev
bcc0680643 evdev: Allow setting of character device ownership and access mode
by device driver. That is required as game pad and joystick events have
to be accessible by ordinary users.

MFC after:	1 month

(cherry picked from commit ecccc9d99901dd874e8d122853026d7c28fa4fcf)
2026-02-17 23:38:26 +03:00
Mark Johnston
361b803102 vmm: Remove an unneeded NULL pointer check
sc->vm is unconditionally dereferenced earlier in this function.  No
functional change intended.

Reviewed by:	bnovkov
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55069

(cherry picked from commit 2d0564b9daf49c46e0e4ef6c7d162c73fc8b35d7)
2026-02-16 13:42:10 +00:00
John Hall
0c370a416b smartpqi: Update to vendor version 14.4690.0.2008 - 15.2.0.2008
Update to versions:
FreeBSD14 14.4690.2008
FreeBSD15 15.2.0.2008

Included in this update are:
 - Support for new controllers
 - Add code that utilizes the new BIG_IOCTL_Command_struct and allows
   the I/O buffer size for a single passthrough ioctl to be stored as a
   32 bit integer instead of the original 16 bit integer.
 - Update occurrences of Microsemi to Microchip
 - Some format changes including converting comments from C++ to C
   style, remove instances of /* $FreeBSD$ */, and updating copyright
   dates.

Update to versions:
FreeBSD14 14.4690.2008
FreeBSD15 15.2.0.2008

Included in this update are:

- Support for new controllers

_ Add code that utilizes the new BIG_IOCTL_Command_struct and allows
  the I/O buffer size for a single passthrough ioctl to be stored as
  a 32 bit integer instead of the original 16 bit integer.

- Update occurrences of Microsemi to Microchip

- Some format changes including converting comments from C++ to C
  style, remove instances of /* $FreeBSD$ */, and updating copyright
  dates.

Reviewed by:	imp
Approved by:	imp
MFC after:	1 week

Sponsored by: Microchip Technology Inc.

Differential Revision:	https://reviews.freebsd.org/D54787

(cherry picked from commit 7f54c65abc67f50363bbd2a68a980d23e69c9ef0)
2026-02-12 12:21:39 -07:00
Zhenlei Huang
0cfc1145cd qlnxe: Overhaul setting the multicast MAC filters
When operating the multicast MAC filters, the current usage of
ECORE_FILTER_ADD and ECORE_FILTER_REMOVE are rather misleading.
ECORE_FILTER_ADD reads "adding new filter", but it actually removes
any existing filters and then addes a new one. ECORE_FILTER_REMOVE
reads "removing a filter", but it actually removes all filters.
Let's use ECORE_FILTER_REPLACE and ECORE_FILTER_FLUSH instead to
avoid confusion.

In the current implementation, only one MAC address is passed to
ecore_sp_eth_filter_mcast() and any previously installed filters are
removed, hence it breaks the multicast function. That can be observed
via either assigning new IPv6 addresses to the interface or putting
the interface as a member of lagg(4) interface with LACP aggregation
protocol. Fix that by calculating the multicast filter bins directly
from multicast MAC addresses and replace the filters every time
the bins changes.

Due to the nature of the multicast filter, which is hash based, a
full 1's multicast filter bin means all multicast packets are to be
accepted. Thus there's no need to make the vport into allmulti mode
when the number of multicast MAC addresses exceeds the limit
(ECORE_MAX_MC_ADDRS, 64).

Tested with a FastLinQ QL41212HLCU 25GbE adapter, both MFW_Version
8.35.23.0 and 8.59.16.0 are tested.

Note: Currently the VF port is set to promiscuous mode unconditionally,
and the setting of the multicast MAC filters for VF ports is
short-circuited, so the VF port functions as it did.

PR:		265857
PR:		290973
Reviewed by:	kbowling
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54892

(cherry picked from commit 70256d2b86d95a678a63c65b157b9c635f1f4c6a)
2026-02-11 18:00:44 +08:00
Zhenlei Huang
425b9cec0b qlnxe: Allow tapping the TX packets
Currently only the packets in the RX path can be captured by tcpdump
as the ETHER_BPF_MTAP call in the TX path is missing. Add it so that
packets in both directions can be captured.

PR:		290973
Reviewed by:	kbowling
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54891

(cherry picked from commit 968647502ec21464ad3aecc7577ff0e8dfd41693)
2026-02-11 18:00:44 +08:00
Zhenlei Huang
b8d2c1c367 qlnxe: Refactor setting the promiscuous and allmulti mode
There are two entry points to set the promiscuous and allmulti mode.
One is ioctl, and another is the init routine. Given they share almost
the identical logic, refactor a little to make the code more clear.

While here, for the ioctl, translate the error to EINVAL to avoid
confusing the net stack.

Reviewed by:	kbowling
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54890

(cherry picked from commit 45b1718fadae7d56051ba04ef9d7a175a602a226)
2026-02-11 18:00:44 +08:00
Zhenlei Huang
0f383f74b7 qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl
Since the change [1], the init routine qlnx_init() works as intended.
Let ether_ioctl() handle SIOCSIFADDR to simplify the code.

Combined with the change [1], this shall be a better fix for PR 287445.

[1] c10e6bc0f007 qlnxe: Avoid reinitializing the interface when it is already initialized

PR:		287445
Reviewed by:	kbowling
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54888

(cherry picked from commit 4012b63889e40bb877bc0e4c8da1792bce472c08)
2026-02-11 18:00:43 +08:00