]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 months agobhyve: add QEMU_FWCFG_INDEX_NB_CPUS item
Corvin Köhne [Mon, 27 Jun 2022 09:05:42 +0000 (11:05 +0200)]
bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item

Requested-by: OVMF (qemu)
Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39316

(cherry picked from commit e46be58cca6bd180dadfb36e98a673ae6d8d2cd1)

bhyve: add missing include to qemu_fwcfg.c

Fixes: e46be58cca6bd180dadfb36e98a673ae6d8d2cd1 ("bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 76fa62b5232e67ef10476cf1329aaceb9cbc2ff5)

15 months agokbdcontrol.c: make pre-Unicode compatibility conditional
Stefan Eßer [Tue, 14 Feb 2023 12:27:27 +0000 (13:27 +0100)]
kbdcontrol.c: make pre-Unicode compatibility conditional

Support for the full range of Unicode character codes has been added
to the main keymap back in 2009, with compatibility shims added in
2011 (to support an older kbdcontrol command on a new kernel during
an upgrade from FreeBSD-8 to FreeBSD-9).

Unicode support for accented characters that are reached via dead key
combinations has been added just recently, again with compatibility
shims to allow all combinations of old/new kernel and old/new
kbdcontrol command to load and display the keymaps including the dead
key table. (But full Unicode in the dead key table requires both a new
kernel and kbdcontrol command.)

This commit makes the compatibility shims depend on the respective
compatibility ioctls (OGIO_KEYMAP, OPIO_KEYMAP, OGIO_DEADKEYMAP, and
OPIO_DEADKEYMAP) being defined in sys/kbio.h. This is true for all of
them in 13-STABLE, none in 12-STABLE (as of now), and will become
optional due to a follow-up commit to sys/kbio.h in -CURRENT.

This commit is the only part of review D38465 that should be merged
back to 12-STABLE and 13-STABLE.

(cherry picked from commit b4eab621f2462574d1836c199dc84c5bdb4f60f7)

15 months agomakefs: emit NM records for all directory entries
Ed Maste [Fri, 24 Mar 2023 17:53:59 +0000 (13:53 -0400)]
makefs: emit NM records for all directory entries

We previously attempted to emit Rock Ridge NM records only when the name
represented by the Rock Ridge extensions would actually differ. We would
omit the record for an all-upper-case directory name, however Linux (and
perhaps other operating systems) map names with no NM record to
lowercase.

This affected only directories, as file names have an implicit ";1"
version number appended and thus always differ.  To solve, just emit NM
records for all entries other than DOT and DOTDOT .

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

PR: 203531
Reported by: Thomas Schmitt <scdbackup@gmx.net
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39258

(cherry picked from commit 978013a0945d4c6b7ab3ee798dc13c74e913762a)

15 months agomakefs: correct El Torito bood record
Ed Maste [Thu, 23 Mar 2023 17:02:44 +0000 (13:02 -0400)]
makefs: correct El Torito bood record

The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

PR: 203531, 203646
Reported by: Coverity Scan
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: kevans
CID: 977470
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39231

(cherry picked from commit 9f2a525360473a778f91021e3be58fd4bfd72ee5)

15 months agomakefs: correct iso9660 Rock Ridge NM values
Ed Maste [Thu, 23 Mar 2023 12:35:34 +0000 (08:35 -0400)]
makefs: correct iso9660 Rock Ridge NM values

These are not actually used by makefs (yet), but ought to match the
spec.

See RRIP 4.1.4 Description of the "NM" System Use Entry for details.

PR: 203531
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c3ec19359e05c3b609e461896aa6ab4d6ad8121f)

15 months agomakefs: correct iso9660 Rock Ridge TF timestamps
Ed Maste [Wed, 22 Mar 2023 23:42:45 +0000 (19:42 -0400)]
makefs: correct iso9660 Rock Ridge TF timestamps

The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) were
incorrect, and timestamps were written in the wrong order.

See RRIP 4.1.6 Description of the "TF" System Use Entry for details.

PR: 203531
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: jrtc27, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39221

(cherry picked from commit c65c969bd5d4ae7c52dedafb3c39b7e933079d4a)

15 months agosetkey(8): add -e option to take script from the command line
Konstantin Belousov [Mon, 3 Apr 2023 01:03:50 +0000 (04:03 +0300)]
setkey(8): add -e option to take script from the command line

(cherry picked from commit 3cb808226c1f62ed5c726480073eb9035a24d2cc)

15 months agoifconfig: Fix configuring if_bridge with additional operating parameters
Zhenlei Huang [Fri, 7 Apr 2023 14:25:41 +0000 (22:25 +0800)]
ifconfig: Fix configuring if_bridge with additional operating parameters

For clone create and rename operations, the interface name get back can be
different from the one passed to ioctl(). Use the interface name we get back
so that ifconfig will not return unexpected ENXIO.

PR: 270618
Reviewed by: kp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39396

(cherry picked from commit 09e5e3d598604167c1fb05e5cd0f41ed83314517)

15 months agoifconfig: Improve VLAN identifier parsing
Zhenlei Huang [Sun, 2 Apr 2023 17:54:31 +0000 (01:54 +0800)]
ifconfig: Improve VLAN identifier parsing

VLAN identifier 0xFFF is reserved. It must not be configured or
transmitted.

Also validate during parsing to prevent potential integer overflow.

Reviewed by: #network, melifaro
Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39282

(cherry picked from commit 28b498e65ab40975ea12393498bacd6249b7204c)

15 months agoinfiniband: Widen NET_EPOCH coverage
Zhenlei Huang [Sun, 2 Apr 2023 16:51:49 +0000 (00:51 +0800)]
infiniband: Widen NET_EPOCH coverage

