Commit graph

135932 commits

Author SHA1 Message Date
Marcin Wojtas
cd925aaa73 marvell: ap806_clock: add missing frequency modes
In the driver init routine the CPU clock frequency
value is obtained from a dedicated register. Until now
only part of the values were handled by the mv_ap806_clock
driver. Fix that by adding missing cases.

Submitted by: Zyta Szpak <zr@semihalf.com>
MFC after: 1 week
Obtained from: Semihalf
Sponsored by: Marvell

(cherry picked from commit a86b0839d7)
2021-02-02 13:28:35 +01:00
Bjoern A. Zeeb
4d85bfa412 __FreeBSD_version: update the references to the doc tree
Update the reference of which file to update in the doc tree when
bumping __FreeBSD_version.

(cherry picked from commit abd619045a)
2021-02-02 11:54:30 +00:00
Bjoern A. Zeeb
91a07ed50f Bump __FreeBSD_version for multiple LinuxKPI updates conflicting
with DRM.  Be sure to update your drm-kmod port to after the update.

Sponsored-by:	The FreeBSD Foundation
2021-02-02 11:52:50 +00:00
Bjoern A. Zeeb
ff119f7c4a LinuxKPI: implement devres() framework parts and two examples
This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
case.
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with
DRM.

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi
MFC After:	3 days
Reviewed-by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D28189

(cherry picked from commit fa765ca73e)
2021-02-02 11:51:26 +00:00
Bjoern A. Zeeb
3ac9e87b76 LinuxKPI: enhance PCI bits for DRM
In pci_domain_nr() directly return the domain which got set in
lkpifill_pci_dev() in all cases.  This was missed between D27550
and 105a37cac7 .

In order to implement pci_dev_put() harmonize further code
(which was started in the aforementioned commit) and add kobj
related bits (through the now common lkpifill_pci_dev() code)
to the DRM specific calls without adding the DRM allocated
pci devices to the pci_devices list.
Add a release for the lkpinew_pci_dev() (DRM) case so freeing
will work.
This allows the DRM created devices to use the normal kobj/refcount
logic and work with, e.g., pci_dev_put().
(For a slightly more detailed code walk see the review).

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi (partially)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28188

(cherry picked from commit 1fac2cb4d6)
2021-02-02 11:51:20 +00:00
Bjoern A. Zeeb
ec06521ee8 LinuxKPI: upstream a collection of drm-kmod conflicting changes
The upcoming in-kernel implementations for LinuxKPI based on work on
iwlwifi (and other wireless drivers) conflicts in a few places with
the drm-kmod graphics work outside the base system.

In order to transition smoothly extract the conflicting bits.
This included "unaligned" accessor functions, sg_pcopy_from_buffer(),
IS_*() macros (to be further restricted in the future), power management
bits (possibly no longer conflicting with DRM), and other minor changes.

Obtained-from:  bz_iwlwifi
Sponsored-by:   The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	kib, hselasky, manu, bdragon (looked at earlier versions)
Differential Revision: https://reviews.freebsd.org/D26598

(cherry picked from commit 4abbf816bf)
2021-02-02 11:51:15 +00:00
Bjoern A. Zeeb
ffd05df717 LinuxKPI: add firmware loading support
Implement linux firmware KPI compat code.
This includes: request_firmware() request_firmware_nowait(),
request_firmware_direct(), firmware_request_nowarn(),
and release_firmware().

Given we will try to map requested names from natively ported
or full-linuxkpi-using drivers to a firmware(9) auto-loading
name format (.ko file name and image name matching),
we quieten firmware(9) and print success or failure (unless
the _nowarn() version was called) in the linuxkpi implementation.
At the moment we try up-to 4 different naming combinations,
with path stripped, original name, and requested name with '/'
or '.' replaced.

We do not currently defer loading in the "nowait" case.

Sponsored-by:	The FreeBSD Foundation
Sponsored-by:	Rubicon Communications, LLC ("Netgate")
		(firmware(9) nowarn update from D27413)
MFC after:	3 days
Reviewed by:	kib, manu (looked at older versions)
Differential Revision:	https://reviews.freebsd.org/D27414

(cherry picked from commit a6c2507d1b)
(cherry picked from commit 4a26380ba6)
2021-02-02 11:50:38 +00:00
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
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
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
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
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
Vincenzo Maffione
e0e00874a3 iflib: netmap: add support for NS_MOREFRAG
The NS_MOREFRAG flag can be set in a netmap slot to represent a
multi-fragment packet. Only the last fragment of a packet does
not have the flag set. On TX rings, the flag may be set by the
userspace application. The kernel will look at the flag and use it
to properly set up the NIC TX descriptors.
On RX rings, the kernel may set the flag if the packet received
was split across multiple netmap buffers. The userspace application
should look at the flag to know when the packet is complete.

Submitted by:	rajesh1.kumar_amd.com
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27799

(cherry picked from commit aceaccab65)
2021-01-31 08:52:45 +00:00
Vincenzo Maffione
7754ef5a37 axgbe: fix some link related issues
By default, axgbe driver does a receiver reset after predefined number
of retries for the link to come up. However, this receiver reset
doesn't always suffice, due to an hardware issue.
In that case, as a workaround, a complete phy reset is necessary.
This patch introduces a sysctl that can be set to 1 to let the driver
reset the phy completely, rather than just doing receiver reset.
The workaround will be removed once the issue is fixed by means
of firmware update.

This patch also fixes the handling of the direct attach cables
properly.

Submitted by:	rajesh1.kumar_amd.com
Differential Revision:	https://reviews.freebsd.org/D28266

(cherry picked from commit bfd75d4557)
2021-01-31 08:47:36 +00:00
Cy Schubert
2ef3f7f5c3 MFC 0e01ea872e:
Fix a typo.

(cherry picked from commit 0e01ea872e)
2021-01-30 20:28:06 -08:00