]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agovm_object: restore handling of shadow_count for all type of objects
Konstantin Belousov [Fri, 17 Dec 2021 20:55:45 +0000 (22:55 +0200)]
vm_object: restore handling of shadow_count for all type of objects

(cherry picked from commit 4cf9f5d807a7767a2ec6113c99bbba024d08b489)

2 years agovm_object: Make is_object_active() global
Rick Macklem [Mon, 20 Dec 2021 00:11:44 +0000 (16:11 -0800)]
vm_object: Make is_object_active() global

(cherry picked from commit cd37afd8b6ddc38fe2441e37a8bf5f8cdce50bc6)

2 years agocsu: define STRIP_FBSDID
Ed Maste [Mon, 20 Dec 2021 21:30:09 +0000 (16:30 -0500)]
csu: define STRIP_FBSDID

__FBSDID() places the provided string in the output object's .comment
section.  However, with the transition to Git $FreeBSD$ is no longer
expanded and so we emitted a literal $FreeBSD$.

$FreeBSD$ will be addressed in a holistic manner in the future, but at
least avoid embedding it into everything linked on FreeBSD (via csu).

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33594

(cherry picked from commit cb2d1350154aab1d649ca70d45ebc7a88708491c)

2 years agolibc: use standard LF line endings, not CRLF
Ed Maste [Wed, 31 Mar 2021 17:04:36 +0000 (13:04 -0400)]
libc: use standard LF line endings, not CRLF

(cherry picked from commit 29e54af43ee06ed5636b9f567795cd271efc1ef7)

2 years agovtfontcvt: minor style(9) fixes from clang-format
Ed Maste [Thu, 13 May 2021 00:17:35 +0000 (20:17 -0400)]
vtfontcvt: minor style(9) fixes from clang-format

Found during clang-format experiments (in D26340).

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30237

(cherry picked from commit a0d701f6142686e853f96745a11bc9231dad97a9)

2 years agofstyp: fix build WITHOUT_ICONV
Ed Maste [Tue, 2 Nov 2021 13:43:56 +0000 (09:43 -0400)]
fstyp: fix build WITHOUT_ICONV

Reported by: Michael Dexter, Build Option Survey
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 3513df4bcc172b2b7b923ba62591490d5df1bf5a)

2 years agobsnmpd: Remove "All Rights Reserved" from FreeBSD Foundation copyrights
Ed Maste [Fri, 22 Oct 2021 22:52:05 +0000 (18:52 -0400)]
bsnmpd: Remove "All Rights Reserved" from FreeBSD Foundation copyrights

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5fff2859ec5de6ed4bcf0c4df1ceabcf14ff72dd)

2 years agobsdinstall: Remove unused sysctl.h header #include
Ed Maste [Wed, 19 May 2021 16:28:47 +0000 (12:28 -0400)]
bsdinstall: Remove unused sysctl.h header #include

(cherry picked from commit 3e5bff102b4bd09962b0f735217635cb513d53a3)

2 years agosrc.conf.5: regen
Ed Maste [Tue, 8 Feb 2022 20:50:12 +0000 (15:50 -0500)]
src.conf.5: regen

2 years agoDrop 'Set to' from most src.conf(5) knobs
Ed Maste [Sat, 10 Apr 2021 02:23:03 +0000 (22:23 -0400)]
Drop 'Set to' from most src.conf(5) knobs

The description is clearly what effect the knob has when set, so the
additional text was unnecessary.

Reviewed by: jhb, se
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29583

(cherry picked from commit 9d178c925fb9acd88d2e5c5145d639b30b398c12)

2 years agosys/cddl: remove extraneous semicolons
Ed Maste [Mon, 16 Aug 2021 14:29:44 +0000 (10:29 -0400)]
sys/cddl: remove extraneous semicolons

Fixes: 5a1b490d502e ("FreeBSD changes to vendor source.")
Fixes: 91eaf3e1831d ("Custom DTrace kernel module...")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b1a217a369186dc45c7df7bde13a87868fd5b2c8)

2 years agohwpmc: drop 0x before %p printf format string
Ed Maste [Mon, 17 Jan 2022 01:27:15 +0000 (20:27 -0500)]
hwpmc: drop 0x before %p printf format string

%p already includes the 0x.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2075d00fabb6d6a76c4829b9e027a496f04262b0)

2 years agoDTrace: remove sparc64 remnants in non-contrib code
Ed Maste [Sun, 21 Mar 2021 01:19:35 +0000 (21:19 -0400)]
DTrace: remove sparc64 remnants in non-contrib code

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 64a790d264808116469914c19265e905b3929e00)

2 years agoRemove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights
Ed Maste [Sun, 8 Aug 2021 14:38:01 +0000 (10:38 -0400)]
Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights

These ones were unambiguous cases where the Foundation was the only
listed copyright holder (in the associated license block).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9feff969a01044c3083b552f06f7eb6416bc0524)

2 years agodt_unring_buf: set dtbd_oldest to the start of the first record
Andriy Gapon [Tue, 11 Jan 2022 13:44:04 +0000 (15:44 +0200)]
dt_unring_buf: set dtbd_oldest to the start of the first record

It was set to the start of the buffer and that can be different from the
start of teh first record because of a misalignment.

