Commit Graph

38233 Commits

Author SHA1 Message Date
Richard Scheffenegger
bfabdade5c Add DSCP support for network QoS to iscsi initiator.
Allow the DSCP codepoint also to be configurable
for the traffic in the direction from the initiator
to the target, such that writes and any requests
are also treated in the appropriate QoS class.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26714
2020-10-09 14:33:09 +00:00
Ruslan Bukin
72479f6bf9 Add iommu_get_dev_ctx() helper that allows to instantiate an iommu context
for a given device_t.

Submitted by:	andrew
Reviewed by:	kib
Sponsored by:	DARPA, AFRL
2020-10-09 13:11:14 +00:00
Warner Losh
8c576a279e Remove APM BIOS support
APM BIOS was relevant only to early laptops (approximately P166 or
P200 and slower). These have not been relevant for a long time, and
this code has been untested for a long time (as far as I can
tell). The APM compat code in ACPI and the apm(8) command is not being
retired. Both of these items are still in use (apm(8) is more
scriptable than the replacement acpiconf, for the most part). This has
been commented out of i386 GENERIC since 2002. This code is not
relevant to any other port.

Discussed on: arch@
2020-10-08 20:56:06 +00:00
Hans Petter Selasky
c3a38d6c91 Try a bit harder to get the USB device descriptor in case the initial read fails.
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-08 11:30:22 +00:00
Hans Petter Selasky
d6dbbdea20 Allow evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in
/boot/loader.conf .

MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-08 10:59:49 +00:00
Navdeep Parhar
77af2b2c85 cxgbe(4): knobs to drop various kinds of undesirable frames on ingress.
These kind of drops come for free in the sense that they do not use the
filter TCAM or any other resource that wouldn't normally be used during
rx.  Frames dropped by the hardware get counted in the MAC's rx stats
but are not delivered to the driver.

hw.cxgbe.attack_filter
Set to 1 to enable the "attack filter".  Default is 0.  The attack
filter will drop an incoming frame if any of these conditions is true:
src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip
is loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback
(::1/128) or unspecified (::/128); tcp and src/dst ip6 is mcast
(ff00::/8).

hw.cxgbe.drop_ip_fragments
Set to 1 to drop all incoming IP fragments.  Default is 0.  Note that
this drops valid frames.

hw.cxgbe.drop_pkts_with_l2_errors
Set to 1 to drop incoming frames with Layer 2 length or checksum errors.
Default is 1.

hw.cxgbe.drop_pkts_with_l3_errors
Set to 1 to drop incoming frames with IP version, length, or checksum
errors.  Default is 0.

hw.cxgbe.drop_pkts_with_l4_errors
Set to 1 to drop incoming frames with Layer 4 length, checksum, or other
errors.  Default is 0.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-10-08 10:00:13 +00:00
Hans Petter Selasky
194ddc011a Properly cleanup driver during remove_one() in mlx5core.
Cleanup all host resources, SYSCTLs, MSIX vectors and memory used
by the host and only leave the device allocated memory behind, if any,
because it may still be in use, when the PCI remove function is called.
Else future probe calls may fail due to SYSCTLs already existing.

MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-07 17:46:49 +00:00
Warner Losh
bc683a89a3 Move kernel env global variables, etc to sys/kenv.h
The kernel globals for kenv are confined to 2 files that need them and
a few that likely shouldn't (but as written the code does). Move them
from sys/systm.h to sys/kenv.h. This removed a XXX from systm.h and
cleans it up a little bit...
2020-10-07 06:16:37 +00:00
John Baldwin
f34702b76e Don't permit DRM buffer mappings to be upgraded to executable.
Reviewed by:	kib
MFC after:	1 month
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26697
2020-10-06 18:13:15 +00:00
John Baldwin
56fb710f1b Store the send tag type in the common send tag header.
Both cxgbe(4) and mlx5(4) wrapped the existing send tag header with
their own identical headers that stored the type that the
type-specific tag structures inherited from, so in practice it seems
drivers need this in the tag anyway.  This permits removing these
extra header indirections (struct cxgbe_snd_tag and struct
mlx5e_snd_tag).

