Commit graph

39027 commits

Author SHA1 Message Date
Kevin Bowling
8b043521b4 intel ethernet: Use ether_gen_addr(9)
Use ether_gen_addr(9) for VF MAC generation

Reviewed by:	Intel Networking (erj), kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31616

(cherry picked from commit 0e5811a2a9)
2021-08-26 18:33:48 -07:00
Kevin Bowling
524ea0dea9 e1000: Update intel shared code
Sync the e1000 shared code with DPDK shared code
"cid-gigabit.2020.06.05.tar.gz released by ND"

Primary focus was on client platforms (ich8lan). More work remains here
but we need an Intel contact for client networking.

Reviewed by:	grehan, Intel Networking (erj, earlier rev)
Obtained from:	DPDK <http://git.dpdk.org/dpdk/tree/drivers/net/e1000/base>
MFC after:	1 week
Sponsored by:	me
Differential Revision:	https://reviews.freebsd.org/D31547

(cherry picked from commit fc7682b17f)
2021-08-25 17:31:17 -07:00
Alexander Motin
2daa57cafb Mark some sysctls as CTLFLAG_MPSAFE.
MFC after:	2 weeks

(cherry picked from commit b776de6796)
2021-08-24 21:53:18 -04:00
Alexander Motin
17c83ffd10 ntb_hw_intel(4): Add CTLFLAG_MPSAFE flags.
I should have added those in 50f16247a1.

MFC after:	2 weeks

(cherry picked from commit 94feb1f1eb)
2021-08-23 22:35:30 -04:00
Alexander Motin
a58ed3b4f4 ntb_hw_intel(4): Remove CTLFLAG_NEEDGIANT flags.
Most of the sysctls just read hardware registers.  They don't need
any locking.

MFC after:	2 weeks

(cherry picked from commit 50f16247a1)
2021-08-23 22:29:46 -04:00
Alexander Motin
ccda3e7069 ntb_transport(4): Mark callouts MP-safe.
The only thing around NTB using Giant lock is NewBus, and these callouts
have nothing to do with it.

MFC after:	2 weeks

(cherry picked from commit c6902e7796)
2021-08-23 22:29:46 -04:00
Kevin Bowling
784459fc16 ixgbe: Avoid sbuf_trim(9) in sysctl handler
This was an error, we cannot use sbuf_trim(9) in the
ixgbe_sbuf_fw_version function because it also gets called in
the context of sbuf_new_for_sysctl(9). sbuf(9) explains the interaction
with drain functions as used by sbuf_new_for_sysctl(9).

Reviewed by:	imp
Fixes:		7660e4ea5c
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D31633

(cherry picked from commit 5de5419b5e)
2021-08-23 17:50:02 -07:00
Vladimir Kondratyev
04a49585bb evdev: Use bit_foreach helper macro
for traversing all bits set in the bitstring(9).

While here move bit_change() definition to common header.

(cherry picked from commit 5f99ae56c9)
2021-08-24 01:23:41 +03:00
Vladimir Kondratyev
290677c3d6 hms(4): Allow attachment to pointer top level collection.
to be in line with Microsoft mouse driver [1]

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/top-level-collections-opened-by-windows-for-system-use

(cherry picked from commit 9b78891df1)
2021-08-24 01:22:43 +03:00
Vladimir Kondratyev
bb5eb85e5c ps4dshock(4): Fix touchpad width in HID report descriptor
(cherry picked from commit 9b2b5f42b4)
2021-08-24 01:22:13 +03:00
Greg V
2de8a0d209 hid: move proper hat switch handling from ps4dshock to hgame
Generic "DirectInput" HID gamepads need this handling too.

Reviewed by:	wulf

(cherry picked from commit 51b2216114)
2021-08-24 01:21:49 +03:00
Jack
6c8f2d24d4 hmt(4): Do not ignore constant usages in HID report descriptor parser
This fixes hmt to work with MELF0411 1FD2:7012 touchscreen

Obtained from:	sysutils/iichid

(cherry picked from commit cb910670ac)
2021-08-24 01:21:24 +03:00
Vladimir Kondratyev
a711310d2d hid: Add extra constant to units of measurement
Some devices like eGalax touchscreens use value of 0x33 instead of 0x13
for inches as unit of measure.

Reported by:	Mark Kane <mark_AT_kane_DOT_mn>

(cherry picked from commit be75951af1)
2021-08-24 01:20:30 +03:00
Vladimir Kondratyev
ec86cee5db evdev: Do not check maximal contact number for MT initialization
This allows singletouch devices which use multitouch protocols to work.

Reported by:	Mark Kane <mark_AT_kane_DOT_mn>

(cherry picked from commit e40fec4ec9)
2021-08-24 01:20:06 +03:00
Vladimir Kondratyev
5517f7f9e7 hmt(4): Store Contact Count in separate variable.
No functional changes.