This change follows the example of dt_realloc_buf().

(cherry picked from commit 256c8c5df2a4bdd43afd9ec5a2f8be9374284e1e)

2 years agoschedgraph.py: port to Python 3
Andriy Gapon [Tue, 11 Jan 2022 13:31:45 +0000 (15:31 +0200)]
schedgraph.py: port to Python 3

The change does not preserve compatibility with Python 2.7.

(cherry picked from commit 7e8ed296e120a57211d377102fa27dd9411d0fbd)

2 years agomlx5core: Set driver version into firmware.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:54 +0000 (16:08 +0100)]
mlx5core: Set driver version into firmware.

If the driver_version capability bit is enabled, send the driver
version to firmware after the init HCA command, for display purposes.

Example of driver version: "FreeBSD,mlx5_core,14.0.0,3.x-xxx"

Linux commits:
012e50e109fd27ff989492ad74c50ca7ab21e6a1

Sponsored by: NVIDIA Networking

(cherry picked from commit e6d7ac1d03d12363916771f515ab88c384f8350b)

2 years agomlx5en: Implement one RQT object per channel.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:54 +0000 (16:08 +0100)]
mlx5en: Implement one RQT object per channel.

These objects will eventually be used to switch TLS RX traffic.

Sponsored by: NVIDIA Networking

(cherry picked from commit 8e332232a5ac8b11fb1c34c70f48bf586267ffda)

2 years agomlx5: Add raw ethernet local loopback support.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:54 +0000 (16:08 +0100)]
mlx5: Add raw ethernet local loopback support.

Currently, unicast/multicast loopback raw ethernet (non-RDMA) packets
are sent back to the vport.  A unicast loopback packet is the packet
with destination MAC address the same as the source MAC address.  For
multicast, the destination MAC address is in the vport's multicast
filter list.

Moreover, the local loopback is not needed if there is one or none
user space context.

After this patch, the raw ethernet unicast and multicast local
loopback are disabled by default. When there is more than one user
space context, the local loopback is enabled.

Note that when local loopback is disabled, raw ethernet packets are
not looped back to the vport and are forwarded to the next routing
level (eswitch, or multihost switch, or out to the wire depending on
the configuration).

Linux commits:
c85023e153e3824661d07307138fdeff41f6d86a
8978cc921fc7fad3f4d6f91f1da01352aeeeff25

Sponsored by: NVIDIA Networking

(cherry picked from commit ea00d7e8cab97f818c9793a112249ab79a2f8322)

2 years agomlx5: Implement mlx5_nic_vport_update_local_lb()
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:54 +0000 (16:08 +0100)]
mlx5: Implement mlx5_nic_vport_update_local_lb()

Sponsored by: NVIDIA Networking

(cherry picked from commit c1b76119cbf91e0698e2c6264be5f85ebfeea652)

2 years agomlx5en: Create TIRs before flowtables.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:54 +0000 (16:08 +0100)]
mlx5en: Create TIRs before flowtables.

Because flowtables may redirect traffic to TIRs.

Sponsored by: NVIDIA Networking

(cherry picked from commit 5381f936473b06e3d62da5e0f22119789db8e621)

2 years agomlx5en: Create flowtables in correct order.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5en: Create flowtables in correct order.

Because it affects how the flow tables may re-direct traffic.

Sponsored by: NVIDIA Networking

(cherry picked from commit 001106f807702592647e2ab4c3dadf31f7ec9427)

2 years agomlx5: Implement flow steering helper functions for TCP sockets.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5: Implement flow steering helper functions for TCP sockets.

This change adds convenience functions to setup a flow steering rule based on
a TCP socket. The helper function gets all the address information from the
socket and returns a steering rule, to be used with HW TLS RX offload.

Sponsored by: NVIDIA Networking

(cherry picked from commit 2c0ade806aa7b450dc4f4c53b5345050eb6dcb4b)

2 years agomlx5: Implement offloads flowtable namespace.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5: Implement offloads flowtable namespace.

This namespace will be used for TCP offloads, like hardware decryption
of TLS TCP data.

Sponsored by: NVIDIA Networking

(cherry picked from commit 0ee1b09eaa99ed96885fd024a32baf182411a35a)

2 years agomlx5en: Create and destroy all flow tables and rules when the network interface attac...
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5en: Create and destroy all flow tables and rules when the network interface attaches and detaches.

Previously flow steering tables and rules were only created and destroyed
at link up and down events, respectivly. Due to new requirements for adding
TLS RX flow tables and rules, the main flow steering table must always be
available as there are permanent redirections from the TLS RX flow table
to the vlan flow table.

Sponsored by: NVIDIA Networking

(cherry picked from commit e059c120b4223fd5ec3af9def21c0519f439fe57)

2 years agomlx5en: Add race protection for SQ remap
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5en: Add race protection for SQ remap

Add a refcount for posted WQEs to avoid a race between
post WQE and FW command flows.

Sponsored by: NVIDIA Networking

(cherry picked from commit a8e715d21b963251e449187c98292fff77dc7576)

2 years agomlx5en: Properly account for no-checksum on tunneled packets.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5en: Properly account for no-checksum on tunneled packets.

