FreeBSD/src 091a1e7sys/dev/qlnx/qlnxe qlnx_os.c ecore_l2.c

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.


    [22 lines not shown]
DeltaFile
+37-153sys/dev/qlnx/qlnxe/qlnx_os.c
+21-20sys/dev/qlnx/qlnxe/ecore_l2.c
+3-8sys/dev/qlnx/qlnxe/ecore_vf.c
+4-5sys/dev/qlnx/qlnxe/ecore_l2_api.h
+1-4sys/dev/qlnx/qlnxe/qlnx_def.h
+66-1905 files

FreeBSD/src 281d578sys/dev/qlnx/qlnxe qlnx_os.c

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)
(cherry picked from commit 425b9cec0b8ce15a6e67d54a73f4f38dc66a4ccc)
(cherry picked from commit ddfe98e8ccb120a0a5c42b2288694ecd2b70c80c)
DeltaFile
+1-0sys/dev/qlnx/qlnxe/qlnx_os.c
+1-01 files

FreeBSD/src 52609ccsys/dev/qlnx/qlnxe qlnx_os.c

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)
(cherry picked from commit 0f383f74b7398161c12a290e50b060baf45d2800)
(cherry picked from commit 20ffe22fcfe13b48a8e993cbf565f9cd9229a4b3)
DeltaFile
+0-19sys/dev/qlnx/qlnxe/qlnx_os.c
+0-191 files

FreeBSD/src aef23e8sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Avoid reinitializing the interface when it is already initialized

qlnx_init_locked() unconditionally uninitialize the interface thus is
actually reinitializing the interface. Well the init routine qlnx_init()
is to initialize the interface by net stack when assigned with the first
inet or inet6 address. The ioctl SIOCSIFADDR for the first inet6 address
is handled by ether_ioctl() thus the interface is reinitialized no matter
it was initialized or not.

Add a driver status check for that to avoid reinitializing. Further plan
is removing SIOCSIFADDR ioctl from the driver and let ether_ioctl() handle
it.

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

(cherry picked from commit c10e6bc0f0079e90cb484323ad71d437f1882422)
(cherry picked from commit 8731ff4871d5397bae65bf184c44629a52c0e97b)
(cherry picked from commit ee6495580925b337f5851b6ee0f1188f81d7a6c8)
DeltaFile
+2-1sys/dev/qlnx/qlnxe/qlnx_os.c
+2-11 files

FreeBSD/src eeb4c04sys/dev/qlnx/qlnxe qlnx_os.c qlnx_def.h

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)
(cherry picked from commit b8d2c1c367465506b66a1696483caec1d04b2ea0)
(cherry picked from commit 00ab0df79364f4567ad61f6a66eba1b2f0a7d507)
DeltaFile
+38-46sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/dev/qlnx/qlnxe/qlnx_def.h
+38-472 files

FreeBSD/src e16c965sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Prevent potential concurrency between ioctls

The driver-managed status flags should be lock protected to be touched.
Also this can serialize ioctls those check the IFF_DRV_RUNNING status.

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

(cherry picked from commit 0df8a998a9fe28af659cb401c537c6d785e55f81)
(cherry picked from commit 285b25c080faf71c60de36e834ef31cf70e6b50d)
(cherry picked from commit 6e5b12acb66a9e269801b8d88c8f9838044d631c)
DeltaFile
+9-8sys/dev/qlnx/qlnxe/qlnx_os.c
+9-81 files

FreeBSD/src fb463bcsys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Fix setting the unicast MAC filter of RX path

When an Ethernet interface is added to lagg(4) as a child interface, its
type, aka if_type, is changed from IFT_ETHER to IFT_IEEE8023ADLAG. Well
changing the link-layer address of the lagg(4) interface will be
propagated to all child interfaces, hence the drivers of child interfaces
shall not presume the type of the interface will not be changed.

Meanwhile, on initializing, an ifnet has been fully attached and it is
guaranteed to have non-null link-layer address so stop NULL checking for
it.

Reviewed by:    kbowling
Fixes:          792226e53023 qlnxe: Allow MAC address override
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54885

