Commit Graph

38724 Commits

Author SHA1 Message Date
Warner Losh
35af933173 acpi: limit the AMDI0020/AMDI0010 workaround to an option
It appears that production versions of EPYC firmware get the _STA method right
for these nodes. In fact, this workaround breaks on production hardware by
including too many uart nodes. This work around was for pre-release hardware
that wound up not having a large deployment. Move this work around to a kernel
option since the machines that needed it have been powered off and are difficult
to resurrect. Should there be a more significant deployment than is understood,
we can restrict it based on smbios strings.

Discussed with: mmacy@, seanc@, jhb@
MFC After: 3 days
2021-02-08 14:47:49 -07:00
Vladimir Kondratyev
d8c6d4c732 wsp: Add sysctl tunable for Z-Axis inversion
This adds a new sysctl to Wellspring Touchpad driver for controlling
Z-Axis (2-finger vertical scroll) direction "hw.usb.wsp.z_invert".

Submitted by:	James Wright <james.wright_AT_digital-chaos_DOT_com>
Reviewed by:	wulf
PR:		253321
Differential revision:	https://reviews.freebsd.org/D28521
2021-02-09 00:35:39 +03:00
Warner Losh
dd2516fc07 nvme: Make nvme_ctrlr_hw_reset static
nvme_ctrlr_hw_reset is no longer used outside of nvme_ctrlr.c, so
make it static. If we need to change this in the future we can.
2021-02-08 13:29:24 -07:00
Warner Losh
9600aa31aa nvme: use NVME_GONE rather than hard-coded 0xffffffff
Make it clearer that the value 0xfffffff is being used to detect the device is
gone. We use it other places in the driver for other meanings.
2021-02-08 13:08:48 -07:00
Toomas Soome
32bf05ad89 vt: terminal size can grow too big with small font
vt is using static buffers for on screen data, the buffer size is
calculated based on maximum supported screen size and 8x16 font.

When using hi-res graphics and very smaller than 8x16 font, we
need to be careful not to overflow static buffers in vt.

Testing: I did test by building smaller buffers than vt currently is using,
royger was testing on actual 4k capable hardware.

MFC after: 1 week
Tested by: royger
2021-02-08 18:00:37 +02:00
Alfredo Dal'Ava Junior
59fffbcf46 mrsas: unbreak i386 build
Fix build regression introduced by
e34a057ca6

Reviewed by:	jhibbits
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D28494
2021-02-05 15:43:48 -03:00
Krzysztof Galazka
7d4dceec10 ixl(4): Fix VLAN HW filtering
X700 family of controllers has limited number of available VLAN
HW filters. Driver did not handle properly a case when user
assigned more VLANs to the interface which had all filters
already in use. Fix that by disabling HW filtering when
it is impossible to create filters for all requested VLANs.
Keep track of registered VLANs using bitstring to be able
to re-enable HW filtering when number of requested VLANs
drops below the limit.

Also switch all allocations to use M_IXL malloc type
to ease detecting memory leaks in the driver.

Reviewed by:	erj
Tested by:	gowtham.kumar.ks@intel.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28137
2021-02-04 15:33:42 -08:00
Alfredo Dal'Ava Junior
e34a057ca6 [POWERPC64BE] mrsas: add big-endian support
Add endiannes conversions in order to support big-endian platforms

Submitted by:	Andre Fernando da Silva <andre.silva@eldorado.org.br>
Reviewed by:	luporl, alfredo, kadesai (on email)
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D26531
2021-02-03 22:06:21 -03:00
Michal Meloun
8727c174b0 dwmmc: Multiple busdma fixes.
- limit maximum segment size to 2048 bytes.  Although dwmmc supports a buffer
  fragment with a maximum length of 4095 bytes, use the nearest lower power
  of two as the maximum fragment size. Otherwise, busdma create excessive
  buffer fragments.
- fix off by one error in computation of the maximum data transfer length.
- in addition, reserve two DMA descriptors that can be used by busdma
  bouncing. The beginning or end of the buffer can be misaligned.
- Don’t ignore errors passed to bus_dmamap_load() callback function.
- In theory, a DMA engine may be running at time when next dma descriptor is
  constructed. Create a full DMA descriptor before OWN bit is set.

