]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agorc.conf(5): describe devmatch rc variables
Mitchell Horne [Sun, 10 Jan 2021 20:53:59 +0000 (16:53 -0400)]
rc.conf(5): describe devmatch rc variables

Reviewed by: imp, gbe (manpages)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28048

3 years agocgem: add 64-bit support
Thomas Skibo [Sun, 10 Jan 2021 20:18:41 +0000 (16:18 -0400)]
cgem: add 64-bit support

Add 64-bit address support to Cadence CGEM Ethernet driver for use in
other SoCs such as the Zynq UltraScale+ and SiFive HighFive Unleashed.

Reviewed by: philip, 0mp (manpages)
Differential Revision: https://reviews.freebsd.org/D24304

3 years agoPrefer the use of vm_page_domain() to vm_phys_domain().
Alan Cox [Sun, 10 Jan 2021 08:51:33 +0000 (02:51 -0600)]
Prefer the use of vm_page_domain() to vm_phys_domain().

When we already have the vm page in hand, use vm_page_domain() instead
of vm_phys_domain().  The former has a trivial constant-time
implementation whereas the latter iterates over the mem_affinity array.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D28005

3 years agohid: Add recently imported drivers to NOTES
Vladimir Kondratyev [Sat, 9 Jan 2021 12:07:19 +0000 (15:07 +0300)]
hid: Add recently imported drivers to NOTES

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D28060

3 years agohid: fix extraneous SYSCTL_ADD_INT() options revealed by LINT build
Vladimir Kondratyev [Sat, 9 Jan 2021 12:06:01 +0000 (15:06 +0300)]
hid: fix extraneous SYSCTL_ADD_INT() options revealed by LINT build

Reviewed by: hselasky (as part of D28060)

3 years agore: netmap: enable/disable krings on interface reinit
Vincenzo Maffione [Sun, 10 Jan 2021 15:09:05 +0000 (15:09 +0000)]
re: netmap: enable/disable krings on interface reinit

This prevents krings from being used during an interface
reset, and notifies the active applications.
See also 1d238b07d5d4d9660ae0.

MFC after:      1 week

3 years agoiflib: fix build failure in case DEV_NETMAP is not defined
Vincenzo Maffione [Sun, 10 Jan 2021 14:42:49 +0000 (14:42 +0000)]
iflib: fix build failure in case DEV_NETMAP is not defined

This addresses the build failure introduced by
3d65fd97e85ab807f3baa62.

MFC with: 3d65fd97e85ab807f3baa62

3 years agonetmap: vtnet: enable/disable krings on any interface reinit
Vincenzo Maffione [Sun, 10 Jan 2021 14:09:00 +0000 (14:09 +0000)]
netmap: vtnet: enable/disable krings on any interface reinit

See 3d65fd97e85ab807f3b for a detailed explanation.

PR:             252453
MFC after:      1 week

3 years agoiflib: add assert to prevent out-of-bounds array access
Vincenzo Maffione [Sun, 10 Jan 2021 13:49:51 +0000 (13:49 +0000)]
iflib: add assert to prevent out-of-bounds array access

The iflib_queues_alloc() allocates isc_nrxqs iflib_dma_info structs
for each rxqset, and links each struct to a different free list.
As a result, it must be isc_nrxqs >= isc_nfl (plus the completion
queue, if present).
Add an assertion to make this constraint explicit.

MFC after: 2 weeks

3 years agoTrack pipe(2) reads and writes as rusage message receives and sends, a
Robert Watson [Fri, 1 Jan 2021 13:04:46 +0000 (13:04 +0000)]
Track pipe(2) reads and writes as rusage message receives and sends, a
feature misplaced during the transition from BSD 4.4's socket implementation
to the optimised FreeBSD pipe implementation.

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

3 years agonetmap: iflib: enable/disable krings on any interface reinit
Vincenzo Maffione [Sun, 10 Jan 2021 12:00:30 +0000 (12:00 +0000)]
netmap: iflib: enable/disable krings on any interface reinit

Since 1d238b07d5d4d9660ae0e0, krings are disabled before
a reinit cycle triggered by iflib_netmap_register.
However, this operation is actually necessary also for
any interface reinit triggered by other causes (i.e.,
ifconfig commands).
We achieve this goal by moving the krings enable/disable
operation inside iflib_stop() and iflib_init_locked().

Once here, this change also removes some redundant operations
from iflib_netmap_register(), that are already performed by
iflib_stop().

PR: 252453
MFC after: 1 week

3 years agofileargs: add support for realpath
Mariusz Zaborski [Sun, 10 Jan 2021 11:44:06 +0000 (12:44 +0100)]
fileargs: add support for realpath

3 years agolibc: implement rtld_get_stack_prot() for real
Konstantin Belousov [Sun, 10 Jan 2021 03:05:42 +0000 (05:05 +0200)]
libc: implement rtld_get_stack_prot() for real

which makes stack prot correct for non-main threads created by binaries
with statically linked libthr.

Cache result, but do not engage into the full double-checked locking,
since calculation of the return value is idempotent.

PR: 252549
Reported and reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28075

3 years agojail: Simplify handling of prison_deref()
Jamie Gritton [Sun, 10 Jan 2021 05:05:06 +0000 (21:05 -0800)]
jail: Simplify handling of prison_deref()

Track the the current lock/reference state in a single variable,
rather than deducing the proper prison_deref() flags from a
combination of equations and hard-coded values.

3 years agotmpfs open: assert that there is no double-init of f_data.
Konstantin Belousov [Thu, 7 Jan 2021 16:34:02 +0000 (18:34 +0200)]
tmpfs open: assert that there is no double-init of f_data.

Sponsored by: The FreeBSD Foundation

3 years agotmpfs_free_tmp(): explicitly assert that tmp is locked
Konstantin Belousov [Tue, 5 Jan 2021 18:53:45 +0000 (20:53 +0200)]
tmpfs_free_tmp(): explicitly assert that tmp is locked