(cherry picked from commit f250852c9a0c1021c3be4b498e27cfc7b42a81db)
(cherry picked from commit 6d138e958ffb318595eec29b910cada414e2f86d)
(cherry picked from commit 93719f8c8348a5d13c9037352072ce67f530288b)
DeltaFile
+3-11sys/dev/qlnx/qlnxe/qlnx_os.c
+3-111 files

FreeBSD/src 18e4cb4sys/dev/qlnx/qlnxe qlnx_os.c qlnx_def.h

qlnxe: Avoid memcpy with same source and destination

In case the device is VF, qlnx_get_mac_addr() returns ha->primary_mac
hence it ends up memcpy with same source and destination. Refactor
slightly to avoid that.

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

(cherry picked from commit 3aeeedc7e0dc231c16406ff64f4a08a716964c40)
(cherry picked from commit 6462189595047800337aaf052e397d1aade3f9a7)
(cherry picked from commit ea1143bddbc3671f49219a6b2a054965deea0c63)
DeltaFile
+7-6sys/dev/qlnx/qlnxe/qlnx_os.c
+0-1sys/dev/qlnx/qlnxe/qlnx_def.h
+7-72 files

FreeBSD/src 610b813sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Fix promiscuous and allmulti settings

PR:             278087

(cherry picked from commit e3ec564ecb9c2daa96a8db36052e50ea554fe598)
(cherry picked from commit e4f48fc20b56df8a03ab63fb867f49bfcc0e7eae)
DeltaFile
+22-11sys/dev/qlnx/qlnxe/qlnx_os.c
+22-111 files

FreeBSD/src 686280clib/libjail jail.c

libjail: avoid a double-free in the MAC label bits

As written, we'll repeatedly jps_free() the first element, which is
obviously bogus.  Fix it to index appropriately.

Fixes:  db3b39f063d9f ("libjail: extend struct handlers [...]")
DeltaFile
+1-1lib/libjail/jail.c
+1-11 files

FreeBSD/src 1ce195dcrypto/heimdal/kdc mit_dump.c

heimdal: Pass the correct pointer to realloc when growing a string buffer

The realloc in my_fgetln was trying to grow the pointer to the string
buffer, not the string buffer itself.

In function 'my_fgetln',
    inlined from 'mit_prop_dump' at crypto/heimdal/kdc/mit_dump.c:156:19:
crypto/heimdal/kdc/mit_dump.c:119:13: error: 'realloc' called on unallocated object 'line' [-Werror=free-nonheap-object]
  119 |         n = realloc(buf, *sz + (*sz >> 1));
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/heimdal/kdc/mit_dump.c: In function 'mit_prop_dump':
crypto/heimdal/kdc/mit_dump.c:139:11: note: declared here
  139 |     char *line = NULL;
      |           ^~~~

Reviewed by:    rmacklem, cy
Fixes:          a93e1b731ae4 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:  https://reviews.freebsd.org/D54933
(cherry picked from commit 03d8ac948b1ad9c419b294c3129b7da58d818363)
DeltaFile
+1-1crypto/heimdal/kdc/mit_dump.c
+1-11 files

FreeBSD/src 51bb8e4crypto/heimdal/lib/hdb keys.c

heimdal: Pass the correct pointer to free in an error case

This fixes a warning reported by GCC 14 on stable/14:

crypto/heimdal/lib/hdb/keys.c:241:13: warning: 'free' called on pointer 'ext' with nonzero offset 16 [-Wfree-nonheap-object]
  241 |             free(hist_keys);
      |             ^~~~~~~~~~~~~~~
crypto/heimdal/lib/hdb/keys.c:234:15: note: returned from 'calloc'
  234 |         ext = calloc(1, sizeof (*ext));
      |               ^~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by:    rmacklem, cy
Fixes:          5000d023a446 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:  https://reviews.freebsd.org/D54932
(cherry picked from commit b26a7af438f36dcde86f39a681123cc2140affb2)
DeltaFile
+1-1crypto/heimdal/lib/hdb/keys.c
+1-11 files

FreeBSD/src 5d6dfa5share/man/man5 src.conf.5

