]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoUpgrade ENA to v2.4.0
Marcin Wojtas [Mon, 14 Jun 2021 08:57:45 +0000 (10:57 +0200)]
Upgrade ENA to v2.4.0

ena: change ENA C++-style comment into C-style

According to man style(9), only C-style comments should be used.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 438c9e3cf89403628ec237cfecdd0538f208087b)

ena: add support for the large LLQ headers in ENA

Default LLQ (Low-latency queue) maximum header size is 96 bytes and can
be too small for some types of packets - like IPv6 packets with multiple
extension. This can be fixed, by using large LLQ headers.

If the device supports larger LLQ headers, the user can activate this
feature by setting sysctl tunable 'hw.ena.force_large_llq_header' to '1'
in the /boot/loader.conf file.

In case the device isn't supporting this feature, the default value (96B)
will be used.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit beaadec9eaec8e6b266faff3b0880a141728fcef)

ena: remove surplus NULL checks when freeing ENA resources

Calling free on a NULL pointer is valid, as appropriate check is already
done internally:

/* free(NULL, ...) does nothing */
if (addr == NULL)
    return;

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit ddec69e6a796283497ebada0569f34bd41bbdf37)

ena: hide sysctl nodes for unused ENA queues

IO queue related attributes are registered statically at driver attach
with the rest of the ENA specific sysctl nodes. However, the number of
queues can be changed at runtime via the `ena_sysctl_io_queues_nb`
request, leading to a potential exposure of attributes for non-existing
queues.

Introduce a new `ena_sysctl_update_queue_node_nb` function, which
updates the sysctl nodes after the number of queues is altered.
This happens by either registering or unregistering node specific oids,
based on a delta between the previous and current queue count.

NOTE: All unregistered oids must be registered again before the driver
detach, e.g. by another call to this function.

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 0e7d31f63b9db869c91228d8ed1e984bdee2b931)

Merge tag 'vendor/ena-com/2.4.0'

Update the driver in order not to break its compilation
and make use of the new ENA logging system

Migrate platform code to the new logging system provided by ena_com
layer.

Make ENA_INFO the new default log level.

Remove all explicit use of `device_printf`, all new logs requiring one
of the log macros to be used.

(cherry picked from commit 3fc5d816f8831d6fc2816ac97bd78dc486cd080c)

Update ENA driver man page

Bring the obsolete man page up to date:
* update diagnostic error messages
* add documentation of loader tunables
* document netmap support
* add a driver history section
* update the contact information

Submitted by: Artur Rojek <ar@semihalf.com>
Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit e34856a2c44a45512463aed0d1794f34258c66ee)

Update ENA version to v2.4.0

Some of the changes in this release:
* Large LLQ headers,
* Bug/stability fixes,
* Change of the README/Documentation.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 93f0df457bf1d0e5f71839ab969c94d1f95813fb)

2 years agommc_fdt_helper: correct typo in DT property name
Marcin Wojtas [Thu, 15 Jul 2021 15:08:16 +0000 (17:08 +0200)]
mmc_fdt_helper: correct typo in DT property name

'no-1-8-v' is a proper name according to the DT binding
documentation
(https://www.kernel.org/doc/Documentation/devicetree/bindings/mmc/mmc-controller.yaml).

Fixes: e63fbd7bb7a25
Submitted by: Bartlomiej Grzesik <bag@semihalf.com>
Sponsored by: Semihalf

(cherry picked from commit d8789cd0ae278a86f92247a87d98bb54f15b5592)

2 years agohpen(4): removed leftover hpen_final_digi_cb declaration
Mateusz Guzik [Sun, 5 Sep 2021 17:30:51 +0000 (17:30 +0000)]
hpen(4): removed leftover hpen_final_digi_cb declaration

(cherry picked from commit 007724cbca6f6d91b8c3450bd4a11f3ea2bb647a)

2 years agosocket: Avoid clearing SS_ISCONNECTING if soconnect() fails
Mark Johnston [Tue, 7 Sep 2021 18:51:54 +0000 (14:51 -0400)]
socket: Avoid clearing SS_ISCONNECTING if soconnect() fails

This behaviour appears to date from the 4.4 BSD import.  It has two
problems:

1. The update to so_state is not protected by the socket lock, so
   concurrent updates to so_state may be lost.
2. Suppose two threads race to call connect(2) on a socket, and one
   succeeds while the other fails.  Then the failing thread may
   incorrectly clear SS_ISCONNECTING, confusing the state machine.

Simply remove the update.  It does not appear to be necessary:
pru_connect implementations which call soisconnecting() only do so after
all failure modes have been handled.  For instance, tcp_connect() and
tcp6_connect() will never return an error after calling soisconnected().
However, we cannot correctly assert that SS_ISCONNECTED is not set after
an error from soconnect() since the socket lock is not held across the
pru_connect call, so a concurrent connect(2) may have set the flag.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit a8aa6f1f784b91acb4ef9387a28c78311493eb66)

2 years agosocket: Rename sb(un)lock() and interlock with listen(2)
Mark Johnston [Tue, 7 Sep 2021 18:49:31 +0000 (14:49 -0400)]
socket: Rename sb(un)lock() and interlock with listen(2)

In preparation for moving sockbuf locks into the containing socket,
provide alternative macros for the sockbuf I/O locks:
SOCK_IO_SEND_(UN)LOCK() and SOCK_IO_RECV_(UN)LOCK().  These operate on a
socket rather than a socket buffer.  Note that these locks are used only
to prevent concurrent readers and writters from interleaving I/O.

When locking for I/O, return an error if the socket is a listening
socket.  Currently the check is racy since the sockbuf sx locks are
destroyed during the transition to a listening socket, but that will no
longer be true after some follow-up changes.

Modify a few places to check for errors from
sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before.  In
particular, add checks to sendfile() and sorflush().

Reviewed by: tuexen, gallatin
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f94acf52a408316ed61ba94705d7ec0a69ba5ec8)

2 years agosyslogd: undo regression after r326573
Eugene Grosbein [Mon, 27 Sep 2021 07:25:21 +0000 (14:25 +0700)]
syslogd: undo regression after r326573

Restore ability for our syslogd to collect pre-RFC3164 formatted
messages from remote hosts that was broken with r326573.

Note that parsing of RFC5424 format not changed.

(cherry picked from commit 3b4cc56e524ac947ba0e6571e2c455139c2839ec)

2 years agoFix busdma resource leak on usb device detach.
Ian Lepore [Tue, 28 Sep 2021 19:29:10 +0000 (13:29 -0600)]
Fix busdma resource leak on usb device detach.

