Commit Graph

38325 Commits

Author SHA1 Message Date
John Baldwin
b3ceca0c80 Clear tp->tod in t4_pcb_detach().
Otherwise, a socket can have a non-NULL tp->tod while TF_TOE is clear.
In particular, if a newly accepted socket falls back to non-TOE due to
an active open failure, the non-TOE socket will still have tp->tod set
even though TF_TOE is clear.

Reviewed by:	np
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D27028
2020-11-10 19:54:39 +00:00
Hans Petter Selasky
6c43a5e9c7 Include GID type when deleting GIDs from HW table under RoCE in mlx4ib.
Refer to the Linux commit mentioned below for a more detailed description.

Linux commit:
a18177925c252da7801149abe217c05b80884798

Requested by:	Isilon
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-10 12:58:25 +00:00
Bjoern A. Zeeb
4c7458fa7c usb_hub: fix whitespace
Fix a whitespace "error" introduced in r367435 noticed when
preparing the MFC.  No functional changes.
2020-11-09 23:36:51 +00:00
Warner Losh
8b8af16875 Remove newline from bxe description, it's not done elsewhere. 2020-11-09 03:02:34 +00:00
Navdeep Parhar
de0a3472d8 cxgbe(4): Allow the PF driver to set a VF's MAC address.
The MAC address can be set with the optional mac-addr property in the VF
section of the iovctl.conf(5) used to instantiate the VFs.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-11-09 00:08:35 +00:00
Mateusz Guzik
e90afaa015 kqueue: save space by using only one func pointer for assertions 2020-11-09 00:04:35 +00:00
Navdeep Parhar
dc0800a9ad cxgbev(4): Use the MAC address set by the the PF if there is one.
Query the firmware for the MAC address set by the PF for the VF and use
it instead of the firmware generated MAC if it's available.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2020-11-09 00:01:13 +00:00
Navdeep Parhar
76b976ad98 cxgbe(4): Add the firmware binaries missing in r367428.
Obtained from:	Chelsio Communications
MFC after:	5 days
Sponsored by:	Chelsio Communications
2020-11-08 22:30:13 +00:00
Kyle Evans
e0f14ecf60 vt: resolve conflict between VT_ALT_TO_ESC_HACK and DBG
When using the ALT+CTRL+ESC sequence to break into kdb, the keyboard is
completely borked when you return. watch(8) shows that it's working, but
it's inserting escape sequences.

Further investigation revealed that VT_ALT_TO_ESC_HACK is the default and
directly conflicts with this sequence, so upon return from the debugger
ALKED is set.

If they triggered the break to debugger, it's safe to assume they didn't
mean to use VT_ALT_TO_ESC_HACK, so just unset it to reduce the surprise when
the keyboard seems non-functional upon return.

Reviewed by:	tsoome
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27109
2020-11-07 15:38:01 +00:00
Bjoern A. Zeeb
2144eb7568 usb_hub: giving up port reset - device vanished
Improve the output of the recently often experienced debug message in order
to gather further data.

PR:		237666
Reviewed by:	hselasky
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D27108
2020-11-06 22:40:00 +00:00
Toomas Soome
0244378f43 efifb: vt_generate_cons_palette() takes max color, not mask
vt_generate_cons_palette() does take max values of RGB component colours, not
mask. Also we need to set info->fb_cmsize, or vt_fb_init() will re-initialize
the info->fb_cmap.
2020-11-06 21:27:54 +00:00
Navdeep Parhar
890efa1ab9 cxgbe(4): Update firmwares to 1.25.0.40.
This fixes a potential crash in firmware 1.25.0.0 on the passive open
side during TOE operation.

Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-11-06 19:04:20 +00:00
Mateusz Guzik
71460dfcb2 nvme: change namei_request_zone into a malloc type
Both the size (128 bytes) and ephemeral nature of allocations make it a great
fit for malloc.

A dedicated zone unnecessarily avoids sharing buckets with 128-byte objects.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D27103
2020-11-05 21:44:58 +00:00
Konstantin Belousov
f10845877e Suspend all writeable local filesystems on power suspend.
This ensures that no writes are pending in memory, either metadata or
user data, but not including dirty pages not yet converted to fs writes.

Only filesystems declared local are suspended.

Note that this does not guarantee absence of the metadata errors or
leaks if resume is not done: for instance, on UFS unlinked but opened
inodes are leaked and require fsck to gc.

