Commit graph

256282 commits

Author SHA1 Message Date
Warner Losh
f19a4e97d3 newvers: tweak uname to be more useful
The current uname is branch-cXXXX-gHASH

Three changes to make uname more useful.
1. Move from using git rev-list --count to git rev-lis --count --first-parent
   since that gives a better, incrementing number.
2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of
   a hash and we've changed the sematnics of XXXXX
3. Remove g to make HASH cut and pastable.

Durting review, #1 & #3 had the largest consensus. There was a diversity of
opinion on #2, but on the whole it was positive so I'll acknowledge the dissent,
but move forward with something seems to have support since the dissent was all
about what letter to use where I chose 'n'.

MFC After: 3 days
Reviewed by: rgrimes, emaste (earlier version)
Differential Revision: https://reviews.freebsd.org/D28338

(cherry picked from commit 8a51f14a78)
2021-02-01 15:31:35 -07:00
Mitchell Horne
c415d0df47 bsdinstall: riscv-specific tweaks
Make the installer more useful, by allowing it to create a bootable
installation. Also, enable the menu option for ZFS-on-root.

Like arm64, RISC-V boots by UEFI only, so arm64's partedit
implementation is renamed and shared among the two platforms.

Reviewed by:	gjb

(cherry picked from commit 7b08a307e8)
2021-02-01 10:54:09 -04:00
Mitchell Horne
14640ac789 bsdinstall: create /efi/boot directory in ESP
If the installer is creating a new ESP, then this directory will not
exist and the subsequent cp will fail silently. This is usually of no
consequence if /efi/freebsd/loader.efi is set up correctly.

Reviewed by:	imp

(cherry picked from commit 676b7d077c)
2021-02-01 10:53:21 -04:00
Jamie Landeg-Jones
3728c4d314 diff: fix incorrectly displaying files as duplicates
When diff hits certain access errors, function diffreg() shows the error
message, and then returns to the calling function, which calls
print_status() with the return value.

However, in these cases, the return value isn't changed from the initial
default value of D_SAME.

Normally, print_status() with a value of D_SAME does nothing, so this
works out ok, however, if the "-s" flag is set, a message is displayed
showing identicality:

case D_SAME:
                if (sflag)
                        printf("Files %s%s and %s%s are identical\n",                                                                                                       path1, entry, path2, entry);
                break;

This then produces such results as:

% diff  -s /COPYRIGHT /var/run/rpcbind.sock
diff: /var/run/rpcbind.sock: Operation not supported
Files /COPYRIGHT and /var/run/rpcbind.sock are identical

% diff  -s /COPYRIGHT /etc/master.passwd
diff: /etc/master.passwd: Permission denied
Files /COPYRIGHT and /etc/master.passwd are identical

Create a D_ERROR status which is returned in such cases, and
print_status() then deals with that status seperately from D_SAME

PR:		252614
MFC after:	1 week

(cherry picked from commit fefb3c46a8)
2021-02-01 14:05:25 +01:00
Baptiste Daroussin
0702bf9c49 diff: add a test case for failed -s option
(cherry picked from commit 13860e71eb)
2021-02-01 14:05:24 +01:00
Mateusz Guzik
71b4605138 Drop temporary compat in setproctitle
(cherry picked from commit 46f168bc66)
2021-02-01 12:39:19 +00:00
Mateusz Guzik
006ec2ed15 cache: add trailing slash support
Tested by:	pho

(cherry picked from commit e027e24bfa)
2021-02-01 12:39:19 +00:00
Mateusz Guzik
6a3047840d cache: handle NOFOLLOW requests for symlinks
Tested by:	pho

(cherry picked from commit 8cbd164a17)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
be03df57d6 amd64: retire sse2_pagezero
All page zeroing is using temporal stores with rep movs*, the routine is
unused for several years.

Should a need arise for zeroing using non-temporal stores, a more
optimized variant can be implemented with a more descriptive name.

(cherry picked from commit d1de5698df)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
3975d4c9e1 amd64: add missing ALIGN_TEXT to loops in memset and memmove
(cherry picked from commit 164c3b8184)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
e5b674594e Reimplement strlen
The previous code neglected to use primitives which can find the end
of the string without having to branch on every character.

While here augment the somewhat misleading commentary -- strlen as
implemented here leaves performance on the table, especially so for
userspace. Every arch should get a dedicated variant instead.

In the meantime this commit lessens the problem.

Tested with glibc test suite.

Naive test just calling strlen in a loop on Haswell (ops/s):

$(perl -e "print 'A' x 3"):
before:	211198039
after:	338626619

