]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolibctf: Improve check for duplicate SOU definitions in ctf_add_type()
Mark Johnston [Mon, 4 Oct 2021 16:28:22 +0000 (12:28 -0400)]
libctf: Improve check for duplicate SOU definitions in ctf_add_type()

When copying a struct or union from one CTF container to another,
ctf_add_type() checks whether it matches an existing type in the
destination container.  It does so by looking for a type with the same
name and kind as the new type, and if one exists, it iterates over all
members of the source type and checks whether a member with matching
name and offset exists in the matched destination type.  This can
produce false positives, for example because member types are not
compared, but this is not expected to arise in practice.  If the match
fails, ctf_add_type() returns an error.

The procedure used for member comparison breaks down in the face of
anonymous struct and union members.  ctf_member_iter() visits each
member in the source definition and looks up the corresponding member in
the desination definition by name using ctf_member_info(), but this
function will descend into anonymous members and thus fail to match.
Fix the problem by introducing a custom comparison routine which does
not assume member names are unique.  This should also be faster for
types with many members; in the previous scheme, membcmp() would perform
a linear scan of the desination type's members to perform a lookup by
name.  The new routine steps through the members of both types in a
single loop.

PR: 258763
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

2 years agoAdd the missing license to gic_if.m
Andrew Turner [Mon, 4 Oct 2021 10:22:19 +0000 (11:22 +0100)]
Add the missing license to gic_if.m

Sponsored by: The FreeBSD Foundation

2 years agoncurses: fix libcompat (lib32 for example) building
Baptiste Daroussin [Mon, 4 Oct 2021 12:16:32 +0000 (14:16 +0200)]
ncurses: fix libcompat (lib32 for example) building

2 years agoncurses: fix path where to find curses.h at bootstrap
Baptiste Daroussin [Mon, 4 Oct 2021 10:31:23 +0000 (12:31 +0200)]
ncurses: fix path where to find curses.h at bootstrap

after the split, curses.h is now generated by tinfo Makefile, but
still used for a file generated in ncurses lib. Adjust the path to
make sure curses.h is always found

2 years agoncurses: document in UPDATING and bump _FreeBSD_version
Baptiste Daroussin [Mon, 4 Oct 2021 09:36:47 +0000 (11:36 +0200)]
ncurses: document in UPDATING and bump _FreeBSD_version

2 years agobsdinstall: reduce overlinking
Baptiste Daroussin [Thu, 23 Sep 2021 02:08:08 +0000 (04:08 +0200)]
bsdinstall: reduce overlinking

both distextract and distfetch does not directly use ncurses,
or figpart, drop their direct link to those libs

2 years agoncurses: chase dependency changes in the source tree
Baptiste Daroussin [Thu, 23 Sep 2021 01:52:46 +0000 (03:52 +0200)]
ncurses: chase dependency changes in the source tree

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

2 years agoncurses: split libtinfo from libncurses
Baptiste Daroussin [Thu, 23 Sep 2021 01:49:51 +0000 (03:49 +0200)]
ncurses: split libtinfo from libncurses

many external program expects libncurses to not be provided as a single
library. Instead of fixing all ports, distribute ncurses the way
upstream distributes it

Turn libncursesw.so into a ldscript which will link automatically as
needed to libtinfow so so this change is seamless at compile time.

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

2 years agoUPDATING: Update notes about new mixer(8) utility.
Hans Petter Selasky [Mon, 4 Oct 2021 09:00:56 +0000 (11:00 +0200)]
UPDATING: Update notes about new mixer(8) utility.

Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking

2 years agocontrib/bc: temporarily disconnect the tests for 5.0.2
Stefan Eßer [Mon, 4 Oct 2021 07:50:44 +0000 (09:50 +0200)]
contrib/bc: temporarily disconnect the tests for 5.0.2

The tests that come with version 5.0.2 have been extended to cover the
line editing functions. It has been found that these tests generate
false negative results in FreeBSD, most likely due to an issue in the
pexpect functionality used.

These history tests are skipped on systems that do not have python and
py-pexpect installed (and thus are unlikely to cause CI test failures),
but in order to not cause irritating failures on systems were these
packages are in fact installed, I temporarily disconnect them.

I had planned to skip this version due to the issue with the history
tests, but some committer has asked me to go ahead since the currently
used version 5.0.0 contains a macro name that collides with a project
he is working on.

No MFC of this version is planned. A version 5.0.3 is expected to be
released soon, and that version will allow to reconnect the tests and
will be MFCed.

2 years agocontrib/bc: remove files ommitted from the release
Stefan Eßer [Mon, 4 Oct 2021 07:41:06 +0000 (09:41 +0200)]
contrib/bc: remove files ommitted from the release

A number of files have been removed from the release distribution of
this bc implementation. They were mostly relevant for pre release
testing and benchmarking to identify regressions. The Markdown
sources of the man pages are only relevant for combinations of build
options not used in FreeBSD and need non-default conversion tools
(available as ports in FreeBSD).

All the omitted files can be found in the upstream git repository,
and they are fetched when building this software as a port. But they
have never been used in the FreeBSD base system.

2 years agovendor/bc: update to upstream version 5.0.2
Stefan Eßer [Sun, 19 Sep 2021 12:41:20 +0000 (14:41 +0200)]
vendor/bc: update to upstream version 5.0.2

(cherry picked from commit a60ef1802a36f2f2a5611564191440ea1c1e2f17)