Despite TMPFS_UNLOCK() is done in both paths later, unlocking not locked
mutex provides different failure mode.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agotmpfs: make M_TMPFSMNT static to tmpfs_vfsops.c
Konstantin Belousov [Tue, 5 Jan 2021 18:52:42 +0000 (20:52 +0200)]
tmpfs: make M_TMPFSMNT static to tmpfs_vfsops.c

This malloc type is only used in this file.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agox86 vdso gettc: Add RDTSCP support
Konstantin Belousov [Wed, 6 Jan 2021 15:05:09 +0000 (17:05 +0200)]
x86 vdso gettc: Add RDTSCP support

Detect and use RDTSCP if available, instead of fence+RDTSC.  For AMD Zens+,
use LFENCE+RDTSC instead of RDTSCP (or MFENCE;RDTSC previously).

Reviewed by: gallatin, markj
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

3 years agox86 vdso gettc: eliminate duplicated code in ifunc selectors.
Konstantin Belousov [Wed, 6 Jan 2021 15:00:48 +0000 (17:00 +0200)]
x86 vdso gettc: eliminate duplicated code in ifunc selectors.

Create array of rdtsc selectors and provide helper that calculate the
index into the selectors array.

Reviewed by: gallatin, markj
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D27986

3 years agox86 vdso gettc: reorganize ifunctions.
Konstantin Belousov [Tue, 5 Jan 2021 21:14:11 +0000 (23:14 +0200)]
x86 vdso gettc: reorganize ifunctions.

Instead of providing ifuncs for each kind of fence, define ifuncs
that combine fence and invocation of RDTSC.  This refactoring makes
introduction of RDTSCP use possible.

Reviewed by: gallatin, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

3 years agotsc: add RDTSCP or faster variants of get_timecount()
Konstantin Belousov [Tue, 5 Jan 2021 21:00:14 +0000 (23:00 +0200)]
tsc: add RDTSCP or faster variants of get_timecount()

Use it in preference of Xfenced RDTSC if RDTSCP is supported. It is
recommended by both Intel and AMD. But, on AMD Zens and newer use
LFENCE, as recommended by AMD [*]. In particular, this means that now
AMD CPUs use more appropriate fence instead of too harsh MFENCe.

Add comment explaining the intent of the selection logic.

Reported by: gallatin [*]
Reviewed by: gallatin, markj
Tested by: gallatin, pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

3 years agox86: Add rdtscp32() into cpufunc.h.
Konstantin Belousov [Sat, 9 Jan 2021 20:39:19 +0000 (22:39 +0200)]
x86: Add rdtscp32() into cpufunc.h.

Suggested by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

3 years agotsc: use u_int for return type for prototype, same as in definitions.
Konstantin Belousov [Tue, 5 Jan 2021 20:44:10 +0000 (22:44 +0200)]
tsc: use u_int for return type for prototype, same as in definitions.

Reviewed by: gallatin, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

3 years agox86 identcpu.c: fix formatting of the comment.
Konstantin Belousov [Wed, 6 Jan 2021 14:52:27 +0000 (16:52 +0200)]
x86 identcpu.c: fix formatting of the comment.

Reviewed by: gallatin, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27986

3 years agojobc: rework detection of orphaned groups.
Konstantin Belousov [Tue, 29 Dec 2020 00:41:56 +0000 (02:41 +0200)]
jobc: rework detection of orphaned groups.

Instead of trying to maintain pg_jobc counter on each process group
update (and sometimes before), just calculate the counter when needed.
Still, for the benefit of the signal delivery code, explicitly mark
orphaned groups as such with the new process group flag.

This way we prevent bugs in the corner cases where updates to the counter
were missed due to complicated configuration of p_pptr/p_opptr/real_parent
(debugger).

Since we need to iterate over all children of the process on exit, this
change mostly affects the process group entry and leave, where we need
to iterate all process group members to detect orpaned status.

(For MFC, keep pg_jobc around but unused).

Reported by: jhb
Reviewed by: jilles
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agokinfo_proc: move job-control related data collection into a new helper.
Konstantin Belousov [Thu, 31 Dec 2020 22:46:20 +0000 (00:46 +0200)]
kinfo_proc: move job-control related data collection into a new helper.

This improves code structure and allows to put the lock asserts right
into place where the locks are needed.

Also move zeroing of the kinfo_proc structure from fill_kinfo_proc_only()
to fill_kinfo_proc(), this looks more symmetrical.

Reviewed by: jilles
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agoLock proctree in around fill_kinfo_proc().
Konstantin Belousov [Thu, 31 Dec 2020 22:29:40 +0000 (00:29 +0200)]
Lock proctree in around fill_kinfo_proc().

Proctree lock is needed for correct calculation and collection of the
job-control related data in kinfo_proc.  There was even an XXX comment
about it.

Satisfy locking and lock ordering requirements by taking proctree lock
around pass over each bucket in proc_iterate(), and in sysctl_kern_proc()
and note_procstat_proc() for individual process reporting.

Reviewed by: jilles
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agotty_wait_background: improve locking.
Konstantin Belousov [Thu, 31 Dec 2020 13:45:06 +0000 (15:45 +0200)]
tty_wait_background: improve locking.

Increase the scope of the process group lock ownership.  This ensures that
we are consistent in returning EIO for tty write from an orphan and delivery
of TTYOUT signals.

Reviewed by: jilles
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agopgrp: Prevent use after free.
Konstantin Belousov [Thu, 31 Dec 2020 13:44:32 +0000 (15:44 +0200)]
pgrp: Prevent use after free.

Often, we have a process locked and need to get locked process group.
In this case, because progress group lock is before process lock,
unlocking process allows the group to be freed.  See for instance
tty_wait_background().

Make pgrp structures allocated from nofree zone, and ensure type stability
of the pgrp mutex.

