Commit Graph

38639 Commits

Author SHA1 Message Date
Mark Johnston
5bdb8b273a safexcel: Maintain per-session context records
The context record contains key material precomputed by the driver at
session creation time.  Rather than storing various components of the
context record in each session, go a bit further and store the full
context record image so that safexcel_process() can simply copy the
image into each request submitted to the hardware.  This simplifies the
data path and eliminates a bunch of unnecessary conditional logic that
was getting executed for each request.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-18 17:07:56 -05:00
Mark Johnston
1a6ffed5d7 safexcel: Simplify request allocation
Rather than preallocating a set of requests and moving them between
queues during state transitions, maintain a shadow of the command
descriptor ring to track the driver context of each request.  This is
simpler and requires less synchronization between safexcel_process() and
the ring interrupt handler.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-18 17:07:56 -05:00
Mark Johnston
b7e27af36b safexcel: Handle command/result descriptor exhaustion gracefully
Rather than returning a hard error in this case, return ERESTART so that
upper layers get a chance to retry the request (or drop it, depending on
the desired policy).

This case is hard to hit due to the somewhat low bound on queued
requests, but that will no longer be true after an upcoming change.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-18 17:07:56 -05:00
Mark Johnston
0371c3faaa safexcel: Add counters for some resource exhaustion conditions
This is useful when analyzing performance problems.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-18 17:07:55 -05:00
Mark Johnston
e934d455ba safexcel: Dispatch requests to the current CPU's ring
This gives better performance in some tests than the previous policy of
statically binding each session to a ring.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-18 17:07:55 -05:00
Marius Strobl
daad26e5fc openpromio(4): remove obsolete pseudo device driver
It's unused since 58aa35d429 and r357455
respectively and should have gone along with these.
2021-01-16 23:53:13 +01:00
Marius Strobl
d65427ad58 sym(4): Remove remainder of SYM_SETUP_LP_PROBE_MAP support
Missed in 221ac8f4cd and r339575
respectively.
2021-01-16 23:53:12 +01:00
Vincenzo Maffione
2968dde3de axgbe: driver changes for netmap support
AMD 10GbE hardware is designed to have two buffers per receive descriptor to
support split header feature. For this purpose, the driver was designed to use
2 iflib freelists per receive queue. So, that buffers from 2 freelists are used
to refill an entry in the receive descriptor. The current design holds good
with regular data traffic.

But, when netmap comes into play, the current design will not fit in. The
current netmap interfaces and netmap implementation in iflib doesn't seem
to accomodate the design of 2 freelists per receive queue. So, exercising
Netmap capability with inbuilt tools like bridge, pkt-gen doesn't work with
the 2 freelists driver design.

So, the driver design is changed to accomodate the current netmap interfaces
and netmap implementation in iflib by using single freelist per receive queue
approach when Netmap capability is exercised without disturbing the current
2 freelists approach.
The dev.ax.sph_enable tunable can be set to 0 to configure the single
free list mode.

Thanks to Stephan Dewt for his Initial set of code changes for the stated
problem.

Submitted by:	rajesh1.kumar_amd.com
Approved by:	vmaffione
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D27797
2021-01-16 08:29:33 +00:00
Emmanuel Vadot
955b980bdf gpiokeys: Use the new device-tree vendor include 2021-01-15 20:07:24 +01:00
Alexander Motin
510cc42126 Unify Intel CODEC naming.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2021-01-15 09:56:15 -05:00
Alexander Motin
006e2b2b82 Add Intel Gemini Lake AHCI ID.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2021-01-15 09:53:35 -05:00
Warner Losh
d1949353e5 uart: Improve console specification parsing
Print warning when we can't parse a console specification (this may
not appear on the console, but will appear in dmesg).

Also, accept key:value and key=value. There's no reason not to
and it makes this more forgiving of mistakes.

Reviewed by: rpokala@
Differential Revision: https://reviews.freebsd.org/D28168
2021-01-14 17:47:04 -07:00
Vladimir Kondratyev
b360682ac9 hid: Add missing input enter/exit epoch pairs.
This was affecting unloading keyboard driver and kdb-related code.
2021-01-14 23:04:47 +03:00
Vladimir Kondratyev
b62f6dfaed hid: Replace USBHID_ENABLED kernel config option with loader tunable
usbhid(4) is disabled by default to avoid conflicts with existing USB HID
drivers. To enable it place following lines to /boot/loader.conf:

hw.usb.usbhid.enable=1
usbhid_load="YES"