2 years agoloader bcache: Allow readahead up to 256 kB I/Os
Colin Percival [Sun, 3 Oct 2021 21:55:10 +0000 (14:55 -0700)]
loader bcache: Allow readahead up to 256 kB I/Os

Prior to this commit, the loader would perform readaheads of up to
128 kB; when booting on a UFS filesystem this resulted in a series
of 160 kB reads (32 kB request + 128 kB readahead).

This commit allows readaheads to be longer, subject to a total I/O
size limit of 256 kB; i.e. 32 kB read requests will have added
readaheads of up to 224 kB.

In my testing on an EC2 c5.xlarge instance, this change reduces the
boot time by roughly 80 ms.

Reviewed by: tsoome
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D32251

2 years agoloader bcache: Track unconsumed readahead
Colin Percival [Sun, 3 Oct 2021 21:49:41 +0000 (14:49 -0700)]
loader bcache: Track unconsumed readahead

The loader bcache attempts to determine whether readahead is useful,
increasing or decreasing its readahead length based on whether a
read could be serviced out of the cache.  This resulted in two
unfortunate behaviours:

1. A series of consecutive 32 kB reads are requested and bcache
performs 16 kB readaheads.  For each read, bcache determines that,
since only the first 16 kB is already in the cache, the readahead
was not useful, and keeps the readahead at the minimum (16 kB) level.

2. A series of consecutive 32 kB reads are requested and bcache
starts with a 32 kB readahead resulting in a 64 kB being read on
the first request.  The second 32 kB request can be serviced out of
the cache, and bcache responds by doubling its readahead length to
64 kB.  The third 32 kB request cannot be serviced out of the cache,
and bcache reduces its readahead length back down to 32 kB.

The first syndrome converts a series of 32 kB reads into a series of
(misaligned) 32 kB reads, while the second syndrome converts a series
of 32 kB reads into a series of 64 kB reads; in both cases we do not
increase the readahead length to its limit (currently 128 kB) no
matter how many consecutive read requests are made.

This change avoids this problem by tracking the "unconsumed
readahead" length; readahead is deemed to be useful (and the
read-ahead length is potentially increased) not only if a request was
completely serviced out of the cache, but also if *any* of the request
was serviced out of the cache and that length matches the amount of
unconsumed readahead.  Conversely, we now only reduce the readahead
length in cases where there was unconsumed readahead data.

In my testing on an EC2 c5.xlarge instance, this change reduces the
boot time by roughly 120 ms.

Reviewed by: imp, tsoome
MFC after: 1 week
Sponsored by: https://patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D32250

2 years agoloader: Refactor readahead adjustment in bcache
Colin Percival [Sun, 3 Oct 2021 19:10:36 +0000 (12:10 -0700)]
loader: Refactor readahead adjustment in bcache

While I'm here, add an explanatory comment.

No functional change intended.

Reviewed by: imp, tsoome (previous version)
MFC after: 1 week
Sponsored by: https://patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D32249

2 years agopci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB
Jessica Clarke [Sun, 3 Oct 2021 18:35:26 +0000 (19:35 +0100)]
pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB

This is the same underlying problem as 262459806433, just for bus ranges
rather than windows. SiFive's HiFive Unmatched has the following
topology:

  Root Port <---> Bridge <---> Bridge <-+-> Bridge <---> (Unused)
   (pcib0)        (pcib1)      (pcib2)  |   (pcib3)
                                        +-> Bridge <---> xHCI
                                        |   (pcib4)
                                        +-> Bridge <---> M.2 E-key
                                        |   (pcib5)
                                        +-> Bridge <---> M.2 M-key
                                        |   (pcib6)
                                        +-> Bridge <---> x16 slot
                                            (pcib7)

If a device is plugged into the x16 slot that itself has a bridge, such
as many graphics cards, we currently fail to allocate a bus number for
its child bus (and so pcib_attach_child skips adding a child bus for
further enumeration) as, when the new child bridge attaches, it attempts
to allocate a bus number from its parent (pcib7) which in turn attempts
to grow its own bus range by calling bus_adjust_resource on its own
parent (pcib2) whose bus rman cannot accommodate the request and needs
to itself be extended by calling its own parent (pcib1). Note that
pcib3-7 do not face the same issue when they attach since pcib1 ends up
managing bus numbers 1-255 from the beginning and so never needs to grow
its own range.

Reviewed by: jhb, mav
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32011

2 years agoriscv: Add vt and kbdmux to GENERIC for video console support
Jessica Clarke [Sun, 3 Oct 2021 18:34:53 +0000 (19:34 +0100)]
riscv: Add vt and kbdmux to GENERIC for video console support

No in-tree drivers are supported for RISC-V (given it supports UEFI we
could enable the EFI framebuffer, but U-Boot has very limited hardware
support and EDK2 remains a work in progress), but drm-kmod exists with
drivers for video cards that can be used with the HiFive Unmatched.

Reviewed by: imp, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32001

2 years agoLinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guards
Jessica Clarke [Sun, 3 Oct 2021 18:34:40 +0000 (19:34 +0100)]
LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guards

One of the three uses is already guarded; this guards the remaining ones
to support architectures like riscv that do not provide write-combining,
and is needed to build drm-kmod on riscv.

Reviewed by: hselasky, manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31999

2 years agolibgcc_s: Export 64-bit int to 128-bit float functions
Jessica Clarke [Sun, 3 Oct 2021 18:34:25 +0000 (19:34 +0100)]
libgcc_s: Export 64-bit int to 128-bit float functions