From static code analysis, some device drivers (cxgbe, mlx4, mthca, and qlnx)
do not enter net epoch before lagg_input_infiniband(). If IPoIB interface is a
member of lagg(4) interface, and after returning from lagg_input_infiniband()
the receiving interface of mbuf is set to lagg(4) interface, then when
concurrently destroying the lagg(4) interface, there is a small window that the
interface gets destroyed and becomes invalid before infiniband_input() re-enter
net epoch, thus leading use-after-free.

Widen NET_EPOCH coverage to prevent use-after-free.

Thanks hselasky@ for testing with mlx5 devices.

Reviewed by: hselasky
Tested by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39275

(cherry picked from commit 90820ef121b38479f2479c03c12c69f940f5fa33)

15 months agolagg(4): Tap traffic after protocol processing
Zhenlei Huang [Sun, 2 Apr 2023 17:01:51 +0000 (01:01 +0800)]
lagg(4): Tap traffic after protocol processing

Different lagg protocols have different means and policies to process incoming
traffic. For example, for failover protocol, by default received traffic is only
accepted when they are received through the active port. For lacp protocol, LACP
control messages are tapped off, also traffic will be dropped if they are
received through the port which is not in collecting state or is not joined to
the active aggregator. It confuses if user dump and see inbound traffic on
lagg(4) interfaces but they are actually silently dropped and not passed into
the net stack.

Tap traffic after protocol processing so that user will have consistent view of
the inbound traffic, meanwhile mbuf is set with correct receiving interface and
bpf(4) will diagnose the right direction of inbound packets.

PR: 270417
Reviewed by: melifaro (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39225

(cherry picked from commit 5f3d0399e903573e9648385ea6585e54af4d573f)

15 months agolacp: Use C99 bool for boolean return value
Zhenlei Huang [Fri, 31 Mar 2023 17:48:36 +0000 (01:48 +0800)]
lacp: Use C99 bool for boolean return value

This improves readability.

No functional change intended.

MFC after: 1 week

(cherry picked from commit 5a8abd0a298e6e7a8bf938a7eb171b647b1860cd)

15 months agolagg(4): Do not enter net epoch recursively
Zhenlei Huang [Wed, 29 Mar 2023 16:25:16 +0000 (00:25 +0800)]
lagg(4): Do not enter net epoch recursively

This saves a little resources.

No functional change intended.

Reviewed by: kp
Fixes: b8a6e03fac92 Widen NET_EPOCH coverage
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39267

(cherry picked from commit d4a80d21b3d32a2de02d1820cc1f38dba1f127cb)

15 months agolagg(4): Refactor out some lagg protocol input routines into a default one
Zhenlei Huang [Wed, 29 Mar 2023 16:16:21 +0000 (00:16 +0800)]
lagg(4): Refactor out some lagg protocol input routines into a default one

Those input routines are identical.

Also inline two fast paths.

No functional change intended.

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

(cherry picked from commit dbe86dd5de18fdf61e1300f6575e0f50785bf6b3)

15 months agolagg(4): Make lagg_list and lagg_detach_cookie static
Zhenlei Huang [Wed, 29 Mar 2023 16:13:02 +0000 (00:13 +0800)]
lagg(4): Make lagg_list and lagg_detach_cookie static

They are used internally only.

No functional change intended.

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

(cherry picked from commit fcac5719a1833ad865ac0a7960ff18319a40dfff)

15 months agolagg: Various style fixes
Zhenlei Huang [Fri, 24 Mar 2023 09:55:15 +0000 (17:55 +0800)]
lagg: Various style fixes

MFC after: 1 week

(cherry picked from commit dcd7f0bd02f407952de42d96e1c2c01ee3460702)

15 months agodaemon: reformat longopts
Kyle Evans [Thu, 23 Mar 2023 02:39:10 +0000 (21:39 -0500)]
daemon: reformat longopts

Use a single tab instead of eight spaces, these aren't line
continuations.

(cherry picked from commit b84aaf143c5097e6b2481b9afec66c90deec627f)

15 months agodaemon: decouple init logic from main loop
Ihor Antonov [Thu, 23 Mar 2023 02:37:12 +0000 (21:37 -0500)]
daemon: decouple init logic from main loop

main() func contained both initialization and main loop logic.
This made certain operations like restarting problematic and
required dirty hacks in form of goto jumps.

This commit moves the main loop logic into daemon_eventloop(),
cleans up main, and makes restart logic clear: daemon_mainloop()
is run in a loop with a restart condition checked at the end.

Reviewed by: kevans

(cherry picked from commit 4c41f4a0d67fc93cfb07ad5287f02d024d19ef5a)

15 months agodaemon: move signal setup into a function
Ihor Antonov [Tue, 21 Mar 2023 04:40:04 +0000 (23:40 -0500)]
daemon: move signal setup into a function

No functional change intended.

Reviewed by: kevans

(cherry picked from commit 9ee1faeebab594712ed302ea51949410c9744920)

15 months agopkill: use an ARG_MAX size buffer for argument matching
Kyle Evans [Mon, 20 Mar 2023 19:19:35 +0000 (14:19 -0500)]
pkill: use an ARG_MAX size buffer for argument matching

Right now pkill/pgrep cut off at _POSIX2_LINE_MAX (2048), but argument
strings can be much larger (ARG_MAX is 256K/512K).  Stop arbitrarily
cutting the search off at 2K, rather than documenting the limit.

Reviewed by: allanjude (earlier version), des
Sponsored by: Klara, Inc.

(cherry picked from commit 3610bffd2888b65389a46e8d075ce8e1fc83af4c)

15 months agodaemon: kill off some stray blank lines
Kyle Evans [Sat, 18 Mar 2023 06:04:35 +0000 (01:04 -0500)]
daemon: kill off some stray blank lines

Overlooked in review; mea culpa.

Reported by: jrtc27

(cherry picked from commit 6b49a630f441e1a9e8c8e57d2bb71e589d95872c)

15 months agodaemon: remove unnecessary memset in daemon_state_init()
Ihor Antonov [Sat, 18 Mar 2023 05:43:35 +0000 (22:43 -0700)]
daemon: remove unnecessary memset in daemon_state_init()

(cherry picked from commit 8117ea0a413150dccc05ea376596b98c4b1855e6)

15 months agodaemon: repace goto exit with daemon_terminate()
Ihor Antonov [Sat, 18 Mar 2023 05:31:12 +0000 (22:31 -0700)]
daemon: repace goto exit with daemon_terminate()

Start breaking down big main()
Remove goto exit label and replace it with a function that does cleanup.

Comment re-worded by kevans@.

(cherry picked from commit cf6356fd471cdf4e5c52550f63599881d722962c)

15 months agodaemon: move variables into struct daemon_state
Ihor Antonov [Sun, 12 Mar 2023 16:07:34 +0000 (10:07 -0600)]
daemon: move variables into struct daemon_state

The fact that most of the daemon's state is stored on the stack
of the main() makes it hard to split the logic smaller chunks.
Which in turn leads to huge main func that does a a lot of things.
struct log_params existed because some variables need to be passed
into other functions together.

This change renames struct log_params into daemon_state
and moves the rest of the variables into it. This is a necessary
preparation step for further refactroing.

Reviewed by: imp

(cherry picked from commit 298a392ec31819c8440974eeb47dfed48568fd5e)

15 months agoBump __FreeBSD_version for llvm 15.0.7 merge
Dimitry Andric [Wed, 8 Feb 2023 19:20:21 +0000 (20:20 +0100)]
Bump __FreeBSD_version for llvm 15.0.7 merge

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 3264f6b88fce7c5437d205685863617d8f6a22dd)

