Commit graph

39214 commits

Author SHA1 Message Date
Alexander Motin
e61892af6f ciss(4): Fix typo.
(cherry picked from commit 5f8cb13cfb)
2021-10-19 11:12:33 -04:00
Alexander Motin
5c691a9593 ciss(4): Properly handle data underrun.
For SCSI data underrun is a part of normal life.  It should not be
reported as error.  This fixes MODE SENSE used by modern CAM.

MFC after:	1 month

(cherry picked from commit e8144a13e0)
2021-10-19 11:12:32 -04:00
Gordon Bergling
17ef4736e2 Fix two typos in source code comments
- s/alocated/allocated/
- s/realocated/reallocated/

(cherry picked from commit 899a3b38f5)
2021-10-19 07:27:21 +02:00
Mark Peek
4e5c1be420 vmci: fix panic due to freeing unallocated resources
Summary:
An error mapping PCI resources results in a panic due to unallocated
resources being freed up. This change puts the appropriate checks in
place to prevent the panic.

PR:		252445
Reported by:	Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Tested by:	marcus
MFC after:	1 week
Sponsored by:	VMware

Test Plan:
Along with user testing, also simulated error by inserting a ENXIO
return in vmci_map_bars().

Reviewed by:	marcus
Subscribers:	imp
Differential Revision: https://reviews.freebsd.org/D32016

(cherry picked from commit 0f14bcbe38)
2021-10-16 18:22:43 +00:00
Mitchell Horne
89f1b82a85 libpmc: fix the 'cycles' event alias on x86
Looking for "tsc-tsc" in the pmu tables will fail every time. Instead,
make this an alias for the static TSC event defined in pmc_events.h.
This fixes 'pmcstat -s cycles' on Intel and AMD.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32197

(cherry picked from commit 937539e0a3)
2021-10-15 12:21:35 -03:00
Alexander Motin
bcc00cabdb mps/mpr(4): Move xpt_register_async() out of lock.
It fixes lock ordere reversal between SIM and device locks.  Also
remove registration for AC_FOUND_DEVICE, unused for a while now.

MFC after:	1 month

(cherry picked from commit 02d8194012)
2021-10-14 06:50:12 -04:00
Kevin Bowling
73922769f0 e1000: print EEPROM/NVM/OROM versions
This is useful for diagnosing problems. In particular, the errata
sheets identify the EEPROM version for many fixes.

Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32333

(cherry picked from commit 293663f4da)
2021-10-12 19:11:18 -07:00
Kevin Bowling
884b89510f e1000: Lock nvm print sysctl
Otherwise results in KASSERT with debug kernels because we rely on the
iflib CTX lock to implement the software serialization to the NVM model

Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32333

(cherry picked from commit 9b3e252e59)
2021-10-12 19:10:54 -07:00
Kevin Bowling
88d064c121 ixgbe: Update shared code catchup
Leftovers from DPDK sync

Reviewed by:	grehan
Obtained from:	DPDK
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D31621

(cherry picked from commit 3f66b96d86)
2021-10-12 11:18:05 -07:00
Hans Petter Selasky
fe5ee07a11 mlx4en(4): Fix wrong mbuf cluster size in mlx4_en_debugnet_init()
This fixes an "invalid cluster size" panic when debugnet is activated.

panic()
m_getzone()
debugnet_mbuf_reinit()
debugnet_any_ifnet_update()
ifhwioctl()
ifioctl()

Submitted by:	ae@
PR:		258923
Sponsored by:	NVIDIA Networking

(cherry picked from commit 5a7de2b42c)
2021-10-12 14:12:00 +02:00
Hans Petter Selasky
1f1aa1aa96 sound(4): Implement mixer mute control for feeder channels.
PR:	258711
Differential Revision:	https://reviews.freebsd.org/D31636
Sponsored by:	NVIDIA Networking