When a usb device is detached, usb_pc_dmamap_destroy() called
bus_dmamap_destroy() while the map was still loaded. That's harmless on x86
architectures, but on all other platforms it causes bus_dmamap_destroy() to
return EBUSY and leak away any memory resources (including bounce buffers)
associated with the mapping, as well as any allocated map structure itself.

This change introduces a new is_loaded flag to the usb_page_cache struct to
track whether a map is loaded or not. If the map is loaded,
bus_dmamap_unload() is called before bus_dmamap_destroy() to avoid leaking
away resources.

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

(cherry picked from commit dc91a9715f8fda4b3633388830a28a99f73cbe59)

2 years agopf tests: Basic adaptive mode syncookie test
Kristof Provost [Sat, 25 Sep 2021 13:05:02 +0000 (15:05 +0200)]
pf tests: Basic adaptive mode syncookie test

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32139

(cherry picked from commit 2f20d80692ceb584842a7642562fc9f610a5b661)

2 years agopf tests: Basic syncookie test
Kristof Provost [Sat, 10 Jul 2021 11:20:44 +0000 (13:20 +0200)]
pf tests: Basic syncookie test

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32138

(cherry picked from commit dc0636636bb1937283d4f218732ac2357f4ec4f1)

2 years agopf.conf: document syncookies
Kristof Provost [Sat, 14 Aug 2021 08:42:03 +0000 (10:42 +0200)]
pf.conf: document syncookies

Reviewed by: bcr
Obtained from: OpenBSD
MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32137

(cherry picked from commit 20f015f08d66d0d953e49245cb95c81c118b9ee9)

2 years agopfctl: userspace adaptive syncookies configration
Kristof Provost [Fri, 13 Aug 2021 11:42:59 +0000 (13:42 +0200)]
pfctl: userspace adaptive syncookies configration

Hook up the userspace bits to configure syncookies in adaptive mode.

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32136

(cherry picked from commit 5062afff9de7e67da96e3f0dcb9d8bbd5a4e1c5b)

2 years agopf: hook up adaptive mode configuration
Kristof Provost [Sat, 24 Jul 2021 12:23:59 +0000 (14:23 +0200)]
pf: hook up adaptive mode configuration

The kernel side of pf syncookie adaptive mode configuration.

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32135

(cherry picked from commit 955460d41e99031906841870e02063ffdf227f09)

2 years agopf: implement adaptive mode
Kristof Provost [Sat, 24 Jul 2021 11:59:34 +0000 (13:59 +0200)]
pf: implement adaptive mode

Use atomic counters to ensure that we correctly track the number of half
open states and syncookie responses in-flight.
This determines if we activate or deactivate syncookies in adaptive
mode.

MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32134

(cherry picked from commit bf8637181a2bb81206ff8c685f1632d07b8feb13)

2 years agotcp_wrappers: get rid of duplicate fgets declarations
Kyle Evans [Thu, 30 Sep 2021 04:21:24 +0000 (23:21 -0500)]
tcp_wrappers: get rid of duplicate fgets declarations

This is declared in stdio.h, no need for this one.

(cherry picked from commit 4dbd8c72d3030b8f111fdac86ba45ff596595497)

2 years agolibc: ssp: sprinkle around some __dead2
Kyle Evans [Wed, 29 Sep 2021 21:48:20 +0000 (16:48 -0500)]
libc: ssp: sprinkle around some __dead2

This is consistent with, e.g., NetBSD's implementation, which declares
these as noreturn in ssp/ssp.h.

(cherry picked from commit 5487294d79f9ebe72a847d0855adb4df85e0d66e)

2 years agobootp: remove the USE_BFUNCS knob
Kyle Evans [Thu, 30 Sep 2021 03:01:34 +0000 (22:01 -0500)]
bootp: remove the USE_BFUNCS knob

We'd likely be better served by converting these to the equivalent mem*
calls, but just kill the knob for now. The b* macros being defined get
in the way of _FORTIFY_SOURCE.

(cherry picked from commit cfb9be506285cd65120f9686d532130a3757ce56)

2 years agojail(3lua): add jail.attach()/jail.remove() methods
Kyle Evans [Fri, 23 Oct 2020 17:52:31 +0000 (12:52 -0500)]
jail(3lua): add jail.attach()/jail.remove() methods

These aren't a part of or use libjail(3), but rather are direct
syscalls.  Still, they seem like good additions, allowing us to attach
to already-running jails.

(cherry picked from commit a6499c56ab6ca54f01dca44b7e34a0fc6a680e90)

2 years agojail(3lua): add a jail.list() method
Kyle Evans [Tue, 13 Oct 2020 02:11:14 +0000 (21:11 -0500)]
jail(3lua): add a jail.list() method

This is implemented as an iterator, reusing parts of the earlier logic
to populate jailparams from a passed in table.

The user may request any number of parameters to pull in while we're
searching, but we'll force jid and name to appear at a minimum.

(cherry picked from commit 6a7647eccd3ef35189c63a61b0ec8865fd559839)

2 years agomodules: iichid: needs opt_acpi.h
Kyle Evans [Thu, 30 Sep 2021 03:47:15 +0000 (22:47 -0500)]
modules: iichid: needs opt_acpi.h

This fixes the standalone build.

(cherry picked from commit 335c4f8edb3a02ea101b0f833c22182594e63c9e)

2 years agomodules: netflow: need opt_inet.h
Kyle Evans [Thu, 30 Sep 2021 04:04:18 +0000 (23:04 -0500)]
modules: netflow: need opt_inet.h

This fixes the standalone build.

(cherry picked from commit 6caae81d93e2a14fa42cb831506c3a60c25d9791)

2 years agomodules: acpi_video: need opt_evdev.h
Kyle Evans [Thu, 30 Sep 2021 04:04:00 +0000 (23:04 -0500)]
modules: acpi_video: need opt_evdev.h

This fixes the standalone build.

(cherry picked from commit 58ca99d11648f0b1749a4b29f534e87b0d88b83a)

2 years agokqueue: document how timers with low/past timeouts are handled
Kyle Evans [Thu, 30 Sep 2021 18:19:05 +0000 (13:19 -0500)]
kqueue: document how timers with low/past timeouts are handled

(cherry picked from commit 4b5554cebb66020f59dc869b835aebbd66e4bb8c)

2 years agokqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME
Kyle Evans [Wed, 29 Sep 2021 19:55:59 +0000 (14:55 -0500)]
kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME

NOTE_ABSTIME values are converted to values relative to boottime in
filt_timervalidate(), and negative values are currently rejected.  We
don't reject times in the past in general, so clamp this up to 0 as
needed such that the timer fires immediately rather than imposing what
looks like an arbitrary restriction.