Reviewed by: jilles
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agoissignal(): when handling STOP-like signals, drop sigacts mutex earlier.
Konstantin Belousov [Thu, 31 Dec 2020 01:45:12 +0000 (03:45 +0200)]
issignal(): when handling STOP-like signals, drop sigacts mutex earlier.

Reviewed by: jilles
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agoStyle. Improve some KASSERTs messages.
Konstantin Belousov [Thu, 31 Dec 2020 00:45:47 +0000 (02:45 +0200)]
Style.  Improve some KASSERTs messages.

Reviewed by: jilles
Tested by: pho
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

3 years agoamd64 pmap: add comment explaining TLB invalidation modes.
Konstantin Belousov [Mon, 21 Dec 2020 17:51:02 +0000 (19:51 +0200)]
amd64 pmap: add comment explaining TLB invalidation modes.

Requested and reviewed by: alc
Discussed with: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25815

3 years agoaio: fix the tests when ZFS is not available
Alan Somers [Sun, 10 Jan 2021 00:14:55 +0000 (17:14 -0700)]
aio: fix the tests when ZFS is not available

Don't try to cleanup the zpool if we couldn't create a zpool in the
first place.

Submitted by: tmunro
MFC-with: 022ca2fc7fe08d51f33a1d23a9be49e6d132914e

3 years agolinuxkpi: Fix the "error: unknown type name 'u32'" compilation issue when
Neel Chauhan [Sat, 9 Jan 2021 23:25:55 +0000 (15:25 -0800)]
linuxkpi: Fix the "error: unknown type name 'u32'" compilation issue when
building the Intel QAT/QuickAssist driver.

Approved by: hselasky, kib
Differential Revision: https://reviews.freebsd.org/D28055

3 years agonetmap: vtnet: stop krings during interface reset
Vincenzo Maffione [Sat, 9 Jan 2021 22:34:10 +0000 (22:34 +0000)]
netmap: vtnet: stop krings during interface reset

Similarly to what done for iflib in 1d238b07d5d4d9660ae0e,
this patch prevents access to the krings during the interface
reset triggered by netmap_register().

MFC after: 1 week

3 years agonetmap: refactor netmap_reset
Vincenzo Maffione [Sat, 9 Jan 2021 22:07:24 +0000 (22:07 +0000)]
netmap: refactor netmap_reset

The netmap_reset() function is meant to be called by the driver
when they initialize (or re-initialize) a hardware ring.
However, since the introduction of support for opening (in
netmap mode) a subset of the available rings, netmap_reset()
may be called multiple times on actively used rings, causing
both kring and netmap ring to transition to an inconsistent
state.
This changes improves the situation by resetting all the
indices fields of the kring to 0, as expected after the
reinitialization of a hardware ring.

PR:     252518
MFC after:  1 week

3 years agonetmap: iflib: fix asserts in netmap_fl_refill()
Vincenzo Maffione [Sat, 9 Jan 2021 21:35:07 +0000 (21:35 +0000)]
netmap: iflib: fix asserts in netmap_fl_refill()

When netmap_fl_refill() is called at initialization time (e.g.,
during netmap_iflib_register()), nic_i must be 0, since the
free list is reinitialized. At the end of the refill cycle, nic_i
must still be zero, because exactly N descriptors (N is the ring size)
are refilled.
This patch therefore fixes the assertions to check on nic_i rather
than on nm_i. The current netmap_reset() may in fact cause nm_i
to be != 0 while the device is resetting: this may happen when
multiple non-cooperating processes open different subsets of the
available netmap rings.

PR:     252518
MFC after:  1 week

3 years agonetmap: iflib: stop krings during interface reset
Vincenzo Maffione [Sat, 9 Jan 2021 20:54:11 +0000 (20:54 +0000)]
netmap: iflib: stop krings during interface reset

When different processes open separate subsets of the
available rings of a same netmap interface, a device
reset may be performed while one of the processes
is actively using some rings (e.g., caused by another
process executing a nmport_open()).
With this patch, such situation will cause the
active process to get a POLLERR, so that it can
have a chance to detect the situation.
We also guarantee that no process is running a txsync
or rxsync (ioctl or poll) while an iflib device reset
is in progress.

PR:     252453
MFC after:  1 week

3 years agofileargs: add tests
Mariusz Zaborski [Sat, 9 Jan 2021 20:56:09 +0000 (21:56 +0100)]
fileargs: add tests

3 years agotcp: don't use KTLS socket option on listening sockets
Michael Tuexen [Fri, 8 Jan 2021 07:51:39 +0000 (08:51 +0100)]
tcp: don't use KTLS socket option on listening sockets

KTLS socket options make use of socket buffers, which are not
available for listening sockets.

Reported by: syzbot+a8829e888a93a4a04619@syzkaller.appspotmail.com
Reviewed by: jhb@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D27948

3 years agoarm: revert MAXDSIZ change from 202aea9c82ea
Kyle Evans [Sat, 9 Jan 2021 20:14:00 +0000 (14:14 -0600)]
arm: revert MAXDSIZ change from 202aea9c82ea

This imposes a fairly severe limitation on space available for mmap that
was not noticed prior to commit. Unfixed mmap will only map from
[data + MAXSIZE, end of user VA space], bringing the amount of usable space
down way too low for non-trivial link jobs (for instance).

Reported by: mmel

3 years agokevent(2): Bugfix for wrong EVFILT_TIMER timeouts
Jan Kokemüller [Sat, 9 Jan 2021 19:00:25 +0000 (20:00 +0100)]
kevent(2): Bugfix for wrong EVFILT_TIMER timeouts

When using NOTE_NSECONDS in the kevent(2) API, US_TO_SBT should be
used instead of NS_TO_SBT, otherwise the timeout results are
misleading.

PR: 252539
Reviewed by: kevans, kib
Approved by: kevans
MFC after: 3 weeks