(cherry picked from commit 4a83ca1078)
2021-10-12 14:10:59 +02:00
Konstantin Belousov
9a1f5e104e mlx5_en: fix use of CALLOUT_DIRECT
(cherry picked from commit 0eb2dcd32e)
2021-10-12 10:00:10 +03:00
Mateusz Guzik
7890bcbc15 mmc: fix 1-byte reallocs (when it should have been sizeof device_t)
Reported by KASAN:
panic: ASan: Invalid access, 8-byte write at 0xfffffe00f0992610, RedZonePartial(1)
panic() at panic+0xb5/frame 0xffffffff86a595b0
__asan_store8_noabort() at __asan_store8_noabort+0x376/frame 0xffffffff86a59670
mmc_go_discovery() at mmc_go_discovery+0x6c61/frame 0xffffffff86a5a790
mmc_delayed_attach() at mmc_delayed_attach+0x35/frame 0xffffffff86a5a7b0
[snip]

Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 13c63ae08d)
2021-10-11 09:12:55 +00:00
Jessica Clarke
398c8572b8 pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB
This is the same underlying problem as 2624598064, just for bus ranges
rather than windows. SiFive's HiFive Unmatched has the following
topology:

  Root Port <---> Bridge <---> Bridge <-+-> Bridge <---> (Unused)
   (pcib0)        (pcib1)      (pcib2)  |   (pcib3)
                                        +-> Bridge <---> xHCI
                                        |   (pcib4)
                                        +-> Bridge <---> M.2 E-key
                                        |   (pcib5)
                                        +-> Bridge <---> M.2 M-key
                                        |   (pcib6)
                                        +-> Bridge <---> x16 slot
                                            (pcib7)

If a device is plugged into the x16 slot that itself has a bridge, such
as many graphics cards, we currently fail to allocate a bus number for
its child bus (and so pcib_attach_child skips adding a child bus for
further enumeration) as, when the new child bridge attaches, it attempts
to allocate a bus number from its parent (pcib7) which in turn attempts
to grow its own bus range by calling bus_adjust_resource on its own
parent (pcib2) whose bus rman cannot accommodate the request and needs
to itself be extended by calling its own parent (pcib1). Note that
pcib3-7 do not face the same issue when they attach since pcib1 ends up
managing bus numbers 1-255 from the beginning and so never needs to grow
its own range.

Reviewed by:	jhb, mav
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32011

(cherry picked from commit 31776afdc7)
2021-10-10 14:36:54 +01:00
Adam Fenn
0c301b963d pvclock: Add vDSO support
(cherry picked from commit d4b2d3035a)
2021-10-10 12:21:17 +03:00
Adam Fenn
0977ab30c9 kvm_clock: KVM paravirtual clock support
(cherry picked from commit 6c69c6bb4c)
2021-10-10 12:21:16 +03:00
Gordon Bergling
18f244304f qlnxe: Fix typos in two error messages
- s/erorr/error/

(cherry picked from commit 957d9ba0c3)
2021-10-09 05:00:47 +02:00
Kevin Bowling
695810a48f e1000: Function prototype cleanup
Drop arguments of function prototypes since the file is mixed between
listing arg names and not.

No functional changes

Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D32329

(cherry picked from commit 28ccd780a9)
2021-10-08 18:03:12 -07:00
Marcin Wojtas
112c1187c2 Upgrade ENA to v2.4.1
ena: Remove redundant declaration of ena_log_level.

GCC6 raises a -Wredundant-decl error due to duplicate declarations
in ena_fbsd_log.h and ena_plat.h.

Sponsored by:	Chelsio Communications

(cherry picked from commit 8843787aa1)

ena: Avoid unnecessary mbuf collapses for LLQ condition

In case of Low-latency Queue, one small enough descriptor can be pushed
directly to the ENA hw, thus saving one fragment. Check for this
condition before performing collapse.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit c81f8c2611)

ena: Trigger reset on ena_com_prepare_tx failure

All ena_com_prepare_tx errors other than ENA_COM_NO_MEM are fatal and
require device reset.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 36130d2979)

ena: Prevent reset after device destruction

Check for ENA_FLAG_TRIGGER_RESET inside a locked context in order to
avoid potential race conditions with ena_destroy_device. This aligns the
reset task logic with the Linux driver.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 433ab9b698)

ena: Add extra log messages

Stay aligned with the Linux driver by adding the following logs:
* inform the user about retrying queue creation
* warn on non-empty ena_tx_buffer.mbuf prior to ena_tx_map_mbuf

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 77160654a1)

ena: Add locking assertions

ENA silently assumed that ena_up, ena_down and ena_start_xmit routines
should be called within locked context. Driver's logic heavily assumes
on concurrent access to those routines, so for safety and better
documentation about this assumption, the locking assertions were added
to the above functions.

The assertion was added only for the main steps (skipping the helper
functions) which can be called from multiple places including the kernel
and the driver itself.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit cb98c439d6)

ena: Move RSS logic into its own source files

Delegate RSS related functionality into separate .c/.h files in
preparation for the full RSS support.

