Commit graph

38819 commits

Author SHA1 Message Date
Tai-hwa Liang
5fcae41665 fwip(4): fixing kernel panic when receiving unicast packet
Wrapping fwip_unicast_input() with NET_EPOCH_{ENTER,EXIT} to avoid a
NET_EPOCH_ASSERT() in netisr_dispatch().

Reviewed by:	hselasky
MFC after:	2 weeks

(cherry picked from commit bdf316e892)
2021-05-06 13:23:00 +00:00
Xin LI
2941198570 arcmsr(4): Fix SCSI command timeout on ARC-1886.
Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>

(cherry picked from commit 438b553207)
2021-05-04 22:03:22 -07:00
Alexander Motin
22b9f618e8 Set PCIe device's Max_Payload_Size to match PCIe root's.
Usually on boot the MPS is already configured by BIOS.  But we've
found that on hot-plug it is not true at least for our Supermicro
X11 boards.  As result, mismatch between root's configuration of
256 bytes and device's default of 128 bytes cause problems for some
devices, while others seem to work fine.

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

(cherry picked from commit 5a898b2b78)
2021-05-04 20:53:55 -04:00
Andriy Gapon
dec9f37753 gpioc_detach: fix freeing of wrong pointers
MFC after:	1 week

(cherry picked from commit 3c6b59567f)
2021-05-03 23:11:12 +03:00
Kevin Bowling
bbe0f3fbc6 e1000: Fix register name in reg_dump sysctl
The correct name of this register is CTRL_EXT.

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

(cherry picked from commit ba7b31b3e9)
2021-05-02 19:31:30 -07:00
Kevin Bowling
f886c2a0aa e1000: Add support for [Tiger, Alder, Meteor] Lake
Add support for current and future client platform PCI IDs. These are
all I219 variants and have no known driver changes versus previous
generation client platform I219 variants.

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

(cherry picked from commit 59690eab57)
2021-05-02 19:31:29 -07:00
Vladimir Kondratyev
51b2d04369 hkbd: Fix typo which disables keyboard input in kdb
Reported by:	Greg V
2021-04-30 23:14:52 +03:00
Vladimir Kondratyev
61860b0a48 ichsmb: Add PCI ID for Intel Gemini Lake SMBus controller
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2021-04-30 23:12:28 +03:00
Vladimir Kondratyev
610e723706 pchtherm: Add IDs for CannonLake-H, CometLake and Lewisburg controllers
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2021-04-30 23:12:20 +03:00
Kevin Bowling
1a34afa954 e1000: Restore VF interface random MAC
Restore 525e07418c after the iflib conversion of igb(4). This
reenables random MAC address generation when attaching to a VF with a
zeroed MAC.

PR:		253535
Reported by:	Balaev PA <mail@void.so>
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29785

(cherry picked from commit 68a46f11ea)
2021-04-28 18:22:16 -07:00
Sofian Brabez
d61f10a878 iwnstats: fix build with clang and allow install under /usr/local/sbin
iwnstats was not compiling because of some issues raised by the clang
compiler due to -Werror. As a tool it is not connected to world build.

Add missing field "barker_mrc" initialization in struct
iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused
pointer *is on iwn_stats_*_print functions and unused variables for
-Wunused-parameter and -Wunused-variable.

The value for field "barker_mrc" of struct iwn2030_sensitivity_limits
was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115
.barker_corr_th_min_mrc = 390).

Also set BINDIR in Makefile to make it possible to install under
/usr/local/sbin/iwnstats as it require super user.

Reviewed by:	adrian
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29800

(cherry picked from commit 561d34d705)
2021-04-27 17:31:12 +00:00
John Baldwin
57d9ae2a44 cxgbe: Ignore doomed virtual interfaces when updating the clip table.
A doomed VI does not have a valid ifnet.

Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications

(cherry picked from commit 45d5c28439)
2021-04-26 12:02:28 -07:00
John Baldwin
0d4d5e9fe0 iscsi: Kick threads out of iscsi_ioctl() during unload.
iscsid can be sleeping in iscsi_ioctl() causing the destroy_dev() to
sleep forever if iscsi.ko is unloaded while iscsid is running.

Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications

(cherry picked from commit 89df484739)
2021-04-26 12:02:21 -07:00
John Baldwin
c2e295647e cxgbe: Add counters for iSCSI PDUs transmitted via TOE.
Sponsored by:	Chelsio Communications