Sponsored by: NVIDIA Networking

(cherry picked from commit aabca1034c742ed6160ffec57a7e481d929153f7)

2 years agomlx5en: Force all packets through the indirection table.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5en: Force all packets through the indirection table.

All packets must go through the indirection table, RQT,
because it is not possible to modify the RQN of the TIR
for direct dispatchment after it is created, typically
when the link goes up and down.

Sponsored by: NVIDIA Networking

(cherry picked from commit 06c2bd1872d637da6042da7059eb2800f3cbe4de)

2 years agomlx5/mlx5en: Add SQ remap support
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:53 +0000 (16:08 +0100)]
mlx5/mlx5en: Add SQ remap support

Add support to map an SQ to a specific schedule queue using a
special WQE as performance enhancement.

SQ remap operation is handled by a privileged internal queue, IQ,
and the mapping is enabled from one rate to another.

The transition from paced to non-paced should however always go
through FW.

Sponsored by: NVIDIA Networking

(cherry picked from commit 266c81aae38adec45effaa67dfec5cd06996f9d3)

2 years agomlx5: Properly define the reg_umr_sq networking offload capability bit.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5: Properly define the reg_umr_sq networking offload capability bit.

Sponsored by: NVIDIA Networking

(cherry picked from commit 1c407d0494260df26726155f8593f48f5068cd78)

2 years agomlx5en: Only delete installed VxLAN rules.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Only delete installed VxLAN rules.

Sponsored by: NVIDIA Networking

(cherry picked from commit 9680b1ba71e4bd9a8d4c1b0e2aec4874635e561d)

2 years agomlx5en: Fix inverted logical assignment.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Fix inverted logical assignment.

Sponsored by: NVIDIA Networking

(cherry picked from commit 6176a5e338f358edeb51c8c7ef9e664d1c52e350)

2 years agomlx5en: Implement support for internal queues, IQ.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Implement support for internal queues, IQ.

Internal send queues are regular sendqueues which are reserved for WQE commands
towards the hardware and firmware. These queues typically carry resync
information for ongoing TLS RX connections and when changing schedule queues
for rate limited connections.

The internal queue, IQ, code is more or less a stripped down copy
of the existing SQ managing code with exception of:

1) An optional single segment memory buffer which can be read or
   written as a whole by the hardware, may be provided.
2) An optional completion callback for all transmit operations, may
   be provided.
3) Does not support mbufs.

Sponsored by: NVIDIA Networking

(cherry picked from commit 694263572f1bdf545199fcfb0853b93eb0dd0644)

2 years agomlx5en: Implement helper functions to open and close TLS TIR context.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Implement helper functions to open and close TLS TIR context.

Sponsored by: NVIDIA Networking

(cherry picked from commit 21228c67ab10570ed63becf6a8b63418fe5f8a83)

2 years agomlx5en: Share DEK objects with TLS RX.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Share DEK objects with TLS RX.

The TLS RX support also needs to be able to allocate DEK objects.
Share the available objects 1:1.

Sponsored by: NVIDIA Networking

(cherry picked from commit 75767cb88997b6b3fc99b2336de8398cff46db2a)

2 years agomlx5en: Add missing TLS structure prototype.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Add missing TLS structure prototype.

Sponsored by: NVIDIA Networking

(cherry picked from commit fad4b7d1f253194b0581a2821484e9e55294c3fc)

2 years agomlx5en: Remove unused hardware TLS field.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Remove unused hardware TLS field.

Sponsored by: NVIDIA Networking

(cherry picked from commit 3a1bf85503f67f7dd3e45d304c1b3db32fec89d1)

2 years agomlx5en: Make the receive packet indirection table, RQT, static instead of dynamic.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:52 +0000 (16:08 +0100)]
mlx5en: Make the receive packet indirection table, RQT, static instead of dynamic.

Allocate the RQT once, pointing all initial entries to the drop RQN.
When opening the channels simplify modify the RQT, directing all traffic
to the new RQNs. Similarly when closing the channels point all RQT entries
back to the so-called drop RQN.

Sponsored by: NVIDIA Networking

(cherry picked from commit 33a6a7a72abc1e1c9ecb4b3d12087731fd11f0bb)

2 years agomlx5en: Set CQN in RQ parameters for drop RQ.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5en: Set CQN in RQ parameters for drop RQ.

Else creating the drop RQ fails.

Sponsored by: NVIDIA Networking

(cherry picked from commit 7800af352ae377579b4fe49630aab8052c342e4c)

2 years agomlx5en: Set channel pointer for drop receive queue.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5en: Set channel pointer for drop receive queue.

A valid channel pointer is needed to get the priv pointer during init.

Sponsored by: NVIDIA Networking

(cherry picked from commit 03567b0dfa713797c52f2c9f27d8c1d4c631ceb5)

2 years agomlx5en: Print error code when opening drop RQ fails.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5en: Print error code when opening drop RQ fails.

Sponsored by: NVIDIA Networking

(cherry picked from commit 4e40e984daa40cbf2e8bce854a9aca9be7a4f587)

2 years agomlx5en: Implement dummy receive queue, RQ, for dropping packets.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5en: Implement dummy receive queue, RQ, for dropping packets.