While at it, reorder functions and remove prototypes for ones with
internal linkage.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 986e7b9227)

ena: Disable meta descriptor caching for netmap

If LLQ is being used, `ena_tx_ctx.meta_valid` must stay enabled. This
fixes netmap support on latest generation ENA HW and aligns it with the
core driver behavior.

As netmap doesn't support any csum offloads, the
`adapter->disable_meta_caching` value can be simply passed to the HW.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit a831466830)

ena: Share ena_global_lock between driver instances

In order to use `ena_global_lock` in sysctl context, it must be kept
outside the driver instance's software context, as sysctls can be called
before attach and after detach, leading to lock use before sx_init and
after sx_destroy otherwise.
Solve this issue by turning `ena_global_lock` into a file scope
variable, shared between all instances of the driver and associated
sysctl context, and in turn initialized/destroyed in dedicated
SYSINIT/SYSUNINIT functions.
As a side effect, this change also fixes existing race in the reset
routine, when simultaneously accessing sysctl exposed properties.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 07aff471c0)

ena: Add missing statistics

Provide the following sysctl statistics in order to stay aligned with
the Linux driver:
* rx_ring.csum_good
* tx_ring.unmask_interrupt_num

Also rename the 'bad_csum' statistic name to 'csum_bad' for alignment.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 223c8cb12e)

ena: Implement full RSS reconfiguration

Bind RX/TX queues and MSI-X vectors to matching CPUs based on the RSS
bucket entries.

Introduce sysctls for the following RSS functionality:
- rss.indir_table:      indirection table mapping
- rss.indir_table_size: indirection table size
- rss.key:              RSS hash key (if Toeplitz used)

Said sysctls are only available when compiled without `option RSS`, as
kernel-side RSS support currently doesn't offer RSS reconfiguration.

Migrate the hash algorithm from CRC32 to Toeplitz and change the initial
hash value to 0x0 in order to match the standard Toeplitz implementation.
Provide helpers for hash key inversion required for HW operations.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 6d1ef2abd3)

ena: fix building in-kernel driver

When building ENA as compiled into the kernel, the driver would fail to
build. Resolve the problem by introducing the following changes:
1. Add missing `ena_rss.c` entry in `sys/conf/files`.
2. Prevent SYSCTL_ADD_INT from throwing an assert due to an extra
CTLTYPE_INT flag.

Fixes: 986e7b9227 ("ena: Move RSS logic into its own source files")
Fixes: 6d1ef2abd3 ("ena: Implement full RSS reconfiguration")

Obtained from: Semihalf
Sponsored by: Amazon, Inc.
MFC after: 1 week

(cherry picked from commit a3f0d18237)

ena: Update driver version to v2.4.1

Some of the changes in this release:
* Hardware RSS hash key reconfiguration and indirection table
reconfiguration support.
* Full kernel RSS support.
* Extra statistic counters.
* Netmap support for ENAv3.
* Locking assertions.
* Extra log messages.
* Reset handling fixes.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 42c7760be3)
2021-10-07 18:10:32 +02:00
Marcin Wojtas
87ffe59470 Upgrade ENA to v2.4.0
ena: change ENA C++-style comment into C-style

According to man style(9), only C-style comments should be used.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 438c9e3cf8)

ena: add support for the large LLQ headers in ENA

Default LLQ (Low-latency queue) maximum header size is 96 bytes and can
be too small for some types of packets - like IPv6 packets with multiple
extension. This can be fixed, by using large LLQ headers.

If the device supports larger LLQ headers, the user can activate this
feature by setting sysctl tunable 'hw.ena.force_large_llq_header' to '1'
in the /boot/loader.conf file.

In case the device isn't supporting this feature, the default value (96B)
will be used.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit beaadec9ea)

ena: remove surplus NULL checks when freeing ENA resources

Calling free on a NULL pointer is valid, as appropriate check is already
done internally:

/* free(NULL, ...) does nothing */
if (addr == NULL)
    return;

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit ddec69e6a7)

ena: hide sysctl nodes for unused ENA queues

IO queue related attributes are registered statically at driver attach
with the rest of the ENA specific sysctl nodes. However, the number of
queues can be changed at runtime via the `ena_sysctl_io_queues_nb`
request, leading to a potential exposure of attributes for non-existing
queues.

Introduce a new `ena_sysctl_update_queue_node_nb` function, which
updates the sysctl nodes after the number of queues is altered.
This happens by either registering or unregistering node specific oids,
based on a delta between the previous and current queue count.