MFC after:	2 weeks
2021-02-03 21:15:11 +01:00
Peter Grehan
5aaea4b99e Always clamp curve25519 keys prior to use.
This fixes an issue where a private key	contained bits that should
have been cleared by the clamping process, but were passed through
to the scalar multiplication routine and resulted in an	invalid
public key.

Issue diagnosed	(and an	initial	fix proposed) by shamaz.mazum in
PR 252894.

This fix suggested by Jason Donenfeld.

PR:		252894
Reported by:	shamaz.mazum
Reviewed by:	dch
MFC after:	3 days
2021-02-03 19:05:09 +10:00
Alexander Motin
3dd2a7a5ea Make DataSN counter of solicited Data-Out local.
DataSN for solicited Data-Out is per-R2T.  Since we handle whole R2T
in one go, we don't need to store it anywhere, especially in global
per-command structure.  This may allow us to handle multiple R2T per
command at once, if we decide, or may be relax locking.

Rename the second use of that field to io_referenced_task_tag.

MFC after:	1 month
2021-02-02 13:56:47 -05:00
Toomas Soome
1912d2b15e vt: parse_font_info_static should set refcount, not parse_font_info
As we get started with no memory allocator, we set up static font data
for font passed by loader (if there is any). At this time, we also must
set refcount 1, and refcount will get incremented in cnprobe() callback.

At some point the memory allocator will be available, and we will set up
properly allocated font data, but we should not disturb the refcount.

PR: 253147
2021-02-02 00:33:58 +02:00
Sai Rajesh Tallamraju
38bfc6dee3 iflib: Free resources in a consistent order during detach
Memory and PCI resources are freed with no particular order.  This could
cause use-after-frees when detaching following a failed attach.  For
instance, iflib_tx_structures_free() frees ctx->ifc_txqs[] but
iflib_tqg_detach() attempts to access this array. Similarly, adapter
queues gets freed by IFDI_QUEUES_FREE() but IFDI_DETACH() attempts to
access adapter queues to free PCI resources.

MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D27634
2021-02-01 11:15:54 -05:00
Navdeep Parhar
3447df8bc5 cxgbe(4): Fixes to tx coalescing.
- The behavior implemented in r362905 resulted in delayed transmission
  of packets in some cases, causing performance issues.  Use a different
  heuristic to predict tx requests.

- Add a tunable/sysctl (hw.cxgbe.tx_coalesce) to disable tx coalescing
  entirely.  It can be changed at any time.  There is no change in
  default behavior.
2021-02-01 03:00:09 -08:00
Alexander Motin
9dc7c250b8 cxgb(4): Remove assumption of physically contiguous mbufs.
Investigation of iSCSI target data corruption reports brought me to
discovery that cxgb(4) expects mbufs to be physically contiguous, that
is not true after I've started using m_extaddref() in software iSCSI
for large zero-copy transmissions.  In case of fragmented memory the
driver transmitted garbage from pages following the first one due to
simple use of pmap_kextract() for the first pointer instead of proper
bus_dmamap_load_mbuf_sg().  Seems like it was done as some optimization
many years ago, and at very least it is wrong in a world of IOMMUs.

This patch just removes that optimization, plus limits packet coalescing
for mbufs crossing page boundary, also depending on assumption of one
segment per packet.

MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Reviewed by:	mmacy, np
Differential revision:	https://reviews.freebsd.org/D28428
2021-01-31 12:55:06 -05:00
Gleb Smirnoff
3f43ada98c Catch up with 6edfd179c8: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG.
Originally IFCAP_NOMAP meant that the mbuf has external storage pointer
that points to unmapped address.  Then, this was extended to array of
such pointers.  Then, such mbufs were augmented with header/trailer.
Basically, extended mbufs are extended, and set of features is subject
to change.  The new name should be generic enough to avoid further
renaming.
2021-01-29 11:46:24 -08:00
Alexander Motin
8fee65d0c7 Add missing newlines.
MFC after:	3 days
2021-01-28 18:20:00 -05:00
Doug Ambrisko
0c852bb9b9 Add support for some more Intel VMD controllers. Some of the
newer controller have a sparce bus space that can be figured
out by probing the HW.  This gives the starting bus number.
When reading the PCI config. space behind the VMD controller,
the offset of the starting bus needs to be subtracted from
the bus being read.