3 years agoldd: renumber executable type constants
Ed Maste [Sat, 9 Jan 2021 18:34:58 +0000 (13:34 -0500)]
ldd: renumber executable type constants

ldd had #defines for AOUT, ELF, and ELF32.  The removal of AOUT left a
possibly confusing gap.  These are not used anywhere but this file so
renumber to avoid the gap.

Reported by: allanjude

3 years agodiff: honour flags with -q
Ed Maste [Sat, 9 Jan 2021 16:22:28 +0000 (11:22 -0500)]
diff: honour flags with -q

Previously -q (just print a line when files differ) ignored flags like
-w (ignore whitespace).  Avoid the D_BRIEF short-circuit when flags are
in effect.

PR: 252515
Reported by: Scott Aitken
Reviewed by: kevans
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28064

3 years agosysctl: improve debug.kdb.panic_str description
Warner Losh [Sat, 9 Jan 2021 18:10:42 +0000 (11:10 -0700)]
sysctl: improve debug.kdb.panic_str description

Improve the wording for this sysctl.

Submitted by: rpokala@

3 years agolast(1): Add EXAMPLES section
Fernando Apesteguía [Sat, 9 Jan 2021 17:28:23 +0000 (18:28 +0100)]
last(1): Add EXAMPLES section

Add two simple examples showing the use of the flags: d, n, s, t
While here, reorder cross references properly by section
Bump .Dd

Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D27540

last(1): Bump .Dd

3 years agoman(1): Bump .Dd
Fernando Apesteguía [Sat, 9 Jan 2021 17:22:08 +0000 (18:22 +0100)]
man(1): Bump .Dd

From commit df965a6829f058b7a9999c39bc229616520645c2

3 years agoman(1): Add EXAMPLES section
Fernando Apesteguía [Sat, 9 Jan 2021 16:55:21 +0000 (17:55 +0100)]
man(1): Add EXAMPLES section

Add some examples showing the use of the flags: a, k, P, w

Reviewed by: gbe@, yuripv@
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D27545

3 years agomvneta: Acquire the softc lock before clearing the MIB
Mark Johnston [Sat, 9 Jan 2021 15:03:46 +0000 (10:03 -0500)]
mvneta: Acquire the softc lock before clearing the MIB

Reported by: Andrei Martin <andrei.cos.martin@gmail.com>
MFC with: caf552a60719

3 years agoAdd fib lookup testing module.
Alexander V. Chernikov [Sat, 9 Jan 2021 12:55:04 +0000 (12:55 +0000)]
Add fib lookup testing module.

This module intended to measure performance of routing lookups.

Uses a list of IP addresses specified by sysctl one-by-one.
Performance testing is triggered by changing sysctl OID with a number of lookups to execute.
Lookups are done by the chunks of 10K routes, entering/exiting epoch on
 chunk granularity to amortise cost.

Example:
make -C sys/modules/test/fib_lookup unload load
for i in `cat ~/ip4.txt`; do sysctl net.route.test.add_inet_addr=$i; done
for i in `cat ~/ip6.txt`; do sysctl net.route.test.add_inet6_addr=$i; done

sysctl net.route.test.run_inet=10000000

dmesg | tail

Dec 13 23:24:05 current kernel: 10000000 packets in 417240173 nanoseconds, 23967011 pps
Dec 13 23:24:06 current kernel: run: 10000000 packets vnet 0xfffff80003073f00
Dec 13 23:24:07 current kernel: 10000000 packets in 423086254 nanoseconds, 23635842 pps

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

3 years agoBring DPDK route lookups to FreeBSD.
Alexander V. Chernikov [Sat, 9 Jan 2021 12:08:00 +0000 (12:08 +0000)]
Bring DPDK route lookups to FreeBSD.

This change introduces loadable fib lookup modules based on
 DPDK rte_lpm lib targeted for high-speed lookups in large-scale tables.
It is based on the lookup framework described in D27401.

IPv4 module is called dpdk_lpm4. It wraps around rte_lpm [1] library.
This library implements variation of DIR24-8 [2] lookup algorithm.
Module provide lockless route lookups and in-place incremental updates,
 allowing for good RIB performance.

IPv6 module is called dpdk_lpm6. It wraps around rte_lpm6 [3] library.
Implementation can be seen as multi-bit trie where the stride or number of bits
 inspected on each level varies from level to level.
It can vary from 1 to 14 memory accesses, with 5 being the average value
 for the lengths that are most commonly used in IPv6.
Module provide lockless route lookups for global unicast addresses
 and in-place incremental updates, allowing for good RIB performance.

Implementation details:
* wrapper code lives in `sys/contrib/dpdk_rte_lpm/dpdk_lpm[6].c`.
* rte_lpm[6] implementation contains both RIB and FIB code.
 . RIB ("rule_") code, backed by array of hash tables part has been commented out,
 as base radix already provides all the necessary primitives.
* link-local lookups are currently implemented as base radix lookup.
 This part should be converted to something like read-only radix trie.

Usage detail:
Compile kernel with option FIB_ALGO and load dpdk_lpm4/dpdk_lpm6
 module at any time. They will be picked up automatically when
 amount of routes raises to several thousand.

[1]: https://doc.dpdk.org/guides/prog_guide/lpm_lib.html
[2]: http://yuba.stanford.edu/~nickm/papers/Infocom98_lookup.pdf
[3]: https://doc.dpdk.org/guides/prog_guide/lpm6_lib.html

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

3 years agoFix LINT kernel build after 01f2e864f79584c0cd250a8e7cfb501a9985768a.
Hans Petter Selasky [Sat, 9 Jan 2021 09:48:13 +0000 (10:48 +0100)]
Fix LINT kernel build after 01f2e864f79584c0cd250a8e7cfb501a9985768a.

Differential revision: https://reviews.freebsd.org/D27893
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agocertctl: factor out certname resolution
Kyle Evans [Sat, 9 Jan 2021 04:34:44 +0000 (22:34 -0600)]
certctl: factor out certname resolution

