Commit graph

4419 commits

Author SHA1 Message Date
Allan Jude
7abbfbda1e smbios: Move smbios driver out from x86 machdep code
Add it to the x86 GENERIC and MINIMAL kernels

Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.
Reviewed by:	rpokala
Differential Revision:	https://reviews.freebsd.org/D28738

(cherry picked from commit d0673fe160)
2022-03-03 08:20:07 -06:00
Navdeep Parhar
86b0782a37 cxgbe(4): Update firmwares to 1.26.6.0.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CHANGES
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Version : 1.26.6.0
Date    : 01/03/2022
================================================================================

Fixes
-----
BASE:
- Fixed one module eeprom read failure.
- Fixed an issue with speed selection when 40G and 25G are advertised and
  supported.
- Fixed a random traffic hang when T5 receives invalid ets BW in dcbx
  messages from a switch.
- Fixed very long link up time with few switches.
================================================================================

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 3b76242433)
2022-02-27 22:48:07 -08:00
Navdeep Parhar
6be5e07275 cxgbe(4): Update firmwares to 1.26.4.0
(Rest is from the README that came with the firmware)

Version : 1.26.4.0
Date    : 12/02/2021

Fixes
-----

BASE:
- Fixed error on setting 25G speed on 100G copper with multiple FEC set in
  firmware commands.
- Handle link of unknown optics modules by enabling module tx unconditionally.
- Fixed link not coming up for 25G CRS phys. Firmware incorrectly tried to
  bring up the link in RS-FEC but as per IEEE spec, it must be BASER FEC.
- Fixed an issue where firmware doesn't automatically retry next FEC if driver
  asks to bring up the link using RS-FEC and link doesn't come up.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 357ba2cf17)
2022-02-27 22:46:38 -08:00
Bjoern A. Zeeb
11045f1b73 iwlwifi: update firmware
Update to the latest firmware based on
linux-firmware at c53073d4e1485ac9f7cb065db466793c495aead7
and update firmware module Makefiles accordingly.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 062103fc93)
2022-02-27 23:41:55 +00:00
Bjoern A. Zeeb
d2a50aafb6 iwlwifi: update from iwlwifi-next
Import new code from iwlwifi-next at cb0a1fb7fd86b0062692b5056ca8552906509512
(matching tag: iwlwifi-next-for-kalle-2022-02-18).

Also add files not previously imported because we are not yet compiling
them to ease updating and having them when needed.

This adds MEI (Management Engine) support upstream which we cannot import
(currently GPL-only) so we have stub functions for the missing bits.

This also reduces the diff to upstream.  Changes submitted to avoid
problems with const and  with void * arithmetics were merged.

In the module build Makefile disable CONFIG_IWLWIFI_OPMODE_MODULAR
as we are building iwlwifi as a single module.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit d9836fb4b9)
2022-02-27 23:41:54 +00:00
Henri Hennebert
545def055b rtsx: Convert driver to use the mmc_sim interface
A lot more generic cam related things were done in mmc_sim so this
simplifies the driver a lot.

Differential Revision:	https://reviews.freebsd.org/D32154
Reviewed by:		imp

(cherry picked from commit 8e9740b62e)
2022-02-22 19:39:19 -05:00
Ed Maste
e0262ffbc6 mgb: Connect if_mgb module to the build
It supports the following Microchip devices:

LAN7430 PCIe Gigabit Ethernet controller with PHY
LAN7431 PCIe Gigabit Ethernet controller with RGMII interface

The driver has a number of caveats and limitations, but is functional.

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 543df60907)
2022-02-12 14:13:50 -05:00
Dimitry Andric
284434f7a6 Disable clang 14 warning about bitwise operators in zstd
Parts of zstd, used in openzfs and other places, trigger a new clang 14
-Werror warning:

```
sys/contrib/zstd/lib/decompress/huf_decompress.c:889:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
                        (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

While the warning is benign, it should ideally be fixed upstream and
then vendor-imported, but for now silence it selectively.

MFC after:	3 days

(cherry picked from commit 5f2aca8394)
2022-02-11 17:42:30 +01:00
Andriy Gapon
0237541d15 add overlay for enabling i2c1 on allwinner h3
At least on Orange Pi PC Plus it is routed to the 40-pin header, so it
can used to communicate with external devices.

(cherry picked from commit a471646a08)
2022-02-09 11:35:59 +02:00
Andriy Gapon
b8db946c3b add overlay for enabling spi0 on allwinner h3
At least on Orange Pi PC Plus it is routed to the 40-pin header, so it
can used to communicate with external devices.

(cherry picked from commit f4a041af29)
2022-02-09 11:35:39 +02:00
Andriy Gapon
ea331a2ef4 add overlay for enabling serial1 / uart1 on rk3328
On Rock64 the uart is routed to pins on the "Pi-2" header, so it is
potentially useful.

Pin mapping:
----------------------------
| ID | Name     | Function |
----------------------------
| 15 | GPIO3_A4 | TX       |
| 16 | GPIO3_A5 | RTS      |
| 18 | GPIO3_A6 | RX       |
| 22 | GPIO3_A7 | CTS      |
----------------------------

(cherry picked from commit 173d0fb616)
2022-02-09 11:35:18 +02:00
Andriy Gapon
b4a16940b9 add overlay for enabling i2c0 on rk3328
On Rock64 it is routed to pins 3 and 5 of the so called Pi-2 header.

(cherry picked from commit f41f98f0f0)
2022-02-09 11:34:58 +02:00
Hans Petter Selasky
26b0e75d64 mlx5: Implement flow steering helper functions for TCP sockets.
This change adds convenience functions to setup a flow steering rule based on
a TCP socket. The helper function gets all the address information from the
socket and returns a steering rule, to be used with HW TLS RX offload.

Sponsored by:	NVIDIA Networking

(cherry picked from commit 2c0ade806a)
2022-02-08 16:08:53 +01:00
Hans Petter Selasky
e53c3826c0 mlx5en: Implement support for internal queues, IQ.
Internal send queues are regular sendqueues which are reserved for WQE commands
towards the hardware and firmware. These queues typically carry resync
information for ongoing TLS RX connections and when changing schedule queues
for rate limited connections.

The internal queue, IQ, code is more or less a stripped down copy
of the existing SQ managing code with exception of:

1) An optional single segment memory buffer which can be read or
   written as a whole by the hardware, may be provided.
2) An optional completion callback for all transmit operations, may
   be provided.
3) Does not support mbufs.

Sponsored by:	NVIDIA Networking

(cherry picked from commit 694263572f)
2022-02-08 16:08:52 +01:00
Hans Petter Selasky
15cdce29d6 mlx5ib: Add missing auto generated header file to Makefile.
Sponsored by:	NVIDIA Networking

(cherry picked from commit 12af59c2cf)
(cherry picked from commit c830e92924)
2022-02-08 16:08:51 +01:00
Cy Schubert
5729ebba33 ipfilter: Move kernel bits to netpfil
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sys/netpil. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to netpfil.

This is the first of three commits the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with:	glebius
Reviewed by:				glebius, kp (for #network)
Differential Revision:		https://reviews.freebsd.org/D33510

(cherry picked from commit 3b9b51fe46)
2022-02-07 05:51:14 -08:00
Bjoern A. Zeeb
1158f08bc5 iwlwifi: import correct firmware versions for select Intel iwlwifi/mvm
The firmware files for 3160, 7260, and 7265 imported contain old versions
no longer supported by the driver.
Replace with latest versions from linux-firmware to possibly also
support these chip revisions.

Reported by:	FreeBSD User (freebsd walstatt-de.de) on wireless (2021-12-30)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 58101517cb)
2022-01-09 02:37:01 +00:00
Bjoern A. Zeeb
9d96f4d349 iwlwifi: attach to the build
Add iwlwifi and iwlwififw to the module builds.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7d4394cbe7)
2021-12-30 18:29:01 +00:00
Bjoern A. Zeeb
fde1b5236f iwlwifi: turn off broadcast filtering for now
Turn off broadcast filtering in iwlwifi for now as it gives me
or rather the firmware headaches.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c6ea5aed79)
2021-12-30 18:28:21 +00:00
Bjoern A. Zeeb
f4290ef2a3 iwlwifi: remove copyright and license from Makefiles
We do not generally protect the Makefiles like this.
Remove the details and go with project style.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ca8bf0e8d6)
2021-12-30 18:27:56 +00:00
Bjoern A. Zeeb
f8612fa7e0 LinuxKPI: add 802.11 compat code
Add 802.11 compat code for mac80211 and to a minimal degree cfg80211.
This allows us to compile and use basic functionality of wireless
drivers such as iwlwifi.

This is a constant work in progress but having it in the tree will
allow others to test and more easy to track changes and avoid having
snapshots no longer applying to branches.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6b4cac814e)
2021-12-30 18:27:45 +00:00
Bjoern A. Zeeb
fb3c236a4b LinuxKPI: import beginning of a new version of netdevice.h
Import a netdevice update complementing the last remaining bits of
the old ifnet derived implementation.  Along add a (for now) task
based NAPI implementation.

This is the minimal set of chnages which are needed for the initial
support of wireless drivers.  The NAPI implementation has an option to
still switch to "direct dispatch" as it had been used by these drivers
before not relying on a deferred context along with some printf tracing.
This has been helpful in the last weeks for debugging and will be
cleaned once we have had broader testing and are sure this is fine as-is.
Should we need a more time-sensitive or load-sensitive response
in the future we can always switch to something more sophisticated.

Sponsored by:		The FreeBSD Foundation
X-Differential Revision: D33075 (abandoned without feedback a while ago)

(cherry picked from commit d105895844)
2021-12-30 18:27:31 +00:00
Bjoern A. Zeeb
508c4fb4c3 LinuxKPI: add a work-in-progress skbuff implementation
This is a work-in-progress implementation of sk_buff compat code
used for wireless drivers only currently.
Bring in this version of the code as it has proven to be good enough
to have packets going for a few months.

The current implementation has several drawbacks including the need
for us to copy data between sk_buffs and mbufs.
Do not rely on the internals of this implementation.  They are highly
likely to change as we will improve the integration to FreeBSD mbufs.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 49ed6e979c)
2021-12-30 18:27:19 +00:00
Bjoern A. Zeeb
baf6251f27 iwlwifi: import Intel's iwlwifi/mvm driver.
Over the past few months we published multiple snapshots for this
Linux derived driver and it has become fairly stable in terms of
minimal local changes needed for new updates.

The current version is based on iwlwifi-next update at
cbaa6aeedee5f92dafa5982eceea2a1f98ce4f7d with the addition of
a hand full of files replaced for FreeBSD.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Do not yet hook this to the build until the remaining compat code
is all in.  Along with the firmware import this will make publishing
the last bits and final testing a lot easier.

Sponsored by:   The FreeBSD Foundation
Approved by:    core (imp) [1]

(cherry picked from commit bfcc09ddd4)
2021-12-30 18:26:05 +00:00
Bjoern A. Zeeb
6e83e1cead iwlwifi: import firmware for Intel iwlwifi/mvm supported chipsets.
Import the most recent versions of the firmware images for iwlwifi
chipsets supported by the "mvm" sub-driver.
This is based on linux-firmware at f5d519563ac9d2d1f382a817aae5ec5473811ac8.
The license of the firmware matches the previous iwnfw(4) and
iwmfw(4) firmware files and you can find a copy in
sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware .

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.
There is an open issue concerning kldxref that we need to resolve
(D32383).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f4c129f5fb)
2021-12-30 18:25:46 +00:00
Martin Matuska
3aa1cabca3 zfs: merge openzfs/zfs@af88d47f1 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.2

Notable upstream pull request merges:
  #12668 FreeBSD: Catch up with recent VFS changes
  #12704 Fix some FreeBSD VOPs to synchronize properly with teardown
  #12717 VOP_RENAME fixes for FreeBSD
  #12724 Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency
  #12745 Restore dirty dnode detection logic
  #12770 ZFS send/recv with ashift 9->12 leads to data corruption
  #12828 FreeBSD: Add vop_standard_writecount_nomsyn
  #12828 FreeBSD: Catch up with more VFS changes

Obtained from:	OpenZFS
OpenZFS commit:	af88d47f1e
OpenZFS tag:	zfs-2.1.2
Relnotes:	yes
2021-12-19 16:25:26 +01:00
Florian Walpen
984b9d89f8 MAC/priority module for realtime privilege group
PR:	239125

(cherry picked from commit bf2fa8d9d1)
2021-12-19 04:42:51 +02:00
Ram Kishore Vegesna
44a78c21df ocs_fc: Add gendump and dump_to_host ioctl command support.
Support to generate firmware dump.

Approved by: mav(mentor)

(cherry picked from commit 29e2dbd42c)

Add ocs_gendump.c to the build, missed in 29e2dbd42c.

(cherry picked from commit d0732fa819)
2021-12-17 16:00:59 +05:30
Eugene Grosbein
0b12cc411b if_epair: MFC: fix module build outside of kernel build environment
(cherry picked from commit 7a382e744b)
2021-12-14 20:22:25 +07:00
Konstantin Belousov
bd914cea9e amd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled
(cherry picked from commit 0f2d88d1eb)
2021-12-14 02:44:01 +02:00
Konstantin Belousov
83271c68c4 Fix some modules to export more used symbols
(cherry picked from commit 5bb3134a8c)
2021-11-25 03:09:21 +02:00
Mark Johnston
f695727330 Export symbols from opensolaris.ko and dtrace.ko
Both modules provide many symbols used by various DTrace provider
modules, so just export everything.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8a693ccf86)
2021-11-24 10:55:37 -05:00
Andriy Gapon
f1d2f22b34 pca954x: driver for PCA954x / TCA954x I2C switches
At the moment only PCA9548A is supported and has been tested.

(cherry picked from commit c0525ab1d1)
2021-11-24 16:19:09 +02:00
Andriy Gapon
9d7c92dbb9 add rk3328 overlay for enabling analog sound
(cherry picked from commit 00c06804a8)
2021-11-21 12:04:42 +02:00
Andriy Gapon
ee82e15cd9 pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C
(cherry picked from commit 6354154ef5)
2021-11-21 11:59:34 +02:00
Andriy Gapon
8f57430de1 driver for MAX44009 I2C illuminance sensor
(cherry picked from commit ff6fe29835)
2021-11-13 11:12:05 +02:00
Andriy Gapon
d6f71e09a7 pcf8591: driver for adc/dac with i2c interface
(cherry picked from commit a60b304697)
2021-11-13 11:10:44 +02:00
John Baldwin
6ca6d4edc2 ossl: Add ChaCha20 cipher support.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28756

(cherry picked from commit 92aecd1e6f)
2021-10-21 08:51:24 -07:00
John Baldwin
bc6265e8cf ossl: Add Poly1305 digest support.
Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28754

(cherry picked from commit a079e38b08)
2021-10-21 08:51:23 -07:00
John Baldwin
d5cbcae312 Add an implementation of CHACHA20_POLY1305 to cryptosoft.
This uses the chacha20 IETF and poly1305 implementations from
libsodium.  A seperate auth_hash is created for the auth side whose
Setkey method derives the poly1305 key from the AEAD key and nonce as
described in RFC 8439.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27837

(cherry picked from commit dd2e1352b6)
2021-10-21 08:51:22 -07:00
John Baldwin
ec3872a696 Add an OCF algorithm for ChaCha20-Poly1305 AEAD.
Note that this algorithm implements the mode defined in RFC 8439.

Reviewed by:	cem
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27836

(cherry picked from commit fc8fc743d8)
2021-10-21 08:51:22 -07:00
Navdeep Parhar
bcb2da3a62 cxgbe(4): Update firmwares to 1.26.2.0.
The firmwares and the following changelog are from the "Chelsio Unified
Wire v3.15.0.0 for Linux."

Version : 1.26.2.0
Date    : 09/24/2021
====================

FIXES
-----

BASE:
- Added support for SFP+ RJ45 (0x1C).
- Fixing backward compatibility issue with older drivers when multiple
  speeds are passed to firmware.

OFLD:
- Do not touch tp_plen_max if driver is supplying tp_plen_max. This
  fixes a connection reset issue in iscsi.

ENHANCEMENTS
------------

BASE:
- Firmware header modified to add firmware binary signature.

Sponsored by:	Chelsio Communications

(cherry picked from commit 45d6fbaec2)
2021-10-20 10:36:34 -07:00
Navdeep Parhar
c1f66d325a cxgbe(4): Update firmwares to 1.26.0.0.
Changes since 1.25.6.0 are listed here.  This list comes from the
Release Notes for "Chelsio Unified Wire 3.14.0.4 for Linux" dated
2021-07-08.

Fixes
-----

BASE:
- Wait 5ms before and after the i2c command that clears the mod_select.
  This fixes incorrect port module type read from i2c.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 3c900106ea)
2021-10-20 10:35:56 -07:00
Navdeep Parhar
20cbc6676b cxgbe(4): Update firmwares to 1.25.6.0.
Changes since 1.25.0.0 are listed here.  This list comes from the
Release Notes for the "Chelsio Unified Wire v3.14.0.3 for Linux"
release dated 2021-05-21.

Fixes
-----

BASE:
- Fixed Back to back T6 100G-CR4 link coming up with NO FEC sometimes.
- [T5] Try to bring up link in 1G speed if link doesn't come up on 10G.
- Fixed a bug to not allow BaseR fec in 100G speed.
- Fixed linkup issues on BT adapter in 1G and 100M speed.
- Fixed an issue to allow driver to send VI_ENABLE multiple times (once
  with rx disable and then later rx enable).
- Fixed rate limiting not working on class number 16 to 30.
- Fixed backward compatibility issue in port type interpretation with vpd
  version 0x80.

ETH:
- Fixed a case when firmware failed to deliver NIC WR completion to host.
- No rate limit support for WR ETH_TX_PKTS2 due to performance reasons.

OFLD
- Fixed a connection hang in SO adapters when tp_plen_max (set by driver)
  is more than the window size.
- Added fw_filter_vnic_mode to firmware API file (t4fw_interface.h)
- Use correct rx channel in coprocessor crypto completion (CPL_FW6_PLD). This
  was causing out of order completion to host.

FOiSCSI
- Fixed a crash due to unaligned access of ipv6 address.
- Fixed a crash during lun reset.

Enhancements
------------

ETH:
- Rate limiting support added for encapsulated (vxlan, nvgre, geneve) NIC TCP
  packets.

OFLD:
- More than 128 SGLs supported in FW_RI_FR_NSMR_WR. Now, more than 16GB
  (upto 64GB) of PBLs can be written with single FW_RI_FR_NSMR_WR.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit e0fa04e257)
2021-10-20 10:30:56 -07:00
Vladimir Kondratyev
fd6adf784e LinuxKPI: Remove FreeBSD struct resource from all LKPI headers
except linux/pci.h to avoid conflicts with Linux version.
This allows to #define resource in drm-kmod globally and strip some #ifdef-s

Reviewed by:	hselasky, manu
Differential revision:	https://reviews.freebsd.org/D31673

(cherry picked from commit 66ea390652)
2021-10-13 11:58:39 +03: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
Kyle Evans
bd4ee4ead1 modules: iichid: needs opt_acpi.h
This fixes the standalone build.

(cherry picked from commit 335c4f8edb)
2021-10-06 02:10:54 -05:00
Kyle Evans
38e0682c8c modules: netflow: need opt_inet.h
This fixes the standalone build.

(cherry picked from commit 6caae81d93)
2021-10-06 02:10:20 -05:00
Kyle Evans
7610a6b150 modules: acpi_video: need opt_evdev.h
This fixes the standalone build.

(cherry picked from commit 58ca99d116)
2021-10-06 02:09:58 -05:00
Guinan Sun
e4a16771e8 e1000: remove duplicated phy codes
Add two files base.c and base.h to reduce the redundancy
in the silicon family code.
Remove the code duplication from e1000_82575 files.
Clean family specific functions from base.
Fix up a stray and duplicate function declaration.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (44dddd14059f151f39f7e075b887decfc9a10f11)
MFC after:	1 week

(cherry picked from commit 6b9d35fac1)
2021-09-23 18:21:34 -07:00