$(perl -e "print 'A' x 100"):
before:	83151997
after:	98285919

(cherry picked from commit 710e45c4b8)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
2bf72739da poll: use fget_unlocked or fget_only_user when feasible
This follows select by eleminating the use of filedesc lock.
This is a win for single-threaded processes and a mixed bag for others
as at small concurrency it is faster to take the lock instead of
refing/unrefing each file descriptor.

Nonetheless, removal of shared lock usage is a step towards a
mtx-protected fd table.

(cherry picked from commit 45e1f85414)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
233225ef7d select: employ fget_only_user
Since most select users are single-threaded this avoid a lot of work
in the common case.

For example select of 16 fds (ops/s):
before:	2114536
after:	2991010

(cherry picked from commit 6affe1b712)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
1077e49657 fd: add fget_only_user
This can be used by single-threaded processes which don't share a file
descriptor table to access their file objects without having to
reference them.

For example select consumers tend to match the requirement and have
several file descriptors to inspect.

(cherry picked from commit eaad8d1303)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
569ac57608 cache: add missing MNT_NOSYMFOLLOW check to symlink traversal
(cherry picked from commit 5c325977b1)
2021-02-01 12:39:18 +00:00
Mateusz Guzik
e13587448a cache: fallback when encountering a mount point during .. lookup
The current abort is overzealous.

(cherry picked from commit 5fc384d181)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
dcba4f2b43 conf/kern.mk: save some work by using realpath instead of cd ; pwd
I did not check if the entire ordeal can be avoided in the first place.

(cherry picked from commit bcb7f57aa2)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
742285d283 cache: tidy up handling of foo/bar lookups where foo is not a directory
The code was performing an avoidable check for doomed state to account
for foo being a VDIR but turning VBAD. Now that dooming puts a vnode
in a permanent "modify" state this is no longer necessary as the final
status check will catch it.

(cherry picked from commit a098a831a1)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
82efef21d0 cache: stop referring to removing entries as invalidating them
Said use is a remnant from the old code and clashes with the NCF_INVALID
flag.

(cherry picked from commit a51eca7936)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
51927c36b8 cache: convert cache_fplookup_parse to void now that it always succeeds
(cherry picked from commit 6943671b48)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
1f28a3afe4 cache: change ->v_cache_dd synchronisation rules
Instead of resorting to seqc modification take advantage of immutability
of entries and check if the entry still matches after everything got
prepared.

(cherry picked from commit e7cf562a40)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
9375a93b6c cache: make ->v_cache_dd accesses atomic-clean for lockless usage
(cherry picked from commit 6f08427649)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
247f652e62 cache: make ->nc_flag accesses atomic-clean for lockless usage
(cherry picked from commit 6ef8fede86)
2021-02-01 12:39:17 +00:00
Mateusz Guzik
8a44ccd058 cache: store vnodes in local vars in cache_zap_locked
(cherry picked from commit ffcf8f97f8)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
872a0097fd tmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics
(cherry picked from commit c09f799271)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
7ba12ba0a2 zfs: use atomic_load_consume_ptr for z_cached_symlink
(cherry picked from commit 7af02ef0b2)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
e8d3e38845 vfs: use atomic_load_consume_ptr in vn_load_v_data_smr
(cherry picked from commit 8d2a230e99)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
fc301c224b atomic: add stub atomic_load_consume_ptr
(cherry picked from commit 054ce2b037)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
e92ab3adf4 atomic: make atomic_store_ptr type-aware
(cherry picked from commit cc96f92a57)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
dde453cf7d zfs: fix panics with invariant kernels from zfs_replay_setattr
(cherry picked from commit f40d6217f2)
2021-02-01 12:39:16 +00:00
Mateusz Guzik
aa411f6ba1 cache: assorted cleanups
(cherry picked from commit 868643e722)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
c700b1baba cache: track calls to cache_symlink_alloc with unsupported size
While here assert on size passed to free.

(cherry picked from commit 1c7a65adb0)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
3eae6412b5 libc: try to skip memcpy in _gettemp
(cherry picked from commit b22fdf45ff)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
410994f463 libc: remove open-coded strlen in _gettemp
(cherry picked from commit 6fe328ace8)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
996912046b libc: skip spurious stat in _gettemp
It was only done to catch ENOTDIR, but the kernel already returns the
error where appropriate.

(cherry picked from commit 97a463120b)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
ba0689009b cache: add back target entry on rename
(cherry picked from commit 02ec31bdf6)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
c5fcd06736 zfs: add support for lockless symlink lookup
Reviewed by:	kib (previous version)
Tested by:	pho (previous version)
Differential Revision:	https://reviews.freebsd.org/D27488