create_blacklisted() will identify a cert whether it's provided a path to
a cert or the hash.serial format that is shown by `certctl list`.

Factor this logic out into a resolve_certname() so that it may be reused
elsewhere.

3 years agocertctl: replace hardcoded uses of /usr/local
Kyle Evans [Sat, 9 Jan 2021 04:00:41 +0000 (22:00 -0600)]
certctl: replace hardcoded uses of /usr/local

Use the new user.localbase sysctl here as well, to reduce the number of
hardcoded localbase by one (1).

MFC after: 3 days (note: just use a literal /usr/local default)

3 years agofix big-endian platforms after 6733401935f8
Chuck Tuffli [Fri, 8 Jan 2021 22:36:37 +0000 (14:36 -0800)]
fix big-endian platforms after 6733401935f8

The NVMe byte-swap routines for big-endian platforms used memcpy() to
move the unaligned 64-bit value into a temp register to byte swap it.
Instead of introducing a dependency, manually byte-swap the values in
place.

Point hat: me

3 years agoFix 32-bit build post 6733401935f83754b4b2744bc3d33ef84b1271e0
Dimitry Andric [Fri, 8 Jan 2021 22:38:21 +0000 (23:38 +0100)]
Fix 32-bit build post 6733401935f83754b4b2744bc3d33ef84b1271e0

The general style in sbin/nvmecontrol apppears to print uint64_t types
using %j, so I'm using that instead of the more general (but admittedly
ugly) PRIu64.

3 years agodtrace: Fix /"string" == NULL/ comparisons using an uninitialized value.
Bryan Drewery [Fri, 18 Dec 2020 17:58:03 +0000 (09:58 -0800)]
dtrace: Fix /"string" == NULL/ comparisons using an uninitialized value.

A test of this is funcs/tst.strtok.d which has this filter:

    BEGIN
    /(this->field = strtok(this->str, ",")) == NULL/
    {
            exit(1);
    }
The test will randomly fail with exit status of 1 indicating that this->field
was NULL even though printing it out shows it is not.

This is compiled to the DTrace instruction set:
    // Pushed arguments not shown here
    // call strtok() and set result into %r1
    07: 2f001f01    call DIF_SUBR(31), %r1          ! strtok
    // set thread local scalar this->field from %r1
    08: 39050101    stls %r1, DT_VAR(1281)          ! DT_VAR(1281) = "field"
    // Prepare for the == comparison
    // Set right side of %r2 to NULL
    09: 25000102    setx DT_INTEGER[1], %r2         ! 0x0
    // string compare %r1 (strtok result) to %r2
    10: 27010200    scmp %r1, %r2

In this case only %r1 is loaded with a string limit set to lim1.  %r2 being
NULL does not get loaded and does not set lim2.  Then we call dtrace_strncmp()
with MIN(lim1, lim2) resulting in passing 0 and comparing neither side.
dtrace_strncmp() handles this case fine and it already has been while
being lucky with what lim2 was [un]initialized as.

Reviewed by: markj, Don Morris <dgmorris AT earthlink.net>
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27671

3 years agobsd.compat.mk: Allow finding non-internal libraries
Bryan Drewery [Wed, 16 Dec 2020 22:06:15 +0000 (14:06 -0800)]
bsd.compat.mk: Allow finding non-internal libraries

Currently only libexec/rtld-elf32 uses internal LIBC_NOSSP_PIC during
the build but it gets it directly from the objdir rather than a sysroot.
For example, /usr/obj/usr/src/amd64.amd64/obj-lib32/lib/libc/libc_nossp_pic.a.
We don't stage lib32 libraries in WORLDTMP/usr/lib32 and doing so doesn't
buy much.  If we want to use a staged lib32 library then we need to look in
LIBCOMPATTMP where they were staged.  For example if LIBC_PIC were wanted then
look for /usr/obj/usr/src/amd64.amd64/obj-lib32/tmp/usr/lib32/libc_pic.a.

Reported by: rlibby
Reviewed by: rlibby
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27648

3 years agoMakefile.inc1: Avoid using release/Makefile for VERSION.
Bryan Drewery [Wed, 16 Dec 2020 20:34:38 +0000 (12:34 -0800)]
Makefile.inc1: Avoid using release/Makefile for VERSION.

release/Makefile.inc1 has git executions that were being ran for each of
these lookups.  The results were not needed so just lookup what we want
directly instead.

Reviewed by: gjb, rlibby, emaste (maybe)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27643

3 years agosifive_uart: quiet GCC -Werror=parentheses
Mitchell Horne [Fri, 8 Jan 2021 21:06:11 +0000 (17:06 -0400)]
sifive_uart: quiet GCC -Werror=parentheses

Add an additional set of braces to clarify intention. The '&' operator
has a higher precedence than '|', but the reader may not always remember
this. No functional change.

3 years agosysctl: implement debug.kdb.panic_str
Warner Losh [Fri, 8 Jan 2021 16:34:31 +0000 (09:34 -0700)]
sysctl: implement debug.kdb.panic_str

This is just like debug.kdb.panic, except the string that's passed in
is reported in the panic message. This allows people with automated
systems to collect kernel panics over a large fleet of machines to
flag panics better. Strings like "Warner look at this hang" or "see
JIRA ABC-1234 for details" allow these automated systems to route the
forced panic to the appropriate engineers like you can with other
types of panics. Other users are likely possible.

Relnotes: Yes
Sponsored by: Netflix
Reviewed by: allanjude (earlier version)
Suggestions from review folded in by: 0mp, emaste, lwhsu
Differential Revision: https://reviews.freebsd.org/D28041

3 years agoi386 kernel is not built with vt_vbefb
Toomas Soome [Fri, 8 Jan 2021 18:57:00 +0000 (20:57 +0200)]
i386 kernel is not built with vt_vbefb

Add vt_vbefb to GENERIC and NOTES