15 months agosctp: tweak panic message
Michael Tuexen [Wed, 3 Aug 2022 15:28:15 +0000 (17:28 +0200)]
sctp: tweak panic message

MFC after: 1 week

(cherry picked from commit 979bc32c7c14f944a340058fcd1a580a7492f785)

15 months agoi386: ansify
Dmitry Chagin [Sat, 25 Mar 2023 20:21:03 +0000 (23:21 +0300)]
i386: ansify

Reported by: clang 15

(cherry picked from commit f0fe68a965a2f0b42c296fef2c756f168a57b326)

15 months agorpc: ansify
Mateusz Guzik [Mon, 13 Feb 2023 05:39:10 +0000 (05:39 +0000)]
rpc: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 71948c15ba9e6db536e7a26c65f2f22ee03f1630)

15 months agolge: ansify
Mateusz Guzik [Sun, 12 Feb 2023 21:37:24 +0000 (21:37 +0000)]
lge: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 16d10ee0235abb217773aa46b927c8c1513f3261)

15 months agosysv: ansify
Mateusz Guzik [Wed, 8 Feb 2023 00:11:10 +0000 (00:11 +0000)]
sysv: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 08d357287b4306b24110dc5ff15bcf5d51f79b28)

15 months agoddb: ansify
Mateusz Guzik [Wed, 8 Feb 2023 00:09:23 +0000 (00:09 +0000)]
ddb: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit fb1b78bfcead2126f9a984ac1c3e6a3a7e505f83)

15 months agosk: ansify
Mateusz Guzik [Wed, 8 Feb 2023 00:05:03 +0000 (00:05 +0000)]
sk: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 82c519c21f15b7ce4775a7484aa4354f40771480)

15 months agosmbfs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:35:11 +0000 (23:35 +0000)]
smbfs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit b09b03a19d26e63046f3413cc8be2e4ece08daff)

15 months agoudf: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:24:24 +0000 (23:24 +0000)]
udf: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 724240c6fa249e03762cee62a95405105bd69ebe)

15 months agonullfs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:22:27 +0000 (23:22 +0000)]
nullfs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 24641b8b3964e9015d3f8579b2359104bb0e5eea)

15 months agofifofs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:18:51 +0000 (23:18 +0000)]
fifofs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ed40bc50dff06219baa251f1d238249624cb74ec)

15 months agovfs: ansify
Mateusz Guzik [Tue, 7 Feb 2023 23:03:20 +0000 (23:03 +0000)]
vfs: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 8377575772be0ed37eb42a0b08c684d9fc5c3e18)

15 months agoamd64: ansify
Mateusz Guzik [Tue, 7 Feb 2023 22:52:06 +0000 (22:52 +0000)]
amd64: ansify

Reported by:    clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit b2c68dc6d9b31de853664ac9277816678d2c9181)

15 months agoUpdate CWARNFLAGS in bsd.sys.mk and CWARNEXTRA in kern.mk for clang 15.
Dimitry Andric [Mon, 25 Jul 2022 10:29:58 +0000 (12:29 +0200)]
Update CWARNFLAGS in bsd.sys.mk and CWARNEXTRA in kern.mk for clang 15.

MFC after: 3 days

(cherry picked from commit 526f57bf85a2b9b113c55ded47b932abc8567bc5)

15 months agoFix unused variable warnings in sctp_indata.c
Dimitry Andric [Mon, 25 Jul 2022 19:15:52 +0000 (21:15 +0200)]
Fix unused variable warnings in sctp_indata.c

With clang 15, the following -Werror warnings are produced:

    sys/netinet/sctp_indata.c:3309:6: error: variable 'tot_retrans' set but not used [-Werror,-Wunused-but-set-variable]
            int tot_retrans = 0;
                ^
    sys/netinet/sctp_indata.c:3842:20: error: variable 'resend' set but not used [-Werror,-Wunused-but-set-variable]
            int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                              ^
    sys/netinet/sctp_indata.c:3842:47: error: variable 'acked' set but not used [-Werror,-Wunused-but-set-variable]
            int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                                                         ^
    sys/netinet/sctp_indata.c:3842:58: error: variable 'above' set but not used [-Werror,-Wunused-but-set-variable]
            int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
                                                                    ^

