Commit Graph

36950 Commits

Author SHA1 Message Date
Eric Joyner
d61b6a41dd ixgbe: Disable EEE for backplane X550EM_X
From Zach:
Intel documentation indicates that backplane X550EM_X KR devices do not
support Energy Efficient Ethernet. Prior to this patch, X552 devices
(device ID 0x15AB) will crash the system when transitioning EEE state
via sysctl.

Signed-off-by: Zach Vargas <zvargas@xes-inc.com>

PR:		240320
Submitted by:	Zach Vargas <zvargas@xes-inc.com>
Reviewed by:	erj@
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D21673
2019-10-15 21:56:19 +00:00
John Baldwin
65db3aa8c4 Install an ACPI PCI bus notify handler.
Rescan a PCI bus when the ACPI_NOTIFY_BUS_CHECK event is posted to a
PCI bus.

Reviewed by:	scottl
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21948
2019-10-15 19:12:09 +00:00
John Baldwin
8c9861f575 Support hot insertion and removal of PCI devices on EC2.
Install ACPI notify handlers on PCI devices with an _EJ0 method.  This
handler is invoked when devices are added or removed.

- When an ACPI_NOTIFY_DEVICE_CHECK event posts, rescan the parent bus
  device.  Note that strictly speaking we only need to rescan the
  specified device, but BUS_RESCAN is what is available, so we rescan
  the entire bus.
- When an ACPI_NOTIFY_EJECT_REQUEST event posts, detach the device
  associated with the ACPI handle, invoke the _EJ0 method, and then
  delete the device.

Eventually this might be changed to vector notify events to devd in
userspace where devctl can be used instead to permit more complex
actions such as graceful unmounting of filesystems.

Tested by:	cperciva
Reviewed by:	cperciva, imp, scottl
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21948
2019-10-15 19:04:39 +00:00
John Baldwin
21d3196209 Export pci_attach() and pci_detach().
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21948
2019-10-15 18:58:01 +00:00
Navdeep Parhar
693a9dfce2 cxgbe(4): An EQ update can be requested in a TX_PKTS2 work request.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2019-10-15 17:35:39 +00:00
Ruslan Bukin
a53a43d988 Fix dwmmc(4) driver attachment when ext_resources are not present.
Ignore only ENOENT (no DTS properties found) and ENODEV (driver not
present) non-zero return values from ext_resources.

Reviewed by:	manu
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22043
2019-10-15 17:24:21 +00:00
Jeff Roberson
0012f373e4 (4/6) Protect page valid with the busy lock.
Atomics are used for page busy and valid state when the shared busy is
held.  The details of the locking protocol and valid and dirty
synchronization are in the updated vm_page.h comments.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision:        https://reviews.freebsd.org/D21594
2019-10-15 03:45:41 +00:00
Jeff Roberson
63e9755548 (1/6) Replace busy checks with acquires where it is trival to do so.
This is the first in a series of patches that promotes the page busy field
to a first class lock that no longer requires the object lock for
consistency.

Reviewed by:	kib, markj
Tested by:	pho
Sponsored by:	Netflix, Intel
Differential Revision:	https://reviews.freebsd.org/D21548
2019-10-15 03:35:11 +00:00
Emmanuel Vadot
ce607eeb9d arm64: Add Synopsys DWC3 driver
This add a driver for the Synopsys DWC3 driver found on multiple SoCs.
It only supports host mode for now.

MFC after:	1 month
2019-10-14 22:27:33 +00:00
Gleb Smirnoff
96b224ed24 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	philip
2019-10-14 20:33:14 +00:00
Gleb Smirnoff
9b64a6db64 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:32:28 +00:00
Gleb Smirnoff
8fd18ef9b6 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:32:08 +00:00
Gleb Smirnoff
19a1980e10 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:31:57 +00:00
Gleb Smirnoff
c55e6e415c Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:31:43 +00:00
Gleb Smirnoff
2a5f613188 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:31:28 +00:00
Gleb Smirnoff
f8ef073e22 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:30:44 +00:00
Gleb Smirnoff
41840e2dab Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:30:30 +00:00
Gleb Smirnoff
100ad729c5 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:30:06 +00:00
Gleb Smirnoff
0a738e4d65 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:29:50 +00:00
Gleb Smirnoff
ae928424f1 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:29:32 +00:00
Gleb Smirnoff
a433f711bb Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:29:14 +00:00
Gleb Smirnoff
9c601934f6 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:26:53 +00:00
Gleb Smirnoff
3e7e87441c Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:26:17 +00:00
Gleb Smirnoff
20b26072b8 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	hselasky
2019-10-14 20:23:16 +00:00
Gleb Smirnoff
ba76aa6357 Convert if_foreach_llmaddr() KPI.
Reviewed by:	erj
2019-10-14 20:21:02 +00:00
Gleb Smirnoff
2a0f8518d6 Convert to if_foreach_llmaddr() KPI.
Reviewed by:	gallatin
2019-10-14 20:18:36 +00:00
John Baldwin
aeb63511bd Remove an unused parameter from get_new_keyid(). 2019-10-14 18:02:56 +00:00
Ruslan Bukin
3ee93b74c7 Fix the driver attachment in cases when the external resource devices
(resets, regulators, clocks) are not available.