(cherry picked from commit 95add157e3)
2021-08-24 01:19:43 +03:00
Kevin Bowling
1a72c3d76a e1000: always enable PCSD when RSS hashing
To enable RSS hashing in the NIC, the PCSD bit must be set.

By default, this is never set when RXCSUM is disabled - which
causes problems higher up in the stack.

While here improve the RXCSUM flag assignments when enabling or
disabling IFCAP_RXCSUM.

See also: https://lists.freebsd.org/pipermail/freebsd-current/2020-May/076148.html

Reviewed by:	markj, Franco Fichtner <franco@opnsense.org>,
		Stephan de Wit <stephan.dewt@yahoo.co.uk>
Obtained from:	OPNsense
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31501
Co-authored-by: Stephan de Wit <stephan.dewt@yahoo.co.uk>
Co-authored-by: Franco Fichtner <franco@opnsense.org>

(cherry picked from commit 69e8e8ea3d)
2021-08-23 09:23:43 -07:00
Konstantin Belousov
1ff28f8a0d coretemp: use x86_msr_op for thermal MSR access
(cherry picked from commit 4cc6fe1e5b)
2021-08-23 12:24:40 +03:00
Konstantin Belousov
56f6a96f93 x86_msr_op: extend the KPI to allow MSR read and single-CPU operations
(cherry picked from commit d0bc4b4666)
2021-08-23 12:24:39 +03:00
Alexander Motin
66e088e12b kbdmux(4): Make callout handler mpsafe.
Both callout and taskqueue now have drain() routines not requiring
external locking.  It allows to remove TASK flag and manual drain,
so the only thing remaining for lock to protect inside the callout
handler is ks_inq_length zero comparison, that can be lockless.

MFC after:	2 weeks

(cherry picked from commit e5018628e7)
2021-08-21 20:27:25 -04:00
Gordon Bergling
af89e052b9 Fix a typo that was introduced while fixing a typo
- s/enrtry/entry/

(cherry picked from commit 646f3a36c8)
2021-08-19 14:32:05 +02:00
Gordon Bergling
ab4864fba2 Fix some common typos in source code comments
- s/struture/structure/
- s/structre/structure/

(cherry picked from commit 17db4b52fb)
2021-08-19 09:28:06 +02:00
Gordon Bergling
ac7cf0c636 Fix a few typos in source code comments
- s/procesing/processing/

(cherry picked from commit 288e553623)
2021-08-19 09:27:34 +02:00
Gordon Bergling
ca2e359c02 Fix a common typo in a comment
- s/enrty/entry/

(cherry picked from commit 86b74b7368)
2021-08-19 09:26:58 +02:00
Gordon Bergling
f296898fb7 Fix a common typo in source code comments
- s/aligment/alignment/

(cherry picked from commit a1581cd735)
2021-08-19 09:18:35 +02:00
Kevin Bowling
15b57cbfde e1000: rctl/srrctl buffer size init, rfctl fix
Simplify the setup of srrctl.BSIZEPKT on igb class NICs.
Improve the setup of rctl.BSIZE on lem and em class NICs.
Don't try to touch rfctl on lem class NICs.
Manipulate rctl.BSEX correctly on lem and em class NICs.

Approved by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31457

(cherry picked from commit 12e8addd32)
2021-08-16 18:35:04 -07:00
Marius Strobl
5dd1d72e5b e1000: fix build after b761f26492 (orig c1655b0f)
(cherry picked from commit c262e8e87e)
2021-08-16 18:31:43 -07:00
Marius Strobl
b761f26492 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.

(cherry picked from commit c1655b0f89)
2021-08-16 18:29:19 -07:00
Kevin Bowling
0d0726a769 e1000: Fix lem/em UDP rx csum offload
Rebase on igb code and unify lem/em implementations.

PR:		257642
Reported by:	Nick Reilly <nreilly@blackberry.com>
Reviewed by:	karels, emaste
Tested by:	Nick Reilly <nreilly@blackberry.com>
Approved by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31449

(cherry picked from commit 015075f383)
2021-08-15 17:56:45 -07:00
Vladimir Kondratyev
f2f52fbfdb psm(4): Probe Synaptics touchpad with active multiplexing mode enabled
if it is only multiplexed device. Also enable syncbit checks for them.
This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop.

Reported by:	Tomasz "CeDeROM" CEDRO <tomek_AT_cedro_DOT_info>
PR:		253279
Differential revision:	https://reviews.freebsd.org/D28502

(cherry picked from commit f5998d20ed)
2021-08-16 03:47:18 +03:00
Vladimir Kondratyev
c3bccba63d iichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts
during suspend/resume cycle. Previously used bus_generic_suspend_intr and
bus_generic_resume_intr may cause interrupt storm because of missed
interrupt acknowledges caused by blocking of intr handler.