The 'tot_retrans' variable was used in sctp_strike_gap_ack_chunks(), but
refactoring in 493d8e5a830e got rid of it. Remove the variable since it
no longer serves any purpose.

The 'resend', 'acked', and 'above' variables are only used when
INVARIANTS is undefined. Ensure they are only declared and set in that
case.

MFC after: 3 days

(cherry picked from commit 05b3a4282c408f495add570bbca12242dd006279)

15 months agoless: silence K&R warns
Mateusz Guzik [Thu, 16 Mar 2023 18:24:12 +0000 (18:24 +0000)]
less: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 3451ed888e7519ba620e7372ba620500c47bdc8a)

15 months agolibz: silence K&R warns
Mateusz Guzik [Thu, 16 Mar 2023 18:22:24 +0000 (18:22 +0000)]
libz: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit de0009f001c2aa0bfb9349d9e08199c46b1af707)

15 months agosendmail: silence K&R warns
Mateusz Guzik [Thu, 16 Mar 2023 18:18:48 +0000 (18:18 +0000)]
sendmail: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 95a2b4d17234fb78177add37c8882d133855c3d0)

15 months agozlib: Use NO_WDEPRECATED_NON_PROTOTYPE
Warner Losh [Mon, 13 Feb 2023 16:15:58 +0000 (09:15 -0700)]
zlib: Use NO_WDEPRECATED_NON_PROTOTYPE

Also add it to kern.mk so it's available for module builds.

Sponsored by: Netflix
Noticed by: mjg
Fixes: b9f235ba3178
Differential Revision: https://reviews.freebsd.org/D38550

(cherry picked from commit b80185c267243a57bbc3e03fd2b47680672d6050)

15 months agobearssl: Suppress warnings from functions that have no args
Warner Losh [Mon, 13 Feb 2023 15:19:40 +0000 (08:19 -0700)]
bearssl: Suppress warnings from functions that have no args

clag15 is much pickier than others, so suppress the warning until
upstream can be updated.

Sponsored by: Netflix

(cherry picked from commit 9768746ba83efa02837c5b9c66348db6e900208f)

15 months agoProperly conditionalize clang 15-only flags
Warner Losh [Mon, 13 Feb 2023 15:19:00 +0000 (08:19 -0700)]
Properly conditionalize clang 15-only flags

Sponsored by: Netflix
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38550

(cherry picked from commit b9f235ba3178e5315cc1c77c87febd033cf69b3e)

15 months agozlib: silence K&R warns
Mateusz Guzik [Sun, 12 Feb 2023 21:12:34 +0000 (21:12 +0000)]
zlib: silence K&R warns

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit eca005d8531fd153f46f941f3101e73cdf181a0b)

15 months agoclang: Define NO_WDEPRECATED_NON_PROTOTYPE for clang 15
Warner Losh [Wed, 30 Nov 2022 18:08:16 +0000 (11:08 -0700)]
clang: Define NO_WDEPRECATED_NON_PROTOTYPE for clang 15

Clang 15 enforces function definitions using the C89 form rather than
the K&R form. While not strictly a prototype (which is only for a
declaration), use the name that mirror's clang's warning name. Much code
in contrib still uses K&R function definitions, so invent this for
compiling there.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D37515

(cherry picked from commit 0ecb61619688acf57a6f5d7b00bf7fda62cf7c53)

15 months agollvm/lld: damage control threading
Mateusz Guzik [Sun, 2 Apr 2023 12:38:49 +0000 (12:38 +0000)]
llvm/lld: damage control threading

See the comment inside.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D39389

(cherry picked from commit 04bab189b8a54974fcd9530140e4eed6ad137f48)

15 months agoReapply: <type_traits>: Avoid instantiating a pointer type in std::decay<>
Dimitry Andric [Thu, 9 Feb 2023 09:33:42 +0000 (10:33 +0100)]
Reapply: <type_traits>: Avoid instantiating a pointer type in std::decay<>

  GCC expands the pointer type in this conditional expression even for
  template types _Up that are not arrays.  This raises an error when
  std::decay<> is used with reference types (as is done in LLVM's
  sources).  Using add_pointer<> causes GCC to only instantiate a
  pointer type for array types.

  A similar change to this commit (albeit reworked due to upstream
  changes) has been merged to libc++ in commit
  26068c6e60324ed866a1ca2afb5cb5eb0aaf015b.

  In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__compare/ordering.h:13,
                   from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__compare/common_comparison_category.h:12,
                   from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/tuple:168,
                   from /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:20,
                   from /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/DenseMap.h:17,
                   from /usr/src/contrib/llvm-project/llvm/lib/Transforms/Scalar/GVNHoist.cpp:36:
  /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits: In instantiation of 'struct std::__1::__decay<llvm::CHIArg&, true>':
  /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:1591:89:   required from 'struct std::__1::decay<llvm::CHIArg&&>'
  /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__utility/pair.h:132:16:   required by substitution of 'template<class _Tuple, typename std::__1::enable_if<typename std::__1::conditional<(std::__1::__tuple_like_with_size<_Tuple, 2, typename std::__1::__uncvref<_Tp>::type>::value && (! std::__1::is_same<typename std::__1::decay<_Tp>::type, std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> > >::value)), std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::_CheckTupleLikeConstructor, std::__1::__check_tuple_constructor_fail>::type::__enable_implicit<_Tuple>(), void>::type* <anonymous> > constexpr std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::pair(_Tuple&&) [with _Tuple = llvm::CHIArg&&; typename std::__1::enable_if<typename std::__1::conditional<(std::__1::__tuple_like_with_size<_Tuple, 2, typename std::__1::__uncvref<_Tp>::type>::value && (! std::__1::is_same<typename std::__1::decay<_Tp>::type, std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> > >::value)), std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::_CheckTupleLikeConstructor, std::__1::__check_tuple_constructor_fail>::type::__enable_implicit<_Tuple>(), void>::type* <anonymous> = <missing>]'
  /usr/src/contrib/llvm-project/llvm/lib/Transforms/Scalar/GVNHoist.cpp:892:51:   required from here
  /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:1582:30: error: forming pointer to reference type 'std::__1::remove_extent<llvm::CHIArg&>::type' {aka 'llvm::CHIArg&'}
   1582 |                      >::type type;
        |                              ^~~~

  Reviewed by:    dim
  Differential Revision:  https://reviews.freebsd.org/D36898

