Commit graph

38861 commits

Author SHA1 Message Date
Kevin Bowling
756d096417 ixgbe: Improve device name strings
This is just clerical work to ease bug triage and may be used to set
expectations around the ability for anyone in the community to perform
testing and development on older parts.

Approved by:	erj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D29876

(cherry picked from commit fdbcd35a75)
2021-05-27 22:53:23 -07:00
Kevin Bowling
1fb96c59b4 e1000: Rework em_msi_link interrupt filter
* Fix 82574 Link Status Changes, carrying the OTHER mask bit around as
  needed.
* Move igb-class LSC re-arming out of FAST back into the handler.
* Clarify spurious/other interrupt re-arms in FAST.

In MSI-X mode, 82574 and igb-class devices use an interrupt filter to
handle Link Status Changes. We want to do LSC re-arms in the handler
to take advantage of autoclear (EIAC) single shot behavior.

82574 uses 'Other' in ICR and IMS for LSC interrupt types when in MSI-X
mode, so we need to set and re-arm the 'Other' bit during attach and
after ICR reads in the FAST handler if not an LSC or after handling on
LSC due to autoclearing.

This work was primarily done to address the referenced PR, but inspired
some clarification and improvement for igb-class devices once the
intentions of previous bug fix attempts became clearer.

PR:		211219
Reported by:	Alexey <aserp3@gmail.com>
Tested by:	kbowling (I210 lagg), markj (I210)
Approved by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D29943

(cherry picked from commit eea55de7b1)
2021-05-27 22:50:07 -07:00
Kevin Bowling
e09d1b7ec4 e1000: Improve device name strings
This is just clerical work to ease bug triage and may be used to set
expectations around the ability for anyone in the community to perform
testing and development on older parts (this driver covers over 20 years
of silicon)

Reviewed by:	erj
Approved by:	markj
Sponsored by:	Pink Floyd - Any Colour You Like (in kind)
Differential Revision:	https://reviews.freebsd.org/D29872

(cherry picked from commit 0f6bea61ed)
2021-05-27 22:45:36 -07:00
Kevin Bowling
938b01476a e1000: Correct promisc multicast filter handling
There are a number of issues in the e1000 multicast filter handling
that have been present for a long time. Take the updated approach from
ixgbe(4) which does not have the issues.

The issues are outlined in the PR, in particular this solves crossing
over and under the hardware's filter limit, not programming the
hardware filter when we are above its limit, disabling SBP (show bad
packets) when the tunable is enabled and exiting promiscuous mode, and
an off-by-one error in the em_copy_maddr function.

PR:		140647
Reported by:	jtl
Reviewed by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D29789

(cherry picked from commit 4b38eed76d)
2021-05-27 22:30:03 -07:00
Kevin Bowling
1567ceeb09 ixgbe: Clean up unneeded set in ixgbe_if_multi_set
We don't need to set the bits here since the if/else if/else statements
fully cover setting these bit pairs.

Reported by:	markj
Reviewed by:	markj, erj
Approved by:	#intel_networking
MFC aftter:	1 week
Differential Revision:	https://reviews.freebsd.org/D29827

(cherry picked from commit deecaa1445)
2021-05-27 22:27:44 -07:00
Philippe Michaud-Boudreault
bdbb0f0565 hda: correct comment about Asus laptop digital mics
Reported in review D30333

MFC after:	1 week

(cherry picked from commit 5d698386fb)
2021-05-26 20:47:14 -04:00
Konstantin Belousov
00ecc35900 alc(4): add support for Mikrotik 10/25G NIC
PR:	256000

(cherry picked from commit 77b637338a)
2021-05-26 14:30:36 +03:00
Alexander Motin
22d8055aa2 mpr/mps(4): Make device mapping some more robust.
Allow new enclosure to replace previously existing one if there is
no completely unused table entry, same as it is done for devices.

If we can not process DPM due to corruption -- wipe it and restart
from scratch.  Otherwise I don't see a way to recover persistence if
something go wrong and there is no BIOS to recover it for us.

Together this solves a problem that appeared when 9300-8i firmware
update to 16.00.10.00 somehow switched its mapping mode from Device
Persistence to Enclosure/Slot without wiping the DPM table.  It made
HBA completely unusable, since overflowed and conflicting mapping
table was unable to map any of enclosures and so devices.

Also while there make some enclosure mapping errors more informative.

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

(cherry picked from commit b99419aee4)
2021-05-24 10:43:39 -04:00
Andriy Gapon
4a7dcb174c storvsc: fix auto-sense reporting
I saw a situation where the driver set CAM_AUTOSNS_VALID on a failed ccb
even though SRB_STATUS_AUTOSENSE_VALID was not set in the status.
The actual sense data remained all zeros.
The problem seems to be that create_storvsc_request() always sets
hv_storvsc_request::sense_info_len, so checking for sense_info_len != 0
is not enough to determine if any auto-sense data is actually available.