Suggested by:	jhb
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D28124
2021-01-14 23:04:47 +03:00
Mark Johnston
6483fc224b qat: Free counters during detach
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
a33b29a044 qat: Count request allocation failures
This can be useful for troubleshooting performance problems.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
95ee7d9b87 qat: Fix DH895XCC firmware module autoloading
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
90cc8706cc iwm(4): Add support for Intel Killer(R) Wireless-AC 1550i
PR:		252578
Submitted by:	shu <ankohuu@outlook.com>
MFC after:	1 week
2021-01-14 11:41:28 -05:00
Hans Petter Selasky
e47a6525e7 Add missing init of new fields after new UAR API was introduced
by f8f5b459d2 in mlx5ib.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
2021-01-14 11:44:54 +01:00
David E. O'Brien
9a01a25516 unifdef -D__FreeBSD__ to remove the OpenBSD support
OpenBSD never accepted this driver, and instead wrote their
own minimal one (sys/dev/acpi/tpm.c for suspending the device).

Reviewed by:    stevek, emaste
Differential Revision:  D10321
2021-01-13 22:35:22 -08:00
Emmanuel Vadot
6003bf9290 dwwdt: Add PNP info for the driver 2021-01-13 18:43:51 +01:00
Emmanuel Vadot
0a05676b44 Add driver for Synopsys Designware Watchdog timer.
This driver supports some arm and arm64 boards equipped with
"snps,dw-wdt"-compatible watchdog device.
Tested on RK3399-based board (RockPro64).
Once started watchdog device cannot be stopped.
Interrupt handler has mode to kick watchdog even when software does not do it
properly.
This can be controlled via sysctl: dev.dwwdt.prevent_restart.
Also - driver handles system shutdown and prevents from restart when system
is asked to reboot.

Submitted by:	kjopek@gmail.com
Differential Revision:	https://reviews.freebsd.org/D26761
2021-01-13 18:43:47 +01:00
Hans Petter Selasky
f2a7b434b3 Variable declarations are since C99 and r363250 allowed inside for-loops.
Partial revert of bafb682656.

Suggested by:	mmel@
2021-01-13 12:30:41 +01:00
Hans Petter Selasky
bafb682656 Fix for off-by-one in GPIO driver after r368585.
While at it declare the iteration variable outside the for-loop
to appease older compilers.

Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-01-13 10:06:30 +01:00
Mitchell Horne
d89e1db5a3 if_wg: fix modules load on !x86
Only x86 provides optimized implementations via the blake2 module. The
software "reference" implementation is already included in the crypto(4)
module, we can drop the extra MODULE_DEPEND for other platforms.

Without this change, if_wg.ko could not be loaded due to the missing
dependency.

PR:		252156
Reported by:	gbe
Sponsored by:	The FreeBSD Foundation
2021-01-12 18:07:10 -04:00
Hans Petter Selasky
6e5baec33c Fix for use-after-free in if_ure(4) driver.
When detaching the if_ure(4) driver, the TX active USB transfer array may
point to freed USB transfers. Given that the number of USB transfers is
very low, simply start all transfers every time there is a packet to
keep safe from use-after-free.

PR: 252608
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
2021-01-12 17:57:58 +01:00
Mateusz Guzik
6b3a9a0f3d Convert remaining cap_rights_init users to cap_rights_init_one
semantic patch:

@@

expression rights, r;

@@

- cap_rights_init(&rights, r)
+ cap_rights_init_one(&rights, r)
2021-01-12 13:16:10 +00:00
Emmanuel Vadot
105a37cac7 linuxkpi: Add more pci functions needed by DRM
-pci_get_class : This function search for a matching pci device based on
   the class/subclass and returns a newly created pci_dev.
 - pci_{save,restore}_state : This is analogous to ours with the same name
 - pci_is_root_bus : Return true if this is the root bus
 - pci_get_domain_bus_and_slot : This function search for a matching pci
   device based on domain, bus and slot/function concat into a single
   unsigned int (devfn) and returns a newly created pci_dev
 - pci_bus_{read,write}_config* : Read/Write to the config space.

While here add some helper function to alloc and fill the pci_dev struct.

Reviewed by:   hselasky, bz (older version)
Differential Revision:	   https://reviews.freebsd.org/D27550
2021-01-12 12:31:00 +01:00
Emmanuel Vadot
8517a547a0 pci: Add pci_find_class_from
pci_find_class_from help finding one or multiple device matching
a class and subclass.
If the from argument is not null we will first loop in the device list
until we find the matching device and only then start to check if the
class/subclass matches.

Reviewed by:   jhb
Differential Revision:	https://reviews.freebsd.org/D27549
2021-01-12 12:25:28 +01:00
Vincenzo Maffione
3005e10ddb netmap: vtnet: fix RX initialization after netmap_reset()
At device reset, we must not publish those netmap receive buffers
that are owned by userspace (nm_kr_rxspace).

