Commit Graph

272210 Commits

Author SHA1 Message Date
Konstantin Belousov
89918a2375 mlx5en: idiomatic use of preprocessor, in particular paths
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-01 14:45:57 +02:00
Konstantin Belousov
b984b95693 mlx5en: normalize use of the opt_*.h files
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-01 14:45:57 +02:00
Hans Petter Selasky
12c56d7dc4 mlx5: idiomatic use of preprocessor, in particular paths
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-01 14:45:57 +02:00
Konstantin Belousov
ee9d634bd3 mlx5: normalize use of the opt_*.h files
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-01 14:45:57 +02:00
Andrew Turner
c363da4ae8 Add the Arm SPE interrupt to acpidump
To support the Arm Statistical Profiling Extension (SPE) ACPI 6.3 added
a place to hold the SPE interrupt. Add to acpidump to show when printing
the Arm Generic Interrupt data.

Sponsored by:	The FreeBSD Foundation
2022-02-01 11:43:13 +00:00
Konstantin Belousov
303d3ae7e8 ufs, msdosfs: do not record witness order when creating vnode
When allocating new vnode, we need to lock it exclusively before
making it externally visible.  Since other threads cannot observe the
vnode yet, current lock order cannot create LoR conditions.

Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34126
2022-02-01 10:51:55 +02:00
Konstantin Belousov
d51b0786a2 msdosfs_denode.c: some style
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D34126
2022-02-01 10:51:48 +02:00
Konstantin Belousov
99aa3b731c ffs: lock buffers after snaplk with LK_NOWITNESS
Reviewed by:	mckusick
Discussed with:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34073
2022-02-01 06:54:50 +02:00
Konstantin Belousov
c02780b78c Add GB_NOWITNESS flag
It prevents WITNESS from recording the lock order for the buffer lock
acquired by getblkx().

Reviewed by:	mckusick
Discussed with:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34073
2022-02-01 06:54:50 +02:00
Konstantin Belousov
e11b2b69c5 ffs_alloc.c: order includes alphabetically
Reviewed by:	mckusick
Discussed with:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34073
2022-02-01 06:54:50 +02:00
Konstantin Belousov
d950c5898a vm/vm_extern.h, vm/vm_page.h: use sys/kassert.h
instead of fatty sys/systm.h.