Another possible scenario is that the system clock had to be adjusted
by ~minutes or ~hours and we have less than that in terms of uptime,
making a reasonable short-timeout suddenly invalid. Firing it is still
a valid choice in this scenario so that applications can at least
expect a consistent behavior.

(cherry picked from commit 9c999a259f00b35f0467acd351fea9157ed7e1e4)
(cherry picked from commit 2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0)

2 years agokern: random: collect ~16x less from fast-entropy sources
Kyle Evans [Mon, 20 Sep 2021 05:46:21 +0000 (00:46 -0500)]
kern: random: collect ~16x less from fast-entropy sources

Previously, we were collecting at a base rate of:

64 bits x 32 pools x 10 Hz = 2.5 kB/s

This change drops it to closer to 64-ish bits per pool per second, to
work a little better with entropy providers in virtualized environments
without compromising the security goals of Fortuna.

(cherry picked from commit 5e79bba562bc303eed669dbd0d391b6c6a9c289b)

2 years agokern: random: drop read_rate and associated functionality
Kyle Evans [Mon, 20 Sep 2021 04:59:09 +0000 (23:59 -0500)]
kern: random: drop read_rate and associated functionality

Refer to discussion in PR 230808 for a less incomplete discussion, but
the gist of this change is that we currently collect orders of magnitude
more entropy than we need.