The corresponding 32-bit int and 128-bit int functions were added in
790a6be5a169, as were all combinations of the float to int functions,
but these two were overlooked. __floatditf is needed to build curl for
riscv as there's a signed 64-bit int to 128-bit float conversion in
lib/progress.c's trspeed as of 7.77.0.

Reviewed by: dim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31997

2 years agoriscv: Add a stub pmap_change_attr implementation
Jessica Clarke [Sun, 3 Oct 2021 18:33:47 +0000 (19:33 +0100)]
riscv: Add a stub pmap_change_attr implementation

pmap_change_attr is required by drm-kmod so we need the function to
exist. Since the Svpbmt extension is on the horizon we will likely end
up with a real implementation of it, so this stub implementation does
all the necessary page table walking to validate the input, ensuring
that no new errors are returned once it's implemented fully (other than
due to out of memory conditions when demoting L2 entries) and providing
a skeleton for that future implementation.

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

2 years agovfs: remove dead fifoop VOP_KQFILTER implementations
Kyle Evans [Sat, 2 Oct 2021 05:17:57 +0000 (00:17 -0500)]
vfs: remove dead fifoop VOP_KQFILTER implementations

These began to become obsolete in d6d64f0f2c26 (r137739) and the deal
was later sealed in 003e18aef4c4 (r137801) when vfs.fifofs.fops was
dropped and vop-bypass for pipes became mandatory.

PR: 225934
Suggested by: markj
Reviewe by: kib, markj
Differential Revision: https://reviews.freebsd.org/D32270

2 years agosleepqueue(9): Remove sbinuptime() from sleepq_timeout().
Alexander Motin [Sun, 3 Oct 2021 00:57:55 +0000 (20:57 -0400)]
sleepqueue(9): Remove sbinuptime() from sleepq_timeout().

Callout c_time is always bigger or equal than the scheduled time.  It
is also smaller than sbinuptime() and can't change while the callback
is running.  So we reliably can use it instead of sbinuptime() here.
In case there was a race and the callout was rescheduled to the later
time, the callback will be called again.

According to profiles it saves ~5% of the timer interrupt time even
with fast TSC timecounter.

MFC after: 1 month

2 years agoffs: retire unused fsckpid mount option
Robert Wing [Sat, 2 Oct 2021 23:11:40 +0000 (15:11 -0800)]
ffs: retire unused fsckpid mount option

The fsckpid mount option was introduced in 927a12ae16433b50 along with a
couple sysctl's to support SU+J with snapshots. However, those sysctl's
were never used and eventually removed in f2620e9ceb3ede02.

There are no in-tree consumers of this mount option.

Reviewed by: mckusick, kib
Differential Revision: https://reviews.freebsd.org/D32015

2 years agonfsd: Fix pNFS handling of Deallocate
Rick Macklem [Sat, 2 Oct 2021 21:11:15 +0000 (14:11 -0700)]
nfsd: Fix pNFS handling of Deallocate

For a pNFS server configuration, an NFSv4.2 Deallocate operation
is proxied to the DS(s).  The code that parsed the reply for the
proxy RPC is broken and did not process the pre-operation attributes.

This patch fixes this problem.

This bug would only affect pNFS servers built from recent main/FreeBSD14
sources.

2 years agosrc/bin/ps: Fix spelling error
Elyes HAOUAS [Sat, 2 Oct 2021 16:37:32 +0000 (10:37 -0600)]
src/bin/ps: Fix spelling error

Spell interruptible correctly.

Pull Request: https://github.com/freebsd/freebsd-src/pull/544
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2 years agosrc/bin/pax: Fix spelling error
Elyes HAOUAS [Sat, 2 Oct 2021 16:36:09 +0000 (10:36 -0600)]
src/bin/pax: Fix spelling error

"whats" -> "what's"

Pull Request: https://github.com/freebsd/freebsd-src/pull/544
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2 years agosrc/bin/mkdir: Spell occur correctly.
Elyes HAOUAS [Sat, 2 Oct 2021 16:34:45 +0000 (10:34 -0600)]
src/bin/mkdir: Spell occur correctly.

Pull Request: https://github.com/freebsd/freebsd-src/pull/544
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2 years agosrc/bin/sh: Fix spelling errors
Elyes HAOUAS [Sat, 2 Oct 2021 16:33:51 +0000 (10:33 -0600)]
src/bin/sh: Fix spelling errors

Pull Request: https://github.com/freebsd/freebsd-src/pull/544
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2 years agoarm64: Spell BeagleBone correctly in config file.
Tom Hukins [Sat, 2 Oct 2021 11:07:50 +0000 (12:07 +0100)]
arm64: Spell BeagleBone correctly in config file.

Pull Request: https://github.com/freebsd/freebsd-src/pull/545

2 years agoti(4): Fix a typo in an error message
Gordon Bergling [Sat, 2 Oct 2021 08:51:29 +0000 (10:51 +0200)]
ti(4): Fix a typo in an error message

- s/chanels/channels/

MFC after: 1 week

2 years agoqlnxe: Fix typos in two error messages
Gordon Bergling [Sat, 2 Oct 2021 08:49:51 +0000 (10:49 +0200)]
qlnxe: Fix typos in two error messages

- s/erorr/error/

MFC after: 1 week

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/

MFC after: 3 days

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/

MFC after: 3 days

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/

MFC after: 3 days

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/