Reviewed by:	markj
Discussed with:	imp
Tested by:	imp (previous version), pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D27054
2020-11-05 20:52:49 +00:00
Leandro Lupori
68dd718256 [PowerPC] hwpmc: add support for POWER8/9 PMCs
This change adds support for POWER8 and POWER9 PMCs (bare metal and
pseries).
All PowerISA 2.07B non-random events are supported.

Implementation was based on that of PPC970.

Reviewed by:	jhibbits
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D26110
2020-11-05 16:36:39 +00:00
Mark Johnston
72143e89bb Add qat(4)
This provides an OpenCrypto driver for Intel QuickAssist devices.  The
driver was initially ported from NetBSD and comes with a few
improvements:
- support for GMAC/AES-GCM, AES-CTR and AES-XTS, and support for
  SHA/HMAC-authenticated encryption
- support for detaching the driver
- various bug fixes
- DH895X support

Discussed with:	jhb
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D26963
2020-11-05 15:55:23 +00:00
Leandro Lupori
9fe896ec79 [PowerPC] Make PPC 970 PMC SPRs the standard ones
And add a _74XX suffix to 74XX SPRs.

This is a preparation for adding support to POWER8/9 PMCs, which have most
SPRs equal to 970 ones.

Reviewed by:	jhibbits
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D26532
2020-11-05 14:15:50 +00:00
Vladimir Kondratyev
07030f3362 atkbdc(4): Add quirk for "System76 lemur Pro" laptops.
Currently atkbdc(4) assumes all coreboot BIOSes belonging to Chromebooks
and unconditionally sets a number of quirks to workaround known issues.

Exclude "System76" laptops from this set as they appeared to be a
traditional hardware ("lemur Pro" is a rebranded Clevo chassis) with
coreboot firmware on board. KBDC_QUIRK_KEEP_ACTIVATED quirk activated for
Chromebook platform makes keyboard on this devices inoperable.

"Purism Librem" laptops may require the same exclusion too.

PR:		250711
Reported by:	nick.lott@gmail.com
MFC after:	2 weeks
2020-11-04 21:52:10 +00:00
Emmanuel Vadot
03d0d84bf6 Plug minor memory leak in dwc3 USB2/USB3 controller.
OF_getprop_alloc called earlier requires corresponding OF_prop_free to release allocated memory.

Submitted by:	kjopek@gmail.com
Differential Revision:	https://reviews.freebsd.org/D27085
2020-11-04 18:23:59 +00:00
Mark Johnston
f7db0c9532 vmspace: Convert to refcount(9)
This is mostly mechanical except for vmspace_exit().  There, use the new
refcount_release_if_last() to avoid switching to vmspace0 unless other
processes are sharing the vmspace.  In that case, upon switching to
vmspace0 we can unconditionally release the reference.

Remove the volatile qualifier from vm_refcnt now that accesses are
protected using refcount(9) KPIs.

Reviewed by:	alc, kib, mmel
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27057
2020-11-04 16:30:56 +00:00
Alexander Motin
06c888ecb9 Add icc (Isochronous Command Completion) ccb_ataio field.
MFC after:	1 week
2020-11-02 01:01:41 +00:00
Vladimir Kondratyev
113ec54c58 acpi_dock(4): Add ACPI_PNP_INFO
MFC after:	2 weeks
2020-10-31 22:20:42 +00:00
Vladimir Kondratyev
58ea3386f3 acpi_wmi(4): Add ACPI_PNP_INFO
MFC after:	2 weeks
2020-10-31 22:19:39 +00:00
Vladimir Kondratyev
9c6e377448 Add plug and play information macroses for ACPI and I2C buses.
Matching table format is compatible with ACPI_ID_PROBE bus method.

Note that while ACPI_ID_PROBE matches against _HID and all _CIDs, current
acpi_pnpinfo_str() exports only _HID and first _CID.  That means second
and further _CIDs should be added to both acpi_pnpinfo_str() and
ACPICOMPAT_PNP_INFO if device matching against them is required.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26824
2020-10-31 22:15:59 +00:00
Hans Petter Selasky
c77bfaa750 Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4).
Submitted by:		pedro martelletto <pedro@ambientworks.net>
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-31 21:53:23 +00:00
Vladimir Kondratyev
59402cc58a acpi_video(4): Put display device in to D3 state on "Display off" event.
As required by ACPI specs 6.3, appendix A.6, table B-8.
2020-10-31 20:28:13 +00:00
Vladimir Kondratyev
16b168c115 acpi_video(4): Add evdev support for reporting of video events. 2020-10-31 20:25:55 +00:00
Vladimir Kondratyev
ae2b074bbb acpi(9): Add EVENTHANDLERs for video and AC adapter events.
They are required for coming ACPI support in LinuxKPI.