This reapplies commit c36de97088a2b9141cdaf2fae2a7f41bf820ffa0, which I
accidentally overwrote in the llvm 15 merge. (It turns out upstream did
not merge this to their 15.x branch.)

MFC after: 2 weeks

(cherry picked from commit 4378cc5cfb5cf928e287c0143efb120d5558c4a0)

15 months agoMerge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6
Dimitry Andric [Sat, 14 Jan 2023 16:33:24 +0000 (17:33 +0100)]
Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 50d7464c3fe687c0a3d4dea6b96a5437779a3ef6)

15 months agoMerge llvm-project release/15.x llvmorg-15.0.6-0-g088f33605d8a
Dimitry Andric [Sun, 4 Dec 2022 22:09:55 +0000 (23:09 +0100)]
Merge llvm-project release/15.x llvmorg-15.0.6-0-g088f33605d8a

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.6-0-g088f33605d8a.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit f3fd488f1e19a3d09c4bdcece893901de4f49cdd)

15 months agoMerge llvm-project release/15.x llvmorg-15.0.2-10-gf3c5289e7846
Dimitry Andric [Sun, 16 Oct 2022 19:03:40 +0000 (21:03 +0200)]
Merge llvm-project release/15.x llvmorg-15.0.2-10-gf3c5289e7846

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.2-10-gf3c5289e7846.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 6246ae0b85d8159978c01ae916a9ad6cde9378b5)

15 months agoMerge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454
Dimitry Andric [Sat, 10 Sep 2022 18:56:18 +0000 (20:56 +0200)]
Merge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.0-9-g1c73596d3454.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit a4a491e2238b12ccd64d3faf9e6401487f6f1f1b)

15 months agoMerge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d
Dimitry Andric [Sat, 13 Aug 2022 15:37:04 +0000 (17:37 +0200)]
Merge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.0-rc2-40-gfbd2950d8d0d.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 61cfbce3347e4372143bcabf7b197577b9f3958a)

15 months agoMerge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4
Dimitry Andric [Wed, 27 Jul 2022 20:11:54 +0000 (22:11 +0200)]
Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before
the upstream release/16.x branch was created.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 972a253a57b6f144b0e4a3e2080a2a0076ec55a0)

15 months agoMerge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b
Dimitry Andric [Sun, 24 Jul 2022 15:11:41 +0000 (17:11 +0200)]
Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit fcaf7f8644a9988098ac6be2165bce3ea4786e91)

15 months agoMerge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f
Dimitry Andric [Thu, 14 Jul 2022 18:58:48 +0000 (20:58 +0200)]
Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 753f127f3ace09432b2baeffd71a308760641a62)

15 months agoMerge llvm-project main llvmorg-15-init-15358-g53dc0f10787
Dimitry Andric [Mon, 4 Jul 2022 19:20:19 +0000 (21:20 +0200)]
Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 81ad626541db97eb356e2c1d4a20eb2a26a766ab)

15 months agolibc/yp: sort out warnings
Mateusz Guzik [Thu, 16 Mar 2023 18:56:47 +0000 (18:56 +0000)]
libc/yp: sort out warnings

.. in least-effort manner

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ba5070ab441f1ad901c0412f531bd646d0bd0616)

15 months agoRevert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"
Dimitry Andric [Wed, 29 Mar 2023 18:37:02 +0000 (20:37 +0200)]
Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"

This reverts commit ab80f0b21fbb9c44d40e6f7a99090188f4ed2f71. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes: ab80f0b21fbb
(cherry picked from commit 4dc3b1fa1bbcf20f7713d94776a1604964ada32b)

15 months ago<type_traits>: Avoid instantiating a pointer type in std::decay<>.
John Baldwin [Thu, 24 Nov 2022 00:10:05 +0000 (16:10 -0800)]
<type_traits>: Avoid instantiating a pointer type in std::decay<>.

GCC expands the pointer type in this conditional expression even for
template types _Up that are not arrays.  This raises an error when
std::decay<> is used with reference types (as is done in LLVM's
sources).  Using add_pointer<> causes GCC to only instantiate a
pointer type for array types.

A similar change to this commit (albeit reworked due to upstream
changes) has been merged to libc++ in commit
26068c6e60324ed866a1ca2afb5cb5eb0aaf015b.