Fixed a bug in which in which not all of the devices
directly attached to the VMD controller would be probed.
On my initial test HW, a switch was found at bus 0, slot 0
and function 0.  All of the NVME drives were behind that
switch.  Now scan for all slots and functions attached to
bus 0.  If a something was found then run attach after the
scan.  On detach also go through all slots and functions
on bus 0.

Tested with device ID's: 0x201d & 0x9a0b

Tested by:	nc@
MFC after:	7 days
PR:		252253
2021-01-28 15:12:14 -08:00
Alexander Motin
b75168ed24 Make software iSCSI more configurable.
Move software iSCSI tunables/sysctls into kern.icl.soft subtree.
Replace several hardcoded length constants there with variables.

While there, stretch the limits to better match Linux' open-iscsi
and our own initiator with new MAXPHYS of 1MB.  Our CTL target is
also optimized for up to 1MB I/Os, so there is also a match now.
For Windows 10 and VMware 6.7 initiators at default settings it
should make no change, since previous limits were sufficient there.

Tests of QD1 1MB writes from FreeBSD over 10GigE link show throughput
increase by 29% on idle connection and 132% with concurrent QD8 reads.

MFC after:	3 days
Sponsored by:	iXsystems, Inc.
2021-01-28 16:22:45 -05:00
Hans Petter Selasky
b8051298b0 Fix missing value in uar_page field for ratelimit in mlx5en(4).
This is a regression issue after the new UAR API was introduced
by f8f5b459d2 .

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-01-28 14:51:58 +01:00
Mark Johnston
2fccd4f9b6 safexcel: Disallow unsupported buffer layouts
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-27 15:31:10 -05:00
Mark Johnston
bd674d8b1f qat: Add support for separate AAD and output buffers
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-27 15:30:58 -05:00
Marius Strobl
c262e8e87e e1000: fix build after c1655b0f 2021-01-27 15:30:35 +01:00
Toomas Soome
93ebd6307e vt: panic while changing vt font
Set refcount for loader provided font to 1 to prevent this font
from being released (so we can reset to default).

PR: 252833
2021-01-27 01:07:03 +02:00
Marius Strobl
c1655b0f89 e1000: consistently use the hw variables
It's rather confusing when adapter->hw and hw are mixed and matched
within a particular function.
Some of this was missed in cd1cf2fc1d
and r353778 respectively.
2021-01-26 22:28:55 +01:00
Brooks Davis
bfc99943b0 ndis(4): remove as previous announced
nids(4) was a clever idea in the early 2000's when the market was
flooded with 10/100 NICs with Windows-only drivers, but that hasn't been
the case for ages and the driver has had no meaningful maintenance in
ages. It only supports Windows-XP era drivers.

Also remove:
 - ndis support from wpa_supplicant
 - ndiscvt(8)

Reviewed By:	emaste, bcr (manpages)
Differential Revision:	https://reviews.freebsd.org/D27609
2021-01-25 21:45:03 +00:00
Hans Petter Selasky
064009e794 Add support for enabling and disabling IFCAP_VLAN_HWTSO via
ifconfig(8) in mlx5en(4).

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-01-25 11:28:05 +01:00
Vincenzo Maffione
ee0005f11f netmap: simplify parameter passing
Changes imported from the netmap github.
2021-01-24 21:59:02 +00:00
Alexander Motin
9bee9a98ff Exclude reserved iSCSI Initiator Task Tag.
RFC 7143 (11.2.1.8):
   An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a
   task by the initiator.  The only instance in which it may be seen on
   the wire is in a target-initiated NOP-In PDU (Section 11.19) and in
   the initiator response to that PDU, if necessary.

MFC after:	1 month
2021-01-24 14:23:04 -05:00
Mark Johnston
519b64e27f Revert "Define PNP info after defining driver modules"
This reverts commit aa37baf3d7.

The reverted commit was motivated by a problem observed on stable/12,
but it turns out that a better solution was committed in r348309 but not
MFCed.  So, revert this change since it is unnecessary and not really
correct: it assumes that the order in which module metadata records is
defined determines their order in the output linker set.  While this
seems to hold in my testing, it is not guaranteed.