The excess comes from bytes being read out of /dev/*random.  The default
rate at which we collect entropy without the read_rate increase is
already more than we need to recover from a compromise of an internal
state.

For stable/13, the read_rate_increment symbol remains as a stub to avoid
breaking loadable random modules.

(cherry picked from commit 6895cade9421238abf541f24fb9327ebd19e94ff)

2 years agocam: Fix a typo in a comment
Gordon Bergling [Sat, 2 Oct 2021 08:48:43 +0000 (10:48 +0200)]
cam: Fix a typo in a comment

- s/perorming/performing/

(cherry picked from commit 15c5f657a0107c7c1a3c954252a9ac6bb80f2535)

2 years agosmsc(4): Fix a typo in a comment
Gordon Bergling [Sat, 2 Oct 2021 08:45:58 +0000 (10:45 +0200)]
smsc(4): Fix a typo in a comment

- s/setings/settings/

(cherry picked from commit 9599d8141f79aa721e47d7fd91e7b9bcfef3a7d5)

2 years agovnic: Fix a typo in a comment
Gordon Bergling [Sat, 2 Oct 2021 08:47:21 +0000 (10:47 +0200)]
vnic: Fix a typo in a comment

- s/setings/settings/

(cherry picked from commit fafb1c574d43b8c3acb510d925f599fee461c039)

2 years agoevdev: Fix a typo in a commit
Gordon Bergling [Sat, 2 Oct 2021 08:43:41 +0000 (10:43 +0200)]
evdev: Fix a typo in a commit

- s/prefered/preferred/

(cherry picked from commit efd8749fe5cccb6c3d6b5f3c3515bf89ad306bcc)

2 years agonetvsc: Fix a typo in a comment
Gordon Bergling [Sat, 2 Oct 2021 08:42:18 +0000 (10:42 +0200)]
netvsc: Fix a typo in a comment

- s/prefered/preferred/

(cherry picked from commit 9ebd651b58502f0572a7832d088f53f7a2ad00a5)

2 years agowpa: Fix EAP/PEAP MSCHAPv2 authentication SIGSEGV
Cy Schubert [Tue, 5 Oct 2021 21:54:06 +0000 (14:54 -0700)]
wpa: Fix EAP/PEAP MSCHAPv2 authentication SIGSEGV

25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 (MFCed by
13f32ff71eeb7213bb9f34bdfa88c7ccecf451bc) introduced a link error
causing a SIGSEGV when using EAP/PEAP MSCHAPv2 authentication. It was
subsequently addressed by c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5,
discovered by build time link errors not experienced during testing of
25ecdc7d52770caf1c9b44b5ec11f468f6b636f3. This commit MFCs a portion
of c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 addressing only the
SIGSEGV. The rest of c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 will
be MFCed in November 2021.

This is a direct commit to stable/13.

PR: 258527
Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Tested by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>

2 years agomgb: sync with version in main
Ed Maste [Fri, 13 Aug 2021 20:57:04 +0000 (16:57 -0400)]
mgb: sync with version in main

This is a combination of 7 commits.

mgb: update Microchip URLs

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6b25b4a73fbe56e15d094895b4c7acdb424ee80d)

mgb: enable multicast in mgb_init

Receive Filtering Engine (RFE) configuration is not yet implemented,
and mgb intended to enable all broadcast, multicast, and unicast.
However, MGB_RFE_ALLOW_MULTICAST was missed (MGB_RFE_ALLOW_UNICAST was
included twice).

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ecac5c2928eead57c05ee7d376ff58de0a575d49)

mgb: Do not KASSERT on error in mgb_init

There's not much we can do if mii_mediachg() fails, but KASSERT is not
appropriate.

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8b889b8953828fe22e5de68647a35610dd87ff8f)

mgb: Staticize devclass and iflib structs (as is typical)

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c83ae596f3c2ce8c4ef2bacfb63100aaf8d48bb7)

mgb: Apply some style(9)

Add parens around return values, rewrap lines

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 820da5820e60f538d3598d8cb226f51a01bdf01c)

mgb: Fix DEBUG (and LINT) build

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5f07d7fe408bbca5c2f6755c363128107916c08d)

mgb: Fix nop admin interrupt handling

Previously mgb_admin_intr printed a diagnostic message if no interrupt
status bits were set, but it's not valid to call device_printf() from a
filter.  Just drop the message as it has no user-facing value.

Also return FILTER_STRAY in this case - there is nothing further for
the driver to do.

Reviewed by: kbowling
MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32231

(cherry picked from commit 1ad2d87778970582854082bcedd2df0394fd4933)

2 years agosched_ule(4): Fix interactive threads stealing.
Alexander Motin [Tue, 21 Sep 2021 19:56:49 +0000 (15:56 -0400)]
sched_ule(4): Fix interactive threads stealing.

In scenarios when first thread in the queue can migrate to specified
CPU, but later ones can't runq_steal_from() incorrectly returned NULL.

MFC after: 2 weeks

(cherry picked from commit bd84094a51c4648a7c97ececdaccfb30bc832096)

2 years agoboot(9): update to match reality
Mitchell Horne [Tue, 28 Sep 2021 14:36:09 +0000 (11:36 -0300)]
boot(9): update to match reality

This function was renamed to kern_reboot() in 2010, but the man page has
failed to keep in sync. Bring it up to date on the rename, add the
shutdown hooks to the synopsis, and document the (obvious) fact that
kern_reboot() does not return.

Fix an outdated reference to the old name in kern_reboot(), and leave a
reference to the man page so future readers might find it before any
large changes.

Reviewed by: imp, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32085

(cherry picked from commit 800e74955d4e5f90e7258956ba42228350f71049)

2 years agorman: fix overflow in rman_reserve_resource_bound()
Elliott Mitchell [Mon, 27 Sep 2021 17:13:19 +0000 (14:13 -0300)]
rman: fix overflow in rman_reserve_resource_bound()

If the default range of [0, ~0] is given, then (~0 - 0) + 1 == 0. This
in turn will cause any allocation of non-zero size to fail. Zero-sized
allocations are prohibited, so add a KASSERT to this effect.

History indicates it is part of the original rman code.  This bug may in
fact be older than some contributors.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30280

(cherry picked from commit bcddaadbef5850ed9f040836d3f25ff57138ae28)

2 years agontb_hw_intel: fix xeon NTB gen3 bar disable logic
David Bright [Mon, 27 Sep 2021 13:18:46 +0000 (06:18 -0700)]
ntb_hw_intel: fix xeon NTB gen3 bar disable logic

In NTB gen3 driver, it was supposed to disable NTB bar access by
default, but due to incorrect register access method, the bar disable
logic does not work as expected. Those registers should be modified
through NTB bar0 rather than PCI configuration space.

Besides, we'd better to protect ourselves from a bad buddy node so
ingress disable logic should be implemented together.

Submitted by:   Austin Zhang (austin.zhang@dell.com)
Sponsored by:   Dell EMC

(cherry picked from commit e3cf7ebc1d36d068f1d1a83ea73ce2eed547e3cb)

2 years agoDisable stack gap for ntpd during build.
Marcin Wojtas [Fri, 21 May 2021 09:29:22 +0000 (11:29 +0200)]
Disable stack gap for ntpd during build.

When starting, ntpd calls setrlimit(2) to limit maximum size of its
stack. The stack limit chosen by ntpd is 200K, so when stack gap
is enabled, the stack gap is larger than this limit, which results
in ntpd crashing.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: cy, imp
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29553

(cherry picked from commit af949c590bd8a00a5973b5875d7e0fa6832ea64a)

2 years agoipfilter: Print the correct TCP sequence index number
Cy Schubert [Sat, 25 Sep 2021 00:00:20 +0000 (17:00 -0700)]
ipfilter: Print the correct TCP sequence index number

TCP sequence numbers in the FTP proxy are maintained in a two dimensional
array. The debug message prints the same seq[N] for both. Fix that.

(cherry picked from commit df38343e71304169ebca0e4c4fa24b339982d7be)

2 years agoipfilter: Correct a comment
Cy Schubert [Sat, 25 Sep 2021 06:41:22 +0000 (23:41 -0700)]
ipfilter: Correct a comment

Correct a comment's grammar and while at it clarify its meaining.

(cherry picked from commit aa6cfcc820b438cec58fbe0af408d4457f8daf9d)

2 years agoipfilter: Locking sysctls here is not required
Cy Schubert [Fri, 24 Sep 2021 18:18:42 +0000 (11:18 -0700)]
ipfilter: Locking sysctls here is not required

Locking of data structures touched by sysctls is more finely locked
in ipflter therefore higher level locks are redundant.

(cherry picked from commit 1605eaa6d23ea5161b5ab8461e83ab32a591a4fc)

2 years agoipfilter: Avoid a null if-then-else blocks
Cy Schubert [Wed, 22 Sep 2021 04:58:08 +0000 (21:58 -0700)]
ipfilter: Avoid a null if-then-else blocks

When WITHOUT_INET6 is selected we generate a null if-then-else blocks
due to incorrect placment of #if statments. Move the #if statements
reducing unnecessary runtime comparisons WITHOUT_INET6.

(cherry picked from commit 73db3b64f167972db3ee3f780cecb439b09492b1)

2 years agovt: call driver's postswitch when panicking on ttyv0
Greg V [Sat, 24 Apr 2021 11:53:34 +0000 (14:53 +0300)]
vt: call driver's postswitch when panicking on ttyv0

In vt_kms, the postswitch callback restores fbdev mode when
panicking or entering the debugger. This ensures that even when
a graphical applicatino was running on the first tty, simple framebuffer
mode would be restored and the panic would be visible instead
of the frozen GUI. But vt wouldn't call the postswitch callback
when we're already on the first tty, so running a GUI on it
would prevent you from reading any panics.

Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D29961

(cherry picked from commit c937a405bdce2fd12c534446a8cc9e5548dd27eb)

2 years agoUnify console output.
Alexander Motin [Sat, 4 Sep 2021 03:13:42 +0000 (23:13 -0400)]
Unify console output.

Without this change when virtual console enabled depending on buffer
presence and state different parts of output go to different consoles.

MFC after: 1 month

(cherry picked from commit a264594d4ff19fd13f7c39a56c8d131296db480d)

2 years agoRe-implement virtual console (constty).
Alexander Motin [Sat, 4 Sep 2021 02:18:51 +0000 (22:18 -0400)]
Re-implement virtual console (constty).

Protect conscallout with tty lock instead of Giant.  In addition to
Giant removal it also closes race on console unset.

Introduce additional lock to protect against concurrent console sets.

Remove consbuf free on console unset as unsafe, making impossible to
change buffer size after first allocation.  Instead increase default
buffer size from 8KB to 64KB and processing rate from 5Hz to 10-15Hz
to make the output more smooth.

MFC after: 1 month

(cherry picked from commit bd6085c6ae28fb1cc81cca325656332fbd2cebd8)

2 years agoioat(4): Remove Giant from ioat_test enable/disable.
Alexander Motin [Sat, 4 Sep 2021 19:53:28 +0000 (15:53 -0400)]
ioat(4): Remove Giant from ioat_test enable/disable.

MFC after: 1 month

(cherry picked from commit 71bf3900b7827643830dfd9aa1db81bc2926eadb)

2 years agopcib(4): Switch from callout to timeout_task.
Alexander Motin [Fri, 3 Sep 2021 19:00:21 +0000 (15:00 -0400)]
pcib(4): Switch from callout to timeout_task.

This allows to avoid blocking on Giant in callout context, moving to
already existing dedicated taskqueue_pci_hp thread.

MFC after: 1 month

(cherry picked from commit fa3b03d378546b74582613431bab537d3488d81f)

2 years agovt(4): Mark callouts MP-safe.
Alexander Motin [Fri, 3 Sep 2021 19:42:46 +0000 (15:42 -0400)]
vt(4): Mark callouts MP-safe.

The code explicitly takes Giant when it accesses keyboard, and I see
no reason to take it globally by callout(9).

MFC after: 1 month

(cherry picked from commit da69c6752674e29eb5d8f82161ca7bc6d1866051)

2 years agobnxt(4): Mark sysctls MP-safe.
Alexander Motin [Fri, 3 Sep 2021 17:51:08 +0000 (13:51 -0400)]
bnxt(4):  Mark sysctls MP-safe.

MFC after: 1 month

(cherry picked from commit 9895a2073f98be927041f5a73d0d3ff5e8844bfb)

2 years agobxe(4): Mark sysctls and callout MP-safe.
Alexander Motin [Fri, 3 Sep 2021 16:25:32 +0000 (12:25 -0400)]
bxe(4): Mark sysctls and callout MP-safe.

MFC after: 1 month

(cherry picked from commit 4081c895e5ce28d3b0e672055271c8d7cc31cc1f)

2 years agomge(4): Mark sysctls and callout MP-safe.
Alexander Motin [Fri, 3 Sep 2021 16:13:56 +0000 (12:13 -0400)]
mge(4): Mark sysctls and callout MP-safe.

MFC after: 1 month

(cherry picked from commit 6b2ff27cb952048527ba13023a8354112fe1d410)

2 years agonfscl: Add vfs.nfs.maxalloclen to limit Allocate RPC RTT
Rick Macklem [Thu, 16 Sep 2021 00:29:45 +0000 (17:29 -0700)]
nfscl: Add vfs.nfs.maxalloclen to limit Allocate RPC RTT

Unlike Copy, the NFSv4.2 Allocate operation does not
allow a reply with partial completion.  As such, the only way to
limit the time the operation takes to provide a reasonable RPC RTT
is to limit the size of the allocation in the NFSv4.2
client.

This patch adds a sysctl called vfs.nfs.maxalloclen to set
the limit on the size of the Allocate operation.
There is no way to know how long a server will take to do an
allocate operation, but 64Mbytes results in a reasonable
RPC RTT for the slow hardware I test on, so that is what
the default value for vfs.nfs.maxalloclen is set to.

For an 8Gbyte allocation, the elapsed time for doing it in 64Mbyte
chunks was the same as the elapsed time taken for a single large
allocation operation for a FreeBSD server with a UFS file system.

(cherry picked from commit 9ebe4b8c67bf823e62617ba9fbd3c9c1768c8b3b)

2 years agoUPDATING: Add entry for commit a599f9f7620b
Rick Macklem [Sun, 3 Oct 2021 22:54:33 +0000 (15:54 -0700)]
UPDATING: Add entry for commit a599f9f7620b

2 years agoparam.h: Bump __FreeBSD_version for commit a599f9f7620b
Rick Macklem [Sun, 3 Oct 2021 22:50:46 +0000 (15:50 -0700)]
param.h: Bump __FreeBSD_version for commit a599f9f7620b

Commit a599f9f7620b deleted the variable called nfs_maxcopyrange
from nfscommon.ko, since it no longer needs to be global.  As such,
the other nfs modules must be rebuilt from up to date sources.
Bump __FreeBSD_version to 1300516.

2 years agonfscl: Make vfs.nfs.maxcopyrange larger by default
Rick Macklem [Sat, 11 Sep 2021 22:36:32 +0000 (15:36 -0700)]
nfscl: Make vfs.nfs.maxcopyrange larger by default

As of commit 103b207536f9, the NFSv4.2 server will limit the size
of a Copy operation based upon a 1 second timeout.  The Linux 5.2
kernel server also limits Copy operation size to 4Mbytes.
As such, the NFSv4.2 client can attempt a large Copy without
resulting in a long RPC RTT for these servers.

This patch changes vfs.nfs.maxcopyrange to 64bits and sets
the default to the maximum possible size of SSIZE_MAX, since
a larger size makes the Copy operation more efficient and
allows for copying to complete with fewer RPCs.
The sysctl may be need to be made smaller for other non-FreeBSD
NFSv4.2 servers.

(cherry picked from commit 55089ef4f8bb7c4d18ee964b4214024e35ae4b0e)

2 years agocmp: add -b, --print-bytes
Kyle Evans [Thu, 23 Sep 2021 05:46:30 +0000 (00:46 -0500)]
cmp: add -b, --print-bytes

This is compatible with GNU cmp.

Reviewed by: bapt, markj (earlier version)
Sponsored by: Klara, Inc.

(cherry picked from commit f66b9b40f403f7c30fec3c4ceed93c6e8fafa8ac)

2 years agocmp: add -i, --ignore-initial, an alternative to skip1/skip2 args
Kyle Evans [Thu, 23 Sep 2021 05:43:32 +0000 (00:43 -0500)]
cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args

This is compatible with GNU cmp.

Reviewed by: markj
Sponsored by: Klara, Inc.

(cherry picked from commit 8d546b6832eea031f95f30eaec3232ec1256a281)

2 years agocmp: add -n, --bytes to limit number of bytes to compare
Kyle Evans [Thu, 23 Sep 2021 05:26:52 +0000 (00:26 -0500)]
cmp: add -n, --bytes to limit number of bytes to compare

This is compatible with GNU cmp.

Reviewed by: markj
Sponsored by: Klara, Inc.

(cherry picked from commit 4e380e8474609875c4cf5277b3755ac29079a8b5)

2 years agocmp: accept SI suffixes for skip1 and skip2
Kyle Evans [Thu, 23 Sep 2021 05:17:07 +0000 (00:17 -0500)]
cmp: accept SI suffixes for skip1 and skip2

This is compatible with GNU cmp.

Reviewed by: bapt (earlier version), markj, imp
Sponsored by: Klara, Inc.

(cherry picked from commit f6787614fd4db2a9d5e649af0e819852ebd5a19d)

2 years agohostname: avoid strcpy() overlap in -d flag handling
Kyle Evans [Sat, 25 Sep 2021 05:00:31 +0000 (00:00 -0500)]
hostname: avoid strcpy() overlap in -d flag handling

We don't need the strcpy() anyways, just use a pointer to the hostname
buffer and move it forward for `hostname -d`.

Sponsored by: Klara, Inc.

(cherry picked from commit 33c1e7271ac21a626829289780b88071ae46ec65)

2 years agomakesyscalls: sprinkle some assert() on standard function calls
Kyle Evans [Wed, 27 Jan 2021 18:12:33 +0000 (12:12 -0600)]
makesyscalls: sprinkle some assert() on standard function calls

Improves our error reporting, ensuring that we aren't just ignoring
errors in the common case.

Note specifically the boundary where we have to change up our error
handling approach.  It's fine to error() out up until we create the
tempdir, then the rest should try to handle it gracefully and abort().
A future change will clean this up further by pcall'ing all of the bits
that cannot currently error() without cleaning up.

(cherry picked from commit 6687410af7dba54e19b773684a969e9c590999e4)

2 years agomakesyscalls: stop trying to remove . and .. in cleanup
Kyle Evans [Wed, 27 Jan 2021 17:46:15 +0000 (11:46 -0600)]
makesyscalls: stop trying to remove . and .. in cleanup

lfs.dir() will include these entries, but os.remove() cannot remove them
for obvious reasons.

(cherry picked from commit 340e009ecc00e5e74d58920ca909968dc7e88af1)

2 years agoman: reset OPTIND before parsing args
Kyle Evans [Wed, 22 Sep 2021 19:58:19 +0000 (14:58 -0500)]
man: reset OPTIND before parsing args

From jilles: POSIX requires that a script set `OPTIND=1` before using
different sets of parameters with `getopts`, or the results will be
unspecified.

The specific problem observed here is that we would execute `man -f` or
`man -k` without cleaning up state from man_parse_args()' `getopts`
loop.  FreeBSD's /bin/sh seems to reset OPTIND to 1 after we hit the
second getopts loop, rendering the following shift harmless; other
/bin/sh implementations will leave it at what we came into the loop at
(e.g., bash as /bin/sh), shifting off any keywords that we had.

Input from: jilles
Reviewed by: allanjude, bapt, imp
Sponsored by: Klara, Inc.

(cherry picked from commit f555b39e6bb7cbfbe1905e90f64c4dfc4456fabb)

2 years agoixgbe: whitespace cleanup pass
Kevin Bowling [Sun, 26 Sep 2021 18:29:00 +0000 (11:29 -0700)]
ixgbe: whitespace cleanup pass

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

(cherry picked from commit 15d077995bd2c56b7b1742ea2d4e9070ff7e9427)

2 years agoixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'
Kevin Bowling [Sat, 25 Sep 2021 23:12:23 +0000 (16:12 -0700)]
ixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'

Rename the 'struct adapter' to 'struct ixgbe_softc' to avoid type
ambiguity in things like kgdb.

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

(cherry picked from commit b1d5caf3c7504a1ece0498ec3f7360ac760577f7)

2 years agocam: Avoiding waking up doneq threads if we're dumping
Mark Johnston [Sat, 25 Sep 2021 14:13:56 +0000 (10:13 -0400)]
cam: Avoiding waking up doneq threads if we're dumping

Depending on the state of the target doneq thread at the time of the
panic, the wakeup can hang indefinitely in thread_lock_block_wait().
That function should likely be modified to return immediately if the
scheduler is stopped, but it is also preferable to avoid wakeups in
general after a panic.

Reported by: pho
Reviewed by: mav, imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ed8ef7ae8b05d9f73db2182b5e24b0b76b0783a2)

2 years agounzip: sync with NetBSD upstream to add passphrase support
Yoshihiro Takahashi [Sat, 25 Sep 2021 16:32:42 +0000 (01:32 +0900)]
unzip: sync with NetBSD upstream to add passphrase support

- Add support for password protected zip archives.
  We use memset_s() rather than explicit_bzero() for more portable
  (See PR).
- Use success/failure macro in exit()
- Mention ZIPX format in unzip(1)

Submitted by: Mingye Wang and Alex Kozlov (ak@)
PR: 244181
Reviewed by: mizhka
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D28892

(cherry picked from commit a4724ff48108840416c83f10e15d666ac8d78937)

2 years agong_ether: Create netgraph nodes for bridge interfaces.
Yoshihiro Takahashi [Sat, 25 Sep 2021 16:24:33 +0000 (01:24 +0900)]
ng_ether: Create netgraph nodes for bridge interfaces.

Create netgraph nodes for bridge interfaces when the ng_ether module
is loaded.  If a bridge interface is created after loading the ng_ether
module, a netgraph node is created via ether_ifattach().

(cherry picked from commit d653b188e89b5e44b2708342c7d3b789398f9cde)

2 years agoubsan: Fix a typo in an error message
Gordon Bergling [Sat, 25 Sep 2021 09:47:24 +0000 (11:47 +0200)]
ubsan: Fix a typo in an error message

- s/asumption/assumption/

Obtained from: NetBSD

(cherry picked from commit 2aad906266d67eea6ad11d8e0c6fe9263077ee99)

2 years agoopencrypto: Disallow requests which pass VERIFY_DIGEST without a MAC
Mark Johnston [Fri, 24 Sep 2021 19:04:45 +0000 (15:04 -0400)]
opencrypto: Disallow requests which pass VERIFY_DIGEST without a MAC

Otherwise we can end up comparing the computed digest with an
uninitialized kernel buffer.

In cryptoaead_op() we already unconditionally fail the request if a
pointer to a digest buffer is not specified.

Based on a patch by Simran Kathpalia.

Reported by: syzkaller
Reviewed by: jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/529

(cherry picked from commit 7c2f227a17ded0934c5941c7911797edb7d770a2)

2 years agotests/sys/sys: Raise WARNS
Mark Johnston [Fri, 24 Sep 2021 15:31:53 +0000 (11:31 -0400)]
tests/sys/sys: Raise WARNS

Sponsored by: The FreeBSD Foundation

(cherry picked from commit d7cf1b262f9ff5e799446f0cbbd007905ab4ae24)

2 years agoloader: dev_net.c should use __func__ with printf
Toomas Soome [Fri, 24 Sep 2021 14:07:20 +0000 (17:07 +0300)]
loader: dev_net.c should use __func__ with printf

We have printf calls with function name hardwired to string,
sometimes wrong name. Use __func__ instead.

(cherry picked from commit 1a25c51e38a7c9f46ec195836233636616741f06)

2 years agoamd64 UEFI loader: enable automatic disable of staging area copying
Konstantin Belousov [Tue, 10 Aug 2021 01:38:55 +0000 (04:38 +0300)]
amd64 UEFI loader: enable automatic disable of staging area copying

(cherry picked from commit 6032b6ba9596927aba15a8004ade521a593a7d58)

2 years agox86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible
Konstantin Belousov [Fri, 24 Sep 2021 17:46:47 +0000 (20:46 +0300)]
x86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible

(cherry picked from commit 24a3897c2c3205c2ec0cf323c555c403d3171e2c)

2 years agomalloc_aligned(9): allow zero size and alignment
Konstantin Belousov [Fri, 24 Sep 2021 19:38:53 +0000 (22:38 +0300)]
malloc_aligned(9): allow zero size and alignment

(cherry picked from commit 71d31f1cf6012b143fd676f099430818ae949c3f)

2 years agopidfile test: guarantee nul termination of the read pid string
Konstantin Belousov [Fri, 24 Sep 2021 03:12:20 +0000 (06:12 +0300)]
pidfile test: guarantee nul termination of the read pid string

PR: 258701

(cherry picked from commit 364790beafec707ca3e334683e4030684d829be2)

2 years agoaio_aqueue(): avoid ucred leak on failure path
Konstantin Belousov [Fri, 24 Sep 2021 00:14:56 +0000 (03:14 +0300)]
aio_aqueue(): avoid ucred leak on failure path

PR: 258698

(cherry picked from commit 45c2c7c484de7747014492b17ff89e323ee66496)

2 years agopf: fix pagefault in pf_getstatus()
Kristof Provost [Thu, 23 Sep 2021 08:39:49 +0000 (10:39 +0200)]
pf: fix pagefault in pf_getstatus()

We can't copyout() while holding a lock, in case it triggers a page
fault.
Release the lock before copyout, which is safe because we've already
copied all the data into the nvlist.

PR: 258601
Reviewed by: mjg
MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32076

(cherry picked from commit cb13059663e455b3fc69c293dadec53c164490dc)

2 years agopowerpc64: change CAS to support Radix MMU
Leandro Lupori [Wed, 15 Sep 2021 18:12:37 +0000 (15:12 -0300)]
powerpc64: change CAS to support Radix MMU

Use radix_mmu environment variable to select between Hash or Radix
MMU, when performing the CAS method call. This matches kernel's
behavior, by selecting Hash MMU by default and Radix if radix_mmu
is not zero, to make sure that both loader and kernel always select
the same MMU.

The device tree is queried to detect Radix/GTSE support and to
find out if CAS is supported, making the old CPU version and HV
bit checks unnecessary now.

Reviewed by: jhibbits
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D31951

(cherry picked from commit a58abcde2c83b71e5bf19575750564f7bff78833)

2 years agoEliminate an unnecessary rerun request in fsck_ffs.
Kirk McKusick [Wed, 22 Sep 2021 23:16:39 +0000 (16:16 -0700)]
Eliminate an unnecessary rerun request in fsck_ffs.

(cherry picked from commit b31c5a25321363ab95c1642dffc6e92319dc42ce)

2 years agogmultipath failloop test: Add a checker for dtrace executes successfully or not
Li-Wen Hsu [Tue, 28 Sep 2021 18:02:27 +0000 (02:02 +0800)]
gmultipath failloop test: Add a checker for dtrace executes successfully or not

To provide a more informative error message.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 819961c5808b053c626648e202dec42a19ebe7a6)
(cherry picked from commit 38dac71d0a95ab2cf2cdfa1232cc556008b7ac94)
(cherry picked from commit b9b5a4dd590e1b30d92dc73b3d1f22d3303e7e41)

2 years agoe1000: fix K1 configuration
Wenzhuo Lu [Fri, 16 Oct 2015 02:51:09 +0000 (10:51 +0800)]
e1000: fix K1 configuration

This patch is for the following updates to the K1 configurations:
Tx idle period for entering K1 should be 128 ns.
Minimum Tx idle period in K1 should be 256 ns.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
PR: 258153
Reviewed by: erj
Tested by: iron.udjin@gmail.com
Approved by: imp
Obtained from: DPDK (6f934fa24dfd437c90ead96bc7598ee77a117ede)
MFC after: 1 week

(cherry picked from commit d5ad2f2a67df54ac40148cca21e726bc61a48982)

2 years ago[fib_algo][dxr] Split unused range chunk list in multiple buckets
Marko Zec [Sat, 25 Sep 2021 04:29:48 +0000 (06:29 +0200)]
[fib_algo][dxr] Split unused range chunk list in multiple buckets

Traversing a single list of unused range chunks in search for a block
of optimal size was suboptimal.

The experience with real-world BGP workloads has shown that on average
unused range chunks are tiny, mostly in length from 1 to 4 or 5, when
DXR is configured with K = 20 which is the current default (D16X4R).

Therefore, introduce a limited amount of buckets to accomodate descriptors
of empty blocks of fixed (small) size, so that those can be found in O(1)
time.  If no empty chunks of the requested size can be found in fixed-size
buckets, the search continues in an unsorted list of empty chunks of
variable lengths, which should only happen infrequently.

This change should permit us to manage significantly more empty range
chunks without sacrifying the speed of incremental range table updating.

MFC after: 3 days

2 years ago[fib_algo][dxr] Merge adjacent empty range table chunks.
Marko Zec [Mon, 20 Sep 2021 04:30:45 +0000 (06:30 +0200)]
[fib_algo][dxr] Merge adjacent empty range table chunks.

MFC after: 3 days

2 years agoTemporarily skip flaky tset cases under sys.aio.aio_test in CI
Li-Wen Hsu [Tue, 28 Sep 2021 19:32:47 +0000 (03:32 +0800)]
Temporarily skip flaky tset cases under sys.aio.aio_test in CI

- sys.aio.aio_test.vectored_unaligned
- sys.aio.aio_test.vectored_zvol_poll

PR: 258766
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0b159faaca08e6cc89abcd29b4b1360f97e18245)

2 years agonfsclient: Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:17:00 +0000 (15:17 +0200)]
nfsclient: Fix a typo in a comment

- s/derefernce/dereference/

(cherry picked from commit 90d60ca8b7f2483cdc162633f7ea4738dad8fa0e)

2 years agopcm(4): Fix a common typo in source code comments
Gordon Bergling [Sun, 26 Sep 2021 09:21:16 +0000 (11:21 +0200)]
pcm(4): Fix a common typo in source code comments

- s/prefered/preferred/

(cherry picked from commit 513ee901eec639da45796d563168f0af966705e6)

2 years agosctp: Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:15:39 +0000 (15:15 +0200)]
sctp: Fix a typo in a comment

- s/assue/assume/

(cherry picked from commit d2e616147db7b688f2b6fa8ec6d545bc4253de92)

2 years agojail(9): Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:17:41 +0000 (15:17 +0200)]
jail(9): Fix a typo in a comment

- s/erorr/error/

(cherry picked from commit 8771ff75384dec8c9f95ce25b6ca9a639c4b208c)

2 years agocontrib/tzdata: correct DST in Jordan and Samoa
Philip Paeps [Wed, 29 Sep 2021 04:43:58 +0000 (12:43 +0800)]
contrib/tzdata: correct DST in Jordan and Samoa

Direct commit to stable/13.

The recent tzdata 2021b release includes several controversial changes
under active debate on the tz mailing list.  Pending consensus, and
hopefully a 2021c release reflecting it, only merge the DST changes for
Jordan and Samoa.  This corrects present and future timestamps in those
regions.

2 years agoFix false device_set_unit() error.
Alexander Motin [Wed, 22 Sep 2021 12:42:36 +0000 (08:42 -0400)]
Fix false device_set_unit() error.

It should silently succeed if the current unit number is the same as
requested, not fail immediately.

MFC after: 1 week

(cherry picked from commit 884f38590c3cc0b1a2c00904c1f1f6c791376308)

2 years agoipmi(4): Limit maximum watchdog pre-timeout interval.
Alexander Motin [Wed, 15 Sep 2021 01:06:39 +0000 (21:06 -0400)]
ipmi(4): Limit maximum watchdog pre-timeout interval.

Previous code by default setting pre-timeout interval to 120 seconds
made impossible to set timeout interval below that, resulting in error
0xcc (Invalid data field in Request) at least on Supermicro boards.

To fix that limit maximum pre-timeout interval to ~1/4 of the timeout
interval, that sounds like a reasonable default: not too short to fire
too late, but also not too long to give many false reports.

MFC after: 2 weeks

(cherry picked from commit 6c2d4404161aa2bac1c7992afbf5a763f1a6f66e)

2 years agoe1000: Fix tabstop width in if_em.h
Kevin Bowling [Sun, 26 Sep 2021 16:24:53 +0000 (09:24 -0700)]
e1000: Fix tabstop width in if_em.h

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D32145

(cherry picked from commit 21ab8c75c940dd15343b4af28b18a66f377e670a)

2 years agouart: Add PCI ID for intel 100 Series/C230 Series AMT
Sean Bruno [Sat, 25 Sep 2021 22:23:08 +0000 (15:23 -0700)]
uart: Add PCI ID for intel 100 Series/C230 Series AMT

Reviewed by: kib
Tested by: kbowling
Differential Revision: https://reviews.freebsd.org/D32146

(cherry picked from commit fb640be4e9443f1890680c27b213825300bc65f4)

2 years agoe1000: Re-arm link changes
Kevin Bowling [Mon, 27 Sep 2021 16:17:48 +0000 (09:17 -0700)]
e1000: Re-arm link changes

A change to MSI-X link handler was somehow causing issues on
MSI-based em(4) NICs.

Revert the change based on user reports and testing.

PR: 258551
Reported by: Franco Fichtner <franco@opnsense.org>, t_uemura@macome.co.jp
Reviewed by: markj, Franco Fichtner <franco@opnsense.org>
Tested by: t_uemura@macome.co.jp
MFC after: 1 day

(cherry picked from commit 450c3f8b3d259c7eb82488319aff45f1f6554aaf)

2 years agoe1000: Rename 'struct adapter' to 'struct e1000_sc'
Kevin Bowling [Sat, 25 Sep 2021 00:09:43 +0000 (17:09 -0700)]
e1000: Rename 'struct adapter' to 'struct e1000_sc'

Rename the 'struct adapter' to 'struct e1000_sc' to avoid type ambiguity
in things like kgdb.

Reviewed by: jhb, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D32129

(cherry picked from commit dc9260515449cde9a4b26b5448f7386388c55bbd)

2 years agoe1000: Consistently use FALLTHROUGH
Kevin Bowling [Fri, 17 Sep 2021 03:13:26 +0000 (20:13 -0700)]
e1000: Consistently use FALLTHROUGH

Approved by: imp
MFC after: 1 week

(cherry picked from commit e05d9788b7e90ffd6405dc59656b52a63ba7ff3e)

2 years agoe1000: Use C99 bool types
Kevin Bowling [Fri, 17 Sep 2021 03:08:08 +0000 (20:08 -0700)]
e1000: Use C99 bool types

Approved by: imp
MFC after: 1 week

(cherry picked from commit 1bbdc25fc1edb43562bf2a5f30df7381078991d4)

2 years agoe1000: Fix up HW vlan ops
Kevin Bowling [Wed, 15 Sep 2021 14:47:19 +0000 (07:47 -0700)]
e1000: Fix up HW vlan ops

2796f7ca:
* Don't reset the entire adapter for vlan changes, fix up the problems
* Add some functions for vlan filter (vfta) manipulation
* Don't muck with the vfta if we aren't doing HW vlan filtering
* Disable interrupts when manipulating vfta on lem(4)-class NICs
* On the I350 there is a specification update (2.4.20) in which the
suggested workaround is to write to the vfta 10 times (if at first you
don't succeed, try, try again). Our shared code has the goods, use it
* Increase a VF's frame receive size in the case of vlans

From the referenced PR, this reduced vlan configuration from minutes
to seconds with hundreds or thousands of vlans and prevents wedging the
adapter with needless adapter reinitialization for each vlan ID.

PR: 230996
Reviewed by: markj
Tested by: Ozkan KIRIK <ozkan.kirik@gmail.com>
Differential Revision: https://reviews.freebsd.org/D30002

22b20b45:
e1000: Fix variable typo

Forgot to git add this in last commit

Reported by: jenkins
Fixes: 2796f7cab107

(cherry picked from commit 2796f7cab10785ef40efbba97ef67ab319c96e9c)
(cherry picked from commit 22b20b45c9118bf6ef313c074cdb107a1eaca78e)

2 years agobcm2835_sdhci: don't use DMA for kernel dumps
Mitchell Horne [Thu, 9 Sep 2021 18:07:06 +0000 (15:07 -0300)]
bcm2835_sdhci: don't use DMA for kernel dumps

When handling a data irq, the sdhci driver calls the
sdhci_platform_will_handle() method, to determine if it should allow the
platform driver to handle the transfer or fall back to programmed I/O.
While dumping, the data irq path may be invoked directly (not from an
interrupt context), which the bcm2835_sdhci DMA code is not prepared to
handle. Return early in this case, to force the fallback to PIO.

Otherwise, the KASSERT that follows will be triggered, and the dump will
fail. On non-INVARIANTS kernels, the system will hang, waiting for a DMA
interrupt that will never arrive.

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

(cherry picked from commit 806ebc9eba2a45638d63ae8a2ed20e6fb44dd06e)

2 years agosyslog.conf.5: Fix the message priority order
Felix Guest [Tue, 21 Sep 2021 15:29:39 +0000 (11:29 -0400)]
syslog.conf.5: Fix the message priority order

PR: 219942

(cherry picked from commit 8678140127296c15894094087b81f71fe79a21d9)