What is a drop RQ and why is it needed?

The RSS indirection table, also called the RQT, selects the
destination RQ based on the receive queue number, RQN. The RQT is
frequently referred to by flow steering rules to distribute traffic
among multiple RQs. The problem is that the RQs cannot be destroyed
before the RQT referring them is destroyed too. Further, TLS RX
rules may still be referring to the RQT even if the link went
down. Because there is no magic RQN for dropping packets, we create
a dummy RQ, also called drop RQ, which sole purpose is to drop all
received packets. When the link goes down this RQN is filled in all
RQT entries, of the main RQT, so the real RQs which are about to be
destroyed can be released and the TLS RX rules can be sustained.

Sponsored by: NVIDIA Networking

(cherry picked from commit 27b778ae55374a195ebb889f40200cd5986e9c15)

2 years agomlx5en: Make the hw_lro parameter read only tunable.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5en: Make the hw_lro parameter read only tunable.

This prevents the so-called TIR context from changing during runtime.

Sponsored by: NVIDIA Networking

(cherry picked from commit a60f953424887cb4c72e2b113d4e0e0408c90bfc)

2 years agomlx5: Remove support for FreeBSD 10 and older.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5: Remove support for FreeBSD 10 and older.

Sponsored by: NVIDIA Networking

(cherry picked from commit 788e9e74780e85aca8863ac4871b2f265b6630a3)

2 years agomlx5en: Patch to inhibit transmit doorbell writes during packet reception.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5en: Patch to inhibit transmit doorbell writes during packet reception.

During packet reception the network stack frequently transmit data in
response to TCP window updates. To reduce the number of transmit doorbells
needed, inhibit all transmit doorbells designated for the same channel until
after the reception of packets for the given channel is completed.

While at it slightly refactor the mlx5e_tx_notify_hw() function:

1) The doorbell information is always stored into sq->doorbell.d64 .
No need to pass a separate pointer to this variable.

2) Move checks for skipping doorbell writes inside this function.

Sponsored by: NVIDIA Networking

(cherry picked from commit 2d5e5a0d75b0612f8cea0f7f59f7d2e59b0c7a60)

2 years agomlx5ib: Add missing auto generated header file to Makefile.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:51 +0000 (16:08 +0100)]
mlx5ib: Add missing auto generated header file to Makefile.

Sponsored by: NVIDIA Networking

(cherry picked from commit 12af59c2cf8dbede2c1386c4744e725b1e1f8bd9)
(cherry picked from commit c830e929247de33fb523fd178ff2923a5c5480df)

2 years agoLRO: Don't merge ACK and non-ACK packets together
Ryan Stone [Tue, 8 Feb 2022 15:08:50 +0000 (16:08 +0100)]
LRO: Don't merge ACK and non-ACK packets together

LRO was willing to merge ACK and non-ACK packets together.  This
can cause incorrect th_ack values to be reported up the stack.
While non-ACKs are quite unlikely to appear in practice, LRO's
behaviour is against the spec.  Make LRO unwilling to merge
packets with different TH_ACK flag values in order to fix the
issue.

Found by: Sysunit test
Differential Revision: https://reviews.freebsd.org/D33775
Reviewed by: rrs

(cherry picked from commit 3284f4925f697ad7cc2aa4761ff5cf6ce98fd623)

2 years agoLRO: Fix lost packets when merging 1 payload with an ACK
Ryan Stone [Tue, 8 Feb 2022 15:08:50 +0000 (16:08 +0100)]
LRO: Fix lost packets when merging 1 payload with an ACK

To check if it needed to regenerate a packet's header before
sending it up the stack, LRO was checking if more than one payload
had been merged into the packet.  This failed in the case where
a single payload was merged with one or more pure ACKs.  This
results in lost ACKs.

Fix this by precisely tracking whether header regeneration is
required instead of using an incorrect heuristic.

Found with: Sysunit test
Differential Revision: https://reviews.freebsd.org/D33774
Reviewed by: rrs

(cherry picked from commit 24fe6643dac0780dc02676626f70052e525b9b22)

2 years agoUse layer five checksum flags in the mbuf packet header to pass on crypto state.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:50 +0000 (16:08 +0100)]
Use layer five checksum flags in the mbuf packet header to pass on crypto state.

The mbuf protocol flags get cleared between layers, and also it was discovered
that M_DECRYPTED conflicts with M_HASFCS when receiving ethernet patckets.

Add the proper CSUM_TLS_MASK and CSUM_TLS_DECRYPTED defines, and start using
these instead of M_DECRYPTED inside the TCP LRO code.

This change is needed by coming TLS RX hardware offload support patches.

Suggested by: kib@
Reviewed by: jhb@
Sponsored by: NVIDIA Networking

(cherry picked from commit 10a62eb109ceafce32aa2b18ec835b3b7285c2dd)

2 years agoUpdate the TCP LRO code to handle both encrypted and un-encrypted traffic.
Hans Petter Selasky [Tue, 8 Feb 2022 15:08:50 +0000 (16:08 +0100)]
Update the TCP LRO code to handle both encrypted and un-encrypted traffic.

