Commit graph

38953 commits

Author SHA1 Message Date
Hans Petter Selasky
349d037802 mlx5ib: Fix XRC QP support after introducing extended atomic.
Extended atomics are supported with RC and XRC QP types, but Linux commit
a60109dc9a95 added an unneeded check to to_mlx5_access_flags().
This broke XRC QPs.

The following ib_atomic_bw invocation over XRC reproduces the issue:
ib_atomic_bw -d mlx5_1 --connection=XRC --atomic_type=FETCH_AND_ADD

It is safe to remove such checks because the QP type was already checked
in ib_modify_qp_is_ok(), which was previously called from
mlx5_ib_modify_qp().

Linux commit:
13f8d9c16693afb908ead3d2a758adbe6a79eccd

Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit cf88b86e49)
2021-07-26 18:04:29 +02:00
Hans Petter Selasky
f1d4741b76 mlx5ib: Limit mkey page size to 2GB
The maximum page size in the mkey context is 2GB.

Until today, we didn't enforce this requirement in the code, and therefore,
if we got a page size larger than 2GB, we have passed zeros in the
log_page_shift instead of the actual value and the registration failed.

This patch limits the driver to use compound pages of 2GB for mkeys.

Linux commit:
762f899ae7875554284af92b821be8c083227092

Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 565cb4e8cc)
2021-07-26 18:04:28 +02:00
Hans Petter Selasky
cae3be82c3 mlx5ib: Simplify mlx5_ib_cont_pages()
The patch simplifies mlx5_ib_cont_pages and fixes the following
issues in the original implementation:

First issues is related to alignment of the PFNs. After the check
base + p != PFN, the alignment of the PFN wasn't checked. So the PFN
sequence 0, 1, 1, 2 would result in a page_shift of 13 even though
the 3rd PFN is not 8KB aligned.

This wasn't actually a bug because it was supported by all the
existing mlx5 compatible device, but we don't want to require
this support in all future devices.

Another issue is because the inner loop didn't advance PFN so
the test "if (base + p != pfn)" always failed for SGE with
len > (1<<page_shift).

Linux commit:
d67bc5d4e3e100d762c0f57ea67f28bc219698a6

Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 21bc3710a4)
2021-07-26 18:04:28 +02:00
Hans Petter Selasky
6b49b46f26 mlx5en: Add more error checks in the transmit path.
- Upon error more completion events than requested may be generated,
  particularly when using the completion event factor feature.
- Count number of event errors in the transmit path.

Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 4f4739a77b)
2021-07-26 18:04:28 +02:00
Hans Petter Selasky
24cf63c778 mlx5ib: Support RAW Ethernet when RoCE is disabled in mlx5ib(4)
On some environments, such as certain SRIOV VF configurations, RoCE is
not supported for mlx5 Ethernet ports. Currently, the driver will not
open IB device on that port.

This is problematic, since we do want user-space RAW Ethernet (RAW_PACKET
QPs) functionality to remain in place. For that end, enhance the relevant
driver flows such that we do create a device instance in that case.

Linux commit:
ca5b91d63192ceaa41a6145f8c923debb64c71fa

Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 626cb01d44)
2021-07-26 18:04:28 +02:00
Hans Petter Selasky
906117f773 mlx5en: Add missing media types for 100GBit/s, 200Gbit/s and 400Gbit/s.
Make the mlx5e_mode_table[] array one dimensional, because there is only
one entry, 10G ER/LR, which share the same protocol bit.

This patch only adds support for basic sub-type distinguishing for the
extended protocol bits. Use verbose ifconfig eeprom output to get actual
media type.