MFC after: 3 days

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/

MFC after: 3 days

2 years agosched_ule(4): Fix possible significance loss.
Alexander Motin [Sat, 2 Oct 2021 03:47:18 +0000 (23:47 -0400)]
sched_ule(4): Fix possible significance loss.

Before this change kern.sched.interact sysctl setting above 32 gave
all interactive threads identical priority of PRI_MIN_INTERACT due to
((PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) / sched_interact) turning
zero.  Setting the sysctl lower reduced the range of used priority
levels up to half, that is not great either.

Change of the operations order should fix the issue, always using full
range of priorities, while overflow is impossible there since both
score and priority values are small.  While there, make the variables
unsigned as they really are.

MFC after: 1 month

2 years agocontrib/tzdata: import tzdata 2021c
Philip Paeps [Sat, 2 Oct 2021 02:52:02 +0000 (10:52 +0800)]
contrib/tzdata: import tzdata 2021c

Merge commit '9530c11c35707c2ed4a95aa90097b30f8a230563'

Changes: https://github.com/eggert/tz/blob/2021c/NEWS

MFC after: 3 days

2 years agoImport tzdata 2021c
Philip Paeps [Sat, 2 Oct 2021 02:47:29 +0000 (10:47 +0800)]
Import tzdata 2021c

2 years agonvme: Use adaptive spinning when polling for completion or state change
Warner Losh [Fri, 1 Oct 2021 17:32:48 +0000 (11:32 -0600)]
nvme: Use adaptive spinning when polling for completion or state change

We only use nvme_completion_poll in the initialization path. The
commands they queue and wait for finish quickly as they involve no I/O
to the drive's media. These command take about 20-200 microsecnds
each. Set the wait time to 1us and then increase it by 1.5 each
successive iteration (max 1ms). This reduces initialization time by
80ms in cpervica's tests.

Use this same technique waiting for RDY state transitions. This saves
another 20ms. In total we're down from ~330ms to ~2ms.

Tested by: cperciva
Sponsored by: Netflix
Reviewed by: mav
Differential Review: https://reviews.freebsd.org/D32259

2 years agonfs: eliminate thread argument from nfsvno_namei
Mateusz Guzik [Fri, 1 Oct 2021 21:20:15 +0000 (23:20 +0200)]
nfs: eliminate thread argument from nfsvno_namei

This is a step towards retiring struct componentname cn_thread

Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D32267

2 years agosctp: don't keep being locked on a stream which is removed
Michael Tuexen [Fri, 1 Oct 2021 22:48:01 +0000 (00:48 +0200)]
sctp: don't keep being locked on a stream which is removed

Reported by: syzbot+f5f551e8a3a0302a4914@syzkaller.appspotmail.com
MFC after: 1 week

2 years agovfs: hoist cn_thread assert in namei
Mateusz Guzik [Fri, 1 Oct 2021 21:13:38 +0000 (23:13 +0200)]
vfs: hoist cn_thread assert in namei

Making it condtional on whether ktrace happens to be enabled makes no
sense.

2 years agoUpdate Azure release bits
Li-Wen Hsu [Fri, 1 Oct 2021 20:59:10 +0000 (04:59 +0800)]
Update Azure release bits

Imports the changes for building official images on Azure Marketplace,
which fulfill the requirements of Azure and FreeBSD cloud images like
disk layout and UEFI for Gen2 VM, along with some minor improvements like
configurations to speed up booting.

"CLOUDWARE" list will be updated after some more collaborations with re
completed.

Reviewed by: re (gjb)
Sponsored by: The FreeBSD Foundation
Technical assistance from: Microsoft
Differential Revision: https://reviews.freebsd.org/D23804

2 years agoRe-style dfcef8771484 to keep the code and variables related to
Gleb Smirnoff [Fri, 1 Oct 2021 20:38:24 +0000 (13:38 -0700)]
Re-style dfcef8771484 to keep the code and variables related to
listening sockets separated from code for generic sockets.

No objection: markj

2 years agoFix segment size in compressing core dumps
Justin Hibbits [Fri, 1 Oct 2021 18:39:18 +0000 (13:39 -0500)]
Fix segment size in compressing core dumps

A core segment is bounded in size only by memory size.  On 64-bit
architectures this means a segment can be much larger than 4GB.
However, compress_chunk() takes only a u_int, clamping segment size to
4GB-1, resulting in a truncated core.  Everything else, including the
compressor internally, uses size_t, so use size_t at the boundary here.

This dates back to the original refactor back in 2015 (r279801 /
aa14e9b7).

MFC after: 1 week
Sponsored by: Juniper Networks, Inc.

2 years agoarm64, riscv: Fix TRAF_PC() to return the PC, not the return address.
John Baldwin [Fri, 1 Oct 2021 18:53:12 +0000 (11:53 -0700)]
arm64, riscv: Fix TRAF_PC() to return the PC, not the return address.

Reviewed by: mhorne
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D31969

2 years agofreebsd-update(8): Add -j flag to support jails
Faraz Vahedi [Fri, 1 Oct 2021 18:48:57 +0000 (13:48 -0500)]
freebsd-update(8): Add -j flag to support jails

Make freebsd-update(8) support jails by adding the -j flag which takes
a jail jid or name as an argument. This takes advantage of the recently
added -j support to freebsd-version(8) in order to get the version of
the installed userland.

Reviewed by: dteske, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25711