Encrypted and un-encrypted traffic needs to be coalesced separately.
Split the 16-bit lro_type field in the address information into two
8-bit fields, and then use the last 8-bit field for flags, which among
other indicate if the received mbuf is encrypted or un-encrypted.

Differential Revision: https://reviews.freebsd.org/D31377
Reviewed by: gallatin
Sponsored by: NVIDIA Networking

(cherry picked from commit bb5cd80e8b42b31a2229077a7e93ffd3585eeb78)

2 years agosrc.conf: regenerate
Piotr Kubaj [Tue, 8 Feb 2022 13:09:55 +0000 (14:09 +0100)]
src.conf: regenerate

2 years agoriscv64: enable ASAN and UBSAN
Piotr Kubaj [Fri, 14 Jan 2022 00:28:55 +0000 (01:28 +0100)]
riscv64: enable ASAN and UBSAN

Differential review: https://reviews.freebsd.org/D33875
Approved by: dim, imp

(cherry picked from commit 9fc131426694387dda365c8624ddc85cb567d727)

2 years agopowerpc: Enable LLDB on all powerpc architectures
Piotr Kubaj [Wed, 26 Jan 2022 14:02:28 +0000 (15:02 +0100)]
powerpc: Enable LLDB on all powerpc architectures

While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review: https://reviews.freebsd.org/D34043
Approved by: dim, imp, emaste

(cherry picked from commit 0b2d2290fe6d4b07d26a4eb0bceadcd2b9b27fd6)

2 years agovm/vm_extern.h, vm/vm_page.h: use sys/kassert.h
Konstantin Belousov [Sat, 29 Jan 2022 03:39:30 +0000 (05:39 +0200)]
vm/vm_extern.h, vm/vm_page.h: use sys/kassert.h

(cherry picked from commit d950c5898a2d8733cd6e75e7ef82b08acac79b34)

2 years agovm/vm_pager.h: use sys/systm.h header
Konstantin Belousov [Tue, 1 Feb 2022 03:54:26 +0000 (05:54 +0200)]
vm/vm_pager.h: use sys/systm.h header

(cherry picked from commit f4cdb9d7c3f2ca277c0e90540595164a109f84c1)

2 years agoIntroduce sys/kassert.h
Konstantin Belousov [Sat, 29 Jan 2022 03:37:15 +0000 (05:37 +0200)]
Introduce sys/kassert.h

(cherry picked from commit 54d34bfbdf08d383b0ecb9a721434ac732620c79)

2 years agomlx5ib: idiomatic use of preprocessor, in particular paths
Konstantin Belousov [Mon, 14 Jun 2021 11:10:30 +0000 (14:10 +0300)]
mlx5ib: idiomatic use of preprocessor, in particular paths

(cherry picked from commit 028130b8e466e96365efaa898adf4ff2d01a2ea9)

2 years agomlx5ib: normalize use of the opt_*.h files
Konstantin Belousov [Mon, 14 Jun 2021 10:29:39 +0000 (13:29 +0300)]
mlx5ib: normalize use of the opt_*.h files

(cherry picked from commit 7060097908ea189827ed401dd57d948d7892f019)

2 years agomlx5en: idiomatic use of preprocessor, in particular paths
Konstantin Belousov [Mon, 14 Jun 2021 10:43:44 +0000 (13:43 +0300)]
mlx5en: idiomatic use of preprocessor, in particular paths

(cherry picked from commit 89918a2375cb27964d143aba6c40d22b41dbe520)

2 years agomlx5en: normalize use of the opt_*.h files
Konstantin Belousov [Mon, 14 Jun 2021 08:05:13 +0000 (11:05 +0300)]
mlx5en: normalize use of the opt_*.h files

(cherry picked from commit b984b95693e0911836815addc95f18bb7ce28b04)

2 years agomlx5: idiomatic use of preprocessor, in particular paths
Hans Petter Selasky [Tue, 1 Feb 2022 10:49:42 +0000 (11:49 +0100)]
mlx5: idiomatic use of preprocessor, in particular paths

(cherry picked from commit 12c56d7dc48821d84cc29e66f5d7f45e2ed8fd11)

2 years agomlx5: normalize use of the opt_*.h files
Konstantin Belousov [Mon, 14 Jun 2021 10:26:03 +0000 (13:26 +0300)]
mlx5: normalize use of the opt_*.h files

(cherry picked from commit ee9d634bd3b985bca49946e5d5697d7e65589711)

2 years agowpa: Import wpa 2.10.
Cy Schubert [Tue, 18 Jan 2022 16:15:25 +0000 (08:15 -0800)]
wpa: Import wpa 2.10.

The long awaited hostapd 2.10 is finally here.

(cherry picked from commit ec080394e21815b6852dee5cba6155bbba26a3ff)

2 years agowpa: Import wpa_supplicant/hostapd commit b26f5c0fe
Cy Schubert [Thu, 6 Jan 2022 18:28:57 +0000 (10:28 -0800)]
wpa: Import wpa_supplicant/hostapd commit b26f5c0fe

This is the December/January update to vendor/wpa committed upstream
2021-12-13.

(cherry picked from commit 32a95656b51ebefcdf3e0b02c110825f59abd26f)