Remove write only "connector_type" variable while at it.

Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit a888087fba)
2021-07-26 18:04:28 +02:00
Konstantin Belousov
9dee4f6789 mlx5: drop Giant around VSC lock and CRSPACE enumeration on attach
(cherry picked from commit 78f5ebaed6)
2021-07-26 16:51:12 +03:00
Konstantin Belousov
f2e512d09b mlx5: add a knob to administratively disable mlx5 fw dump setup
(cherry picked from commit 8391db038d)
2021-07-26 16:51:12 +03:00
Konstantin Belousov
180c45c1b4 mlx5: Fix PBMC register mapping
(cherry picked from commit 0fc0b62b0f)
2021-07-26 16:51:12 +03:00
Konstantin Belousov
4348f0758c mlx5: Fix PPLM register mapping
(cherry picked from commit 06a3fd0e5c)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
14e2413289 mlx5en: add ASCII art providing an overview of flow tables organization
(cherry picked from commit b1277d42d7)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
a6925a8e34 mlx5en: vxlan: do not report TCP inner packet as UDP for software parser
(cherry picked from commit 1db1e58d93)
2021-07-26 16:51:11 +03:00
Hans Petter Selasky
976a59ba6d mlx5en: Add missing error case when creating VXLAN flow tables.
(cherry picked from commit 2f7ce2326f)
2021-07-26 16:51:11 +03:00
Hans Petter Selasky
40fa8f462b mlx5en: Fix for IPv6 VxLAN checksum offload.
(cherry picked from commit 1918b253d3)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
518c3f34d0 mlx5en: Honor IFCAP_VXLAN_HWCSUM
(cherry picked from commit 48acda2b2d)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
779fd2390b mlx5en: remove all dynamic vxlan steering rules on close and reinstall on open
(cherry picked from commit 0e4cb0d5a4)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
c0d0e85679 mlx5en: add mlx5e_add_vxlan_rule_from_db() helper
(cherry picked from commit 559eaa44d9)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
2226c0e785 mlx5en: remove unneeded protocol and port parameters from mlx5e_add_vxal_rule
(cherry picked from commit e012189d02)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
692ba7de91 mlx5: fix typo, KENREL_MIN_LEVEL->KERNEL_MIN_LEVEL
(cherry picked from commit 859e41e901)
2021-07-26 16:51:11 +03:00
Konstantin Belousov
d2fcc95d34 mlx5en: announce mce(4) capabilities for stateless VxLAN offloading
(cherry picked from commit bf202a8d7a)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
56fd9780ad mlx5en: handle checksum and TSO offloading for VxLAN packets on TX
(cherry picked from commit 7c9febf9f1)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
2ec7f3d2fe mlx5en: handle offloaded Rx checksums calculated for tunneled packets
(cherry picked from commit 149349e01e)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
56e096ec86 mlx5en: build TIRs to handle inner RSS
(cherry picked from commit fba6942f19)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
64f13da9dc mlx5en: allow software parser for created send queues
(cherry picked from commit 5e12b3bb43)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
8ab58a780d mlx5en: register vxlan start/stop handlers
(cherry picked from commit 861a612d7b)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
ed08b37119 mlx5en: eliminate magic constant
(cherry picked from commit 1b36b3869f)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
f9b965c238 mlx5en: style, remove redundant parentheses
(cherry picked from commit 16816f9689)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
273cc11d5c mlx5en: increase the limit MLX5E_MAX_TX_HEADER
(cherry picked from commit 8b8c71d7ac)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
3e8436ec78 mlx5: Flow steering tree: increase number of supported flow tables from 3 to 5
(cherry picked from commit bc56a8f9e7)
2021-07-26 16:51:10 +03:00
Konstantin Belousov
5955e8b93e mlx5: cqe64: update the tunneled bit name with recent PRM
(cherry picked from commit c8bdc78be1)
2021-07-26 16:51:09 +03:00
Mateusz Guzik
f89065625c hwpmc: mostly clean up cc --analyze
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit aee6e7dc0c)
2021-07-25 07:00:05 +00:00
Leandro Lupori
572e3575db aacraid: reduce max I/O size to avoid DMA issues
Reserve one page for the DMA subsystem, that may need it when the I/O
buffer is not page aligned.

Without this change, writes with the maximum allowed size failed, if:
- physical memory was fragmented, making it necessary to use one DMA
  segment for each page
- the buffer to be written was not page aligned, causing the DMA
  subsystem to need one extra segment