In addition, this permits driver-independent code to query the type of
a tag, e.g. to know what type of tag is being queried via
if_snd_query.

Reviewed by:	gallatin, hselasky, np, kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26689
2020-10-06 17:58:56 +00:00
Navdeep Parhar
8741306b3b cxgbe(4) sysctls do not need Giant.
Sponsored by:	Chelsio Communications
2020-10-05 22:18:04 +00:00
Mark Johnston
ce3e137ca1 re(4): Add a 8168-compatible device ID
This is described in RealTek's driver as a "RTL8168 Series add-on card."

PR:		250037
Submitted by:	Hiroshi HASEGAWA <hhase1973@gmail.com>
MFC after:	1 week
2020-10-05 19:58:55 +00:00
Hans Petter Selasky
8853522919 Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to
the USB generic serial port driver, ugensa.

MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D21863
Submitted by:		greg_unrelenting.technology (Greg V)
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-04 17:17:16 +00:00
Emmanuel Vadot
b48668250e pwm_backlight: Fix 32 bits build
Reported by:	jenkins, mjg
2020-10-03 08:31:28 +00:00
Navdeep Parhar
73f6606b47 cxgbe(4): set up the firmware flowc for the tid before send_abort_rpl.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-10-02 23:48:57 +00:00
Emmanuel Vadot
38d94a4bc7 Add pwm_backlight
Driver for pwm-backlight compatible device.

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26252
2020-10-02 18:23:27 +00:00
Emmanuel Vadot
675aae732d Add backlight subsystem
This is a simple subsystem that allow drivers to register as a backlight.
Each backlight creates a device node under /dev/backlight/backlightX and
an alias based on the name provided.

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26250
2020-10-02 18:18:01 +00:00
Nick O'Brien
3f59a7f97b flash: Add support for SPI flash s25fl512s
Reviewed by:	kp
Approved by:	kp (mentor)
Sponsored by:	Axiado
2020-10-02 17:33:56 +00:00
Navdeep Parhar
7676c62aa3 cxgbe(4): validate largest_rx_cluster and safest_rx_cluster.
These tunables can only be set to a valid cluster size (2K, 4K, 9K, or
16K) as documented in the man page.  Anything else could lead to a
panic on interface up.

Reported by:	mav@
MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-10-02 05:59:55 +00:00
Emmanuel Vadot
48c13e5270 ichsmb_pci: convert to pci_device_table / add PCI_PNP_INFO
Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D25260
2020-10-01 16:55:01 +00:00
Michal Meloun
c19440e350 Fix the inverted condition in mtx_asserts.
Mutex should be owned in affected functions.