Reviewed by:	hselasky, manu (as part of D26603)
2020-10-31 20:14:28 +00:00
Vladimir Kondratyev
fe64ff3c04 acpi: Tweak _DSM method evaluation helpers.
- Use ACPI style for _DSM evaluation helper parameter types.
- Constify UUID parameter.
- Increase size of returned DSM function bitmap by acpi_DSMQuery() up to 64
  items. Old limit of 8 functions is not sufficient for JEDEC JESD245 NVDIMMs.
- Add new acpi_EvaluateDSMTyped() helper which performs additional return
  value type check as compared with acpi_EvaluateDSM().
- Reimplement acpi_EvaluateDSM() on top of the acpi_EvaluateDSMTyped() call.

Reviewed by:	scottph, manu
Differential Revision:	https://reviews.freebsd.org/D26602
2020-10-31 19:47:34 +00:00
Vladimir Kondratyev
f19aed3517 ig4(4): Add PCI IDs for Intel Comit Lake I2C controllers.
MFC after:	2 weeks
2020-10-31 19:30:23 +00:00
John Baldwin
b7d92a6683 Remove IF_SND_TAG_TYPE_TLS_RATE_LIMIT conditionals.
Support for TLS rate limit tags is now in the tree, so this macro is
always defined.

Reviewed by:	hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27020
2020-10-30 21:05:50 +00:00
John Baldwin
418b5444f8 Fix a couple of silly bugs in r367149.
- Assign the TLS rate limit value to the correct member of the
  rl_params for the nested rate limit tag.

- Remove a dead condition.

Pointy hat to:	jhb
2020-10-30 00:06:36 +00:00
John Baldwin
36e0a362ac Add m_snd_tag_alloc() as a wrapper around if_snd_tag_alloc().
This gives a more uniform API for send tag life cycle management.

Reviewed by:	gallatin, hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27000
2020-10-29 23:28:39 +00:00
John Baldwin
638000c0b6 Use public interfaces to manage the nested rate limit send tag.
Each TLS send tag in mlx5 contains a nested rate limit send tag.
Previously, the driver was calling internal functions to manage the
nested tag.  Calling free methods directly instead of m_snd_tag_rele()
leaked send tag references and references on the ifp.  Changes to use
the ifp methods for the nested tag for other methods are more cosmetic
but do simplify the code.

Reviewed by:	gallatin, hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26996
2020-10-29 22:22:27 +00:00
John Baldwin
521eac97f3 Support hardware rate limiting (pacing) with TLS offload.
- Add a new send tag type for a send tag that supports both rate
  limiting (packet pacing) and TLS offload (mostly similar to D22669
  but adds a separate structure when allocating the new tag type).

- When allocating a send tag for TLS offload, check to see if the
  connection already has a pacing rate.  If so, allocate a tag that
  supports both rate limiting and TLS offload rather than a plain TLS
  offload tag.

- When setting an initial rate on an existing ifnet KTLS connection,
  set the rate in the TCP control block inp and then reset the TLS
  send tag (via ktls_output_eagain) to reallocate a TLS + ratelimit
  send tag.  This allocates the TLS send tag asynchronously from a
  task queue, so the TLS rate limit tag alloc is always sleepable.

- When modifying a rate on a connection using KTLS, look for a TLS
  send tag.  If the send tag is only a plain TLS send tag, assume we
  failed to allocate a TLS ratelimit tag (either during the
  TCP_TXTLS_ENABLE socket option, or during the send tag reset
  triggered by ktls_output_eagain) and ignore the new rate.  If the
  send tag is a ratelimit TLS send tag, change the rate on the TLS tag
  and leave the inp tag alone.

- Lock the inp lock when setting sb_tls_info for a socket send buffer
  so that the routines in tcp_ratelimit can safely dereference the
  pointer without needing to grab the socket buffer lock.

- Add an IFCAP_TXTLS_RTLMT capability flag and associated
  administrative controls in ifconfig(8).  TLS rate limit tags are
  only allocated if this capability is enabled.  Note that TLS offload
  (whether unlimited or rate limited) always requires IFCAP_TXTLS[46].