Rely on a system initialization done by a bootloader in that cases.

This fixes operation on Terasic DE10-Pro (an Intel Stratix 10
development kit).

Sponsored by:	DARPA, AFRL
2019-10-14 15:52:59 +00:00
Matt Macy
1bb4eefa6c Fix sample check in hwpmc
Don't drop samples with callchain pending

Tested by: mjg@

Submitted by:	Rajeeb Barman at amd.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D17011
2019-10-13 22:26:55 +00:00
Mark Johnston
4dc5c02c01 Remove an unneeded include of opt_sctp.h.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-10-11 17:23:23 +00:00
Conrad Meyer
515013704d nvdimm(4): Calculate and save memattr once; it never changes
Refactor nvdimm_spa_memattr() routine and callers to just save the value at
initialization and use the value directly.  The reference value from NFIT,
MemoryMapping, is read only once, so the associated memattr could never
change.

No functional change.

Sponsored by:	Dell EMC Isilon
2019-10-10 22:49:45 +00:00
Doug Ambrisko
f2521a76ed This driver attaches to the Intel VMD drive and connects a new PCI domain
starting at the max. domain, and then work down.  Then existing FreeBSD
drivers will attach.  Interrupt routing from the VMD MSI-X to the NVME
drive is not well known, so any interrupt is sent to all children that
register.

VROC used Intel meta data so graid(8) works with it. However, graid(8)
supports RAID 0,1,10 for read and write. I have some early code to
support writes with RAID 5.  Note that RAID 5 can have life issues
with SSDs since it can cause write amplification from updating the parity
data.