2 years agofreebsd-version(1): Add -j flag to support jails
Faraz Vahedi [Fri, 1 Oct 2021 18:46:23 +0000 (13:46 -0500)]
freebsd-version(1): Add -j flag to support jails

Make freebsd-version(1) support jails by adding the -j flag which takes
a jail jid or name as an argument. As with other options, -j
flags stack and display in the order requested.

Reviewed by: bcr (manpages), kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25705

2 years agokqueue: fix recent assertion
Kyle Evans [Fri, 1 Oct 2021 16:59:31 +0000 (11:59 -0500)]
kqueue: fix recent assertion

NOTE_ABSTIME may also have a zero timeout, which indicates that we
should still fire immediately as an absolute time in the past.  A test
has been added for this one as well.

Fixes: 9c999a259f00 ("kqueue: don't arbitrarily restrict long-past...")
Point hat: kevans
Reported by: syzbot+1c8d1154f560b3930042@syzkaller.appspotmail.com

2 years agotime_t is pathological: use %j + cast to print it.
Warner Losh [Fri, 1 Oct 2021 18:14:35 +0000 (12:14 -0600)]
time_t is pathological: use %j + cast to print it.

Sponsored by: Netflix

2 years agoDon't set GELI UMA zone as UMA_ZONE_NOFREE.
Gleb Smirnoff [Fri, 1 Oct 2021 17:24:50 +0000 (10:24 -0700)]
Don't set GELI UMA zone as UMA_ZONE_NOFREE.

That fixes memory leak on last GELI provider destroyed, introduced
in 2dbc9a388ee. This patch was originally developed late 2019 and
the flag was necessary to prevent zone drainage under memory pressure.
Today, with f09cbea31a3f the UMA is fixed not to drain into reserves.

Discussed with: jtl, markj
Fixes: 2dbc9a388ee
PR: 258787

2 years agonvme: Only reset once on attach.
Warner Losh [Fri, 1 Oct 2021 17:09:34 +0000 (11:09 -0600)]
nvme: Only reset once on attach.

The FreeBSD nvme driver has reset the nvme controller twice on attach to
address a theoretical issue assuring the hardware is in a known
state. However, exierence has shown the second reset is unnecessary and
increases the time to boot. Eliminate the second reset. Should there be
a situation when you need a second reset (for buggy or at least somewhat
out of the mainstream hardware), the hardware option NVME_2X_RESET will
restore the old behavior. Document this in nvme(4).

If there's any trouble at all with this, I'll add a sysctl tunable to
control it.

Sponsored by: Netflix
Reviewed by: cperciva, mav
Differential Revision: https://reviews.freebsd.org/D32241

2 years agonvme: Remove pause while resetting
Warner Losh [Fri, 1 Oct 2021 17:09:05 +0000 (11:09 -0600)]
nvme: Remove pause while resetting

After some study of the code and the standard, I think we can just drop
the pause(), unconditionally.  If we're not initialized, then there's
nothing to wait for from a software perspective.  If we are initialized,
then there might be outstanding I/O. If so, then the qpair 'recovery
state' will transition to WAITING in nvme_ctrlr_disable_qpairs, which
will ignore any interrupts for items that complete before we complete
the reset by setting cc.en=0.

If we go on to fail the controller, we'll cancel the outstanding I/O
transactions.  If we reset the controller, the hardware throws away
pending transactions and we retry all the pending I/O transactions. Any
transactions that happend to complete before cc.en=0 will have the same
effect in the end (doing the same transaction twice is just inefficient,
it won't affect the state of the device any differently than having done
it once).

The standard imposes no wait times here, so it isn't needed from that
perspective.

Unanswered Question: Do we may need to disable interrupts while we
disable in legacy mode since those are level-sensitive.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D32248

2 years agonvme: Explain a workaround a little better
Warner Losh [Fri, 1 Oct 2021 15:53:10 +0000 (09:53 -0600)]
nvme: Explain a workaround a little better

The don't touch the mmio of the drive after we do a EN 1->0 transition
is only for a tiny number of dirves that have this unforunate issue.

Sponsored by: Netflix

2 years agonvme_ctrlr_enable: Small style nits
Warner Losh [Fri, 1 Oct 2021 16:51:24 +0000 (10:51 -0600)]
nvme_ctrlr_enable: Small style nits

Rewrite the nested if's using the preferred FreeBSD style for branches
of ifs that return. NFC. Minor tweaks to the comments to better fit new
code layout.

Sponsored by: Netflix
Reviewed by: mav, chuck (prior rev, but comments rolled in)
Differential Revision: https://reviews.freebsd.org/D32245

2 years agonvme: Use MS_2_TICKS rather than rolling our own
Warner Losh [Fri, 1 Oct 2021 16:50:04 +0000 (10:50 -0600)]
nvme: Use MS_2_TICKS rather than rolling our own

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D32246

2 years agonvme_ctrlr_enable: Remove unnecessary 5ms delays
Warner Losh [Fri, 1 Oct 2021 16:47:27 +0000 (10:47 -0600)]
nvme_ctrlr_enable: Remove unnecessary 5ms delays

Remove the 5ms delays after writing the administrative queue
registers. These delays are from the very earliest days of the driver
(they are in the first commit) and were most likely vestiges of the
Chatham NVMe prototype card that was used to create this driver. Many of
the workarounds necessary for it aren't necessary for standards
compliant cards. The original driver had other areas marked for Chatham,
but these were not. They are unneeded. There's three lines of supporting
evidence.