Sponsored by:	CyberSecure

(cherry picked from commit 8afecefd57)
2021-05-21 13:32:13 +03:00
Andriy Gapon
d7d4592ada PCI hot-plug: use dedicated taskqueue for device attach / detach
Attaching and detaching devices can be heavy-weight and detaching can
sleep waiting for events.  For that reason using the system-wide
single-threaded taskqueue_thread is not really appropriate.
There is even a possibility for a deadlock if taskqueue_thread is used
for detaching.

In fact, there is an easy to reproduce deadlock involving nvme, pass
and a sudden removal of an NVMe device.
A pass peripheral would not release a reference on an nvme sim until
pass_shutdown_kqueue() is executed via taskqueue_thread.  But the
taskqueue's thread is blocked in nvme_detach() -> ... -> cam_sim_free()
because of the outstanding reference.

Sponsored by:	CyberSecure
Reviewed by:	mav, imp

(cherry picked from commit 12588ce02d)
2021-05-21 13:28:06 +03:00
Kevin Bowling
a7e6edc7d7 e1000: fix em_mac_min and 82547 packet buffer
The boundary differentiating "lem" vs "em" class devices was wrong
after the iflib conversion of lem(4).

The Packet Buffer size for 82547 class chips was not set correctly
after the iflib conversion of lem(4).

These changes restore functionality on an 82547 for the submitter.

PR:		236119
Reported by:	Jeff Gibbons <jgibbons@protogate.com>
Reviewed by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D29766

(cherry picked from commit bb1b375fa7)
2021-05-18 00:45:49 -07:00
Kevin Bowling
135a6b5652 e1000: disable hw.em.sbp debug setting
This is a debugging tunable that shouldn't have retained this setting
after the initial iflib conversion of the driver

PR:		248934
Reported by:	Franco Fichtner <franco@opnsense.org>
Reviewed by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D29768

(cherry picked from commit 548d8a131d)
2021-05-18 00:42:59 -07:00
Mark Johnston
1e066db6cd Add missing sockaddr length and family validation to various protocols
Several protocol methods take a sockaddr as input.  In some cases the
sockaddr lengths were not being validated, or were validated after some
out-of-bounds accesses could occur.  Add requisite checking to various
protocol entry points, and convert some existing checks to assertions
where appropriate.

Reported by:	syzkaller+KASAN
Reviewed by:	tuexen, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29519

(cherry picked from commit f161d294b9)
2021-05-17 13:43:07 -04:00
Sai Rajesh Tallamraju
c9361f2fb0 ixgbe: Restore AIM support
AIM (adaptive interrupt moderation) was part of BSD11 driver. Upon IFLIB
migration, AIM feature got lost. Re-introducing AIM back into IFLIB
based IXGBE driver.

One caveat is that in BSD11 driver, a queue comprises both Rx and Tx
ring. Starting from BSD12, Rx and Tx have their own queues and rings.
Also, IRQ is now only configured for Rx side. So, when AIM is
re-enabled, we should now consider only Rx stats for configuring EITR
register in contrast to BSD11 where Rx and Tx stats were considered to
manipulate EITR register.

Reviewed by:	gallatin, markj
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D27344

(cherry picked from commit 64881da478)
2021-05-16 22:21:10 -04:00
Navdeep Parhar
1f9df724eb cxgbe(4): Use ifaddr_event_ext instead of ifaddr_event for CLIP management.
The _ext event notification includes the address being added/removed and
that gives the driver an easy way to ignore non-IPv6 addresses.  Remove
'tom' from the handler's name while here, it was moved out of t4_tom a
long time ago.

Sponsored by:	Chelsio Communications

(cherry picked from commit f4ba035bca)
2021-05-15 20:45:59 -07:00
Navdeep Parhar
8f7d958766 cxgbe(4): Do not panic when tx is called with invalid checksum requests.
There is no need to panic in if_transmit if the checksums requested are
inconsistent with the frame being transmitted.  This typically indicates
that the kernel and driver were built with different INET/INET6 options,
or there is some other kernel bug.  The driver should just throw away
the requests that it doesn't understand and move on.

Sponsored by:	Chelsio Communications

(cherry picked from commit b9820bca18)
2021-05-15 20:44:46 -07:00
Navdeep Parhar
1c0a5613ac cxgbe(4): hw.cxgbe.panic_on_fatal_err can be changed any time.
Sponsored by:	Chelsio Communications

(cherry picked from commit 50f5d13eeb)
2021-05-15 20:37:37 -07:00
Navdeep Parhar
294591a4b7 cxgbe(4): Move the hw-specific parts of VXLAN setup to a separate function.
It can be called to (re)apply the settings in the driver softc to the
hardware.