2 years agoopenssh: sync update document with main
Ed Maste [Mon, 22 Feb 2021 19:03:28 +0000 (14:03 -0500)]
openssh: sync update document with main

(cherry picked from commit 519496a5985549d2935cf296a709b1e726b1b5e5)
(cherry picked from commit 576b477ba41c9916fae3a83e6b4dd98c682a0c2f)
(cherry picked from commit 35a034250896584a63204f60fa57e6eddca049ac)
(cherry picked from commit f3fd88507489f6b80402ab7a0fb195ca9c708334)
(cherry picked from commit b645ee1815daf96ee9512633b55c423bc897b244)
(cherry picked from commit 438fd19dc327400e5fbcebfcb9fe9361b317e791)

2 years agoopenssh: port upgrade doc and script to git
Ed Maste [Wed, 10 Feb 2021 00:50:32 +0000 (19:50 -0500)]
openssh: port upgrade doc and script to git

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28564

(cherry picked from commit 74c59ab790db0062b768bb9742e4d1ad036501ad)

2 years agokldxref: add R_PPC64_ADDR64 handler
Alfredo Dal'Ava Junior [Mon, 27 Dec 2021 18:29:50 +0000 (15:29 -0300)]
kldxref: add R_PPC64_ADDR64 handler

Implements R_PPC64_ADDR64 handler for kldxref, addressing
"kldxref: unhandled relocation type 38" when running
"kldxref /boot/kernel"

Reviewed by: jhibbits
MFC after: 1 week
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D33615

(cherry picked from commit c3d9c63329a8b70a0a3b139c7819ace13aab6716)

2 years agond6: use CARP link level address in SLLAO for NS sent out
Thomas Steen Rasmussen [Tue, 25 Jan 2022 05:02:47 +0000 (21:02 -0800)]
nd6: use CARP link level address in SLLAO for NS sent out

When sending an NS, check if we are using a IPv6 CARP address
and if we do, then put proper CARP link level address into
ND_OPT_SOURCE_LINKADDR option and also put PACKET_TAG_CARP tag
on the packet.  The latter will enforce CARP link level address
at the data link layer too, which might be necessary for broken
implementations.
The code really follows what NA sending code has been doing since
introduction of carp(4).  While here, bring to style(9) the whole
block of code.

PR: 193280
Differential revision: https://reviews.freebsd.org/D33858

(cherry picked from commit bc6abdd97e951b54294d331698317a607246255d)

2 years agoarm64, riscv: handle RB_KDB
Mitchell Horne [Tue, 1 Feb 2022 17:58:07 +0000 (13:58 -0400)]
arm64, riscv: handle RB_KDB

This allows entering the debugger at the earliest possible time, if
the '-d' argument is passed to the kernel.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34120

(cherry picked from commit 4e1bc961bb4467f074e48aa6e710ccd1aa7f2888)

2 years agopf: Initialize pf_kpool mutexes earlier
Mark Johnston [Mon, 31 Jan 2022 21:14:00 +0000 (16:14 -0500)]
pf: Initialize pf_kpool mutexes earlier

There are some error paths in ioctl handlers that will call
pf_krule_free() before the rule's rpool.mtx field is initialized,
causing a panic with INVARIANTS enabled.

Fix the problem by introducing pf_krule_alloc() and initializing the
mutex there.  This does mean that the rule->krule and pool->kpool
conversion functions need to stop zeroing the input structure, but I
don't see a nicer way to handle this except perhaps by guarding the
mtx_destroy() with a mtx_initialized() check.

Constify some related functions while here and add a regression test
based on a syzkaller reproducer.

Reported by: syzbot+77cd12872691d219c158@syzkaller.appspotmail.com
Reviewed by: kp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 773e3a71b2f11d422694495aca988d4c7143601b)

2 years agoipfilter: Correct a typo in a comment
Cy Schubert [Wed, 2 Feb 2022 03:55:56 +0000 (19:55 -0800)]
ipfilter: Correct a typo in a comment

(cherry picked from commit 445ecc480c48c02ad89ee97a17c4aa797f464ac3)

2 years agoipfilter: inline is superfluous for an extrn function
Cy Schubert [Mon, 10 Jan 2022 18:33:56 +0000 (10:33 -0800)]
ipfilter: inline is superfluous for an extrn function

Remove superfluous inline for function defined as extrn.

(cherry picked from commit 835a0e2f0d60d791316ab3cfef1a9f420c0ae592)

2 years agoipfilter: Remove redundant else if
Cy Schubert [Mon, 10 Jan 2022 17:45:27 +0000 (09:45 -0800)]
ipfilter: Remove redundant else if

Combine two else ifs using an or.

(cherry picked from commit f98cc177f7b8afae670f28adf2b88cc00b990bf7)

2 years agoipfilter: Restore ipfsync
Cy Schubert [Sat, 8 Jan 2022 04:12:50 +0000 (20:12 -0800)]
ipfilter: Restore ipfsync

ipfsync is a WIP sync daemon designed to be used in a failover scenario.
It was removed by 5ee61c7daa511927aae8652d6a3ea78866a50ef8. This commit
restores its three files. ipfsync is in my work queue.

(cherry picked from commit 08ab34a06a9b0a84e979ff43f2d6f2d60fb37ed9)