src.conf.5: regen documenting WITH_IPFILTER_IPFS

(cherry picked from commit b9b1262a8ef95857101e538145703894e3b880b7)
DeltaFile
+5-1share/man/man5/src.conf.5
+5-11 files

FreeBSD/src f981908tools/build/options WITH_IPFILTER_IPFS

options: describe WITH_IPFILTER_IPFS

Add a description for WITH_IPFILTER_IPFS.

Fixes:          0ff0c19e7f70 ("ipfilter: Disable ipfs(8) by default")
(cherry picked from commit c112ad75605ccdfcb8bbce2f57b0e7a077f057f8)
DeltaFile
+3-0tools/build/options/WITH_IPFILTER_IPFS
+3-01 files

FreeBSD/src 7ae432esys/kern vfs_mount.c

vfs_mount.c: Don't call VFS_MOUNT() if only exports are being updated

PR#293198 reports a hang within ZFS when exports
are being updated concurrently with a VOP_SETEXTATTR().
The hang appears to be caused by mishandling of the
z_teardown_lock, but fixing handling of this lock appears
to be a major effort. Since the hang occurs when
VFS_MOUNT() acquires a write/exclusive z_teardown_lock,
which rarely occurs, except when exports are being updated,
this patch avoids the VFS_MOUNT() call for this case.

Avoiding a VFS_MOUNT() call fixes the hang for the case
reported by PR#293198 and is also an optimization.
As such, this patch avoids the VFS_MOUNT() call when only exports
are being updated similar to what was already being done
within vnet prisons.

PR:     293198

(cherry picked from commit 935cf3284f520c90a63baaadb762caaa30084f5c)
DeltaFile
+31-21sys/kern/vfs_mount.c
+31-211 files

FreeBSD/src 4791189usr.sbin/syslogd/tests syslogd_format_test_common.sh

syslogd/tests: use kern.features to detect INET support

This fixes INET feature detection with kernel configs
that do not include the kern.conftxt sysctl, such as
riscv64 currently[0].

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/usr.sbin.syslogd/syslogd_forwarded_format_test/O_flag_bsd_forwarded_legacy/

Reviewed by:    markj
Approved by:    emaste (mentor)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55383

(cherry picked from commit c721ceeb3ef0b29d06e6c3c634579f3bc85cc28b)
DeltaFile
+1-2usr.sbin/syslogd/tests/syslogd_format_test_common.sh
+1-21 files

FreeBSD/src 86a8a67sys/riscv/conf GENERIC

riscv: GENERIC: enable KERN_TLS

This unskips 585 sys/kern/ktls_test testcases[0] in CI. All 585 tests currently pass.

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/sys.kern/

Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55376

(cherry picked from commit 1e649491b8567151270095fda3bce8faea394952)
DeltaFile
+1-0sys/riscv/conf/GENERIC
+1-01 files

FreeBSD/src 49ab036share/man/man4 multicast.4

multicast.4: Fix disabling multicast forwarding

Reviewed by: markj, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55266

(cherry picked from commit f2c2e5b0bf9def01b10651b9802fa38d07d9d265)
DeltaFile
+22-4share/man/man4/multicast.4
+22-41 files

FreeBSD/src 97b7f73sys/riscv/conf GENERIC

riscv: GENERIC: enable KERN_TLS

This unskips 585 sys/kern/ktls_test testcases[0] in CI. All 585 tests currently pass.

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/sys.kern/

Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55376

(cherry picked from commit 1e649491b8567151270095fda3bce8faea394952)
DeltaFile
+1-0sys/riscv/conf/GENERIC
+1-01 files

FreeBSD/src b0476eesecure/lib/libcrypto/man/man3 Makefile

OpenSSL: install EVP_CIPHER_CTX_get_app_data.3 once

A separate EVP_CIPHER_CTX_get_app_data.3 was added in the OpenSSL 3.5.5
import, but the link to EVP_EncryptInit.3 was still being installed
which stomped on the file and created inconsistent entries in the METALOG.

Reviewed by:    emaste
Found by:       package_check script in Cirrus-CI
Fixes:          1731fc70f734 ("OpenSSL: update vendor sources to match 3.5.5 content")
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D55332