Sponsored by:	Chelsio Communications

(cherry picked from commit 5f00292fe3)
2021-05-15 20:36:13 -07:00
Navdeep Parhar
7d984fe000 cxgbe(4): Add flag to reliably stop the driver from accessing hw stats.
There are two kinds of routines in the driver that read statistics from
the hardware: the cxgbe_* variants read the per-port MPS/MAC registers
and the vi_* variants read the per-VI registers.  They can be called
from the 1Hz callout or if_get_counter.  All stats collection now takes
place under the callout lock and there is a new flag to indicate that
these routines should not access any hardware register.

Sponsored by:	Chelsio Communications

(cherry picked from commit b47b28e5b2)
2021-05-15 20:34:01 -07:00
Navdeep Parhar
8b8b659f39 cxgbe(4): RSS hash for VXLAN traffic is computed from the inner frame.
Sponsored by:	Chelsio Communications

(cherry picked from commit d107ee06f3)
2021-05-15 20:28:50 -07:00
Navdeep Parhar
b7259437d5 cxgbe(4): Fix minor nit in the display of MPS TCAM entries.
(cherry picked from commit dc77e79296)
2021-05-15 20:26:58 -07:00
Navdeep Parhar
9b107d9ef4 cxgbe(4): make the logging helpers a little more robust.
Sponsored by:	Chelsio Communications

(cherry picked from commit 8f1bc78ef7)
2021-05-15 20:26:22 -07:00
Navdeep Parhar
81ec0d0546 cxgbe/tom: Fix potential leak in t4_aiotx_process_job.
The mbuf allocated could be a chain and must be freed with m_freem.

Reviewed by:	jhb@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D29579

(cherry picked from commit bf5057691b)
2021-05-15 20:24:06 -07:00
Navdeep Parhar
e0897d6669 cxgbe(4): Always use the per-VI callout to read interface stats.
There is no change in the source of the stats (t4_get_port_stats or
t4_get_vi_stats) but the per-port callout is gone.

Sponsored by:	Chelsio Communications
Reviewed by:	jhb@
Differential Revision:	https://reviews.freebsd.org/D29527

(cherry picked from commit 516fe911a6)
2021-05-15 20:21:58 -07:00
Navdeep Parhar
248bc9784a cxgbe/t4_tom: restore socket's protosw before entering TIME_WAIT.
This fixes a panic due to stale so->so_proto if t4_tom is unloaded and
one or more connections that were previously offloaded are still around
in TIME_WAIT state.

Reviewed by:	jhb@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D29503

(cherry picked from commit 5394893269)
2021-05-15 20:18:42 -07:00
Navdeep Parhar
95a3005326 cxgbe(4): Allow a T6 adapter to switch between TOE and NIC TLS mode.
The hw.cxgbe.kern_tls tunable was used for this in the past and if it
was set then all T6 adapters would be configured for NIC TLS operation
and could not be reconfigured for TOE without a reload.  With this
change ifconfig can be used to manipulate toe and txtls caps like any
other caps.  hw.cxgbe.kern_tls continues to work as usual but its
effects are not permanent any more.

* Enable nic_ktls_ofld in the default configuration file and use the
  firmware instead of direct register manipulation to apply/rollback
  NIC TLS configuration.  This allows the driver to switch the hardware
  between TOE and NIC TLS mode in a safe manner.  Note that the
  configuration is adapter-wide and not per-port.

* Remove the kern_tls config file as it works with 100G T6 cards only
  and leads to firmware crashes with 25G cards.  The configurations
  included with the driver (with the exception of the FPGA configs) are
  supposed to work with all adapters.

Reported by:	Veeresh U.K. at Chelsio
Sponsored by:	Chelsio Communications
Reviewed by:	jhb@
Differential Revision: https://reviews.freebsd.org/D29291

(cherry picked from commit 15f3355567)
2021-05-15 20:12:11 -07:00
Navdeep Parhar
139c8bd6f3 cxgbe(4): create a separate helper routine to write the global RSS key.
While here, make sure only the PF driver attempts to program the global
RSS key (with options RSS).  The VF driver doesn't have access to those
device registers.

Sponsored by:	Chelsio Communications

(cherry picked from commit 3cc6f777be)
2021-05-15 20:10:57 -07:00
Navdeep Parhar
d9eb1e0c90 cxgbe(4): make it safe to call setup_memwin repeatedly.
A repeat call will recreate the memory windows in the hardware and move
them to their last-known positions without repeating any of the software
initialization.

Sponsored by:	Chelsio Communications

(cherry picked from commit a1d803c162)
2021-05-15 20:08:51 -07:00
Navdeep Parhar
564d1f6aef cxgbe(4): use standard sysctl routines to deal with 16b values.
These routines to handle 8b and 16b types were added in r289773 5+ years
ago.