In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__compare/ordering.h:13,
                 from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__compare/common_comparison_category.h:12,
                 from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/tuple:168,
                 from /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:20,
                 from /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/DenseMap.h:17,
                 from /usr/src/contrib/llvm-project/llvm/lib/Transforms/Scalar/GVNHoist.cpp:36:
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits: In instantiation of 'struct std::__1::__decay<llvm::CHIArg&, true>':
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:1591:89:   required from 'struct std::__1::decay<llvm::CHIArg&&>'
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__utility/pair.h:132:16:   required by substitution of 'template<class _Tuple, typename std::__1::enable_if<typename std::__1::conditional<(std::__1::__tuple_like_with_size<_Tuple, 2, typename std::__1::__uncvref<_Tp>::type>::value && (! std::__1::is_same<typename std::__1::decay<_Tp>::type, std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> > >::value)), std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::_CheckTupleLikeConstructor, std::__1::__check_tuple_constructor_fail>::type::__enable_implicit<_Tuple>(), void>::type* <anonymous> > constexpr std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::pair(_Tuple&&) [with _Tuple = llvm::CHIArg&&; typename std::__1::enable_if<typename std::__1::conditional<(std::__1::__tuple_like_with_size<_Tuple, 2, typename std::__1::__uncvref<_Tp>::type>::value && (! std::__1::is_same<typename std::__1::decay<_Tp>::type, std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> > >::value)), std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::_CheckTupleLikeConstructor, std::__1::__check_tuple_constructor_fail>::type::__enable_implicit<_Tuple>(), void>::type* <anonymous> = <missing>]'
/usr/src/contrib/llvm-project/llvm/lib/Transforms/Scalar/GVNHoist.cpp:892:51:   required from here
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:1582:30: error: forming pointer to reference type 'std::__1::remove_extent<llvm::CHIArg&>::type' {aka 'llvm::CHIArg&'}
 1582 |                      >::type type;
      |                              ^~~~

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D36898

(cherry picked from commit c36de97088a2b9141cdaf2fae2a7f41bf820ffa0)

15 months agotimes: Use modern function definitions
Warner Losh [Tue, 25 Oct 2022 05:03:11 +0000 (23:03 -0600)]
times: Use modern function definitions

Use the modern ANSI function defition syntax rather than the old K&R
syntax for times.

Sponsored by: Netflix

(cherry picked from commit aec9453fec70864234c70ccd0198c8b612139cf7)

15 months agonetlink: add standrard ifaddr/neigh parsers to snl(3).
Alexander V. Chernikov [Sun, 26 Mar 2023 09:04:41 +0000 (09:04 +0000)]
netlink: add standrard ifaddr/neigh parsers to snl(3).

MFC after: 2 weeks

(cherry picked from commit 9a11f3dff991bac89afb5f74a476e765abdbd1d1)

15 months agorouting: add public rt_is_exportable() version to check if
Alexander V. Chernikov [Sun, 26 Mar 2023 08:19:56 +0000 (08:19 +0000)]
routing: add public rt_is_exportable() version to check if
 the route can be exported to userland when jailed.

Differential Revision: https://reviews.freebsd.org/D39204
MFC after: 2 weeks

(cherry picked from commit 2cda6a2fb0d9473a53931dc2b0171af54dd79b04)

15 months agoheimdal: Do not build a redundant source file
Cy Schubert [Sat, 1 Apr 2023 03:43:10 +0000 (20:43 -0700)]
heimdal: Do not build a redundant source file

Heimdal's lib/hdb/db3.c is only built if DB3 is enabled, i.e. #if HAVE_DB3.
FreeBSD's bdb is DB1. Therefore the entire db3.c file is #ifdef'd out.
Let's avoid building a file that results in a useless object file.

(cherry picked from commit 7ee18f5aada07f03433504545c1b7bed91cbda82)

15 months agowpa_supplicant/hostapd: Fix uninitialized packet pointer on error
Cy Schubert [Thu, 6 Apr 2023 04:07:15 +0000 (21:07 -0700)]
wpa_supplicant/hostapd: Fix uninitialized packet pointer on error

The packet pointer (called packet) will remain uninitialized when
pcap_next_ex() returns an error. This occurs when the wlan
interface is shut down using ifconfig destroy. Adding a NULL
assignment to packet duplicates what pcap_next() does.

The reason we use pcap_next_ex() in this instance is because with
pacp_next() when we receive a null pointer if there was an error
or if no packets were read. With pcap_next_ex() we can differentiate
between an error and legitimately no packets were received.

PR: 270649
Reported by: Robert Morris <rtm@lcs.mit.edu>
Fixes: 6e5d01124fd4

(cherry picked from commit 953efa5b200f060564a090ab71b3d7f614a35e3f)

15 months agorouting: fix panic when adding an interface route to the p2p interface
Alexander V. Chernikov [Wed, 29 Mar 2023 20:28:24 +0000 (20:28 +0000)]
routing: fix panic when adding an interface route to the p2p interface
  without and inet/inet6 addresses attached.

MFC after:      3 days

(cherry picked from commit badcb3fd5710a511e35ac3afd724ef68c77614b7)

15 months agonetlink: reduce the default debugging levels
Alexander V. Chernikov [Tue, 21 Mar 2023 18:55:00 +0000 (18:55 +0000)]
netlink: reduce the default debugging levels

Reported by: kp
MFC after: 2 weeks

(cherry picked from commit a74998f38a2e1d1c943087e2c9cf104a4f037a45)

15 months agotests: fix python parsing of netlink nested attributes
Alexander V. Chernikov [Mon, 13 Mar 2023 10:17:36 +0000 (10:17 +0000)]
tests: fix python parsing of netlink nested attributes

MFC after: 2 weeks

(cherry picked from commit 90bc2120b51bc5ac9fbcb29763cc47562ee49977)

15 months agotests: add more netlink tests for neighbors/routes
Alexander V. Chernikov [Tue, 7 Mar 2023 17:30:35 +0000 (17:30 +0000)]
tests: add more netlink tests for neighbors/routes

Differential Revision: https://reviews.freebsd.org/D38912
MFC after: 2 weeks

(cherry picked from commit c57dfd92c876fabc04e94945dd9534468520bbbf)

15 months agotests: add netlink large dump buffer check
Alexander V. Chernikov [Mon, 20 Feb 2023 10:20:23 +0000 (10:20 +0000)]
tests: add netlink large dump buffer check

Differential Revision: https://reviews.freebsd.org/D38665
MFC after: 2 weeks

(cherry picked from commit 828d3c6c4cc0b782e16abb1ae18023734a0b710f)

15 months agotests: fix netlink test_dump_ifaces_many test.
Alexander V. Chernikov [Sat, 18 Feb 2023 22:26:32 +0000 (22:26 +0000)]
tests: fix netlink test_dump_ifaces_many test.