(cherry picked from commit 568e69e4eb)
2021-04-26 12:02:16 -07:00
John Baldwin
27395a69d1 cxgbe: Make the TOE TLS stats per-queue instead of per-port.
This avoids some atomics by using counter_u64 for TX and relying on
existing single-threading (single ithread per rxq) for RX.

Sponsored by:	Chelsio Communications

(cherry picked from commit fe496dc02a)
2021-04-26 12:02:12 -07:00
John Baldwin
4e4ec8a9cc cxgbe: Add a struct sge_ofld_txq type.
This type mirrors struct sge_ofld_rxq and holds state for TCP offload
transmit queues.  Currently it only holds a work queue but will
include additional state in future changes.

Sponsored by:	Chelsio Communications

(cherry picked from commit 077ba6a845)
2021-04-26 12:02:06 -07:00
John Baldwin
d6ee411d42 cxgbei: Enter network epoch and set vnet around t4_push_pdus().
Sponsored by:	Chelsio Communications

(cherry picked from commit 90c74b2b60)
2021-04-26 12:02:02 -07:00
John Baldwin
bcd7b64748 cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED.
This avoids mixing the use of two different enums which modern C
compilers warn about.

Sponsored by:	Chelsio Communications

(cherry picked from commit 017902fc5f)
2021-04-26 12:01:57 -07:00
John Baldwin
345bf0b368 cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi().
Sponsored by:	Chelsio Communications

(cherry picked from commit 8855ed61b5)
2021-04-26 12:01:52 -07:00
John Baldwin
278db4ba3c cxgbei: Move some function prototypes to cxgbei.h.
Sponsored by:	Chelsio Communications

(cherry picked from commit 45eed2331e)
2021-04-26 12:01:47 -07:00
John Baldwin
483bcffad7 cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp().
Sponsored by:	Chelsio Communications

(cherry picked from commit 52c11c3f74)
2021-04-26 12:01:40 -07:00
John Baldwin
c0b22e1468 ccr: Disable requests on port 1 when needed to workaround a firmware bug.
Completions for crypto requests on port 1 can sometimes return a stale
cookie value due to a firmware bug.  Disable requests on port 1 by
default on affected firmware.

Sponsored by:	Chelsio Communications

(cherry picked from commit 5fe0cd6503)
2021-04-26 12:01:32 -07:00
John Baldwin
ea511d5a5b ccr: Add per-port stats of queued and completed requests.
Sponsored by:	Chelsio Communications

(cherry picked from commit 9c5137beb5)
2021-04-26 12:01:27 -07:00
John Baldwin
9cdd43808c ccr: Set the RX channel ID correctly in work requests.
These fixes are only relevant for requests on the second port.  In
some cases, the crypto completion data, completion message, and
receive descriptor could be written in the wrong order.

- Add a separate rx_channel_id that is a copy of the port's rx_c_chan
  and use it when an RX channel ID is required in crypto requests
  instead of using the tx_channel_id.

- Set the correct rx_channel_id in the CPL_RX_PHYS_ADDR used to write
  the crypto result.

- Set the FID to the first rx queue ID on the adapter rather than the
  queue ID of the first rx queue for the port.

- While here, use tx_chan to set the tx_channel_id though this is
  identical to the previous value.

Reported by:	Chelsio QA
Sponsored by:	Chelsio Communications

(cherry picked from commit 8f885fd1f3)
2021-04-26 12:01:15 -07:00
Navdeep Parhar
cc76018cdd cxgbe(4): Read the rx 'c' channel for a port and make it available.
Sponsored by:	Chelsio Communications

(cherry picked from commit dfff1de729)
2021-04-26 12:01:10 -07:00
John Baldwin
8130bdab38 Handle negative return values from syncache_expand().
These errors do not clear so to NULL, so the existing check was
treating these failures as success.  The rest of do_pass_establish()
then tried to use the listen socket as if it was a connection socket
newly created by syncache_expand().

In addition, for negative return values, do not send a RST to the
peer.

Reported by:	Sony Arpita Das @ Chelsio
Sponsored by:	Chelsio Communications

(cherry picked from commit 1deaad9364)
2021-04-26 12:01:00 -07:00
Kevin Bowling
8209a085c7 ixgbe: Clarify index name in ixgbe_mc_filter_apply
"It looks like it would be less confusing to rename 'count' to
something like 'idx', since that's what it's used for in this
function."

Reviewed by:	erj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D29798