Sponsored by:	Chelsio Communications

(cherry picked from commit 473f6163e3)
2021-05-15 20:06:35 -07:00
Navdeep Parhar
af1edd87f6 cxgbe(4): catch up with the latest cryptocaps.
There are two crypto capabilities that the driver didn't know about.

Sponsored by:	Chelsio Communications

(cherry picked from commit 0b373f26be)
2021-05-15 20:02:40 -07:00
Navdeep Parhar
9b9bd93450 cxgbe(4): Remove extra blank line.
No functional change.

(cherry picked from commit 765d623d60)
2021-05-15 20:01:55 -07:00
Navdeep Parhar
7f68191760 cxgbe(4): Fix an assertion that is not valid during attach.
Firmware access from t4_attach takes place without any synchronization.
The driver should not panic (debug kernels) if something goes wrong in
early communication with the firmware.  It should still load so that
it's possible to poke around with cxgbetool.

Sponsored by:	Chelsio Communications

(cherry picked from commit 4a4e9c516c)
2021-05-15 20:01:07 -07:00
Navdeep Parhar
d314a9f279 cxgbe(4): Use the correct filter width for T5+.
T5 and above have extra bits for the optional filter fields.  This is a
correctness issue and not just a waste because a filter mode valid on a
T4 (36b) may not be valid on a T5+ (40b).

Sponsored by:	Chelsio Communications

(cherry picked from commit 0460a45062)
2021-05-15 19:54:17 -07:00
Navdeep Parhar
a8076e0afd cxgbe(4): Add a driver ioctl to set the filter mask.
Allow the filter mask (aka the hashfilter mode when hashfilters are
in use) to be set any time it is safe to do so.  The requested mask
must be a subset of the filter mode already.  The driver will not change
the mode or ingress config just to support a new mask.

Sponsored by:	Chelsio Communications

(cherry picked from commit c91dda5ad9)
2021-05-15 19:53:07 -07:00
Navdeep Parhar
191894573b cxgbe(4): Use firmware commands to get/set filter configuration.
1. Query the firmware for filter mode, mask, and related ingress config
   instead of trying to figure them out from hardware registers.  Read
   configuration from the registers only when the firmware does not
   support this query.

2. Use the firmware to set the filter mode.  This is the correct way to
   do it and is more flexible as well.  The filter mode (and associated
   ingress config) can now be changed any time it is safe to do so.

   The user can specify a subset of a valid mode and the driver will
   enable enough bits to make sure that the mode is maxed out -- that
   is, it is not possible to set another bit without exceeding the
   total width for optional filter fields.  This is a hardware
   requirement that was not enforced by the driver previously.

Sponsored by:	Chelsio Communications

(cherry picked from commit 7ac8040a99)
2021-05-15 19:50:36 -07:00
Navdeep Parhar
e99210ab63 cxgbe(4): Break up t4_read_chip_settings.
Read the PF-only hardware settings directly in get_params__post_init.
Split the rest into two routines used by both the PF and VF drivers: one
that reads the SGE rx buffer configuration and another that verifies
miscellaneous hardware configuration.

Sponsored by:	Chelsio Communications

(cherry picked from commit fae028dd97)
2021-05-15 19:45:16 -07:00
Hans Petter Selasky
a122a5ebde Add more USB quirks for Garmin devices.
Sort the Garmin products while at it.

PR:		254664
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 28af0c4814)
2021-05-10 16:11:19 +02:00
Hans Petter Selasky
0d1e6e9413 Remove USB device ID added by SVN r150701 in the CDC USB ethernet driver.
Since then, the FreeBSD USB stack has got proper USB RNDIS support.

PR:		254345
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit d2c8714064)
2021-05-10 16:11:19 +02:00
Hans Petter Selasky
74ef3f740d Add more USB quirks for Kingston devices.
PR:		253855
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 47bc8fc9ae)
2021-05-10 16:11:19 +02:00
Hans Petter Selasky
9312bcb2e9 if_smsc: Add the ability to disable "turbo_mode", also called RX frame batching,
similarly to the Linux driver, by a tunable read only sysctl.

Submitted by:	Oleg Sidorkin <osidorkin@gmail.com>
PR:		254884
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 5a3426f453)
2021-05-10 16:11:19 +02:00
Jose Luis Duran
b316c016e1 Add Apollo Lake SIO/LPSS UARTs PCI IDs
PR:	255556

(cherry picked from commit 8f1562430f)
2021-05-10 03:50:08 +03:00
Jose Luis Duran
2fb889b520 uart_bus_pci.c: Style
PR:	255556

(cherry picked from commit 5b8b6b26e4)
2021-05-10 03:50:02 +03:00
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