Hot plug support needs a change to skip the following check to work:
	if (pcib_request_feature(dev, PCI_FEATURE_HP) != 0) {
in sys/dev/pci/pci_pci.c.

Looked at by: imp, rpokala, bcr
Differential Revision:	https://reviews.freebsd.org/D21383
2019-10-10 03:12:17 +00:00
John Baldwin
b60229e2f1 Remove adapters from t4_list earlier during detach.
This ensures the clip task won't race with t4_destroy_clip_table.

While here, make some mutex destroys unconditional since attach always
initializes them.

Reviewed by:	np
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D21952
2019-10-09 21:08:51 +00:00
Emmanuel Vadot
e3014a572e dwmmc: Reset the dma controller at attach
If the bootloader enabled DMA we need to fully reset the DMA controller
otherwise we might have some stale data in it that provoke weird
behavior.

MFC after:	1 week
2019-10-09 16:57:14 +00:00
Eric van Gyzen
83b82cd48c Add CTLFLAG_STATS to the dev.ioat.N.stats sysctl OIDs
Refer to r353111.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2019-10-09 12:14:10 +00:00
John Baldwin
4f13842f75 Add support for KTLS in the Chelsio TOE module.
This adds a TOE hook to allocate a KTLS session.  It also recognizes
TLS mbufs in the socket buffer and sends those to the NIC using a TLS
work request to encrypt the record before segmenting it.

TOE TLS support must be enabled via the dev.t6nex.<N>.tls sysctl in
addition to enabling KTLS.

Reviewed by:	np, gallatin
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D21891
2019-10-08 21:40:42 +00:00
John Baldwin
c59050aab5 Set the FID field in lookaside crypto requests to the rx queue ID.
The PCI block in the adapter requires this field to be set to a valid
queue ID.  It is not clear why it did not fail on all machines, but
the effect was that crypto operations reading input data via DMA
failed with an internal PCI read error on machines with 128G or more
of RAM.

Reported by:	gallatin
Reviewed by:	np
MFC after:	3 days
Sponsored by:	Chelsio Communications
2019-10-08 20:22:05 +00:00
Hans Petter Selasky
08650d170c Fix regression issue after r352989:
As noted by the commit message, callouts are now persistant
and should not be in the auto-zero section of the RQ's and SQ's.
This fixes an assert when using the TX completion event
factor feature with mlx5en(4).

Found by:	gallatin@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-08 19:49:25 +00:00
Doug Moore
2288078c5e Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map.
In case the implementation ever changes from using a chain of next pointers,
then changing the macro definition will be necessary, but changing all the
files that iterate over vm_map entries will not.

Drop a counter in vm_object.c that would have an effect only if the
vm_map entry count was wrong.

Discussed with: alc
Reviewed by: markj
Tested by: pho (earlier version)
Differential Revision:	https://reviews.freebsd.org/D21882
2019-10-08 07:14:21 +00:00
Gleb Smirnoff
b8a6e03fac Widen NET_EPOCH coverage.
When epoch(9) was introduced to network stack, it was basically
dropped in place of existing locking, which was mutexes and
rwlocks. For the sake of performance mutex covered areas were
as small as possible, so became epoch covered areas.

However, epoch doesn't introduce any contention, it just delays
memory reclaim. So, there is no point to minimise epoch covered
areas in sense of performance. Meanwhile entering/exiting epoch
also has non-zero CPU usage, so doing this less often is a win.

Not the least is also code maintainability. In the new paradigm
we can assume that at any stage of processing a packet, we are
inside network epoch. This makes coding both input and output
path way easier.

On output path we already enter epoch quite early - in the
ip_output(), in the ip6_output().

This patch does the same for the input path. All ISR processing,
network related callouts, other ways of packet injection to the
network stack shall be performed in net_epoch. Any leaf function
that walks network configuration now asserts epoch.

Tricky part is configuration code paths - ioctls, sysctls. They
also call into leaf functions, so some need to be changed.

This patch would introduce more epoch recursions (see EPOCH_TRACE)
than we had before. They will be cleaned up separately, as several
of them aren't trivial. Note, that unlike a lock recursion the
epoch recursion is safe and just wastes a bit of resources.

Reviewed by:	gallatin, hselasky, cy, adrian, kristof
Differential Revision:	https://reviews.freebsd.org/D19111
2019-10-07 22:40:05 +00:00
Hans Petter Selasky
ac66be4122 Make control endpoint quirk for xhci(4) configurable.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2019-10-07 13:40:29 +00:00
Conrad Meyer
cbd974b4b9 nvdimm(4): Add nvdimm_e820 pseudo-bus
nvdimm_e820 is a newbus pseudo driver that looks for "legacy" e820 PRAM
spans and creates ordinary-looking SPA devfs nodes for them
(/dev/nvdimm_spaN).

As these legacy regions lack real NFIT SPA regions and namespace
definitions, they must be administratively sliced up externally using
device.hints.  This is similar in purpose to the Linux memmap= mechanism.

It is assumed that systems with working NFIT tables will not have any use
for this driver, and that that will be the prevailing style going forward,
so if there are no explicit hints provided, this driver does not
automatically create any devices.

Reviewed by:	kib (previous version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21885
2019-10-04 18:38:47 +00:00
Emmanuel Vadot
7a58744fd0 Split out the attachment from the generic-ehci driver
Create an attachment file for the existing ACPI attachment, and create a
new FDT attachment for the generic-ehci driver.

Submitted by:	andrew (Original version)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D19389
2019-10-03 18:53:03 +00:00
Conrad Meyer
31f1c8fc84 nvdimm: Fix error path mis-free
Regression introduced in r343629 when malloc result was renamed from spa to
spa_mapping and the 'spa' name was instead used to iterate a table, but the
free() target was not updated.

Reviewed by:	kib, scottph
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21871
2019-10-02 19:13:35 +00:00
Hans Petter Selasky
bb2d815739 Fix build failure for gcc after r352983, due to
not using static variable declared by net/sff8472.h .

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 12:45:39 +00:00
Hans Petter Selasky
67a254a074 Fix build failure for 32-bit platforms after r352991, due to
incorrect printf() formatter string.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 12:02:14 +00:00
Hans Petter Selasky
d3d47408fc Bump driver version for mlx5core, mlx5en(4) and mlx5ib(4).
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:15:35 +00:00
Hans Petter Selasky
fedc7bd218 Print numeric error_type and module_status in mlx5core
in case the strings are not available.

Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:06:01 +00:00
Hans Petter Selasky
02fd8723c2 Add print to show user a reason for rejecting buffer size change in mlx5en(4).
Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:05:05 +00:00
Hans Petter Selasky
e525a7f0eb Only update lossy buffers config when manual PFC configuration was done
in mlx5en(4).

Submitted by:	kib@
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-10-02 11:02:54 +00:00