First, the NVMe standards make no mention of a delay time after these
registers are written. Second, the Linux driver doesn't have them, even
as an option. Third, all my nvme cards work w/o them.

To be safe, add a write barrier between setting up the admin queue and
enabling the controller.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D32247

2 years agosem_clockwait_np test: fix usage of ATF API
Eric van Gyzen [Fri, 1 Oct 2021 11:25:48 +0000 (06:25 -0500)]
sem_clockwait_np test: fix usage of ATF API

ATF_REQUIRE_ERRNO requires the given errno iff the given expression is
true.  These test cases used it incorrectly, potentially allowing
sem_clockwait_np to succeed when it was expected to fail.  Use separate
ATF calls to require failure and the expected errno.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agosem test: move sem_clockwait_np tests into individual cases
Eric van Gyzen [Fri, 1 Oct 2021 11:24:27 +0000 (06:24 -0500)]
sem test: move sem_clockwait_np tests into individual cases

Move these tests into individual test cases for all the usual reasons.
No functional change intended.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agosem_clockwait_np test: relax time constraint on VMs
Eric van Gyzen [Fri, 1 Oct 2021 10:37:17 +0000 (05:37 -0500)]
sem_clockwait_np test: relax time constraint on VMs

In a guest on a busy hypervisor, the time remaining after an
interrupted sleep could be much lower than other environments.
Relax the lower bound on VMs.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agotcp: Make dsack stats available in netstat and also make sure its aware of TLP's.
Randall Stewart [Fri, 1 Oct 2021 14:32:30 +0000 (10:32 -0400)]
tcp: Make dsack stats available in netstat and also make sure its aware of TLP's.

DSACK accounting has been for quite some time under a NETFLIX_STATS ifdef. Statistics
on DSACKs however are very useful in figuring out how much bad retransmissions you
are doing. This is further complicated, however, by stacks that do TLP. A TLP
when discovering a lost ack in the reverse path will cause the generation
of a DSACK. For this situation we introduce a new dsack-tlp-bytes as well
as the more traditional dsack-bytes and dsack-packets. These will now
all display in netstat -p tcp -s. This also updates all stacks that
are currently built to keep track of these stats.

Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D32158

2 years agomixer(3): Fix buildworld after 38c857d956d61b811fb2047bc980b90d64a072bf .
Hans Petter Selasky [Fri, 1 Oct 2021 14:34:03 +0000 (16:34 +0200)]
mixer(3): Fix buildworld after 38c857d956d61b811fb2047bc980b90d64a072bf .

s/default_unit/dunit/g

Differential Revision: https://reviews.freebsd.org/D32254
Sponsored by: NVIDIA Networking

2 years agomixer(3): Add some manual page symlinks.
Hans Petter Selasky [Fri, 1 Oct 2021 12:17:20 +0000 (14:17 +0200)]
mixer(3): Add some manual page symlinks.

Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D32254
Sponsored by: NVIDIA Networking

2 years agomixer(3): Add symbol versioning.
Hans Petter Selasky [Fri, 1 Oct 2021 12:14:38 +0000 (14:14 +0200)]
mixer(3): Add symbol versioning.

Suggested by: kib
Differential Revision: https://reviews.freebsd.org/D32254
Sponsored by: NVIDIA Networking

2 years agoFix bsnmpd(1) crash with ill-formed Discovery message
Shteryana Shopova [Fri, 1 Oct 2021 11:10:39 +0000 (14:10 +0300)]
Fix bsnmpd(1) crash with ill-formed Discovery message

RFC 3414 Section 4. Discovery specifies that a discovery request message has a
varBindList left empty. Nonetheless, bsnmpd(1) should not crash when receiving
a non-zero var-bindings list in a Discovery Request message.

PR: 255214
MFC after: 2 weeks

2 years agoAdd a gic interface to allocate MSI interrupts
Andrew Turner [Wed, 29 Sep 2021 13:33:18 +0000 (14:33 +0100)]
Add a gic interface to allocate MSI interrupts

The previous update to handle the gicv2m as a child of the gicv3 driver
assumed there was only a single gicv2m child. On some hardware there
are multiple children. Support this by removing the mbi ivars and
adding a new interface to handle MSI allocation in a given range.

Tested by: mw, trasz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32224

2 years agoAllow ddb and dtrace use the DMAP region on arm64
Andrew Turner [Tue, 21 Sep 2021 17:10:57 +0000 (17:10 +0000)]
Allow ddb and dtrace use the DMAP region on arm64

When writing to memory on arm64 we may be trying to be accessing a
read-only page. In this case try to access via the DMAP region to
get a writable location.

While here simplify writing data in DDB and stop trashing the size as
it is passed into the cache handling functions.

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

2 years agoAlso print symbols when printing arm64 registers
Andrew Turner [Thu, 23 Sep 2021 10:32:16 +0000 (10:32 +0000)]
Also print symbols when printing arm64 registers

When printing arm64 registers because of an exception in the kernel
also print the symbol and offset. This can be used to track down why
the exception occured without needing external tools.

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

2 years agoenetc_mdio: Fix devclass name
Kornel Duleba [Thu, 5 Aug 2021 10:31:33 +0000 (12:31 +0200)]
enetc_mdio: Fix devclass name

Use correct devclass name, due to the mismatch miibus would attach
to the wrong thing causing mii_attach to silently fail.

