This allows the adapter to be suspended or reset even when stateful TOE is
active, in some limited configurations.
The LLD has already stopped the adapter hardware and all its queues by the time
these ULD routines get called. The general approach in t4_tom is to purge the
lookup tables immediately so that they are ready for operation by the time the
adapter resumes, and park all the resources left hanging by the stopped hardware
into separate "stranded" queues that can be dealt with at leisure.
Outstanding active opens, live connections, and synq entries (for connections in
the middle of the 3-way handshake) are all treated as if the hardware had
reported an abrupt error for the tid. The servers/listeners are a bit different
in that no error is reported. They're just noted as non-functional when the
hardware stops and are recreated by the driver during restart.
MFC after: 1 month
Sponsored by: Chelsio Communications
Live tid entries in tid_tab are either full fledged connections or synq
entries. toep_list tracks the connections already and this change adds
a synqe_list to track the synq entries. These two lists can be used to
enumerate and iterate over all live tids.
MFC after: 1 week
Sponsored by: Chelsio Communications
L2T entries are used by both filters and TOE and the L2T is shared
between the base driver (LLD) and the TOM ULD. Add a flag to indicate
that the L2T is stopped, which means:
* t4_alloc_l2e and t4_l2t_alloc_switching will not allocate new entries.
* t4_tom will ignore all ARP/NDP updates from the kernel.
* Previously allocated L2T entries can still be freed.
MFC after: 1 month
Sponsored by: Chelsio Communications
atids are used by both filters and TOE and the atid table is in the base
driver (LLD). New atids cannot be allocated when the allocator is
stopped but existing ones can still be freed. It is expected that the
owners of outstanding atids will release them in their own stop
processing, before the adapter is restarted.
MFC after: 1 month
Sponsored by: Chelsio Communications
The suspend/resume/reset implementation in the base driver (LLD)
currently works when only stateless features are in use. This commit
adds basic infrastructure for stateful upper layer drivers (ULDs) to
participate in suspend/resume/reset.
* Add a uld_restart to indicate that the adapter has been restarted
after a stop and the ULD should resume operations.
* Move the existing functionality in t4_suspend/t4_resume to stop_lld and
restart_lld. Use these and the new uld restart routines everywhere the
adapter has to be stopped abruptly and restarted, namely:
1. PCIE bus suspend/resume/reset methods invoked by the kernel.
2. Manual internal-reset using driver sysctl.
3. Automatic internal-reset on a fatal error.
* Implement an alternate internal-reset for use in VMs and for testing.
Typical reset sequence is:
stop_adapter(sc);
stop_lld(sc);
stop_all_uld(sc);
set_adapter_hwstatus(sc, false);
/* hw reset takes place here. */
restart_adapter(sc);
restart_lld(sc);
set_adapter_hwstatus(sc, true);
restart_all_uld(sc);
MFC after: 1 month
Sponsored by: Chelsio Communications
Allow a TCP function block (tfb) to become the default stack only if
tfb->tfb_flags has the TCP_FUNC_DEFAULT_OK flags set. This allows a
TCP function block, that is not suitable as a default function block
to ensure that it is not set as the default via sysctl. In this case
sysctl would return EINVAL.
Reviewed by: gallatin, Peter Lei
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45419
The NFS RFCs are pretty loose with respect to what characters
can be in a filename returned by a Readdir. However, FreeBSD,
as a POSIX system will not handle imbedded '/' or nul characters
in file names. Also, for NFSv4, the file names "." and ".."
are handcrafted on the client and should not be returned by a
NFSv4 server.
This patch scans for the above in filenames returned by Readdir and
ignores any entry returned by Readdir which has them in it.
Because an imbedded nul would be a string terminator, it was
not possible to code this check efficiently using string(3)
functions.
Reported by: Apple Security Engineering and Architecture (SEAR)
MFC after: 1 week
Work around an issue in LLVM's register allocator, which can cause
slightly different i386 object files, when produced by a native or cross
build of clang.
This adds another volatile qualifier to a float variable declaration in
the weightCalcHelper() function, which otherwise produces slightly
different float results on amd64 and i386 hosts. In turn, this can lead
to different (but equivalent) register choices, and thus non-identical
assembly code.
See https://github.com/llvm/llvm-project/issues/99396 for more details.
Note this is a temporary fix, meant to merge in time for 13.4. As soon
as upstream has a permanent solution we will import that.
PR: 276961
Reported by: cperciva
MFC after: 3 days
Use the intended TCP stack when creating a TCP endpoint instead of
creating it the endpoint the default stack first and after that
switching it to use the intended TCP stack.
Reviewed by: Peter Lei, rrs and jtl (older version)
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45411
Implement the improved SEG.ACK validation described in RFC 5961.
In addition to that, also detect ghost ACKs, which are ACKs for data
that has never been sent.
The additional checks are enabled by default, but can be disabled
by setting the sysctl-variable net.inet.tcp.insecure_ack to a
non-zero value.
PR: 250357
Reviewed by: Peter Lei, rscheff (older version)
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45894
The existing pretty-printing code fails to properly print complex
pointer types. This commit fixes this behaviour by traversing the
chain of CTF types until a base type is encountered.
Approved by: markj (mentor)
Fixes: c21bc6f3c2
The struct pretty-printing code uses the ctm_offset field in
struct ctf_member_v3 to calculate the address of a struct member.
However, the code treats this as a byte offset rather than the
offset in bits, leading to wrong values being printed.
Fix this by diving with ctm_offset by NBBY.
Approved by: markj (mentor)
Fixes: c21bc6f3c2
If the resource was allocated with want_iomap_res flag set.
Sponsored by: Serenity CyberSecurity, LLC
MFC after: 1 week
Reviewed by: manu, bz
Differential Revision: https://reviews.freebsd.org/D45905
pci_iomap_range creates a virtual mapping cookie for a PCI BAR.
As compared with pci_iomap it got extra offset parameter.
Sponsored by: Serenity CyberSecurity, LLC
MFC after: 1 week
Reviewed by: manu, bz
Differential Revision: https://reviews.freebsd.org/D45904
acpi_dev_get_first_match_dev returns the first match of ACPI device
and acpi_device_handle returns its ACPI handle.
Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D45847
It finds out if a given PCI device matches a given pci_id table.
Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D45846
devm_device_add_group creates a managed attribute group for a device.
Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D45845
__diag macros turn individual warnings and errors on and off locally,
depending on version of compiler. Add dummy implementation as drm-kmod
set warnings separately for each file.
Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu, emaste
Differential Revision: https://reviews.freebsd.org/D45842
Either due to a race, or to the privilege restrictions, it is not
guaranteed that kern.files returned file information for all pcbs
read from net.inet.<proto>.pcblist. In this case the file rbtree does
not return the matching file by data address, and code must avoid
dereferencing NULL.
PR: 279875
Reviewed by: asomers
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D46050
This was missed in b8730c11a3 ("include: ssp: fix the build [...]"),
but <ssp/wchar.h> also had a bare `inline` in use. Swap it over to
__ssp_inline as well.
Reported by: netchild
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain
their leap-second updates from IERS.
This resolves an issue for IPv6-only hosts as IERS is not accessible
via IPv6, requiring IPv6-only host to rely on some other source,
above.
From this point forward we should fetch the file from IERS, the
organization responsible for deciding when to insert leap-seconds.
PR: 279413
Obtained from: https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
Discussed with: imp
MFC after: 1 day
Allocate to a simple poiter, use that everywhere, then return it at the
end. The code looks cleaner.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D46043
Intersting/relevant changes since bmake-20240625
ChangeLog since bmake-20240625
2024-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* cleanup redundant differences from NetBSD make
o parse.c: no longer uses mmap
o var.c: check __STDC_VERSION__ not __STDC__
2024-07-12 Simon J Gerraty <sjg@beast.crufty.net>
* Apply some patches from NetBSD pkgsrc to reduce divergence
o meta.c: requires sys/select.h if available
o var.c: ensure SIZE_MAX has a value
o util.c: ensure SA_RESTART is defined
* configure.in: use *ksh* rather than just *ksh to match
ksh shell specification.
* unit-tests/Makefile: expand BROKEN_TESTS for ksh and
mksh in particular
2024-07-11 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240711
Merge with NetBSD make, pick up
o compat.c: allow Compat_RunCommand to also handle very long
commands by writing to a temp file when needed.
o main.c: extract the temp file logic recently added to Cmd_Exec
to Cmd_Argv so it can be leveraged by Compat_RunCommand.
2024-07-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240709
Merge with NetBSD make, pick up
o error out on parse/evaluation errors in shell commands
o var.c: error out on syntax errors in ':M' and ':N' modifiers
2024-07-07 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240707
Merge with NetBSD make, pick up
o only generate code for cleanup functions in CLEANUP mode
o hash.c: don't track hash table chain lengths during lookup
unless debugging
o main.c: move initialization of variable scopes to targ.c
o var.c: remove Var_End as it is now unnecessary
2024-07-06 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240706
Merge with NetBSD make, pick up
o reduce lint comments about ARGSUSED
o cond.c: error out on conditions containing the operators '&' and '|'
o str.c: error out on a matching malformed matching pattern '[['
o var.c: in error messages, distinguish parsing from evaluating
in error messages for anonymous variables, log the value
error out on unclosed expressions during parse time
2024-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240704
Merge with NetBSD make, pick up
o add more context information to error messages
o main.c: on error, print the targets to be made
add detailed exit status to message for failed sub-commands
o var.c: error out on the "Bad modifier" error message
2024-07-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240701
Merge with NetBSD make, pick up
o var.c: add :tt for Title case
2024-06-30 Simon J Gerraty <sjg@beast.crufty.net>
* configure.in: 20240630 further refine check for whether
TZ=Europe/Berlin works
* VERSION (_MAKE_VERSION): 20240630
Merge with NetBSD make, pick up
o job.c: reduce use of UNCONST
o main.c: add detailed exit status to message for failed sub-commands
o var.c: error out on some more syntax errors
add more context to "returned non-zero status" message
We support all the C++ standards to some degree. However, pre C++11
standard support has been disappearing upstream, so also add a note
about -pedantic-errors might not work for earlier standards. Add note
about __cplusplus values.
Sponsored by: Netflix
I was testing this in several trees, and this chunk was in the tree I
tested. I didn't detect the mismerge before the commit...
Fixes: 6f1dd6071a
Sponsored by: Netflix
Make nvme_qpair_manual_complete_request take dnr as well as a
print_on_error action. Make the status word computation common between
it and nvme_qpair_manual_complete_tracker. And print the error when
we are cancelling the I/O on failure, but not when we're filtering
the I/O after we've failed. Make it private again to nvme_qpair.c.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D46049
When the drive is failed, we can't send passthrough commands to the
card, so fail them right away. Rearrange the comments to reflect the
current failure paths in the driver.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D46048