2 years agoipfilter: Fix manpage typos
Cy Schubert [Tue, 4 Jan 2022 15:09:43 +0000 (07:09 -0800)]
ipfilter: Fix manpage typos

Reported by: jrtc27
Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329

(cherry picked from commit ad07e93fe10baf9228b809997da3cf817486b018)

2 years agoipfilter userland: Fix typos
Cy Schubert [Tue, 4 Jan 2022 11:04:22 +0000 (03:04 -0800)]
ipfilter userland: Fix typos

Reported by: netchild
Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329

(cherry picked from commit cc3e5b372e8cc5312649c8066ed662db7b77383b)

2 years agoipfilter userland: Fix branch mismerge
Cy Schubert [Tue, 4 Jan 2022 03:04:04 +0000 (19:04 -0800)]
ipfilter userland: Fix branch mismerge

The work to ANSIfy and adjust returns to style(9) resulted in a mismerge
of a stash when ipfilter was moved from contrib to sbin. An older file
replaced WIP at the time, resulting in a regression.

The majority of this work was done in 2018 saved as git stashes within
a git-svn tree and migrated to the git tree. The regression occurred
when the various stashes were sequentially merged to create individual
commits, following the ipfilter move to netpfil and sbin.

Reported by: jrtc27
Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329
Pointy hat to: cy

(cherry picked from commit a3522837b021a46f2de81303247599ea51163d13)

2 years agoipfilter userland: Style(9) requires a space after return
Cy Schubert [Tue, 4 Jan 2022 02:49:18 +0000 (18:49 -0800)]
ipfilter userland: Style(9) requires a space after return

Reported by:    jrtc27
Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329
(cherry picked from commit 44bc30192139b0b3c95510ab3b35802bcc6d63e4)

2 years agoipfilter module: Style(9) requires a space after return
Cy Schubert [Tue, 4 Jan 2022 02:42:49 +0000 (18:42 -0800)]
ipfilter module: Style(9) requires a space after return

Reported by: jrtc27
Fixes: 8c82b37461fa4e60276639df214100fbf559ea6e

(cherry picked from commit 701301511f0ca044fc71470ed7842cd2c6fee001)

2 years agoipfilter: Fix typos
Cy Schubert [Tue, 4 Jan 2022 02:39:11 +0000 (18:39 -0800)]
ipfilter: Fix typos

Reported by: jrtc27
Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329

(cherry picked from commit d86f022e79862e9d91be80a806a4b011359d6cc8)

2 years agoipfilter userland: Fix whitespace errors
Cy Schubert [Wed, 22 Dec 2021 05:11:44 +0000 (21:11 -0800)]
ipfilter userland: Fix whitespace errors

Replace leading spaces with a tabs on affected lines.

(cherry picked from commit 5e13b104a4083c022162a06ffab4f37e7e93aa45)

2 years agoipfilter module: Fix whitespace errors
Cy Schubert [Wed, 22 Dec 2021 04:53:03 +0000 (20:53 -0800)]
ipfilter module: Fix whitespace errors

Replace leading spaces with a tabs on affected lines.

(cherry picked from commit 80030b6cc734cc50c20d87de99bb631a06888f37)

2 years agoipfilter userland: Remove trailing whitespace
Cy Schubert [Wed, 22 Dec 2021 03:09:23 +0000 (19:09 -0800)]
ipfilter userland: Remove trailing whitespace

(cherry picked from commit 27fc223414670ecd20d3c6f375fc48a3cd31c889)

2 years agoipfilter: Remove extraneous comment line
Cy Schubert [Wed, 22 Dec 2021 03:06:50 +0000 (19:06 -0800)]
ipfilter: Remove extraneous comment line

(cherry picked from commit 00a5b8c3d98df6c51cc8e0ec1e86c7363744bf7c)

2 years agoipfilter module: Remove trailing whitespace
Cy Schubert [Wed, 22 Dec 2021 03:06:01 +0000 (19:06 -0800)]
ipfilter module: Remove trailing whitespace

(cherry picked from commit 2eef572879afe0309e3c538017c7909c1b7307d0)

2 years agoipfilter: Adjust userland returns to conform to style(9)
Cy Schubert [Wed, 22 Dec 2021 02:37:19 +0000 (18:37 -0800)]
ipfilter: Adjust userland returns to conform to style(9)

Adjust ipfilter's userland return statements to conform to style(9).

(cherry picked from commit 2582ae5740181e0d2bab10003d66ae91c9b56329)

2 years agoipfilter: Adjust kernel module returns to conform to style(9)
Cy Schubert [Wed, 22 Dec 2021 02:35:12 +0000 (18:35 -0800)]
ipfilter: Adjust kernel module returns to conform to style(9)

Adjust ipfilter's kernel module return statements to conform to style(9).

(cherry picked from commit 8c82b37461fa4e60276639df214100fbf559ea6e)

2 years agoipfilter: INLINE --> inline
Cy Schubert [Tue, 21 Dec 2021 17:22:10 +0000 (09:22 -0800)]
ipfilter: INLINE --> inline

Replace the INLINE macro with inline. Some ancient compilers supported
__inline__ instead of inline. The INLINE hack compensated for it.
Ancient compilers are history.