Consider only loopback interfaces when counting.
Otherwise, if pf is loaded, 'pflog0' gets added to the vnet,
 breaking the test.

MFC after: 2 weeks

(cherry picked from commit 79748cec1f1c3437e49d7694e95fc7f438336805)

15 months agonetlink: do not crash when linux message translation fails.
Alexander V. Chernikov [Sat, 18 Feb 2023 17:41:48 +0000 (17:41 +0000)]
netlink: do not crash when linux message translation fails.

CID: 1498889
MFC after: 2 weeks

(cherry picked from commit 453c7d6803aa9cbbaec74c7706276736de22f7b4)

15 months agonetlink: initialise error in nl_autobind_port().
Alexander V. Chernikov [Sat, 18 Feb 2023 17:18:57 +0000 (17:18 +0000)]
netlink: initialise error in nl_autobind_port().

CID: 1498877
MFC after: 2 weeks

(cherry picked from commit 4404e840cf3aa8d06d79dc281fffbb32860ab2af)

15 months agonetlink: check result of sooptcopyin().
Alexander V. Chernikov [Sat, 18 Feb 2023 17:15:25 +0000 (17:15 +0000)]
netlink: check result of sooptcopyin().

CID: 1498866
MFC after: 2 weeks

(cherry picked from commit 3f70fca90f9f1c6a40e55e6edd2dc1b1272f4998)

15 months agonetlink: remove redundant check.
Alexander V. Chernikov [Sat, 18 Feb 2023 17:10:39 +0000 (17:10 +0000)]
netlink: remove redundant check.

MFC after: 2 weeks
CID: 1498867

(cherry picked from commit 1ea58b413595310de43587c609421ede74770f11)

15 months agonetlink: improve attribute decoding in python tests
Alexander V. Chernikov [Fri, 17 Feb 2023 18:04:53 +0000 (18:04 +0000)]
netlink: improve attribute decoding in python tests

MFC after: 2 weeks

(cherry picked from commit ff8da9b2bab43920a19c16855ac3d30b5ccb1df2)

15 months agonetlink: add public ucred accessor for nlp.
Alexander V. Chernikov [Sat, 18 Mar 2023 11:44:29 +0000 (11:44 +0000)]
netlink: add public ucred accessor for nlp.

MFC after: 2 weeks

(cherry picked from commit 046acc2bfd13f0caaf5132c1ad34877917db1a38)

15 months agonetlink: fix capped uncapped ack handling in snl(3).
Alexander V. Chernikov [Fri, 17 Mar 2023 14:27:08 +0000 (14:27 +0000)]
netlink: fix capped uncapped ack handling in snl(3).

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D39144
MFC after: 2 weeks

(cherry picked from commit 568a645ba55a1c3fc4fc74735cb0fab08bfe4cbf)

15 months agonetlink: improve snl(3)
Alexander V. Chernikov [Wed, 15 Mar 2023 13:56:26 +0000 (13:56 +0000)]
netlink: improve snl(3)

Summary:
* add snl_send_message() as a convenient send wrapper
* add signed integer parsers
* add snl_read_reply_code() to simplify operation result checks
* add snl_read_reply_multi() to simplify reading multipart messages
* add snl_create_genl_msg_request()
* add snl_get_genl_family() to simplify family name->id resolution
* add tests for some of the functionality

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D39092
MFC after: 2 weeks

(cherry picked from commit 73ae25c174b515616050496dea764a943796efef)

15 months agofix buildworld after 595d23f777dc.
Alexander V. Chernikov [Thu, 9 Mar 2023 15:44:59 +0000 (15:44 +0000)]
fix buildworld after 595d23f777dc.

Reported by: se

(cherry picked from commit da4047d3ba23201ae4049dccea1151bd6ca2d1df)

15 months agonetlink: add snl(3) default parsers for routes and links.
Alexander V. Chernikov [Thu, 9 Mar 2023 14:43:56 +0000 (14:43 +0000)]
netlink: add snl(3) default parsers for routes and links.

This change adds the "default" parsers of _all_ route/link attributes
 exported by the kernel.
It removes the need to declare similar parsers in the userland applications,
 simplifying their logic.

Differential Revision: https://reviews.freebsd.org/D38979
MFC after: 2 weeks

(cherry picked from commit 595d23f777dc24cb285b072c596ca96bbc2db3cd)

15 months agonetlink: add rtsock-compatible header to use with netlink snl(3).
Alexander V. Chernikov [Thu, 9 Mar 2023 14:36:52 +0000 (14:36 +0000)]
netlink: add rtsock-compatible header to use with netlink snl(3).

Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones
 used by the the Netlink.
As some rtsock definitions like interface flags or route flags are used in
 both netlink and rtsock, provide a convenient way to include those without
 running into the define collision.

Differential Revision: https://reviews.freebsd.org/D38982
MFC after: 2 weeks

(cherry picked from commit 90d625122886a2db5b66d248807b89f4a0270466)

15 months agonetlink: add basic message writing support to snl(3).
Alexander V. Chernikov [Thu, 9 Mar 2023 14:33:26 +0000 (14:33 +0000)]
netlink: add basic message writing support to snl(3).

Differential Revision: https://reviews.freebsd.org/D38947
MFC after: 2 weeks

(cherry picked from commit 76f6d391504b040528882a908147e47ea90b7b90)

15 months agonetlink: make snl(3) scratch buffer growable
Alexander V. Chernikov [Wed, 8 Mar 2023 11:17:43 +0000 (11:17 +0000)]
netlink: make snl(3) scratch buffer growable

Differential Revision: https://reviews.freebsd.org/D38946
MFC after: 2 weeks

(cherry picked from commit 0679eb1f39aa798da6c4601bb06bab4c175c4b18)