(cherry picked from commit 21afed4b1d)
2021-04-25 00:44:09 -07:00
Alexander Motin
f0077b4c1d mpt(4): Remove incorrect S/G segments limits.
First, two of those four checks are unreachable.
Second, I don't believe there should be ">=" instead of ">".
Third, bus_dma(9) already returns the same EFBIG if ">".

This fixes false I/O errors in worst S/G cases with maxphys >= 2MB.

MFC after:	1 week

(cherry picked from commit 0f29396e49)
2021-04-23 20:43:14 -04:00
Alexander Motin
6514cb18d9 pms(4): Limit maximum I/O size to 256KB instead of 1MB.
There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per
I/O since the initial driver import.  I don't know why it was added,
can only guess some hardware limitation, but in worst case it means
maximum I/O size of 508KB.  Respect it to be safe, rounding to 256KB.

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

(cherry picked from commit 3e34783420)
2021-04-22 21:05:42 -04:00
Alexander Motin
4bc708e1e8 pms(4): Do not return CAM_REQ_CMP on errors.
It is a direct request for data corruptions, one report of which we
have received.  I am very surprised that only one.

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

(cherry picked from commit 8434a65ce4)
2021-04-22 21:05:24 -04:00
Vincenzo Maffione
89a4cc5c8a netmap: don't use linux type struct device *
Such type cannot be used in code that is in common between
FreeBSD and Linux. Use the FreeBSD type instead.

MFC after:	3 days
Reported by:	markj
Differential Revision:	https://reviews.freebsd.org/D29677

(cherry picked from commit 70275a6735)
2021-04-19 14:17:08 -04:00
Mark Johnston
1d553a9e3a qlnxr: Properly initialize the Linux device structure
The driver needs to provide a LinuxKPI device structure to register
itself with the IB subsystem.  It was erroneously using a copy of its
FreeBSD device structure for this purpose.

Use linux_pci_attach_device() instead, following the example of the
Chelsio iwarp driver.  Also ensure that we don't leak the faked device
during detach.

Reviewed by:	hselasky
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29595

(cherry picked from commit 56cbd386fb)
2021-04-19 09:02:06 -04:00
Mark Johnston
07f3c3b500 cxgb: Use device_t in preference to struct device *
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9771af4942)
2021-04-19 09:02:04 -04:00
Mark Johnston
dba90f9e26 al_eth: Use device_t in preference to struct device *
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d8b1601d54)
2021-04-19 09:02:01 -04:00
Dmitry Chagin
02816ecfb9 Partially revert r248770.
Under geom(4) nvme_ns_bio_process() is on the path where sleep
is prohibited as g_io_shedule_down() calls THREAD_NO_SLEEPNG()
before geom->start().

Reviewed By:		imp
Differential Revision:	https://reviews.freebsd.org/D29539

(cherry picked from commit a78109d5db)
2021-04-16 11:33:32 +03:00
Alexander Motin
3bec9180c9 Add IDs for ASMedia ASM116x PCIe 3.0 AHCI controllers.
MFC after:	1 week

(cherry picked from commit 5a8d32b53b)
2021-04-13 21:02:58 -04:00
Mark Johnston
507c464748 qat: Make prototypes consistent with the implementation
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 843d16436d)
2021-04-12 08:22:42 -04:00
Vladimir Kondratyev
99bc385243 hid: add opt_hid.h to modules that use HID_DEBUG
Submitted by:	Greg V <greg_AT_unrelenting_DOT_technology>
Reviewed by:	imp, wulf
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D28995

(cherry picked from commit 6241b57131)
2021-04-12 00:48:51 +03:00
Vladimir Kondratyev
09d2a7a67b ig4: Add PCI IDs for Intel Gemini Lake I2C controller.
Submitted by:	Dmitry Luhtionov
MFC after:	2 weeks

(cherry picked from commit bbacb7ce72)
2021-04-12 00:48:08 +03:00
Alex Richardson
30626f9ad5 sys/dev/md: Drop unncessary __GLOBL(mfs_root)
LLVM12 complains if you change the symbol binding:
error: mfs_root_end changed binding to STB_WEAK [-Werror,-Winline-asm]
error: mfs_root changed binding to STB_WEAK [-Werror,-Winline-asm]

(cherry picked from commit 69e18c9b7b)
2021-04-10 14:01:05 +01:00
Alexander Motin
88fe518973 Move time math out of disabled interrupts sections.
We don't need the result before next sleep time, so no reason to
additionally increase interrupt latency.