In the scenario above, the DMA subsystem would run out of segments,
resulting in a write with no SG segments, that would fail.

Reviewed by:		imp
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D30798

(cherry picked from commit 9c2c635319)
2021-07-23 08:28:58 -03:00
Emmanuel Vadot
a5a6fd462c dwmmc: Add bus_generic_add_child in the methods
Otherwise sdiob cannot add it's children.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30295

(cherry picked from commit c99d887ca8)
2021-07-22 19:25:54 +02:00
Emmanuel Vadot
a402f80395 an: Deprecate the driver
Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision:	https://reviews.freebsd.org/D30678
Reviewed by:		imp (earlier version), adrian (earlier version)
MFC after:		3 days
Sponsored by:		Diablotin Systems

(cherry picked from commit ab30bb8270)
2021-07-22 19:18:56 +02:00
Emmanuel Vadot
1e372b0494 extres: regulator: Fix regulator_status for already enable regulators
If a regulator hasn't been enable by a driver but is enabled in hardware
(most likely enabled by U-Boot), regulator_status will returns that it
is enabled and so any call to regulator_disable will panic as it wasn't
enabled by one of our drivers.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30293

(cherry picked from commit f52072b06d)
2021-07-22 19:09:43 +02:00
Emmanuel Vadot
ea9bd18bac mmc: dwmmc: Call mmc_fdt_set_power
This allow us to powerup/down the card and enabling/disabling the
regulators if any.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30292

(cherry picked from commit ce41765c21)
2021-07-22 19:09:42 +02:00
Emmanuel Vadot
19ccda09de mmc_fdt_helper: Add mmc_fdt_set_power
This helper can be used to enable/disable the regulator and starting
the power sequence of sd/sdio/eMMC cards.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30291

(cherry picked from commit 03d4e8bb65)
2021-07-22 19:09:41 +02:00
Emmanuel Vadot
ac90d80771 mmc_fdt_helpers: Parse the optional pwrseq element.
If a sd/emmc node have a pwrseq property parse it and get the corresponding
driver.
This can later be used to powerup/powerdown the SDIO card or eMMC.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30289

(cherry picked from commit b0387990a7)
2021-07-22 19:09:39 +02:00
Emmanuel Vadot
d35cbeb4b1 mmc: Add mmc-pwrseq driver
This driver is used to power up sdio card or eMMC.
It handle the reset-gpio, clocks and needed delays for powerup/powerdown.

Sponsored by:	Diablotin Systems
Differential Revision:	https://reviews.freebsd.org/D30288

(cherry picked from commit 5b2a81f58d)
2021-07-22 19:09:38 +02:00
Emmanuel Vadot
41607b5ed4 mmccam: Add two new XPT for MMC and use them in mmc_sim and sdhci
For the discovery phase of SD/eMMC we need to do some transaction in a async
way.
The classic CAM XPT_{GET,SET}_TRAN_SETTING cannot be used in a async way.
This also allow us to split the discovery phase into a more complete state
machine and we don't mtx_sleep with a random number to wait for completion
of the tasks.
For mmc_sim we now do the SET_TRAN_SETTING in a taskqueue so we can call
the needed function for regulators/clocks without the cam lock(s). This part is
still needed to be done for sdhci.
We also now save the host OCR in the discovery phase as it wasn't done before and
only worked because the same ccb was reused.

Reviewed by:	imp, kibab, bz
Differential Revision:	https://reviews.freebsd.org/D30038

(cherry picked from commit af2253f61c)
2021-07-22 19:09:38 +02:00
Emmanuel Vadot
bb2e1d6c69 dwc: Use mii_fdt function
Use the helper function to get phy mode and configure dwc accordingly.

Reviewed by:	ian

(cherry picked from commit f77d8d1011)
2021-07-22 18:48:11 +02:00
Emmanuel Vadot
f6deb48c11 dwmmc: Add \n to a debug printf
(cherry picked from commit 7cbdf8a05d)
2021-07-22 18:47:07 +02:00
Emmanuel Vadot
821c689006 mmc: dwmmc: Convert driver to use the mmc_sim interface
A lot more generic cam related things are done in mmc_sim so this simplify
the driver a lot.