Reported by:	J.R. Oldroyd <jr_AT_opal_DOT_com>

(cherry picked from commit 82626fef62)
2021-08-16 03:46:18 +03:00
J.R. Oldroyd
094860333a iichid(4): disable interrupt on suspend
Commit message of the identical change in Linux driver says:
"When an I2C HID device is powered off during system sleep, as a result
of removing its power resources (by the ACPI core) the interrupt line
might go low as well.  This results inadvertent interrupts."

This change fixes suspend/resume on Asus S510UQ laptops.

While here add a couple of typo fixes as well as a slight change to the
iichid_attach() code to have the power_on flag set properly.

Submitted by:	J.R. Oldroyd <jr_AT_opal_DOT_com>
Reviewed by:	wulf

(cherry picked from commit 5236888db7)
2021-08-16 03:45:44 +03:00
Kevin Bowling
2257c7810c igc: sync igc_txrx with igb(4)
Reviewed by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31227

(cherry picked from commit d02e436353)
2021-08-15 12:25:16 -07:00
Peter Grehan
d7388d33b4 MFC 517904de5c: igc(4): Introduce new driver for the Intel I225 Ethernet controller.
This controller supports 2.5G/1G/100MB/10MB speeds, and allows
tx/rx checksum offload, TSO, LRO, and multi-queue operation.

The driver was derived from code contributed by Intel, and modified
by Netgate to fit into the iflib framework.

Thanks to Mike Karels for testing and feedback on the driver.

Reviewed by:	bcr (manpages), kbowling, scottl, erj
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30668

(cherry picked from commit 517904de5c)
2021-08-15 20:33:54 +10:00
Gordon Bergling
64085efb67 hms(4): Fix a typo in sysctl description
- s/threshhold/threshold/

(cherry picked from commit 4b4850aefe)
2021-08-15 07:56:02 +02:00
Alexander Motin
7eb023696a coretemp(4): Switch to smp_rendezvous_cpus().
Use of smp_rendezvous_cpus() instead of sched_bind() allows to not
block indefinitely if target CPU is running some thread with higher
priority, while all we need is single rdmsr/wrmsr instruction call.
I guess it should also be much cheaper than full thread migration.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 74f80bc1af)
2021-08-12 21:48:17 -04:00
Alexander Motin
b41b86b65f ipmi(4): Add more watchdog error checks.
Add request submission status checks before checking req->ir_compcode,
otherwise it may be zero just because of initialization.

Add checks for req->ir_compcode errors in ipmi_reset_watchdog() and
ipmi_set_watchdog().  In first case explicitly check for 0x80, which
means timer was not previously set, that I found happening after BMC
cold reset.  This change makes watchdog timer to recover instead of
permanently ignoring reset errors after BMC reset or upgraded.

MFC after:	2 weeks
Sponsored by:   iXsystems, Inc.

(cherry picked from commit 9d3b47abbb)
2021-08-12 21:18:31 -04:00
Ka Ho Ng
ddf1b5ac76 bhyve: virtio shares definitions between sys/dev/virtio
Definitions inside usr.sbin/bhyve/virtio.h are thrown away.
Definitions in sys/dev/virtio are used instead.

This reduces code duplication.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	grehan
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D29084

(cherry picked from commit 54ac6f721e)
2021-08-12 14:44:52 +08:00
Mitchell Horne
2e50ba7074 hwpmc: disable uncore class on Sandy Bridge and newer
It was written for Nehalem and Westmere, with minor but incomplete
updates for Sandy Bridge in 78d763a29b. The uncore architecture
changed significantly with this generation, bringing new layouts and
locations for some MSRs.

Misprogramming these MSRs in ucp_start_pmc() may panic the system, and
this is trivially reproducible via pmcstat(8) on at least Broadwell and
Haswell. Disable the class on these CPUs until it can be updated more
completely and leave a TODO comment detailing some of the work required.
Note that the nclasses value for Broadwell was already incorrect and
doesn't need changing.

The result is that any uncore events listed by pmcstat -L will no longer
be allocatable, but this is already the case for newer generations of
Intel CPUs.

PR:		253687
Reported by:	Zhenlei Huang <zlei.huang@gmail.com>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31389

(cherry picked from commit 4f35e8cba2)
2021-08-11 13:49:44 -03:00
Andrew Turner
7bc9938541 Support fixed size, variable location acpi resources
These have been found in some Arm ACPI tables generated by edk2, e.g.
when describing the pl011 uart on the Arm AEMv8 model.

Reviewed by:	imp, jkim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31110