MFC after:	1 week
2021-01-11 21:38:32 +00:00
Brooks Davis
d7a7d6a7c3 ndis: Per user request, delay removal to 14
We will remove ndis shortly after the 13 branch.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D28049
2021-01-11 18:11:49 +00:00
Mitchell Horne
7dcddacafa cgem: update 64-bit check
The cgem(4) driver was updated to support 64-bit bus addressing in
facdd1cd20. However, the committed version determines this in an
un-idiomatic way. Change the compile-time conditional to check
BUS_SPACE_MAXADDR, rather than comparing int and pointer sizes.

Reported by:	jrtc27
2021-01-11 12:15:32 -04:00
Roger Pau Monne
a765078790 xen/privcmd: implement the restrict ioctl
Use an interface compatible with the Linux one so that the user-space
libraries already using the Linux interface can be used without much
modifications.

This allows an open privcmd instance to limit against which domains it
can act upon.

Sponsored by:	Citrix Systems R&D
2021-01-11 16:33:27 +01:00
Roger Pau Monne
ed78016d00 xen/privcmd: implement the dm op ioctl
Use an interface compatible with the Linux one so that the user-space
libraries already using the Linux interface can be used without much
modifications.

This allows user-space to make use of the dm_op family of hypercalls,
which are used by device models.

Sponsored by:	Citrix Systems R&D
2021-01-11 16:33:27 +01:00
Roger Pau Monne
658860e2d0 xen/privcmd: implement the map resource ioctl
The interface is mostly the same as the Linux ioctl, so that we don't
need to modify the user-space libraries that make use of it.

The ioctl is just a proxy for the XENMEM_acquire_resource hypercall.

Sponsored by:	Citrix Systems R&D
2021-01-11 16:15:00 +01:00
Roger Pau Monné
147e593921 xen/privcmd: split setup of virtual address range into helper
Preparatory change for further additions that will also make use of
the same code. No functional change.

Sponsored by:	Citrix Systems R&D
2021-01-11 16:14:59 +01:00
Roger Pau Monné
f713a5b37e xen/privcmd: make some integers unsigned
There's no reason for them to be signed. No functional change.

Sponsored by:	Citrix Systems R&D
2021-01-11 16:14:59 +01:00
Ryan Libby
16079c7233 hid: quiet -Wswitch
Gcc builds complained that not all switch cases are handled.  Add
default cases to appease gcc.

Reviewed by:	hselasky (previous version), wulf
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D28082
2021-01-10 21:53:15 -08:00
Vincenzo Maffione
55f0ad5fde netmap: restore hwofs and support it in iflib
Restore the hwofs functionality temporarily disabled by
7ba6ecf216 to prevent issues with iflib.
This patch brings the necessary changes to iflib to
enable howfs to allow interface restarts without
disrupting netmap applications actively using its
rings.
After this change, it becomes possible for multiple
non-cooperating netmap applications to use non-overlapping
subsets of the available netmap rings without clashing
with each other.

PR:		252453
MFC after:	1 week
2021-01-10 22:51:15 +00:00
Thomas Skibo
facdd1cd20 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
2021-01-10 16:51:52 -04:00
Vladimir Kondratyev
8ffcde2554 hid: fix extraneous SYSCTL_ADD_INT() options revealed by LINT build
Reviewed by:	hselasky (as part of D28060)
2021-01-10 22:17:20 +03:00
Vincenzo Maffione
54bbcca4f9 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 1d238b07d5.

MFC after:      1 week
2021-01-10 15:09:05 +00:00
Vincenzo Maffione
bb714db6d3 netmap: vtnet: enable/disable krings on any interface reinit
See 3d65fd97e8 for a detailed explanation.

PR:             252453
MFC after:      1 week
2021-01-10 14:10:09 +00:00
Vincenzo Maffione
9ac59d42c0 netmap: vtnet: stop krings during interface reset
Similarly to what done for iflib in 1d238b07d5,
this patch prevents access to the krings during the interface
reset triggered by netmap_register().

MFC after:	1 week
2021-01-09 22:34:52 +00:00
Vincenzo Maffione
7ba6ecf216 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
2021-01-09 22:07:24 +00:00
Vincenzo Maffione
1d238b07d5 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
2021-01-09 21:01:46 +00:00
Mark Johnston
109260d202 mvneta: Acquire the softc lock before clearing the MIB
Reported by:	Andrei Martin <andrei.cos.martin@gmail.com>
MFC with:	caf552a607
2021-01-09 10:04:17 -05:00
Chuck Tuffli
e83fdf8bb3 fix big-endian platforms after 6733401935
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
2021-01-08 14:41:45 -08:00
Mark Johnston
e65e4e61f5 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
2021-01-08 13:32:05 -05:00
Mark Johnston
adc0dcc352 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
2021-01-08 13:32:05 -05:00