Commit Graph

37454 Commits

Author SHA1 Message Date
Pawel Biernacki
59e4be225c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (5 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by:	imp, kib
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D23633
2020-02-16 17:11:54 +00:00
Dimitry Andric
bacffcd4b1 Merge r357970 from the clang1000-import branch:
Fix the following -Werror warning from clang 10.0.0 in hptmv(4):

sys/dev/hptmv/ioctl.c:240:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        _vbus_p=pArray->pVBus;
                        ^
sys/dev/hptmv/ioctl.c:237:10: note: previous statement is here
                if(!mIsArray(pArray))
                ^

This is because the return statement after the if statement was not
indented.  (Note that this file has been idented assuming 4-space tabs.)

MFC after:	3 days
2020-02-15 19:15:24 +00:00
Pawel Biernacki
f8d2b1f3f7 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by:	hselasky, kib
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D23632
2020-02-15 18:52:12 +00:00
Pawel Biernacki
e0d69c5a88 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (1 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by:	kib, trasz
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D23640
2020-02-15 18:48:38 +00:00
Dimitry Andric
ceba62b93d Fix the following -Werror warning from clang 10.0.0 in hptmv(4):
sys/dev/hptmv/ioctl.c:240:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        _vbus_p=pArray->pVBus;
                        ^
sys/dev/hptmv/ioctl.c:237:10: note: previous statement is here
                if(!mIsArray(pArray))
                ^

This is because the return statement after the if statement was not
indented.  (Note that this file has been idented assuming 4-space tabs.)

MFC after:	3 days
2020-02-15 18:37:26 +00:00
Dimitry Andric
74dc6beb30 Merge ^/head r357855 through r357920. 2020-02-14 19:32:58 +00:00
Alexander Motin
0d9cef0a94 Add support for Hygon NTB PCI device in ntb_hw_amd driver.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23565
2020-02-14 15:04:56 +00:00
Alexander Motin
a6da07a319 Add Hygon PCI ID and description for AHCI SATA controller.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23556
2020-02-14 14:55:40 +00:00
Hans Petter Selasky
144d6690b5 Exclude modifier keys from keyboard repeat logic.
This restores USB keyboard driver behaviour prior to r357861.

Requested by:	jkim@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-14 00:29:21 +00:00
John Baldwin
ff8c6681c8 Don't check the auth algorithm for GCM.
The upstream OpenSSL changes only set the cipher for GCM since the
authentication is redundant, and changes to OCF will soon remove the
GCM authentication algorithm constants entirely for the same reason.
In addition, ktls_create_session() already validates these fields and
wouldn't pass down an invalid auth_algorithm value to any drivers or
ktls backends.

Reviewed by:	hselasky
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D23671
2020-02-13 23:04:11 +00:00
John Baldwin
ca3b3c573e Remove the per-TXQ tls_wrs stat.
It duplicated the kern_tls_records stat and was not conditional on NIC
TLS being enabled.

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D23670
2020-02-13 22:55:45 +00:00
Konstantin Belousov
4e012582d3 hyperv: Add Hygon Dhyana support.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23563
2020-02-13 19:12:07 +00:00
Konstantin Belousov
100eced555 ecc_inject: Add Hygon Dhyana support.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23561
2020-02-13 19:10:51 +00:00
Konstantin Belousov
decf9c5ff6 amdsbwd, intpm: Add Hygon Dhyana support.
Initialize the FCH SMBus controller for Hygon Dhyana CPU.
Set the vendor of the FCH description via the exact CPU vendor.

Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23558
2020-02-13 19:09:24 +00:00
Konstantin Belousov
4afea6b4e0 amdpm: Add Hygon Dhyana support.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23557
2020-02-13 19:07:42 +00:00
Hans Petter Selasky
d4028678f2 Improve USB gaming keyboard support.
Add support for decoding pressed keys as a bitmap. The keys in the
bitmap are described in the interface specific HID descriptor. Some
keyboards even have multiple input interfaces, only using the bitmap
method when the event array is full. That typically means when more
than seven keys are pressed simultaneously.

The internals of the USB keyboard driver have been slightly reworked
to keep track of all keys in a single bitmap having 256 bits. This
bitmap is then divided into blocks of 64-bits as an optimisation.

Simplify automatic key repeat logic, because only the last key pressed
can be repeated.

PR:	224592
PR:	233884
Tested by:	Alex V. Petrov <alexvpetrov@gmail.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-13 16:03:12 +00:00
Hans Petter Selasky
01651e9615 Add support for debugnet in mlx5en(4).
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-12 10:03:25 +00:00
Hans Petter Selasky
f14d849862 Add support for disabling and polling MSIX interrupts in mlx5core.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-12 09:58:19 +00:00
Navdeep Parhar
77ad00bf36 cxgbe(4): Update T4/5/6 firmwares to 1.24.12.0.
Obtained from:	Chelsio Communications
MFC after:	1 month
Sponsored by:	Chelsio Communications
2020-02-12 02:55:06 +00:00
Brooks Davis
8e2e3137a3 Mark hme(4) as deprecated.
It was saved from the initial purge of drivers in fcp-101 due to being
the onboard Ethernet device on a number of sparc64 machines.  Now that
sparc64 is gone, it serves little purpose (PCI cards exist, but are rare
and are unlikely to have been deployed outside Sun systems).

MFC after:	3 days
2020-02-12 00:58:17 +00:00
Gleb Smirnoff
301a87ac4c Mark lio taskqueue as requiring network epoch. 2020-02-11 19:13:34 +00:00
Gleb Smirnoff
6c3e93cb5a Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D23518
2020-02-11 18:57:07 +00:00
Ruslan Bukin
667c3fc0f6 Add PCI Express driver for the ARM Neoverse N1 System Development
Platform (N1SDP).

Neoverse N1 is a high-performance ARM microarchitecture designed
by the ARM Holdings for the server market.

The PCI part on N1SDP was shipped untested and suffers from some
integration issues.

For instance accessing to not existing BDFs causes System Error
(SError) exception. To mitigate this, the firmware scans the bus,
catches SErrors and creates a table with valid BDFs. That allows
us to filter-out accesses to invalid BDFs in this driver.

Also the root complex config space (BDF == 0) has an unusual
location in memory map, so remapping accesses to it is required.

Finally, the config space is restricted to 32-bit accesses only.

This was tested on the ARM boxes kindly provided by the ARM Ltd
to the DARPA CHERI Project.

In collaboration with:	andrew
Reviewed by:	andrew
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D23349
2020-02-11 15:12:09 +00:00
Hans Petter Selasky
d82c0ebc69 Add USB host controller PCI ID's for Hygon.
Differential Revision:	https://reviews.freebsd.org/D23564
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-02-10 11:09:56 +00:00
Ruslan Bukin
d987842d1e Enter the network epoch in the xdma interrupt handler if required
by a peripheral device driver.

Sponsored by:	DARPA, AFRL
2020-02-08 23:07:29 +00:00
Ruslan Bukin
a00eed9676 Fix a KASSERT since chained mbufs are accepted by the xdma bounce
buffer loader. m_copydata() will copy entire chain to a single buffer.

Sponsored by:	DARPA, AFRL
2020-02-08 21:02:20 +00:00
Marcin Wojtas
73f20bb3a9 Implement jumbo frame support in mvneta driver
This patch introduces processing of the frames
up to 9kB by the mvneta driver. Some versions of
this NIC limit TX checksum offloading, depending
on the frame size, so add appropriate handling
of this feature.

Submitted by: Kornel Duleba
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D23225
2020-02-08 13:33:47 +00:00
Marcin Wojtas
3599e81c97 Destroy RX DMA tag on detach in mvneta driver
This patch fixes deinitialization sequence of the mvneta
driver by adding missing bus_dma_tag_destroy call.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
MFC after: 1 week
Sponsored by: Stormshield
2020-02-08 13:25:39 +00:00
Konstantin Belousov
53071ed1c9 pmc: Add Hygon Dhyana support.
To make the PMC tool pmcstat working properly on Hygon platform, add
support for Hygon Dhyana family 18h by using the PMC initialization
code path of AMD family 17h.

Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23562
2020-02-07 22:28:04 +00:00
Konstantin Belousov
fc9134243d acpi_hpet: Add Hygon Dhyana support.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23555
2020-02-07 22:26:11 +00:00
Ed Maste
5aa0576b33 Miscellaneous typo fixes
Submitted by:	Gordon Bergling <gbergling_gmail.com>
Differential Revision:	https://reviews.freebsd.org/D23453
2020-02-07 19:53:07 +00:00
Vincenzo Maffione
723180da59 netmap: improve netmap(4) and vale(4) man pages
Clean up obsolete sysctl descriptions and add missing ones.

PR:		243838
Reviewed by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23546
2020-02-07 19:26:26 +00:00
Ruslan Bukin
a8692c16c9 Fix xae(4) driver attachement on the Government Furnished Equipment (GFE)
riscv cores.

GFE cores come with standard DTS file that lacks standard 'dmas ='
property, which means xae(4) could not find a DMA controller to use.

The 'dmas' property could not be added to the DTS file because the
ethernet controller and DMA engine parts in Linux are implemented
in a single driver.

Instead of 'dmas' property the standard Xilinx 'axistream-connected'
property is provided, so fallback to use it instead.

Suggested by:	James Clarke <jrtc27@jrtc27.com>
Reviewed by:	James Clarke <jrtc27@jrtc27.com>
Sponsored by:	DARPA, AFRL
2020-02-07 14:36:28 +00:00
Scott Long
69e85eb8ae Advertise the MPI Message Version that's contained in the IOCFacts message
in the sysctl block for the driver.  mpsutil/mprutil needs this so it can
know how big of a buffer to allocate when requesting the IOCFacts from the
controller.  This eliminates the kernel console messages about wrong
allocation sizes.

Reported by:	imp
2020-02-07 12:15:39 +00:00
Scott Long
d176b8039e Ever since the block layer expanded its command syntax beyond just
BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in
drivers when the driver doesn't support a particular command.  Do a
sweep and fix that.

Reported by:	imp
2020-02-07 09:22:08 +00:00
Roger Pau Monné
d16bd54140 xen/console: fix priority of Xen console
Currently the Xen console is always attached with priority CN_REMOTE
(highest), which means that when booting with a single console the Xen
console will take preference over the VGA for example, and that's not
intended unless the user has also selected to use a serial console.

Fix this by lowering the priority of the Xen console to NORMAL unless
the user has selected to use a serial console. This keeps the usual
FreeBSD behavior of outputting to the internal consoles (ie: VGA) when
booted as a Xen dom0.

MFC after:	3 days
Sponsored by:	Citrix Systems R&D
2020-02-06 14:02:47 +00:00
Navdeep Parhar
21935a41fd cxgbe(4): Add native netmap support to the main interface.
This means that extra virtual interfaces (VIs) created with
hw.cxgbe.num_vis are no longer required to use netmap.  Use this
tunable to enable native netmap support on the main interface:

hw.cxgbe.native_netmap="3"

There is no change in default behavior.

Suggested by:	jch@
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-02-05 22:29:01 +00:00
Alfredo Dal'Ava Junior
f272c8de6e [virtio] Fix r/w to PCI configuration area on big endian platforms
In legacy VirtIO drivers, the header must be PCI endianness (little) and the
device-specific region is encoded in the native endian of the guest.

This patch makes the access (read/write) to VirtIO header using the little
endian order. Other read and write access are native endianness. This also
sets the device's IO region as big endian if on big endian machine.

PR:		205178
Submitted by:	Andre Silva <afscoelho@gmail.com>
Reported by:	Kenneth Salerno <kennethsalerno@yahoo.com>
Reviewed by:	bryanv, bdragon, luporl, alfredo
Approved by:	jhibbits (mentor)
Differential Revision:	https://reviews.freebsd.org/D23401
2020-02-05 20:39:18 +00:00
Navdeep Parhar
f4220a703d cxgbe(4): Add a knob to allow netmap tx traffic to be checksummed by
the hardware.

hw.cxgbe.nm_txcsum=1

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-02-05 00:13:15 +00:00
Navdeep Parhar
ba8b75ae01 cxgbe(4): Allow nm_black_hole and nm_cong_drop to be set at any time.
The cong_drop setting will apply to queues created after the setting is
changed and not to existing queues.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-02-05 00:08:58 +00:00
Navdeep Parhar
3479fe20e2 cxgbe(4): Report accurate rx_buf_maxsize to netmap.
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-02-04 23:55:21 +00:00
Kyle Evans
e88f22ff04 psm: use make_dev_s instead of make_dev
This most importantly reduces duplication, but it also removes any potential
race with usage of dev->si_drv1 since it's now set prior to the device being
constructed enough to be accessible.
2020-02-04 18:45:28 +00:00
Kyle Evans
ee20e0605a psm: release resources on attach failure
In exactly 1/3 cases we'll release resources on failure; touch up the other
two to do so as well.
2020-02-04 18:29:06 +00:00
Navdeep Parhar
87bbb3338e cxgbe(4): Add pfil(9) hooks to the driver's rx.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-04 01:09:02 +00:00
Navdeep Parhar
1486d2de9e cxgbe(4): Treat NIC rx as special and run its handler directly and not
via the t4_cpl_handler dispatch table.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-04 01:01:35 +00:00
Navdeep Parhar
46e1e307ed cxgbe(4): Retire the allow_mbufs_in_cluster optimization.
This simplifies the driver's rx fast path as well as the bookkeeping
code that tracks various rx buffer sizes and layouts.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-04 00:51:10 +00:00
Navdeep Parhar
d6f79b2710 cxgbe(4): Avoid ext_arg2 in rxb_free.
ext_arg2 is the only item in the third cacheline in an mbuf and could be
cold by the time rxb_free runs.  Put the information needed by rxb_free
in the same line as the refcount, which is very likely to be hot given
that rxb_free runs when the refcount is decremented and reaches 0.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:50:29 +00:00
Navdeep Parhar
44c6fea82b cxgbe(4): Do not use pack boundary > 512B unless it is explicitly
requested.

This is a tradeoff between PCIe efficiency during large packet rx and
packing efficiency during small packet rx.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:30:39 +00:00
Navdeep Parhar
a9c4062a9a cxgbe(4): Initialize the rx buffer's metadata on first-use and not on
allocation.

refill_fl doesn't touch any part of a freshly allocated cluster after
this change.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:25:12 +00:00
Navdeep Parhar
9087a3df60 cxgbe(4): Only checksummed TCP should be considered for LRO.
This avoids the per-packet nanouptime in tcp_lro_rx for traffic that's
not even TCP.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-02-03 23:06:42 +00:00