Fixes: dfcaa2c18bf9 (enetc_mdio: Support building the driver ...)
2 years agomodules: felix: Remove etherswitch_if.c from Makefile
Kornel Duleba [Thu, 30 Sep 2021 11:06:34 +0000 (13:06 +0200)]
modules: felix: Remove etherswitch_if.c from Makefile

Having it included confuses KOBJOPLOOKUP resulting in kobj_error_method
being called instead of a devmethod from the switch driver.
That in turn returns ENXIO which was treated as a pointer and
dereferenced by etherswitch ioctl logic causing the kernel to panic.

Fixes: b542c9e42ba4 (modules: felix: Add needed dependencies)
2 years agoarm64: std.nxp Add enetc NIC driver
Kornel Duleba [Thu, 30 Sep 2021 07:34:52 +0000 (09:34 +0200)]
arm64: std.nxp Add enetc NIC driver

It was missed during the conversion of kernel configs.
Although the driver is already built as a kernel module we might
want to have it built-in for diskless booting and such.

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.

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.

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.

Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D32235

2 years agokqueue: clean up some igor and mandoc -Tlint warnings
Kyle Evans [Thu, 30 Sep 2021 18:22:01 +0000 (13:22 -0500)]
kqueue: clean up some igor and mandoc -Tlint warnings

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

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

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.

Reviewed by: kib, markj
Discussed with: allanjude
Differential Revision: https://reviews.freebsd.org/D32230

2 years agoImport ACPICA 20210930
Jung-uk Kim [Thu, 30 Sep 2021 20:23:21 +0000 (16:23 -0400)]
Import ACPICA 20210930

(cherry picked from commit c509b6ab0d7e5bafc5348b08653b8738bd40716e)

2 years agoEFI loader: Don't free bcache for DEVT_DISK devs
Colin Percival [Thu, 30 Sep 2021 21:48:14 +0000 (14:48 -0700)]
EFI loader: Don't free bcache for DEVT_DISK devs

Booting on an EC2 c5.xlarge instance, this reduces the number of I/Os
performed from 609 to 432, reduces the total number of blocks read
from 61963 to 60797, and reduces the time spent in the loader by 39 ms.

Note that b4cb3fe0e39a allowed the bcache to be retained for most of
the boot process, but relies on mounting filesystems; this commit
allows the bcache to be retained at the start of the boot process,
before the root filesystem has been located.

Reviewed by: imp, tsoome
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D32239

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.

Reviewed by: freqlabs
Differential Revision: https://reviews.freebsd.org/D26927

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.

Reviewed by: freqlabs
Differential Revision: https://reviews.freebsd.org/D26756

2 years agouart: Match simple comm
Warner Losh [Thu, 30 Sep 2021 20:16:19 +0000 (14:16 -0600)]
uart: Match simple comm

Match the PCI simple comm devices (or try to). Be conservative and use
legacy interrupts rather than msi messages by default for this 'catch
all' since it matches what Linux does (it has opt-in generally for MSI,
but also matches more devices because it does a catch-all like
implemented in this commit).

Sponsored by: Netflix
Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D32228

2 years agouart: Allow PCI quirk for not using MSI interrupts
Warner Losh [Thu, 30 Sep 2021 20:15:32 +0000 (14:15 -0600)]
uart: Allow PCI quirk for not using MSI interrupts

Some setups claim to have one MSI, but they don't actually work. Allow
these to be flagged.

Sponsored by: Netflix
Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D32229

2 years agomgb: Fix nop admin interrupt handling
Ed Maste [Wed, 29 Sep 2021 21:24:39 +0000 (17:24 -0400)]
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

2 years agonet80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames
Mathy Vanhoef [Sun, 6 Jun 2021 22:10:56 +0000 (22:10 +0000)]
net80211: prevent plaintext injection by A-MSDU RFC1042/EAPOL frames

No longer accept plaintext A-MSDU frames that start with an RFC1042
header with EtherType EAPOL.  This is done by only accepting EAPOL
packets that are included in non-aggregated 802.11 frames.

Note that before this patch, FreeBSD also only accepted EAPOL frames
that are sent in a non-aggregated 802.11 frame due to bugs in
processing EAPOL packets inside A-MSDUs. In other words,
compatibility with legitimate devices remains the same.

This relates to section 6.5 in the 2021 Usenix "FragAttacks" (Fragment
and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation)
paper.

Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be)
Security: CVE-2020-26144
PR: 256120
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D30665

2 years agonet80211: mitigation against A-MSDU design flaw
Mathy Vanhoef [Sun, 6 Jun 2021 22:10:52 +0000 (22:10 +0000)]
net80211: mitigation against A-MSDU design flaw

Mitigate A-MSDU injection attacks by detecting if the destination address
of a subframe equals an RFC1042 (i.e., LLC/SNAP) header, and if so
dropping the complete A-MSDU frame.  This mitigates known attacks,
although new (unknown) aggregation-based attacks may remain possible.

This defense works because in A-MSDU aggregation injection attacks, a
normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means
the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042
header. In other words, the destination MAC address of the first A-MSDU
subframe contains the start of an RFC1042 header during an aggregation
attack. We can detect this and thereby prevent this specific attack.

This relates to section 7.2 in the 2021 Usenix "FragAttacks" (Fragment
and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation)
paper.

Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be)
Security: CVE-2020-24588
PR: 256119
Differential Revision: https://reviews.freebsd.org/D30664