15 months agonetlink: cleanup netlink_writer code
Alexander V. Chernikov [Tue, 7 Mar 2023 17:42:27 +0000 (17:42 +0000)]
netlink: cleanup netlink_writer code

* Remove unused nlattr_add_nla() - that's a duplicate of nlattr_add_raw().
* Calculate alignment only once in nlmsg_reserve_data_raw()

MFC after: 2 weeks

(cherry picked from commit 5c8277ec2588a660f126e1a9866cd65f59336c51)

15 months agonetlink: fix vlan interface creation
Alexander V. Chernikov [Fri, 3 Mar 2023 16:01:34 +0000 (16:01 +0000)]
netlink: fix vlan interface creation

MFC after: 2 weeks

(cherry picked from commit ce9f95bd835ec7d3ac6def5a910282509b1413f0)

15 months agonetlink: add u8/u64 attribute fetcher accessors to snl(3).
Alexander V. Chernikov [Fri, 3 Mar 2023 14:05:40 +0000 (14:05 +0000)]
netlink: add u8/u64 attribute fetcher accessors to snl(3).

MFC after: 2 weeks

(cherry picked from commit 61507ae30b9096eaa0d44fec71211f3843d546eb)

15 months agonetlink: add userland name mappings to all NETLINK_ROUTE messages.
Alexander V. Chernikov [Wed, 1 Mar 2023 15:22:21 +0000 (15:22 +0000)]
netlink: add userland name mappings to all NETLINK_ROUTE messages.

MFC after: 1 day

(cherry picked from commit e6b4177c478da54e25db464ae60ddae9e890c2cb)

15 months agofdesc_lookup(): drop fdropped
Konstantin Belousov [Thu, 23 Mar 2023 19:30:04 +0000 (21:30 +0200)]
fdesc_lookup(): drop fdropped

(cherry picked from commit 13262b07a06910edd5e58e6bb2e1d4786a7b7d8e)

15 months agofdesc_lookup(): the condition to use vn_vget_ino() is always true
Konstantin Belousov [Thu, 23 Mar 2023 19:28:08 +0000 (21:28 +0200)]
fdesc_lookup(): the condition to use vn_vget_ino() is always true

(cherry picked from commit 7dca8fd1cb3f91e7a3c07b7f57af6d9d43d0c71c)

15 months agofdesc_lookup(): no need to vhold the dvp vnode
Konstantin Belousov [Wed, 22 Mar 2023 13:36:00 +0000 (15:36 +0200)]
fdesc_lookup(): no need to vhold the dvp vnode

(cherry picked from commit 8d97282a394278d29883e7afa98ed6294efab35e)

15 months agoacl tests: Serialize
Mark Johnston [Sat, 25 Mar 2023 19:09:48 +0000 (15:09 -0400)]
acl tests: Serialize

Some of these tests import a ZFS pool with a hard-coded name, so they
cannot run in parallel.

MFC after: 1 week

(cherry picked from commit 34b696e41259e41ae3ac61a539bd152d3afb73ae)

15 months agofdgrowtable tests: Address a set-but-not-used warning
Mark Johnston [Thu, 30 Mar 2023 17:53:48 +0000 (13:53 -0400)]
fdgrowtable tests: Address a set-but-not-used warning

MFC after: 1 week

(cherry picked from commit 889b5662ce06ad01f87f1e501dc56c7bc50bbf9b)

15 months agopf tests: Serialize
Mark Johnston [Sat, 25 Mar 2023 12:55:41 +0000 (08:55 -0400)]
pf tests: Serialize

These tests reuse jail names and cannot run in parallel.  Until this is
fixed - which is desirable since these takes take a while to run - tell
kyua to serialize them.

MFC after: 1 week

(cherry picked from commit b60600ceeb68d1001d61222830e0be3441ef0885)

15 months agonetpfil tests: Serialize
Mark Johnston [Thu, 30 Mar 2023 15:20:01 +0000 (11:20 -0400)]
netpfil tests: Serialize

These tests reuse jail names and so cannot run in parallel.

MFC after: 1 week

(cherry picked from commit cdb192434cbc6449778888a73c7bdbe2ae94c3c8)

15 months agoaio tests: Use unique names for zvols
Mark Johnston [Sat, 25 Mar 2023 19:41:07 +0000 (15:41 -0400)]
aio tests: Use unique names for zvols

Otherwise tests which create zvols cannot be run in parallel.

MFC after: 1 week

(cherry picked from commit 9cefc0fb1387f6c5b0954e875b14e596167c9a45)

15 months agocap_dns tests: Convert to ATF, avoid failing when lookups don't resolve
Mark Johnston [Thu, 30 Mar 2023 23:27:36 +0000 (19:27 -0400)]
cap_dns tests: Convert to ATF, avoid failing when lookups don't resolve

The cap_dns tests require Internet access.  Currently they fail when
that's not available, which for CI purposes is undesirable.  Let's
instead skip the tests if none of the non-casper name/addr lookups
succeed.

To that end:
- Convert the tests to ATF so that skipping is easier to implement.
- Break up the tests into separate test cases.
- If one of the system (i.e., non-casper) lookup functions fails, skip
  the test if all of them failed, otherwise fail the tests, since
  partial failure indicates something is flaky and deserves a closer
  look.

Reviewed by: oshogbo
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39241

(cherry picked from commit 615bf03e33e466ca10e3f1d203f4c27188d28fc3)

15 months agocap_sysctl tests: Serialize
Mark Johnston [Fri, 24 Mar 2023 16:26:20 +0000 (12:26 -0400)]
cap_sysctl tests: Serialize

These tests fail spuriously when run in parallel, since some of them
write a value to a global sysctl, read it back, and expect to see the
written value.  These tests complete quite quickly in any case.

MFC after: 1 week

(cherry picked from commit 5d96ca7a307279cf4bdb191b7074cd1efcd3b8e8)