(cherry picked from commit 3110d4ebd6)
2021-02-01 12:39:15 +00:00
Mateusz Guzik
080f149046 tmpfs: add support for lockless symlink lookup
Reviewed by:	kib (previous version)
Tested by:	pho (previous version)
Differential Revision:	https://reviews.freebsd.org/D27488

(cherry picked from commit 618029af50)
2021-02-01 12:38:23 +00:00
Mateusz Guzik
afea6cb020 ufs: denote lack of support for lockless symlink lookup
It is unclear without investigating if it can be provided without using
extra memory, so for the time being just don't.

(cherry picked from commit c892d60a1d)
2021-02-01 12:38:23 +00:00
Mateusz Guzik
dcee996423 cache: add symlink support to lockless lookup
Reviewed by:	kib (previous version)
Tested by:	pho (previous version)
Differential Revision:	https://reviews.freebsd.org/D27488
2021-02-01 12:37:46 +00:00
Hans Petter Selasky
6bc1f84255 MFC 064009e794:
Add support for enabling and disabling IFCAP_VLAN_HWTSO via
ifconfig(8) in mlx5en(4).

Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 064009e794)
2021-02-01 10:25:16 +01:00
Hans Petter Selasky
22aca67268 MFC b8051298b0:
Fix missing value in uar_page field for ratelimit in mlx5en(4).
This is a regression issue after the new UAR API was introduced
by f8f5b459d2 .

Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit b8051298b0)
2021-02-01 10:23:25 +01:00
Bjoern A. Zeeb
b760436e13 firmware(9): extend firmware_get() by a "no warn" flag.
With the upcoming usage from LinuxKPI but also from drivers
ported natively we are seeing more probing of various
firmware (names).

Add the ability to firmware(9) to silence the
"firmware image loading/registering errors" by adding a new
firmware_get_flags() functions extending firmware_get() and
taking a flags argument as firmware_put() already does.

Requested-by:	zeising (for future LinuxKPI/DRM)
Sponsored-by:	The FreeBSD Foundation
Sponsored-by:	Rubicon Communications, LLC ("Netgate")
MFC after:	3 days
Reviewed-by:	markj
Differential Revision:	https://reviews.freebsd.org/D27413

(cherry picked from commit 6f65b50546)
2021-02-01 07:15:29 +00:00
Kyle Evans
b06fd805cc tmpfs: push VEXEC check into tmpfs_lookup()
vfs_cache_lookup() has already done the appropriate VEXEC check, therefore
we must not re-check in VOP_CACHEDLOOKUP.

This fixes O_SEARCH semantics on tmpfs and removes a redundant descent into
VOP_ACCESS() in the common case.

(cherry picked from commit 0f919ed4ae)
2021-01-31 23:42:30 -06:00
Alexander Motin
3f185aacc5 Decode NFIT Platform Capabilities.
(cherry picked from commit 1b109c69ed)
2021-01-31 20:53:23 -05:00
Alexander Motin
c060c19240 Add missing newlines.
(cherry picked from commit 8fee65d0c7)
2021-01-31 12:06:22 -05:00
Alexander Motin
38da7d23b6 Make software iSCSI more configurable.
Move software iSCSI tunables/sysctls into kern.icl.soft subtree.
Replace several hardcoded length constants there with variables.

While there, stretch the limits to better match Linux' open-iscsi
and our own initiator with new MAXPHYS of 1MB.  Our CTL target is
also optimized for up to 1MB I/Os, so there is also a match now.
For Windows 10 and VMware 6.7 initiators at default settings it
should make no change, since previous limits were sufficient there.

Tests of QD1 1MB writes from FreeBSD over 10GigE link show throughput
increase by 29% on idle connection and 132% with concurrent QD8 reads.

Sponsored by:	iXsystems, Inc.

(cherry picked from commit b75168ed24)
2021-01-31 12:05:12 -05:00
Emmanuel Vadot
7ba4d0f829 release: ROCKPRO64: Remove the quirk that disable the big cores
It's not needed anymore.

(cherry picked from commit 183d6cc0e0)
2021-01-31 14:57:59 +01:00
Vincenzo Maffione
e4c81e46ac netmap: simplify parameter passing
Changes imported from the netmap github.

(cherry picked from commit ee0005f11f)
2021-01-31 08:53:06 +00:00
Vincenzo Maffione
a8ca736bb4 iflib: netmap: move per-packet operation out of fragments loop
MFC after:	1 week

(cherry picked from commit f80efe5016)
2021-01-31 08:52:57 +00:00