3 years agolinuxkpi: handle ARI
Konstantin Belousov [Mon, 4 Jan 2021 21:41:12 +0000 (23:41 +0200)]
linuxkpi: handle ARI

Stop trying to manually calculate RID, which cannot be done correctly
by PCI_DEVFN().  Use PCI_GET_RID() method instead.

Do not use pci_find_dbsf() to go from the linux pci_dev to freebsd
device_t.  First, device is readily available as dev.bsddev.  Second,
using pci_find_dbsf() fails for ARI-enabled functions with large
function numbers, because PCI_SLOT()/PCI_FUNC() are for non-ARI.

Reviewed by: bz, hselasky, manu
Tested by: manu (drm)
Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27960

3 years agolibregex: re-enable `make check`
Kyle Evans [Fri, 8 Jan 2021 19:57:32 +0000 (13:57 -0600)]
libregex: re-enable `make check`

The tests are generally expected to pass, uncomment the annotation that
lets `make check` work. Note that `make check` currently requires kyua
from ports or an appropriate symlink into /usr/local/bin.

3 years agolibc: regex: rework unsafe pointer arithmetic
Miod Vallat [Fri, 8 Jan 2021 18:59:00 +0000 (12:59 -0600)]
libc: regex: rework unsafe pointer arithmetic

regcomp.c uses the "start + count < end" idiom to check that there are
"count" bytes available in an array of char "start" and "end" both point to.

This is fine, unless "start + count" goes beyond the last element of the
array. In this case, pedantic interpretation of the C standard makes the
comparison of such a pointer against "end" undefined, and optimizers from
hell will happily remove as much code as possible because of this.

An example of this occurs in regcomp.c's bothcases(), which defines
bracket[3], sets "next" to "bracket" and "end" to "bracket + 2". Then it
invokes p_bracket(), which starts with "if (p->next + 5 < p->end)"...

Because bothcases() and p_bracket() are static functions in regcomp.c, there
is a real risk of miscompilation if aggressive inlining happens.

The following diff rewrites the "start + count < end" constructs into "end -
start > count". Assuming "end" and "start" are always pointing in the array
(such as "bracket[3]" above), "end - start" is well-defined and can be
compared without trouble.

As a bonus, MORE2() implies MORE() therefore SEETWO() can be simplified a
bit.

PR: 252403

3 years agoFix 32-bit build post 5cc52631b3b88dfc36d8049dc8bece8573c5f9af.
Cy Schubert [Fri, 8 Jan 2021 19:28:30 +0000 (11:28 -0800)]
Fix 32-bit build post 5cc52631b3b88dfc36d8049dc8bece8573c5f9af.

3 years agoarm64: gdb(4) machine-dependent bits
mhorne [Wed, 9 Dec 2020 20:38:42 +0000 (16:38 -0400)]
arm64: gdb(4) machine-dependent bits

Everything required for remote kernel debugging over a serial
connection. For FDT-based systems, a debug port can be specified by
setting hw.fdt.dbgport to the desired device tree node in loader.conf.
For example, hw.fdt.dbgport="uart1", or
hw.fdt.dbgport="serial@ff1a0000".

Looks good: emaste
Tested by: rwatson
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27727

3 years agoarm64: remove pcb_pc
mhorne [Mon, 21 Dec 2020 16:16:09 +0000 (12:16 -0400)]
arm64: remove pcb_pc

The program counter field in the PCB is written in exactly one place,
makectx(), upon entry to the debugger. For threads other than curthread,
its value will be empty, or bogus. Rather than writing to this field in
more places, it can be removed in favor of using the value in the link
register.

To make this clearer, pcb->pcb_x[30] is renamed to pcb->pcb_lr, similar
to what already exists in struct trapframe. Also, prefer lr to x30 in
assembly, as it better conveys intention.

This improves PC_REGS() for kdb_thread != curthread. It is required for
a functional gdb(4) stub, fixing the output of `info threads`, in
particular.

The space occupied by pcb_pc is retained, for compatibility with kgdb.

Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27720

3 years agoarm64: don't pass user trapframe to kdb_trap()
mhorne [Fri, 18 Dec 2020 18:43:52 +0000 (14:43 -0400)]
arm64: don't pass user trapframe to kdb_trap()

This effectively undoes the changes made in r321571. While useful, it is
inconsistent with how other architectures pass trapframes to kdb. This
change is also required to get a working gdb(4) stub on arm64, as
otherwise the backtrace will begin too early.

As of 088a7eef95b1, this information can still be obtained via
"show registers/u".

Reviewed by: jhb (slightly earlier version)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Pull Request: https://reviews.freebsd.org/D27719

3 years agoddb: add ability to print user registers
mhorne [Fri, 18 Dec 2020 20:06:46 +0000 (16:06 -0400)]
ddb: add ability to print user registers

The debugger is always entered after some kind of kernel trap, often a
breakpoint in kdb_enter(). This means that the most recent trapframe
will include kernel state at the time of the trap, when often it is
desirable to the developer to view the contents of the previous
trapframe. This trapframe often corresponds to the entry from userspace.

The ddb(4) man page claims the ability to display user register state
via the 'u' modifier to `show registers`, but this appears untrue. It is
not obvious from a quick search of the history when this feature was
added, or when it was removed. (Re)implement this feature in
db_show_regs, noting that it is not necessarily populated with userspace
state.

Reviewed by: jhb (earlier version), markj, bcr (manpages)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27705

3 years agombuf: enable ext_pgs ("unmapped") mbufs by default
Andrew Gallatin [Fri, 8 Jan 2021 18:18:42 +0000 (13:18 -0500)]
mbuf: enable ext_pgs ("unmapped") mbufs by default

Ext_pg mbufs allow carrying multiple pages per mbuf. This
reduces mbuf linked list traversals, especially in socket
buffers, thereby reducing cache misses and CPU use for
applications using sendfile.  Note that ext_pages use
unmapped pages, eliminating KVA mapping costs on 32-bit
platforms.