2 years agonet80211: reject mixed plaintext/encrypted fragments
Mathy Vanhoef [Sun, 6 Jun 2021 22:10:41 +0000 (22:10 +0000)]
net80211: reject mixed plaintext/encrypted fragments

ieee80211_defrag() accepts fragmented 802.11 frames in a protected Wi-Fi
network even when some of the fragments are not encrypted.
Track whether the fragments are encrypted or not and only accept
successive ones if they match the state of the first fragment.

This relates to section 6.3 in the 2021 Usenix "FragAttacks" (Fragment
and Forge: Breaking Wi-Fi Through Frame Aggregation and Fragmentation)
paper.

Submitted by: Mathy Vanhoef (Mathy.Vanhoef kuleuven.be)
Security: CVE-2020-26147
PR: 256118
Differential Revision: https://reviews.freebsd.org/D30663

2 years agolibpmc: add some AMD pmu counter aliases
Mitchell Horne [Thu, 30 Sep 2021 14:13:37 +0000 (11:13 -0300)]
libpmc: add some AMD pmu counter aliases

Make it mostly compatible with what's defined for Intel. Except where
noted, these are defined for all of amdzen(1|2|3).

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

2 years agolibpmc: fix the 'cycles' event alias on x86
Mitchell Horne [Thu, 30 Sep 2021 14:11:36 +0000 (11:11 -0300)]
libpmc: fix the 'cycles' event alias on x86

Looking for "tsc-tsc" in the pmu tables will fail every time. Instead,
make this an alias for the static TSC event defined in pmc_events.h.
This fixes 'pmcstat -s cycles' on Intel and AMD.

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

2 years agolinprocfs: find cwd and root handling
Mateusz Guzik [Thu, 30 Sep 2021 10:50:18 +0000 (12:50 +0200)]
linprocfs: find cwd and root handling

The code would incorrectly use curthread instead of the target proc to
resolve vnodes.

Fixes: 8d03b99b9dafe928 ("fd: move vnodes out of filedesc into a dedicated structure")
PR: 258729
Noted by:  Damjan Jovanovic <damjan.jov@gmail.com>

2 years agofd: add pwd_hold_proc
Mateusz Guzik [Thu, 30 Sep 2021 10:49:51 +0000 (12:49 +0200)]
fd: add pwd_hold_proc

2 years agoocs_fc: Fix device lost timer where device is not getting deleted.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:35:30 +0000 (15:05 +0530)]
ocs_fc: Fix device lost timer where device is not getting deleted.

Issue: Devices wont go away after the link down.

Device lost timer functionality in ocs_fc is broken,
`is_target` flag is not set in the target database and target delete is skipped.

Fix: Remove unused flags and delete the device when timer expires.

Reported by: ken@kdm.org
Reviewed by: mav, ken

2 years agoocs_fc: When commands complete with an error, freeze the device queue.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:32:09 +0000 (15:02 +0530)]
ocs_fc: When commands complete with an error, freeze the device queue.

Proper error recovery depends on freezing the device queue when an
error occurs, so we can recover from an error before sending
additional commands.

The ocs_fc(4) driver was not freezing the device queue for most
SCSI errors, and that broke error recovery.

sys/dev/ocs_fc/ocs_cam.c:
In ocs_scsi_initiator_io_cb(), freeze the device queue if
        we're passing back status other than CAM_REQ_CMP.

Submitted by: ken@kdm.org
Reviewed by: mav, ken

2 years agoocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:19:49 +0000 (14:49 +0530)]
ocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned.

        In ocs_scsi_initiator_io_cb(), if the SCSI command that is
        getting completed had a residual equal to the transfer length,
        it was setting the CCB status to CAM_REQ_CMP.

        That breaks the expected behavior for commands like READ ATTRIBUTE.
        For READ ATTRIBUTE, if the first attribute requested doesn't exist,
        the command is supposed to return an error (Illegal Request,
        Invalid Field in CDB).  The broken behavior for READ ATTRIBUTE
        caused LTFS tape formatting to fail.  It looks for attribute
        0x1623, and expects to see an error if the attribute isn't present.

        In addition, if the residual is negative (indicating an overrun),
        only set the CCB status to CAM_DATA_RUN_ERR if we have not already
        reported an error.  The SCSI sense data will have more detail about
        what went wrong.

        sys/dev/ocs_fc/ocs_cam.c:
                In ocs_scsi_initiator_io_cb(), don't set the status to
                CAM_REQ_CMP if the residual is equal to the transfer length.

                Also, only set CAM_DATA_RUN_ERR if we didn't get SCSI
                status.

Submitted by: ken@kdm.org
Reviewed by: mav, ken

2 years agoocs_fc: Increase maximum supported SG elements to support larger transfer sizes.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:05:03 +0000 (14:35 +0530)]
ocs_fc: Increase maximum supported SG elements to support larger transfer sizes.

Reported by: ken@kdm.org
Reviewed by: mav, ken

2 years agoocs_fc: Emulex Gen 7 HBA support.
Ram Kishore Vegesna [Thu, 23 Sep 2021 06:51:26 +0000 (12:21 +0530)]
ocs_fc: Emulex Gen 7 HBA support.

Emulex Gen7 adapter support in ocs_fc driver.

Reviewed by: mav, ken

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.

2 years agomodules: a lot: need opt_kern_tls.h
Kyle Evans [Thu, 30 Sep 2021 04:07:17 +0000 (23:07 -0500)]
modules: a lot: need opt_kern_tls.h

This fixes the standalone build.

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

This fixes the standalone build.