NOTE: All unregistered oids must be registered again before the driver
detach, e.g. by another call to this function.

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 0e7d31f63b)

Merge tag 'vendor/ena-com/2.4.0'

Update the driver in order not to break its compilation
and make use of the new ENA logging system

Migrate platform code to the new logging system provided by ena_com
layer.

Make ENA_INFO the new default log level.

Remove all explicit use of `device_printf`, all new logs requiring one
of the log macros to be used.

(cherry picked from commit 3fc5d816f8)

Update ENA driver man page

Bring the obsolete man page up to date:
* update diagnostic error messages
* add documentation of loader tunables
* document netmap support
* add a driver history section
* update the contact information

Submitted by: Artur Rojek <ar@semihalf.com>
Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit e34856a2c4)

Update ENA version to v2.4.0

Some of the changes in this release:
* Large LLQ headers,
* Bug/stability fixes,
* Change of the README/Documentation.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

(cherry picked from commit 93f0df457b)
2021-10-07 18:10:21 +02:00
Marcin Wojtas
fb5eed2c43 mmc_fdt_helper: correct typo in DT property name
'no-1-8-v' is a proper name according to the DT binding
documentation
(https://www.kernel.org/doc/Documentation/devicetree/bindings/mmc/mmc-controller.yaml).

Fixes: e63fbd7bb7

Submitted by: Bartlomiej Grzesik <bag@semihalf.com>
Sponsored by: Semihalf

(cherry picked from commit d8789cd0ae)
2021-10-07 18:09:50 +02:00
Mateusz Guzik
6004dc8bc3 hpen(4): removed leftover hpen_final_digi_cb declaration
(cherry picked from commit 007724cbca)
2021-10-07 10:00:13 -04:00
Mark Johnston
f983298883 socket: Rename sb(un)lock() and interlock with listen(2)
In preparation for moving sockbuf locks into the containing socket,
provide alternative macros for the sockbuf I/O locks:
SOCK_IO_SEND_(UN)LOCK() and SOCK_IO_RECV_(UN)LOCK().  These operate on a
socket rather than a socket buffer.  Note that these locks are used only
to prevent concurrent readers and writters from interleaving I/O.

When locking for I/O, return an error if the socket is a listening
socket.  Currently the check is racy since the sockbuf sx locks are
destroyed during the transition to a listening socket, but that will no
longer be true after some follow-up changes.

Modify a few places to check for errors from
sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before.  In
particular, add checks to sendfile() and sorflush().

Reviewed by:	tuexen, gallatin
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f94acf52a4)
2021-10-07 09:56:47 -04:00
Ian Lepore
b1cca74367 Fix busdma resource leak on usb device detach.
When a usb device is detached, usb_pc_dmamap_destroy() called
bus_dmamap_destroy() while the map was still loaded. That's harmless on x86
architectures, but on all other platforms it causes bus_dmamap_destroy() to
return EBUSY and leak away any memory resources (including bounce buffers)
associated with the mapping, as well as any allocated map structure itself.

This change introduces a new is_loaded flag to the usb_page_cache struct to
track whether a map is loaded or not. If the map is loaded,
bus_dmamap_unload() is called before bus_dmamap_destroy() to avoid leaking
away resources.

Differential Revision:	https://reviews.freebsd.org/D32208

(cherry picked from commit dc91a9715f)
2021-10-06 09:36:02 -06:00
Kyle Evans
06248c8215 kern: random: collect ~16x less from fast-entropy sources
Previously, we were collecting at a base rate of:

64 bits x 32 pools x 10 Hz = 2.5 kB/s

This change drops it to closer to 64-ish bits per pool per second, to
work a little better with entropy providers in virtualized environments
without compromising the security goals of Fortuna.

(cherry picked from commit 5e79bba562)
2021-10-06 01:44:07 -05:00
Kyle Evans
40f9f2279c kern: random: drop read_rate and associated functionality
Refer to discussion in PR 230808 for a less incomplete discussion, but
the gist of this change is that we currently collect orders of magnitude
more entropy than we need.