Ext_pg mbufs are also required for ktls (KERN_TLS), and having
them disabled by default is a stumbling block for those
wishing to enable ktls.

Reviewed-by: jhb, glebius
Sponsored by: Netfix

3 years agovmd: Clean up resources properly when vmd_attach() fails
Mark Johnston [Fri, 8 Jan 2021 18:32:05 +0000 (13:32 -0500)]
vmd: Clean up resources properly when vmd_attach() fails

- Free the resource container by calling rman_fini().[1]
- Call device_delete_child() if device_probe_and_attach() fails.

Reported by: nc [1]
MFC after: 2 weeks

3 years agompr, mps: Fix an off-by-one bug in the BTDH_MAPPING ioctl
Mark Johnston [Fri, 8 Jan 2021 18:32:05 +0000 (13:32 -0500)]
mpr, mps: Fix an off-by-one bug in the BTDH_MAPPING ioctl

The device mapping table contains sc->max_devices entries, so only
indices in [0, sc->max_devices) are valid.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27964

3 years agompr, mps: Fix a stack buffer overflow in the user passthru ioctl
Mark Johnston [Fri, 8 Jan 2021 18:32:04 +0000 (13:32 -0500)]
mpr, mps: Fix a stack buffer overflow in the user passthru ioctl

Previously we copied in the request into a stack-allocated structure
that could be smaller than the request size.  Furthermore, we checked
the request size only after doing the copyin.

Fix this by allocating a buffer to hold the request, then copying the
buffer's contents into a command descriptor.  This is a bit heavy-handed
but I expect the overhead will not be noticeable.  The approach of
coping the header in first is susceptible to TOCTOU problems.

Reviewed by: imp
Reported by: maxpl0it@protonmail.com
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27963

3 years agosafexcel: Fix a race around unblocking of crypto ops
Mark Johnston [Fri, 8 Jan 2021 18:32:04 +0000 (13:32 -0500)]
safexcel: Fix a race around unblocking of crypto ops

safexcel_ring_intr() could fail to observed that sc_blocked is set after
completing all outstanding ops for a ring, in which case blocked ops
would be deferred forever.

Request structures are managed by individual rings, so move the
"blocked" flag into the per-ring state block and use the ring lock to
synchronize with safexcel_process().  Remove sc_mtx since it is now
unused.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

3 years agosafexcel: Stop using a stack buffer for the ring lock name
Mark Johnston [Fri, 8 Jan 2021 18:32:04 +0000 (13:32 -0500)]
safexcel: Stop using a stack buffer for the ring lock name

mtx_init() does not make a copy of the name so the buffer must be valid
for the lifetime of the driver instance.  Store each ring's lock's name
in the ring structure.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

3 years agoigmp: Avoid leaking mbuf when source validation fails
Mark Johnston [Fri, 8 Jan 2021 18:32:04 +0000 (13:32 -0500)]
igmp: Avoid leaking mbuf when source validation fails

PR: 252504
Submitted by: Panagiotis Tsolakos <panagiotis.tsolakos@gmail.com>
MFC after: 3 days

3 years agoDon't offset the UAR map twice in mlx5en(4).
Hans Petter Selasky [Fri, 8 Jan 2021 17:32:16 +0000 (18:32 +0100)]
Don't offset the UAR map twice in mlx5en(4).

The new UAR API already offsets the UAR map pointer the mlx5en(4) is using.
While at it remove some no longer needed variables for keeping track
of the current BF offset.

This fixes a regression issue after the new UAR allocation APIs
were introduced.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agonvmecontrol: add device self-test op and log page
Chuck Tuffli [Fri, 8 Jan 2021 17:19:37 +0000 (09:19 -0800)]
nvmecontrol: add device self-test op and log page

Add decoding of the Device Self-test log page and the ability to start
or abort a test.

Reviewed by: imp, mav
Tested by: Muhammad Ahmad <muhammad.ahmad@seagate.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27517

3 years agoWhen be_activate() turns on a new boot environment, it always deactivates
Gleb Smirnoff [Fri, 8 Jan 2021 17:23:16 +0000 (09:23 -0800)]
When be_activate() turns on a new boot environment, it always deactivates
the current one first. And if it fails to do so, it abandons activation.
However, with the new bootonce feature, there is a legitimate case when
a pool doesn't have "bootfs" property set. Check for this case before
calling be_deactivate().

Reviewed by: kevans

3 years agobuild: add WITHOUT_CLEAN workaround for 821aa63a0940
Kyle Evans [Fri, 8 Jan 2021 15:18:46 +0000 (09:18 -0600)]
build: add WITHOUT_CLEAN workaround for 821aa63a0940

The *w variants of ncurses directories went away, and the remaining names
build the widechar variants instead of non-widechar variants. As such, the
entire ncurses tree should be regenerated.

Key off of lib/ncurses/ncursesw being present and remove the whole ncurses
hierarchy if it is.

Reviewed by: emaste (IRC)

3 years agoefidev: remove EFIIOC_GET_TABLE ioctl
Kyle Evans [Thu, 7 Jan 2021 21:51:18 +0000 (15:51 -0600)]
efidev: remove EFIIOC_GET_TABLE ioctl

This ioctl would instantly induce a panic, likely since near inception, up
until 0861c7d3e048. Lack of previous interest in fixing it combined with
the problematic interface (exports a pointer, really a physical address)
brings us to the natural conclusion: remove it until a useful consumer
forward.

If it eventually gets resurrected, the interface should definitely not
return in this exact form and likely needs to be reimagined.

The associated KPI, efi_get_table, is left intact for the time being.

Reviewed by: imp, jrtc27
Also discussed with: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D28030

3 years agoGitHub actions: unbreak macOS build
Ulrich Spörlein [Fri, 8 Jan 2021 14:36:38 +0000 (15:36 +0100)]
GitHub actions: unbreak macOS build