(cherry picked from commit 1472117a1e)
2021-08-05 20:50:20 +00:00
Luiz Otavio O Souza
18ea5bc166 virtio: enable VTNET_LEGACY_TX when ALTQ is enabled.
ALTQ only works on network drivers which use if_start (rather than
if_transmit). vtnet uses if_start if built with VTNET_LEGACY_TX. Default
to that the kernel is built with ALTQ enabled, to reduce user surprise.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 5afe81a7b2)
2021-08-05 22:04:04 +02:00
Alexander Motin
7e48916d19 vmci(4): Shorten interrupt descriptions.
We have no space there for such a long strings.  Also it makes no
sense to set description if there is only one interrupt.

MFC after:	2 weeks

(cherry picked from commit ab38c12b4a)
2021-08-04 20:34:34 -04:00
Konstantin Belousov
dfda6a71e7 /dev/pci: clarify meaning of writeable file descriptor
(cherry picked from commit 85ae35ef37)
2021-08-03 12:52:36 +03:00
Kevin Bowling
bb048438e7 igb: clean up igb_txrx comments
Reviewed by:	grehan
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D31227

(cherry picked from commit ff01d6343f)
2021-08-02 19:04:46 -07:00
Kevin Bowling
b91bb9b07f e1000: Add missing branch prediction
I missed this edit from the ixgbe review (D30074)

Reviewed by:	gallatin
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30073

(cherry picked from commit 9fd0cda92d)
2021-08-02 19:04:31 -07:00
Kevin Bowling
4ccafcfc86 e1000: Clean up igb_txrx
The intention here is to reduce differences between em, igb, igc, ixgbe.

The main functional change is logical simplification in igb_rx_checksum
and getting interface caps from scctx instead of the ifp.

Reviewed by:	gallatin, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30073

(cherry picked from commit 41f0225714)
2021-08-02 19:04:05 -07:00
Alexander Motin
156b889469 mrsas(4): Report more correct maximum I/O size.
Subtract one SGE for the case of misaligned address.  Also take into
account maximum number of sectors reported by firmware, that gives
nicer 256KB limit instead of 276KB calculated from the SGE limit.

While there, remove number of I/O size checks, duplicating what is
already checked by CAM and busdma(9).

MFC after:	1 month
Sponsored by:	iXsystems, Inc.

(cherry picked from commit fa3d57c256)
2021-08-02 11:56:10 -04:00
Kevin Bowling
fe6803c18e ixgbe: Clean up ix_txrx
The intention here is to reduce differences with D30072.
The only functional change is logical simplification in
ixgbe_rx_checksum.

Reviewed by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D30074

(cherry picked from commit 51e46835e1)
2021-07-29 17:27:24 -07:00
Kevin Bowling
ebdd2bc441 ixgbe: Print FW NVM and Option ROM versions
It can be useful for system operators to see this kind of information
when correlating issues or requesting support from the OEM or Intel for
hardware and firmware issues.

Reviewed by:	gallatin
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30178

(cherry picked from commit 7660e4ea5c)
2021-07-29 17:26:45 -07:00
Mitchell Horne
862ea25915 hwpmc_arm64: add a PMCDBG to the interrupt handler
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 13f5a3076b)
2021-07-29 12:05:55 -03:00
Mitchell Horne
83166f8714 arm64 support for pmu-events
8cc3815f:
hwpmc_arm64: accept raw event codes for PMC_OP_PMCALLOCATE

Make it possible to specify event codes without an offset of
PMC_EV_ARMV8_FIRST, by setting a machine-dependent flag. This is
required to make use of event definitions from pmu-events.

Reviewed by:	ray (slightly earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30602

28dd6730:
libpmc: enable pmu_utils on arm64

This allows supported libpmc to query/select from the pmu-events table,
which may have a more complete set of events than what we define
manually. A future update to these definitions should greatly improve
this support. The alias table is empty for now, until this future import
is complete.

Add the Foundation's copyright for recent work on this file.

Reviewed by:	ray (slightly earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30603

27ea55fc:
libpmc/hwpmc: fix issues with arm64 pmu-events support

Due to a mis-merge, the changes committed to libpmc never called
pmu_parse_event(), or set pm->pm_ev. However, this field shouldn't be
used to carry the actual pmc event code anyway, as it is expected to
contain the index into the pmu event array (otherwise, it breaks event
name lookup in pmclog_get_event()). Add a new MD field,
pm_md.pm_md_config, to pass the raw event code to arm64_allocate_pmc().

Additionally, the change made to pmc_md_op_pmcallocate was incorrect, as
this is a union, not a struct. Restore the proper padding size.

Reviewed by:	luporl, ray, andrew
Fixes:		28dd6730a5 ("libpmc: enable pmu_utils on arm64")
Fixes:		8cc3815f02 ("hwpmc_arm64: accept raw event codes...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31221

(cherry picked from commit 8cc3815f02)
(cherry picked from commit 28dd6730a5)
(cherry picked from commit 27ea55fc65)
2021-07-29 12:02:05 -03:00