Differential Revision:	https://reviews.freebsd.org/D27487
Reviewed by:	kibab

(cherry picked from commit f1cc48e5da)
2021-07-22 18:42:11 +02:00
Oskar Holmund
120e7f7399 usr.sbin/pwm/pwm add support for flags
The pwm utility cant set the only flag defined (PWM_POLARITY_INVERTED) so this
patch add the option -I (capital letter i) to send it to the drivers.

None of existing PWM driver have implemented support for flags.
But soon:ish I will put up an review of a pwm driver using TI OMAP DMTimer.

Differential Revision: https://reviews.freebsd.org/D29137
MFC after:   2 weeks

(cherry picked from commit 17b14d8f77)
2021-07-22 18:39:57 +02:00
Oskar Holmund
5c11eddf95 share/man/man9/pwmbus.9 fix types in arguments
Fix the types of period and duty in share/man/man9/pwmbus.9 to match the one in sys/dev/pmw/pwmbus.c.

Reviewed By: rpokala
Differential Revision: https://reviews.freebsd.org/D29139
MFC after:   3 days

(cherry picked from commit 7d4a5de84d)
2021-07-22 18:39:56 +02:00
Warner Losh
aebc14fcf5 nvme: Enable interrupts after qpair fully constructed
To guard against the ill effects of a spurious interrupt during
construction (or one that was bogusly pending), enable interrupts after
the qpair is completely constructed. Otherwise, we can die with null
pointer dereferences in nvme_qpair_process_completions. This has been
observed in at least one pre-release NVMe drive where the MSIX interrupt
fired while the queue was being created, before we'd started the NVMe
controller card.

The alternative of only turning on the interrupts after the rest was
tried, but was insufficient to work around this bug and made the code
more complicated w/o benefit.

Reviewed by:		mav, chuck
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31182

(cherry picked from commit fc9a084023)
2021-07-21 10:13:11 -06:00
Andriy Gapon
c5fa78d35d rtwn: make sure to not write in upper bits of txdseq
ni_txseqs is kept as 16-bit counter, but we need to trim the upper four
bits as they may have special meanings for the firmware / hardware.
For instance, bit 15 enables hardware / firmware generation of sequence
numbers that overrides sequence numbers programmed by the driver.

Reviewed by:	adrian

(cherry picked from commit 7544c1d20d)
2021-07-19 09:45:41 +03:00
Bjoern A. Zeeb
b9e51ecb5a mlx4/OFED: replace the struct net_device with struct ifnet
Given all the code does operate on struct ifnet, the last step in this
longer series of changes now is to rename struct net_device to
struct ifnet (that is what it was defined to in the LinuxKPi code).
While mlx4 and OFED are "shared" code the decision was made years ago
to not write it based on the netdevice KPI but the native ifnet KPI
for most of it.  This commit simply spells this out and with that
frees "struct netdevice" to be re-done on LinuxKPI to become a more
native/mixed implementation over time as needed by, e.g., wireless
drivers.

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

(cherry picked from commit 1411f52fac)
2021-07-18 00:35:03 +00:00
Bjoern A. Zeeb
70c9c5431f mlx4: replace LinuxKPI macros with ifnet functions
The LinuxKPI net_device actually is an ifnet;  in order to further
clean that up so we can extend "net_device" replace the few macros
inline in mlx4.

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

(cherry picked from commit 60afad6fc3)
2021-07-18 00:35:02 +00:00
Bjoern A. Zeeb
ddecc06c99 LinuxKPI/OFED/mlx4: cleanup netdevice.h some more
This removes all unused bits from linux/netdevice.h and migrates two
inline functions into the mlx4 and ofed code respectively.

This gets the mlx4/ofed (struct ifnet) specific bits down to 7 lines
in netdevice.h.

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

(cherry picked from commit c35034b338)
2021-07-18 00:35:02 +00:00