Reported by:	cem
Discussed with:	imp
MFC after:	3 days
2021-01-23 10:59:41 -05:00
Vincenzo Maffione
bfd75d4557 axgbe: fix some link related issues
By default, axgbe driver does a receiver reset after predefined number
of retries for the link to come up. However, this receiver reset
doesn't always suffice, due to an hardware issue.
In that case, as a workaround, a complete phy reset is necessary.
This patch introduces a sysctl that can be set to 1 to let the driver
reset the phy completely, rather than just doing receiver reset.
The workaround will be removed once the issue is fixed by means
of firmware update.

This patch also fixes the handling of the direct attach cables
properly.

Submitted by:	rajesh1.kumar_amd.com
Differential Revision:	https://reviews.freebsd.org/D28266
2021-01-23 13:51:29 +00:00
Marius Strobl
3b433ed765 mmcsd(4): properly set BIO error when partition switching fails
While at it, remove redundant braces and goto in mmcsd_task().

Reported by:	Coverity
CID:		1419639
2021-01-22 00:18:40 +01:00
Marius Strobl
2dcbf0462e sym(4): handle mixed tagged/untagged commands gracefully
Handle the case of a tagged command arriving when there's an untagged
one still outstanding gracefully instead of panicing.

While at it:
- Replace fancy arithmetics with a simple assignment as busy_itl can
  only ever be either 0 or 1.
- Fix a comment typo in sym_free_ccb().
2021-01-22 00:18:39 +01:00
Marius Strobl
e60a0db3b8 sym(4): fix nits reported by Coverity
- In ___dma_getp(), remove dead code. [1]
- In sym_sir_bad_scsi_status(), add missing FALLTHROUGH. [2]

While at it:
- For getbaddrcb(), remove __unused from the nseg argument as it's in
  fact used when compiling with INVARIANTS.
- In sym_int_sir(), ensure in all branches that cp is not NULL before
  using it.

Reported by:	Coverity
CID:		1008861 [1], 114996 [2]
2021-01-22 00:18:39 +01:00
Marius Strobl
c62ee7332e fb_if: remove unused method
Apparently, it never came into play.
2021-01-22 00:18:39 +01:00
Marius Strobl
b2a29e5f83 boot_font(4): remove obsolete font
It's no longer used since 4e421792ec
and r325892 respectively.
2021-01-22 00:18:39 +01:00
Mark Johnston
aa37baf3d7 Define PNP info after defining driver modules
PNP info definitions currently have an unfortunate requirement in that
they must follow the associated module definition in the module metadata
linker set.  Otherwise devmatch can segfault while processing the linker
hints file since kldxref maintains the order in the linker set.

A number of drivers violate this requirement.  In some cases this can
cause devmatch(8) to segfault when processing the linker hints file.
Work around the problem for now simply by adjusting the drivers.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D28260
2021-01-21 14:30:18 -05:00
Alexander Motin
ff751ee05c Remove FirstBurstLength limit for software iSCSI.
For hardware offload solicited data may potentially be handled more
efficiently than unsolicited due to direct data placement.  Or there
can be some unsolicited write buffering limitations.  It may create
situations where FirstBurstLength limit is really useful.

Software driver though has no those factors, having to do memcopy()
any way and having no so hard limit on the temporary storage.  Same
time more active use of unsolicited transfers allows to avoid some
of Ready To Transfer (R2T) PDU round-trip times and processing.

This change effectively doubles from 64KB to 128KB the maximum size
of write command that can be transferred within one link RTT.  Tests
of (64KB, 128KB] QD1 writes mixed with simultaneous QD8 reads over
the same connection, increasing RTT, shows almost double write speed
and half latency, while we should be able to afford few megabytes of
RAM for additional buffering on a target these days.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2021-01-20 23:17:12 -05:00
Jessica Clarke
85ad7f8da1 virtio_mmio: Delete a stale #if 0'ed debug print
This was blindly moved in r360722 but the variable being printed is not
yet initialised. It's of little use and can easily be added back in the
right place if needed by someone debugging, so just delete it.