Reported by: glebius

(cherry picked from commit 9be9c1c084574e3d29f38019118a50f648d2f2a8)

2 years agoipflter: ANSIfy userland function declarations
Cy Schubert [Mon, 20 Dec 2021 17:07:20 +0000 (09:07 -0800)]
ipflter: ANSIfy userland function declarations

Convert ipfilter userland function declarations from K&R to ANSI. This
syncs our function declarations with NetBSD hg commit 75edcd7552a0
(apply our changes). Though not copied from NetBSD, this change was
partially inspired by NetBSD's work and inspired by style(9).

Reviewed by: glebius (for #network)
Differential Revision: https://reviews.freebsd.org/D33595

(cherry picked from commit efeb8bffe34422937c7f8df836afb5b817366d16)

2 years agoipflter: ANSIfy kernel function declarations
Cy Schubert [Mon, 20 Dec 2021 16:43:49 +0000 (08:43 -0800)]
ipflter: ANSIfy kernel function declarations

Convert ipfilter kernel function declarations from K&R to ANSI. This
syncs our function declarations with NetBSD hg commit 75edcd7552a0
(apply our changes). Though not copied from NetBSD, this change was
partially inspired by NetBSD's work and inspired by style(9).

Reviewed by: glebius (for #network)
Differential Revision: https://reviews.freebsd.org/D33595

(cherry picked from commit 064a5a95649d05ac084bcf2612cbac5575d76358)

2 years agoipfilter userland: Path fixup no longer required
Cy Schubert [Mon, 27 Dec 2021 08:18:49 +0000 (00:18 -0800)]
ipfilter userland: Path fixup no longer required

Since the move of ipfilter from contrib to sbin adjusting the source path
is no longer required.

Fixes: 41edb306f05651fcaf6c74f9e3557f59f80292e1

(cherry picked from commit 7cb2d7c41368a662bb5e8db5e12420d4a8a190b1)

2 years agoipfilter: Move userland bits to sbin
Cy Schubert [Wed, 15 Dec 2021 21:45:47 +0000 (13:45 -0800)]
ipfilter: Move userland bits to sbin

Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sbin/ipf. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to sbin.

This is the second of three commits of the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with: glebius
Reviewed by: glebius, kp (for #network)
Differential Revision: https://reviews.freebsd.org/D33510

(cherry picked from commit 41edb306f05651fcaf6c74f9e3557f59f80292e1)

2 years agoipfilter: Move kernel bits to netpfil
Cy Schubert [Wed, 15 Dec 2021 16:28:18 +0000 (08:28 -0800)]
ipfilter: Move kernel bits to netpfil

Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sys/netpil. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to netpfil.

This is the first of three commits the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with: glebius
Reviewed by: glebius, kp (for #network)
Differential Revision: https://reviews.freebsd.org/D33510

(cherry picked from commit 3b9b51fe464ebb91e894742a6a0e6417e256f03a)

2 years agoufs, msdosfs: do not record witness order when creating vnode
Konstantin Belousov [Tue, 1 Feb 2022 05:16:30 +0000 (07:16 +0200)]
ufs, msdosfs: do not record witness order when creating vnode

(cherry picked from commit 303d3ae7e8419b457078598b8569e57a5e3fb5ce)

2 years agoffs_read(): lock buffers after snaplk with LK_NOWITNESS
Konstantin Belousov [Sat, 5 Feb 2022 02:03:47 +0000 (04:03 +0200)]
ffs_read(): lock buffers after snaplk with LK_NOWITNESS

(cherry picked from commit 0af463e6619cf9f7386129d427c244d3da30fa3a)

2 years agoffs: lock buffers after snaplk with LK_NOWITNESS
Konstantin Belousov [Fri, 28 Jan 2022 04:42:33 +0000 (06:42 +0200)]
ffs: lock buffers after snaplk with LK_NOWITNESS

(cherry picked from commit 99aa3b731caa252e94d92add8cb02d077a24a256)

2 years agoAdd GB_NOWITNESS flag
Konstantin Belousov [Fri, 28 Jan 2022 04:37:23 +0000 (06:37 +0200)]
Add GB_NOWITNESS flag

(cherry picked from commit c02780b78c7f1df3e682e1a88b380820c288ec04)

2 years agoffs_alloc.c: order includes alphabetically
Konstantin Belousov [Fri, 28 Jan 2022 04:36:50 +0000 (06:36 +0200)]
ffs_alloc.c: order includes alphabetically

(cherry picked from commit e11b2b69c5a1d1463720f140e58f9c012cb1b83b)

2 years agoufs: be more persistent with finishing some operations
Konstantin Belousov [Tue, 18 Jan 2022 01:49:36 +0000 (03:49 +0200)]
ufs: be more persistent with finishing some operations

(cherry picked from commit 8d8589b385c901581ee71d09d86d044a6f42dfef)

2 years agoffs_snapblkfree(): add a comment explaining lockmgr invocation
Konstantin Belousov [Sun, 23 Jan 2022 00:33:18 +0000 (02:33 +0200)]
ffs_snapblkfree(): add a comment explaining lockmgr invocation

(cherry picked from commit 4559700a0a99376640a8913d08bdf0cfb0124d4a)