While there, remove extra PM ticks to microseconds conversion, making
C2/C3 sleep times look 4 times smaller than really.  The conversion
is already done by AcpiGetTimerDuration().  Now I see reported sleep
times up to 0.5s, just as expected for planned 2 wakeups per second.

MFC after:	1 month

(cherry picked from commit 2cee045b4d)
2021-04-06 20:33:59 -04:00
Alexander Motin
e6e4f79a6c Do not read timer extra time when MWAIT is used.
When we enter C2+ state via memory read, it may take chipset some
time to stop CPU.  Extra register read covers that time.  But MWAIT
makes CPU stop immediately, so we don't need to waste time after
wakeup with interrupts still disabled, increasing latency.

On my system it reduces ping localhost latency, waking up all CPUs
once a second, from 277us to 242us.

MFC after:	1 month

(cherry picked from commit 075e4807df)
2021-04-06 20:31:10 -04:00
Alexander Motin
9c27e7141b Change mwait_bm_avoidance use to match Linux.
Even though the information is very limited, it seems the intent of
this flag is to control ACPI_BITREG_BUS_MASTER_STATUS use for C3,
not force ACPI_BITREG_ARB_DISABLE manipulations for C2, where it was
never needed, and which register not really doing anything for years.
It wasted lots of CPU time on congested global ACPI hardware lock
when many CPU cores were trying to enter/exit deep C-states same time.

On idle 80-core system it pushed ping localhost latency up to 20ms,
since badport_bandlim() via counter_ratecheck() wakes up all CPUs
same time once a second just to synchronously reset the counters.
Now enabling C-states increases the latency from 0.1 to just 0.25ms.

Discussed with:	kib
MFC after:	1 month

(cherry picked from commit 455219675d)
2021-04-06 20:30:23 -04:00
Ka Ho Ng
2e107638ea virtio_pci_legacy: Allow memory space for configuration
For guests running under some kind of VMMs, configuration structure is
available in memory space but not I/O space.

Reported by:	Yuan Rui <number201724@me.com>
Reviewed by:	rpokala, bryanv, jhb
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D28818

(cherry picked from commit cf5d111240)
2021-04-03 14:09:50 +08:00
Ka Ho Ng
98740ead97 virtio_pci_legacy: Use the table BAR and PBA BAR from MSI-X cap
The MSI-X resource shouldn't be assumed to be always on BAR1.
The Virtio v1.1 Spec did not specify that MSI-X table and PBA BAR has to
be BAR1 either.

Reported by:	Yuan Rui <number201724@me.com>
Reviewed by:	bryanv, jhb
Approved by:	philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D28817

(cherry picked from commit faf9a4e914)
2021-04-03 14:09:31 +08:00
Neel Chauhan
ea96dcc6e2 ichsmb: Add PCI IDs for Intel Comet Lake and Tiger Lake
Reviewed by:		manu
Differential Revision:	https://reviews.freebsd.org/D27859
MFC after:		2 weeks

(cherry picked from commit a94d15af26)
2021-04-02 10:22:46 -07:00
Hans Petter Selasky
484bc45f54 MFC 31070b5bc7:
Set default alternate setting when USB audio devices are not in use,
to activate power save features.

Differential Revision:	https://reviews.freebsd.org/D28032
Suggested by:	Shichun_Ma@Dell.com
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 31070b5bc7)
2021-04-01 11:13:10 +02:00
Mark Johnston
381ba4357c Fix several dev_clone callbacks to avoid out-of-bounds reads
Use strncmp() instead of bcmp(), so that we don't have to find the
minimum of the string lengths before comparing.

Reviewed by:	kib
Reported by:	KASAN
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29463

(cherry picked from commit 3428b6c050)
2021-03-31 09:15:58 -04:00
John Baldwin
325427f71d xnb: Don't pass SIOC{ADD,DEL}MULTI to ifmedia_ioctl().
ifmedia_ioctl() doesn't handle these requests, and this matches what
xn does.

Sponsored by:	DARPA

(cherry picked from commit 71ba16a0a0)
2021-03-29 15:36:36 -07:00
John Baldwin
1a325aa204 Remove unused wrappers around kproc_create() and kproc_exit().
Sponsored by:	Netflix

(cherry picked from commit 645b15e558)
2021-03-29 11:10:43 -07:00