Reported by:	bryanv
2021-01-21 02:14:41 +00:00
Jessica Clarke
633218ee46 virtio: Reduce boilerplate for device driver module definitions
Rather than have every device register itself for both virtio_pci and
virtio_mmio, provide a VIRTIO_DRIVER_MODULE wrapper to declare both,
merge VIRTIO_SIMPLE_PNPTABLE with VIRTIO_SIMPLE_PNPINFO and make the
latter register for both buses. This also has the benefit of abstracting
away the available transports and their names.

Reviewed by:	bryanv
Differential Revision:	https://reviews.freebsd.org/D28073
2021-01-21 01:07:23 +00:00
Jessica Clarke
be79a2c60f virtio_mmio: Fix V1 device probing spec conformance (section 4.2.3.1.1)
We must check MagicValue not just Version before anything else, and then
we must check DeviceID and immediately abort if zero (and this must not
be an error).

Do all this when probing rather than at the start of attaching as that's
where this belongs, and provides a clear boundary between the device
detection and device initialisation parts of the specified driver
initialisation process. This also means we don't create empty device
instances for placeholder devices, reducing clutter on systems that
pre-allocate a large number, such as QEMU's AArch64 virt machine (which
provides 32).

Reviewed by:	bryanv
Differential Revision:	https://reviews.freebsd.org/D28070
2021-01-21 01:05:21 +00:00
Jessica Clarke
0e72f2c541 virtio_mmio: Fix a style(9) issue 2021-01-21 01:05:20 +00:00
Ryan Libby
e54a1d5751 pms: handle maximum size IO with any alignment
Define the maximum numbers of segments to allow for non-page alignment
at the beginning and end of a maxphys size transfer.  Also set
ccb_pathinq.maxio consistent with maxphys.

Reviewed by:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D28043
2021-01-20 13:59:49 -08:00
Ryan Libby
84ab9074d4 pms: quiet -Wunused-variable
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27994
2021-01-20 13:59:49 -08:00
Vladimir Kondratyev
7a810290b8 evdev: Make variable-size ioctls return actual length of copyouted data
on success instead of 0 to match Linux.
Imprivata binary depends on this.

Submitted by:	Shunchao Hu <ankohuu_outlook.com>
Reviewed by:	wulf
Differential revision:	https://reviews.freebsd.org/D28218
2021-01-20 23:10:07 +03:00
Vladimir Kondratyev
5cc21ab994 hmt: Allow I2C sampling mode support to be compiled out. 2021-01-20 23:10:07 +03:00
Vladimir Kondratyev
3e954a8bc6 hms: Workaround idle mouse drift in I2C sampling mode.
Many I2C "compatibility" mouse devices found on touchpads continue to
return last report data in sampling mode after touch has been ended.
That results in cursor drift.  Filter out such a reports with comparing
content of current report with content of previous one.

Reported by:	many
Tested by:	omatsuda, gllb (github.com)
Obtained from:	sysutils/iichid
2021-01-20 23:10:07 +03:00
Vladimir Kondratyev
fa656aefe4 hconf(4): Do not fetch report before writing new usage values back.
There is a report that reading of surface/button switch feature report
causes SYN1B7D touchpad malfunction.  As specs does not require it to
be readable assume that report usages have default value on attach and
last written value during operation. Do not apply default usage values
on attachment and resume.
While here fix manpage typos and add avg@ to copyright header.

Reported by:	Jakob Alvermark <jakob_AT_alvermark_DOT_net>
Reviewed by:	avg
Differential revision:	https://reviews.freebsd.org/D28196
2021-01-20 23:10:06 +03:00
Lutz Donnerhacke
fa6662b368 ixl: Permit 802.1ad frames to pass though the chip
This patch is a quick hack to change the internal Ethertype used
within the chip.  All frames with this type are dropped silently.
This patch allows you to overwrite the factory default 0x88a8, which
is used by IEEE 802.1ad VLAN stacking.

Reviewed by:	kp, philip, brueffer
Approved by:	kp (mentor)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24179
2021-01-19 16:01:09 +01:00
Andriy Gapon
2c98edd6d6 htu21: driver for HTU21D I2C temperature and humidity sensor
MFC after:	2 weeks
Relnotes:	perhaps
2021-01-19 15:08:51 +02:00