Reborted by:	emaste
MFC after:	4 weeks
MFC with:	r366161
2020-10-01 09:50:08 +00:00
Emmanuel Vadot
6b74091dd5 ahci_generic: add quirk for NXP0004 (NXP Layerscape LX2160A)
This fixes this error :
(aprobe3:ahcich3:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
(aprobe3:ahcich3:0:15:0): CAM status: Command timeout
(aprobe3:ahcich3:0:15:0): Error 5, Retries exhausted

Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	imp, mav
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25157
2020-09-30 17:10:49 +00:00
Emmanuel Vadot
a52c8a6502 acpi_resource: support multiple IRQs
Some DSDT entries have multiple interrupts for one device.
Add support for it.

This fixes ahci on NXP LS2160 and genet on RPi4

Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25145
2020-09-30 17:09:17 +00:00
John Baldwin
0e99339684 Fallback to software for more GCM and CCM requests.
ccr(4) uses software to handle GCM and CCM requests not supported by
the crypto engine (e.g. with only AAD and no payload).  This change
adds a fallback for a few more requests such as those with more SGL
entries than can fit in a work request (this can happen for GCM when
decrypting a TLS record split across 15 or more packets).

Reported by:	Chelsio QA
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D26582
2020-09-29 21:51:32 +00:00
Bjoern A. Zeeb
3917c9ba65 rtwn: narrow the epoch area
Rather than placing the epoch around the entire receive loop which
might call into rtwn_rx_frame() and USB and sleep, split the loop
into two[1] and leave us with one unlock/lock cycle as well.

PR:		249925
Reported by:	thj, (rkoberman gmail.com)
Tested by:	thj
Suggested by:	adrian [1]
Reviewed by:	adrian
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation (initially, paniced my iwl lab host)
Differential Revision:	https://reviews.freebsd.org/D26554
2020-09-29 20:46:25 +00:00
Ruslan Bukin
6186bfbd18 Rename kernel option ACPI_DMAR to IOMMU.
This is mostly needed for a common arm64/amd64 iommu code.

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D26587
2020-09-29 20:29:07 +00:00
Ruslan Bukin
025730aad6 o Rename acpi_iommu_get_dma_tag() -> iommu_get_dma_tag().
This function isn't ACPI dependent and we may use it on FDT systems
  as well.
o Don't repeat the function declaration, include iommu.h instead.

Reviewed by:	andrew, kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D26584
2020-09-29 15:10:56 +00:00
Navdeep Parhar
822967e7e5 cxgbe(4): Avoid unnecessary work in the firmware during netmap tx.
Bind the netmap tx queues to a special '0xff' scheduling class which
makes the firmware skip some processing related to rate limiting on the
outgoing traffic.  Future firmwares will do this automatically.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-09-29 09:25:52 +00:00
Navdeep Parhar
7efe256233 Remove duplicate line. 2020-09-29 09:11:51 +00:00
Navdeep Parhar
15ca0766ed cxgbe(4): adjust the doorbell threshold for netmap freelists to match the
maximum burst size used when fetching descriptors from the list.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-09-29 07:51:06 +00:00
Navdeep Parhar
f7b8615af5 cxgbe(4): display an error message when netmap cannot be enabled because
the interface is down.

MFC after:	1 week
2020-09-29 07:36:21 +00:00
Navdeep Parhar
a9f476580e cxgbe(4): fixes for netmap operation with only some queues active.
- Only active netmap receive queues should be in the RSS lookup table.

- The RSS table should be restored for NIC operation when the last
  active netmap queue is switched off, not the first one.

- Support repeated netmap ON/OFF on a subset of the queues.  This works
  whether the the queues being enabled and disabled are the only ones
  active or not.  Some kring indexes have to be reset in the driver for
  the second case.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-09-29 05:08:45 +00:00
Michal Meloun
01d0f9c0e4 Refine locking inside of syscon driver.
In some cases, the syscon driver may be used by consumer requiring better
control about locking (ie. it may be used as registe file provider for clock
driver which needs locked access to multiple registers).
Add fine locking protocol methods together with bunch of helper functions
in syscon driver and implement this functionality in syscon_generic driver.

MFC after:	4 weeks
2020-09-25 16:44:01 +00:00
Michal Meloun
8dc348a479 Correctly handle nodes compatible with "syscon", "simple-bus".
Syscon can also have child nodes that share a registration file with it.
To do this correctly, follow these steps:
- subclass syscon from simplebus and expose it if the node is also
  "simple-bus" compatible.
- block simplebus probe for this compatible string, so it's priority
 (bus pass) doesn't colide with syscon driver.

While I'm in, also block "syscon", "simple-mfd" for the same reason.

MFC after:	4 weeks
2020-09-25 13:52:31 +00:00
Michal Meloun
b95a8021ec Make simplebus friendlier for subclassing.
MFC after:	1 week
2020-09-25 09:56:50 +00:00
Conrad Meyer
5b50517079 amdtemp(4), amdsmn(4): Attach to Ryzen 4000 APU (Zen 2, "Renoir")
PR:		249864
Reported by:	Florian Millet <florian.millet AT laposte.net>
Tested by:	Florian Millet
2020-09-25 04:16:28 +00:00
Bjoern A. Zeeb
fe5ebb23cc Provide MS() and SM() macros for 80211 and wireless drivers.
We have (two versions) of MS() and SM() macros which we use throughout
the wireless code.  Change all but three places (ath_hal, rtwn, and rsu)
to the newly provided _IEEE80211_MASKSHIFT() and _IEEE80211_SHIFTMASK()
macros.  Also change one internal case using both _S and _M instead of
just _S away from _M (one of the reasons rtwn and rsu were not changed).

This was done semi-mechanically.  No functional changes intended.

Requested by:	gnn (D26091)
Reviewed by:	adrian (pre line wrap)
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC (d/b/a "Netgate")
Differential Revision:	https://reviews.freebsd.org/D26539
2020-09-24 10:57:39 +00:00
Navdeep Parhar
30e3f2b4ea cxgbe(4): let the PF driver use VM work requests for transmit.
This allows the PF interfaces to communicate with the VF interfaces over
the internal switch in the ASIC.  Fix the GL limits for VM work requests
while here.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-22 04:16:40 +00:00
Navdeep Parhar
7054f6ec97 cxgbe(4): add counters for mbuf pullups and defrags.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-22 03:06:36 +00:00
Hans Petter Selasky
8463bd8a77 Add support for Winbond USB CDC modem device found in Tenma power supply.
PR:		249384
MFC after:	1 week
Submitted by:	darius@dons.net.au
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-09-21 18:32:57 +00:00
David Bright
e32d47f32d Add an ioctl to get an NVMe device's maximum transfer size
Reviewed by:	imp, chuck
Obtained from:	Dell EMC Isilon
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26390
2020-09-21 15:41:47 +00:00
Hans Petter Selasky
a29c0348f0 Fix for use of the XHCI driver on Cortex-A72 by adding a missing cache
flush operation before writing to the XHCI_ERSTBA_LO/HI register(s).

PR:		237666
Discussed with:	Mark Millard <marklmi@yahoo.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies // Nvidia
2020-09-19 22:37:45 +00:00
Eric van Gyzen
f9cc8410e1 vm_ooffset_t is now unsigned
vm_ooffset_t is now unsigned. Remove some tests for negative values,
or make other adjustments accordingly.

Reported by:	Coverity
Reviewed by:	kib markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26214
2020-09-18 16:48:08 +00:00
Navdeep Parhar
3b8506ae30 cxgbe(4): add the firmware binaries instead of the empty files that were added
in r365861.

Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-18 03:11:47 +00:00
Navdeep Parhar
a4a4ad2dd9 cxgbe(4): add support for stateless offloads for VXLAN traffic.
Hardware assistance includes checksumming (tx and rx), TSO, and RSS on
the inner traffic in a VXLAN tunnel.

Relnotes:	Yes
Sponsored by:	Chelsio Communications
2020-09-18 03:01:47 +00:00
Navdeep Parhar
88c9c3f4dd cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0.
Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-17 22:14:11 +00:00
Eric Joyner
a3b9a7366e e1000: Properly retain promisc flag
From Franco:
The iflib rewrite forced the promisc flag but it was not reported
to the system.  Noticed on a stock VM that went into unsolicited
promisc mode when dhclient was started during bootup.

PR:		248869
Submitted by:	Franco Fichtner <franco@opnsense.org>
Reviewed by:	erj@
MFC after:	3 days
2020-09-15 21:07:30 +00:00
Eric Joyner
467515a494 igb(4): Fix define and includes with RSS option enabled
This re-adds the opt_rss.h header to the driver and includes some
RSS-specific headers when RSS is defined.

PR:		249191
Submitted by:	Milosz Kaniewski <milosz.kaniewski@gmail.com>
MFC after:	3 days
2020-09-15 21:00:25 +00:00
Warner Losh
44a8153672 Don't do the busy dance in icee_open/close
We don't need to do the busy dance for this driver. It's handled by
destroy_dev() entirely. Since all we did was busy/unbusy in
open/close, just delete them. We therefore don't need to track closes
either.

Reviewed by: ian@
Differential Revision: https://reviews.freebsd.org/D26431
2020-09-14 23:30:04 +00:00
Navdeep Parhar
bb60ba7e22 cxgbe(4): Get the count of FCS errors from the MAC and not MPS for T6 ports.
The MPS register on the T6 counts something other than FCS errors despite its
name.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-09-14 22:15:54 +00:00