Error: llvm 11.0.0 is already installed

Also make the linking failure non-fatal:

Error: The `brew link` step did not complete successfully

3 years agoMove the PMC overflow count to make it per-CPU
Andrew Turner [Mon, 4 Jan 2021 13:25:45 +0000 (13:25 +0000)]
Move the PMC overflow count to make it per-CPU

Virtual PMCs could be running on multiple CPUs so this needs to be
a per-CPU value.

Submitted by: rwatson (earlier version)
Reviewed by: gnn
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D27973

3 years agoUpdate hwpmc on armv7 to handle overflow better
Andrew Turner [Mon, 4 Jan 2021 13:50:17 +0000 (13:50 +0000)]
Update hwpmc on armv7 to handle overflow better

When testing hwpmc on arm64 we found the counter could overflow while
reading the event count. Handle this case in the armv7 code by also
checking if the overflow bit is set and incrementing the overflow
cound as needed.

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D27969

3 years agocache: just assign ni_resflags = NIRES_ABS
Mateusz Guzik [Fri, 8 Jan 2021 12:00:41 +0000 (13:00 +0100)]
cache: just assign ni_resflags = NIRES_ABS

It is guaranteed to be 0 on entry.

3 years agomac: cheaper check for mac_vnode_check_readlink
Mateusz Guzik [Fri, 8 Jan 2021 02:52:35 +0000 (03:52 +0100)]
mac: cheaper check for mac_vnode_check_readlink

3 years agoUpdate user access region, UAR, APIs in the core in mlx5core.
Hans Petter Selasky [Fri, 8 Jan 2021 12:30:26 +0000 (13:30 +0100)]
Update user access region, UAR, APIs in the core in mlx5core.

This change include several changes as listed below all related to UAR.
UAR is a special PCI memory area where the so-called doorbell register and
blue flame register live. Blue flame is a feature for sending small packets
more efficiently via a PCI memory page, instead of using PCI DMA.

- All structures and functions named xxx_uuars were renamed into xxx_bfreg.
- Remove partially implemented Blueflame support from mlx5en(4) and mlx5ib.
- Implement blue flame register allocator.
- Use blue flame register allocator in mlx5ib.
- A common UAR page is now allocated by the core to support doorbell register
  writes for all of mlx5en and mlx5ib, instead of allocating one UAR per
  sendqueue.
- Add support for DEVX query UAR.
- Add support for 4K UAR for libmlx5.

Linux commits:
7c043e908a74ae0a935037cdd984d0cb89b2b970
2f5ff26478adaff5ed9b7ad4079d6a710b5f27e7
0b80c14f009758cefeed0edff4f9141957964211
30aa60b3bd12bd79b5324b7b595bd3446ab24b52
5fe9dec0d045437e48f112b8fa705197bd7bc3c0
0118717583cda6f4f36092853ad0345e8150b286
a6d51b68611e98f05042ada662aed5dbe3279c1e

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFix whitespace in mlx5en(4).
Hans Petter Selasky [Fri, 8 Jan 2021 11:44:42 +0000 (12:44 +0100)]
Fix whitespace in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoBump driver versions for mlx5en(4) and mlx4en(4).
Hans Petter Selasky [Fri, 8 Jan 2021 10:45:26 +0000 (11:45 +0100)]
Bump driver versions for mlx5en(4) and mlx4en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFix memory leaks in error paths in krping.
Hans Petter Selasky [Fri, 8 Jan 2021 11:22:18 +0000 (12:22 +0100)]
Fix memory leaks in error paths in krping.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoBump some copyrights in mlx5en(4).
Hans Petter Selasky [Fri, 8 Jan 2021 11:21:58 +0000 (12:21 +0100)]
Bump some copyrights in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoImplement SIOCGIFRSSKEY and SIOCGIFRSSHASH and mlx5en(4).
Hans Petter Selasky [Fri, 8 Jan 2021 11:12:02 +0000 (12:12 +0100)]
Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH and mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFixes for SRIOV in mlx5core.
Hans Petter Selasky [Fri, 8 Jan 2021 11:06:11 +0000 (12:06 +0100)]
Fixes for SRIOV in mlx5core.

- call pci_iov_detach() on detaching from PCI device to take care of hang
  on destroying VFs after PF is down.

- disable eswitch SRIOV support right after pci_iov_detach(),
  else the eswitch cleanup sometimes occur while the SRIOV flow table
  is still present.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoUpdate the PCI ID list in mlx5core.
Hans Petter Selasky [Fri, 8 Jan 2021 11:00:54 +0000 (12:00 +0100)]
Update the PCI ID list in mlx5core.

- Add descriptions for new devices.
- Add support for Bluefield.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoThe "unsigned" type is the same like "unsigned int".
Hans Petter Selasky [Fri, 8 Jan 2021 10:58:10 +0000 (11:58 +0100)]
The "unsigned" type is the same like "unsigned int".

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFix spelling in mlx5core.
Hans Petter Selasky [Fri, 8 Jan 2021 10:54:16 +0000 (11:54 +0100)]
Fix spelling in mlx5core.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoProperly handle case where firmware dump returns more registers on second pass
Hans Petter Selasky [Fri, 8 Jan 2021 10:52:44 +0000 (11:52 +0100)]
Properly handle case where firmware dump returns more registers on second pass
in mlx5core.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoDowngrade error about missing VSC to warning and make messages consistent
Hans Petter Selasky [Fri, 8 Jan 2021 10:50:41 +0000 (11:50 +0100)]
Downgrade error about missing VSC to warning and make messages consistent
in mlx5core.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agosysctl debug.dump_modinfo should recognize font module
Toomas Soome [Thu, 7 Jan 2021 15:05:45 +0000 (17:05 +0200)]
sysctl debug.dump_modinfo should recognize font module

Add MODINFOMD_FONT to dump list.