Reviewed by:	gallatin, hselasky
Relnotes:	yes
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26691
2020-10-29 00:23:16 +00:00
Alexander Motin
6dd1985bad Fix unintentional constant rename in r367109.
MFC after:	1 week
2020-10-28 18:22:25 +00:00
Alexander Motin
c44441f8fd Print NVMe controller capabilities in verbose dmesg.
Those values are not reported in controller identification, while sometimes
interesting for development and debugging.

MFC after:	1 week
2020-10-28 15:43:29 +00:00
Edward Tomasz Napierala
bce7ee9d41 Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@.  It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by:	emaste, imp, gbe (manpages)
Differential Revision:	https://reviews.freebsd.org/D26980
2020-10-28 13:46:11 +00:00
Hans Petter Selasky
87462084ac Add new USB IDs.
Submitted by:		aleksi.kaalinpaa@kapsi.fi
PR:			250675
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-28 08:22:38 +00:00
Alexander Motin
8836496815 Introduce support of SCSI Command Priority.
SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default.  SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL.  Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles.  Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target.  Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.

MFC after:	1 month
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2020-10-25 19:34:02 +00:00
Alexander Motin
eb5a54f880 Fix incorrect constants of target tag action.
ocs_scsi_recv_cmd() receives the flags after ocs_get_flags_fcp_cmd(),
which translates them from FCP_TASK_ATTR_* to OCS_SCSI_CMD_*.  As result
non-SIMPLE requests turned into HEAD or ORDERED depending on direction.

MFC after:	2 weeks
2020-10-25 16:58:48 +00:00
Warner Losh
f90045602b Remove support for ancient compilers
We don't support building the kernel from such old compilers, nor with
the Intel Compiler specifically. Remove support for this old construct
that was copied from stdbool.h and not relevant here.
2020-10-24 23:21:18 +00:00
Richard Scheffenegger
4dfbcffbb9 Add network QoS support for PCP to iscsi initiator.
Make the Ethernet PCP codepoint configurable
for L2 local traffic, to allow lower latency for
iSCSI block IO. This addresses the initiator
side only.

Reviewed by:	mav, trasz, bcr
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26739
2020-10-24 21:07:13 +00:00
Ruslan Bukin
f32f0095e9 o Add iommu de-initialization method for MSI interface.
o Add iommu_unmap_msi() to release the msi GAS entry.
o Provide default implementations for iommu init/deinit methods.

Reviewed by:	kib
Sponsored by:	Innovate DSbD
Differential Revision:	https://reviews.freebsd.org/D26906
2020-10-24 20:09:27 +00:00
Warner Losh
0fc1d20881 nvme: Remove compat code for older kernels
Remove code that supported pre-2011 kernels. CTLTYPE_S64 was defined
in rev 217616. All supported branches have it, so remove its compat
definition as OBE.
2020-10-24 01:59:01 +00:00
Ruslan Bukin
9729b14985 Move the iommu stubs to a generic place, so they are available on all the
platforms.

This allows to not depend on the IOMMU macro in AHCI driver.

Requested by:	kib
Suggested by:	andrew
Reviewed by:	kib
Sponsored by:	Innovate DSbD
Differential Revision:	https://reviews.freebsd.org/D26887
2020-10-23 21:27:48 +00:00
Konstantin Belousov
116bc58260 xhci: Handle the case when MSI-X BAR is the same as IO BAR.
PCIe allows for MSI-X BAR to be either dedicated, or MSI-X Table may
be co-located in some functional BAR.  In the later case xhci(4) is
unable to allocate active resource for the table because BAR is
already activated.

Handle it by checking for this special case, and not try to alloc
resource if MSI-X BAR is IO.

Reported and tested by:	emaste
Reviewed by:	emaste, hselasky
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D26913
2020-10-23 18:18:45 +00:00
Mark Johnston
93fb2b060b ntb: Fix the 32-bit build after r366969
Reported by:	Jenkins
MFC with:	r366969
2020-10-23 15:12:06 +00:00
Mark Johnston
6660ef6e91 ntb: Add Intel Xeon Gen3 support
The NTB hardware starting with Skylake has some changes to the register
map and the doorbell interface.  Add a new NTB_XEON_GEN3 device type and
use it to conditionalize driver logic that differs from the existing
Xeon code.

Reviewed by:	vangyzen
Discussed with:	cem, Bret Ketchum <Bret.Ketchum@dell.com>
MFC after:	1 month
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26683
2020-10-23 14:16:52 +00:00
Mark Johnston
97441fab87 ntb: Fix an assertion to permit >= 32 doorbells
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
2020-10-23 14:15:58 +00:00