(cherry picked from commit c4130a8a84e1ce0fc9c05d2b48f83e66ade302aa)
DeltaFile
+0-1secure/lib/libcrypto/man/man3/Makefile
+0-11 files

FreeBSD/src b4305c9usr.bin/less lesspipe.sh

lesspipe: Allow zstd to operate on a symlink

By default zstd refuses to operate on symlinks, so for example
`zless /var/crash/vmcore.last.zst` failed to view the uncompressed core
file.  Add -f to the zstd command line to allow operation on symlinks.

Reviewed by:    delphij
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55101
DeltaFile
+1-1usr.bin/less/lesspipe.sh
+1-11 files

FreeBSD/src 16822dasys/dev/acpi_support acpi_panasonic.c

acpi_panasonic: Clear wireless RF_KILL on boot and resume

On Panasonic FZ-Y1 and similar models, the EC latches RF_KILL on
shutdown and suspend when battery is at certain level, causing wireless
to boot with hard block.

Call WLSW.SHRF during attach and resume to clear the block.

Tested on Panasonic FZ-Y1 with Intel Wireless 7265.

Reviewed by:    adrian, obiwac
Approved by:    adrian, obiwac
Differential Revision:  https://reviews.freebsd.org/D55265
DeltaFile
+36-0sys/dev/acpi_support/acpi_panasonic.c
+36-01 files

FreeBSD/src 477ab96share/misc committers-ports.dot

Add records about new ports committer (nxjoseph)

Update Mentor and Mentee Information to follow step
5 of the Committers Guide.

Reviewed by:    osa, vvd (mentors)
Approved by:    osa (mentor)
Differential Revision:  https://reviews.freebsd.org/D55457
DeltaFile
+4-0share/misc/committers-ports.dot
+4-01 files

FreeBSD/src 3ca02a7sys/dev/vt vt_core.c, sys/teken teken.c teken.h

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)
DeltaFile
+6-0sys/dev/vt/vt_core.c
+4-0sys/teken/teken.c
+2-0sys/teken/teken.h
+12-03 files

FreeBSD/src 21b4ec5tools/test/hwpmc pmctest.py

Split counting from sampling.

(cherry picked from commit 77153a491e3b31475f5faddb21271a0a8e0d4a9b)
DeltaFile
+21-4tools/test/hwpmc/pmctest.py
+21-41 files

FreeBSD/src 329655dtools/test/hwpmc pmctest.py

Correct the data collection arguments.  Add proper tempdirs.

(cherry picked from commit e018fedef0a6389240322da9fa4b9fa9971f6e59)
DeltaFile
+6-3tools/test/hwpmc/pmctest.py
+6-31 files

FreeBSD/src 711ab19tools/test/hwpmc pmctest.py

Start adding an exercise mode for programs under test.

In exercise mode we collect data for every available counter on a
program and keep all of that in a directory in /tmp.

(cherry picked from commit 4a1b69ade6b5e8665dfb4d0cb683854705192a68)
DeltaFile
+24-9tools/test/hwpmc/pmctest.py
+24-91 files

FreeBSD/src 259506ftools/test/hwpmc pmctest.py

Extend the script to collect gprof data

While we're at it, switch to simple waiting from communicate() calls.

(cherry picked from commit e2bedc7d69926426a710d035df51e0a0812d38b1)
DeltaFile
+27-4tools/test/hwpmc/pmctest.py
+27-41 files

FreeBSD/src 9f80b89tools/test/hwpmc pmctest.py

Convert fully to Python 3.  Remove licence text, only keep SPDX.

Update to use argparse rather than OptionParser (now deprecated).

(cherry picked from commit eb1c0d74cbb99f329767b3d565ae57a3ec032bee)
DeltaFile
+19-54tools/test/hwpmc/pmctest.py
+19-541 files

FreeBSD/src 4a9a270tools/test/hwpmc pmctest.py

Split counting from sampling.

(cherry picked from commit 77153a491e3b31475f5faddb21271a0a8e0d4a9b)
DeltaFile
+21-4tools/test/hwpmc/pmctest.py
+21-41 files