Suggested by:	jhb
Reviewed by:	alc, imp, jhb (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34089
2022-02-01 05:55:35 +02:00
Konstantin Belousov
f4cdb9d7c3 vm/vm_pager.h: use sys/systm.h header
it is needed for __read_mostly attribute definition, which right now
comes from vm/vm_page.h including sys/systm.h

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34089
2022-02-01 05:55:35 +02:00
Konstantin Belousov
54d34bfbdf Introduce sys/kassert.h
It contains assert-related definitions previously provided by
sys/systm.h.  The new header is leaner than whole systm.h.
Include kassert.h from systm.h for compatibility.

The copyright assignment to Eivind Eklund was suggested by Kirk McKusick
and is based in the commit 5526d2d920.

Suggested by:	jhb
Reviewed by:	alc, imp, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34089
2022-02-01 05:14:14 +02:00
John Baldwin
58862c0bea fstyp: Remove __packed from struct exfat_de_label.
This fixes a -Waddress-of-packed-member warning about a possibly
unaligned pointer from GCC 9 when calling convert_label().

__packed has to be removed from struct exfat_dirent as well to fix an
alignment warning when casting from a struct exfat_dirent pointer to a
struct exfat_de_label pointer.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D32144
2022-01-31 17:33:31 -08:00
John Baldwin
6c9ed42828 ggatec: Use ANSI C definition for init_initial_buffer_size.
This fixes -Wstrict-prototypes and -Wold-style-definition warnings
from GCC 9.
2022-01-31 17:12:04 -08:00
John Baldwin
53e938e408 hyperv storvsc: Don't abuse struct sglist to hold virtual addresses.
struct sglist is intended for holding S/G lists of physical address
ranges, not virtual address ranges.  GCC 9.x issues several warnings
due to casts between pointers and integers of different sizes as a
result (vm_paddr_t is 64-bits on i386).  Instead, add a local 'struct
hv_sglist' which uses an array of 'struct iovec' to hold the S/G list
of virtual address ranges.

Differential Revision:	https://reviews.freebsd.org/D31933
2022-01-31 17:11:27 -08:00
John Baldwin
d782385e9b tcp_ratelimit: Handle some edge cases with TLS + RL send tags.
- After a connection has fallen back from NIC TLS to SW TLS, any
  pacing rate changes should modify the inpcb send tag even though
  SB_TLS_IFNET is set.

- If a connection tries to modify the pacing rate before the send
  tag has been converted from plain TLS to TLS + RL, don't fail
  the rate request set but let it fall through to setting the rate
  on the non-TLS inpcb RL tag.

Reviewed by:	gallatin, rrs, hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D34085
2022-01-31 16:40:04 -08:00
John Baldwin
d958bc7963 ktls: Try to enable TOE TLS after marking existing data not ready.
At the moment this is mostly a no-op but in the future there will be
in-flight encrypted data which requires software decryption.  This
same setup is also needed for NIC TLS RX.

Note that this does break TOE TLS RX for AES-CBC ciphers since there
is no software fallback for AES-CBC receive.  This will be resolved
one way or another before 14.0 is released.

Reviewed by:	hselasky
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34082
2022-01-31 16:39:21 -08:00
Gordon Tetlow
9ad859dab2 Fix minor grammar nit. 2022-01-31 15:35:23 -08:00
Ed Maste
e38610abca ssh: remove unused header
Fixes:		0746301c49 ("ssh: pass 0 to procctl(2) to operate...")
Sponsored by:	The FreeBSD Foundation
2022-01-31 17:15:21 -05:00
Mark Johnston
773e3a71b2 pf: Initialize pf_kpool mutexes earlier
There are some error paths in ioctl handlers that will call
pf_krule_free() before the rule's rpool.mtx field is initialized,
causing a panic with INVARIANTS enabled.

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

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

Reported by:	syzbot+77cd12872691d219c158@syzkaller.appspotmail.com
Reviewed by:	kp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34115
2022-01-31 16:14:00 -05:00
Robert Wing
b4cc5d63b6 bhyve/virtio: use correct device id for virtio-scsi
Section 4.1.2.1 of the virtio spec states that the transitional PCI
device id for a scsi device is 0x1004.

Fix suggested by reporter.

PR:             259961
Reported by:    me@nanaya.pro
Reviewed by:	imp, jhb
Fixes:  f9c005a17f ("Add bhyve virtio-scsi storage backend support.")
Differential Revision:	https://reviews.freebsd.org/D34103
2022-01-31 09:44:47 -09:00
Wolfram Schneider
1536d37b20 fix casting issue in error message for 32bit CPUs (e.g. armv7) 2022-01-31 18:30:07 +00:00
Kristof Provost
6f47a72d8e libpfctl: fix pfctl_kill_states()
735748f30a changed the output of the states so that the creator id
endianness would be consistent. This means that we need to convert the
host endianness creatorid back to big-endian before we give it to the
kernel.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-01-31 19:13:26 +01:00
Wolfram Schneider
d7e8005bfa cleanup documentation 2022-01-31 18:11:14 +00:00
Wolfram Schneider
00ad40d70a throw an error if reading from stdin failed 2022-01-31 18:04:45 +00:00
Wolfram Schneider
834a8fa169 enable to configure the locate path length at compile time
The length has not changed and is 1024 chars (equals PATH_MAX).

PR: 201243
Submitted by: Willem Jan Withagen <wjw@digiware.nl>
2022-01-31 17:32:46 +00:00
Wolfram Schneider
8d35ca86c5 Fix statistics for empty databases
An empty database is a database which does not contain any filenames.
It should not occur in practice but maybe in the case of an error.

echo | /usr/libexec/locate.mklocatedb > empty.db; locate -d empty.db -S
2022-01-31 17:03:08 +00:00
Konstantin Belousov
90be4091a7 insmntque(9): update and correct man page
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D34071
2022-01-31 16:51:05 +02:00
Konstantin Belousov
66c5fbca77 insmntque1(): remove useless arguments
Also remove once-used functions to clean up after failed insmntque1(),
which were destructor callbacks in previous life.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D34071
2022-01-31 16:49:08 +02:00
Wolfram Schneider
69ae5b9667 remove register
There are no measurable performance differences if registers are used or not.
2022-01-31 10:59:07 +00:00
Kornel Duleba
1a6d987b7f enetc: Wait for pending transmissions before disabling TX queues
According to the RM it's not safe to disable a TX ring while it is busy
transmitting frames.
In order to be safe wait until the ring is empty. (cidx==pidx)
Use this opportunity to remove a set-but-unused variable.

Obtained from: Semihalf
Sponsored by: Alstom Group
2022-01-31 08:57:48 +01:00
Kornel Duleba
a6bda3e1ef enetc: Simply TX ring credits counting logic
According to the RM rings can hold at most ring_size - 1 descriptors at any time.
No additional logic is needed since iflib already respects this constrain.
Thanks to that the pidx == cidx situation is not ambiguous and indicates an
empty ring.
Use that to simplify the logic that calculates the amount of processed frames.

Obtained from: Semihalf
Sponsored by: Alstom Group
2022-01-31 08:57:48 +01:00
Kornel Duleba
f485d733e8 enetc: Disable HW IP packet alignment
The NIC can IP align received packets.
It was observed that it caused some rare stalls, that required full board reset.
Disable this feature for now. It doesn't provide any significant performance
improvement anyway.

Obtained from: Semihalf
Sponsored by: Alstom Group
2022-01-31 08:57:48 +01:00
Konstantin Belousov
8d8589b385 ufs: be more persistent with finishing some operations
when the vnode is doomed after relock.  The mere fact that the vnode is
doomed does not prevent us from doing UFS operations on it while it is
still belongs to UFS, which is determined by non-NULL v_data.  Not
finishing some operations, e.g. not syncing the inode block only because
the vnode started reclamation, is not correct.

Add macro IS_UFS() which incapsulates the v_data != NULL, and use it
instead of VN_IS_DOOMED() for places where the operation completion is
important.

Reviewed by:	markj, mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34072
2022-01-31 04:46:21 +02:00
Konstantin Belousov
4559700a0a ffs_snapblkfree(): add a comment explaining lockmgr invocation
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34072
2022-01-31 04:46:21 +02:00
Konstantin Belousov
0cdc603308 ufs: Use IS_SNAPSHOT()
Reviewed by:	markj, mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34072
2022-01-31 04:46:21 +02:00
Konstantin Belousov
3d68c4e175 syncer VOP_FSYNC(): unlock syncer vnode around call to VFS_SYNC()
The lock is unneccessary since the mount point is busied, which prevents
unmount and syncer vnode deallocation.  Having the vnode locked causes
innocent LoRs and complicates debugging.

Also stop starting write accounting around it.  Any caller of
VOP_FSYNC() must do it already, and sync_vnode() does.

Reported and tested by:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34072
2022-01-31 04:46:21 +02:00
Konstantin Belousov
5875b94c74 buf_alloc(): lock the buffer with LK_NOWAIT
The buffer must not be accessed by any other thread, it is freshly
allocated.  As such, LK_NOWAIT should be nop but also it prevents
recording the order between the buffer lock and any other locks we might
own in the call to getnewbuf().  In particular, if we own FFS snap lock,
it should avoid triggering false positive warning.

Reviewed by:	markj, mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34072
2022-01-31 04:46:21 +02:00
Konstantin Belousov
531f8cfea0 Use dedicated lock name for pbufs
Also remove a pointer to array variable, use array address directly.

Reviewed by:	markj, mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34072
2022-01-31 04:46:14 +02:00
Konstantin Belousov
9cd59de2e1 ext2fs: remove remnants of the UFS snapshot code
Noted and reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34095
2022-01-31 04:37:16 +02:00
Kirk McKusick
85f7e9a4f0 In GEOM debugging output, show consumer for cloned and duplicated bio's.
When using bio's created by g_clone_bio() or g_duplicate_bio()
their consumer device (the device to which their I/O requests
are sent) is listed by the geom debugging facility as [unknown].
If available, this update lists the consumer associated with
the bio's parent.

MFC after:    2 weeks
Sponsored by: Netflix
2022-01-30 17:21:13 -08:00
Gregory Neil Shapiro
e58d0869c6 Update commit instructions. Still more TBD as I plan out the first
git-based vendor import.
2022-01-30 22:20:12 +00:00
Ed Maste
42818aba8d ObsoleteFiles: move libelf.so.2 to MOVED_LIBS
5a536241ea moved it from /usr/lib to /lib.  This case is now handled
using MOVED_LIBS.

Reported by:	dim
Sponsored by:	The FreeBSD Foundation
2022-01-30 16:35:02 -05:00
Dimitry Andric
fdf2784101 Apply clang fix for assertion failure compiling science/chrono
Merge commit 6b0f35931a44 from llvm git (by Jennifer Yu):

  Fix signal during the call to checkOpenMPLoop.

  The root problem is a null pointer is accessed during the call to
  checkOpenMPLoop, because loop up bound expr is an error expression
  due to error diagnostic was emit early.

  To fix this, in setLCDeclAndLB, setUB and setStep instead return false,
  return true when LB, UB or Step contains Error, so that the checking is
  stopped in checkOpenMPLoop.

  Differential Revision: https://reviews.llvm.org/D107385

Note this only fixes the assertion reported in bug 261567; some other
tweaks for port dependencies are probably still required to make it
build to completion.

PR:		261567
MFC after:	3 days
2022-01-30 21:41:37 +01:00
Wolfram Schneider
33ee87fa0a improve error handling for corrupt database 2022-01-30 18:04:52 +00:00
Wolfram Schneider
5260fbcebd fix check for integer
For historical reasons, the integer is stored with an offset of plus 14.
That means, for a given max path length of 1024 the valid values
are -1009 .. 1037 and not -1023 .. 1023

PR: 201243
2022-01-30 16:27:27 +00:00
Wolfram Schneider
e7d6783f4a enable to set locate command 2022-01-30 16:24:49 +00:00
Wolfram Schneider
8e7c0a6d32 fix fgets error handling (from last commit) 2022-01-30 13:08:42 +00:00
Wolfram Schneider
72a0982cd5 improve error handling 2022-01-30 09:27:21 +00:00