The excess comes from bytes being read out of /dev/*random.  The default
rate at which we collect entropy without the read_rate increase is
already more than we need to recover from a compromise of an internal
state.

For stable/13, the read_rate_increment symbol remains as a stub to avoid
breaking loadable random modules.

(cherry picked from commit 6895cade94)
2021-10-06 01:41:18 -05:00
Gordon Bergling
7172006900 smsc(4): Fix a typo in a comment
- s/setings/settings/

(cherry picked from commit 9599d8141f)
2021-10-06 08:21:05 +02:00
Gordon Bergling
d00fdb9736 vnic: Fix a typo in a comment
- s/setings/settings/

(cherry picked from commit fafb1c574d)
2021-10-06 08:20:41 +02:00
Gordon Bergling
d58ccf3ba4 evdev: Fix a typo in a commit
- s/prefered/preferred/

(cherry picked from commit efd8749fe5)
2021-10-06 08:20:20 +02:00
Gordon Bergling
badbe6a4a8 netvsc: Fix a typo in a comment
- s/prefered/preferred/

(cherry picked from commit 9ebd651b58)
2021-10-06 08:19:58 +02:00
Ed Maste
9130e0ace0 mgb: sync with version in main
This is a combination of 7 commits.

mgb: update Microchip URLs

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6b25b4a73f)

mgb: enable multicast in mgb_init

Receive Filtering Engine (RFE) configuration is not yet implemented,
and mgb intended to enable all broadcast, multicast, and unicast.
However, MGB_RFE_ALLOW_MULTICAST was missed (MGB_RFE_ALLOW_UNICAST was
included twice).

MFC after:	1 week
Fixes:		8890ab7758 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ecac5c2928)

mgb: Do not KASSERT on error in mgb_init

There's not much we can do if mii_mediachg() fails, but KASSERT is not
appropriate.

MFC after:	1 week
Fixes:		8890ab7758 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8b889b8953)

mgb: Staticize devclass and iflib structs (as is typical)

MFC after:	1 week
Fixes:		8890ab7758 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c83ae596f3)

mgb: Apply some style(9)

Add parens around return values, rewrap lines

MFC after:	1 week
Fixes:		8890ab7758 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 820da5820e)

mgb: Fix DEBUG (and LINT) build

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5f07d7fe40)

mgb: Fix nop admin interrupt handling

Previously mgb_admin_intr printed a diagnostic message if no interrupt
status bits were set, but it's not valid to call device_printf() from a
filter.  Just drop the message as it has no user-facing value.

Also return FILTER_STRAY in this case - there is nothing further for
the driver to do.

Reviewed by:	kbowling
MFC after:	1 week
Fixes:		8890ab7758 ("Introduce if_mgb driver...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32231

(cherry picked from commit 1ad2d87778)
2021-10-05 14:57:21 -04:00
David Bright
52e1406947 ntb_hw_intel: fix xeon NTB gen3 bar disable logic
In NTB gen3 driver, it was supposed to disable NTB bar access by
default, but due to incorrect register access method, the bar disable
logic does not work as expected. Those registers should be modified
through NTB bar0 rather than PCI configuration space.

Besides, we'd better to protect ourselves from a bad buddy node so
ingress disable logic should be implemented together.

Submitted by:   Austin Zhang (austin.zhang@dell.com)
Sponsored by:   Dell EMC

(cherry picked from commit e3cf7ebc1d)
2021-10-04 06:53:26 -07:00
Greg V
c39bfe4713 vt: call driver's postswitch when panicking on ttyv0
In vt_kms, the postswitch callback restores fbdev mode when
panicking or entering the debugger. This ensures that even when
a graphical applicatino was running on the first tty, simple framebuffer
mode would be restored and the panic would be visible instead
of the frozen GUI. But vt wouldn't call the postswitch callback
when we're already on the first tty, so running a GUI on it
would prevent you from reading any panics.

Reviewed by:	tsoome
Differential Revision: https://reviews.freebsd.org/D29961

(cherry picked from commit c937a405bd)
2021-10-04 00:46:49 +03:00
Alexander Motin
b7fde5e82b ioat(4): Remove Giant from ioat_test enable/disable.
MFC after:	1 month

(cherry picked from commit 71bf3900b7)
2021-10-03 21:14:25 -04:00
Alexander Motin
36e67f5bad pcib(4): Switch from callout to timeout_task.
This allows to avoid blocking on Giant in callout context, moving to
already existing dedicated taskqueue_pci_hp thread.

MFC after:	1 month

(cherry picked from commit fa3b03d378)
2021-10-03 21:13:24 -04:00
Alexander Motin
03d748e924 vt(4): Mark callouts MP-safe.
The code explicitly takes Giant when it accesses keyboard, and I see
no reason to take it globally by callout(9).

MFC after:	1 month

(cherry picked from commit da69c67526)
2021-10-03 21:11:59 -04:00
Alexander Motin
50570c6479 bnxt(4): Mark sysctls MP-safe.
MFC after:	1 month

(cherry picked from commit 9895a2073f)
2021-10-03 21:10:43 -04:00
Alexander Motin
d2f4b7bc1c bxe(4): Mark sysctls and callout MP-safe.
MFC after:	1 month

(cherry picked from commit 4081c895e5)
2021-10-03 21:10:02 -04:00
Alexander Motin
fe830ad79a mge(4): Mark sysctls and callout MP-safe.
MFC after:	1 month

(cherry picked from commit 6b2ff27cb9)
2021-10-03 21:09:24 -04:00
Kevin Bowling
456b1d96e8 ixgbe: whitespace cleanup pass
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32131

(cherry picked from commit 15d077995b)
2021-10-02 18:32:19 -07:00
Kevin Bowling
4418b03c67 ixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'
Rename the 'struct adapter' to 'struct ixgbe_softc' to avoid type
ambiguity in things like kgdb.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32131

(cherry picked from commit b1d5caf3c7)
2021-10-02 18:32:01 -07:00
Wenzhuo Lu
4cb203d8f3 e1000: fix K1 configuration
This patch is for the following updates to the K1 configurations:
Tx idle period for entering K1 should be 128 ns.
Minimum Tx idle period in K1 should be 256 ns.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

PR:		258153
Reviewed by:	erj
Tested by:	iron.udjin@gmail.com
Approved by:	imp
Obtained from:	DPDK (6f934fa24dfd437c90ead96bc7598ee77a117ede)
MFC after:	1 week

(cherry picked from commit d5ad2f2a67)
2021-09-29 17:22:59 -07:00
Gordon Bergling
5559896136 pcm(4): Fix a common typo in source code comments
- s/prefered/preferred/

(cherry picked from commit 513ee901ee)
2021-09-29 19:18:55 +02:00
Alexander Motin
df86667641 ipmi(4): Limit maximum watchdog pre-timeout interval.
Previous code by default setting pre-timeout interval to 120 seconds
made impossible to set timeout interval below that, resulting in error
0xcc (Invalid data field in Request) at least on Supermicro boards.

To fix that limit maximum pre-timeout interval to ~1/4 of the timeout
interval, that sounds like a reasonable default: not too short to fire
too late, but also not too long to give many false reports.

MFC after:	2 weeks

(cherry picked from commit 6c2d440416)
2021-09-28 20:43:18 -04:00
Kevin Bowling
e265ddaac1 e1000: Fix tabstop width in if_em.h
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D32145

(cherry picked from commit 21ab8c75c9)
2021-09-28 09:56:51 -07:00
Sean Bruno
dc3c7c1106 uart: Add PCI ID for intel 100 Series/C230 Series AMT
Reviewed by:	kib
Tested by:	kbowling
Differential Revision:	https://reviews.freebsd.org/D32146

(cherry picked from commit fb640be4e9)
2021-09-28 09:56:50 -07:00
Kevin Bowling
594a25fa43 e1000: Re-arm link changes
A change to MSI-X link handler was somehow causing issues on
MSI-based em(4) NICs.

Revert the change based on user reports and testing.

PR:		258551
Reported by:	Franco Fichtner <franco@opnsense.org>, t_uemura@macome.co.jp
Reviewed by:	markj, Franco Fichtner <franco@opnsense.org>
Tested by:	t_uemura@macome.co.jp
MFC after:	1 day

(cherry picked from commit 450c3f8b3d)
2021-09-28 09:55:59 -07:00
Kevin Bowling
717bed4f6f e1000: Rename 'struct adapter' to 'struct e1000_sc'
Rename the 'struct adapter' to 'struct e1000_sc' to avoid type ambiguity
in things like kgdb.

Reviewed by:	jhb, markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D32129

(cherry picked from commit dc92605154)
2021-09-28 09:55:59 -07:00
Kevin Bowling
1f80b2b78d e1000: Consistently use FALLTHROUGH
Approved by:	imp
MFC after:	1 week

(cherry picked from commit e05d9788b7)
2021-09-28 09:55:59 -07:00
Kevin Bowling
e6f324c15f e1000: Use C99 bool types
Approved by:	imp
MFC after:	1 week

(cherry picked from commit 1bbdc25fc1)
2021-09-28 09:55:53 -07:00