]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r347310:
Hans Petter Selasky [Thu, 16 May 2019 16:34:11 +0000 (16:34 +0000)]
MFC r347310:
Expose per-lane counters before correction mechanism in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r347309:
Hans Petter Selasky [Thu, 16 May 2019 16:33:35 +0000 (16:33 +0000)]
MFC r347309:
Add support for extended PCIe counters in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r347308:
Hans Petter Selasky [Thu, 16 May 2019 16:32:59 +0000 (16:32 +0000)]
MFC r347308:
Extend the counters framework in mlx5en(4).

Allow more macro arguments and split the variable type and name into
separate arguments. This allows simple and powerful copy and extraction
of values from IFC based structures into SYSCTLs with the use of a single
macro.

Sponsored by: Mellanox Technologies

5 years agoMFC r347307:
Hans Petter Selasky [Thu, 16 May 2019 16:32:22 +0000 (16:32 +0000)]
MFC r347307:
Update performance counter bits in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r347306:
Hans Petter Selasky [Thu, 16 May 2019 16:31:39 +0000 (16:31 +0000)]
MFC r347306:
Implement reading PCI power status in mlx5core.

Implement a watchdog as part of the healtcare subsystem which
reads the PCI power status during startup and upon the PCI
power status change event and store it into the core device
structure. This value is then exported to user-space via a
read-only SYSCTL. A dmesg print has been added to inform
the admin about the PCI power status.

Sponsored by: Mellanox Technologies

5 years agoMFC r347305:
Hans Petter Selasky [Thu, 16 May 2019 16:31:03 +0000 (16:31 +0000)]
MFC r347305:
Move workqueue from mlx5en(4) to mlx5core.

This avoids creating more workqueues in mlx5core to do
simple firmware command polling tasks.

Sponsored by: Mellanox Technologies

5 years agoMFC r347304:
Hans Petter Selasky [Thu, 16 May 2019 16:30:25 +0000 (16:30 +0000)]
MFC r347304:
Always return success for RoCE modify port in mlx5ib.

CM layer calls ib_modify_port() regardless of the link layer.

For the Ethernet ports, qkey violation and Port capabilities
are meaningless. Therefore, always return success for ib_modify_port
calls on the Ethernet ports.

Linux Commit:
ec2558796d25e6024071b6bcb8e11392538d57bf

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347303:
Hans Petter Selasky [Thu, 16 May 2019 16:29:48 +0000 (16:29 +0000)]
MFC r347303:
Add support for new rates to mlx5ib.

Submitted by: slavash@
Sponsored by:   Mellanox Technologies

5 years agoMFC r347302:
Hans Petter Selasky [Thu, 16 May 2019 16:29:12 +0000 (16:29 +0000)]
MFC r347302:
Add support for 200Gbit speeds to libibverbs.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347301:
Hans Petter Selasky [Thu, 16 May 2019 16:27:21 +0000 (16:27 +0000)]
MFC r347301:
Add new rates to ibcore.

Add the new rates that were added to the Infiniband specification as part of
HDR and 2x support.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347300:
Hans Petter Selasky [Thu, 16 May 2019 16:26:46 +0000 (16:26 +0000)]
MFC r347300:
Do not add IFM_10G_LR and IFM_40G_ER4 to supported media types by default in
mlx5en(4).

IFM_10G_LR and IFM_40G_ER4 media should be added only if the device
has the needed capability bit set for it.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347299:
Hans Petter Selasky [Thu, 16 May 2019 16:26:09 +0000 (16:26 +0000)]
MFC r347299:
Add support for 200Gb ethernet speeds to mlx5core.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347298:
Hans Petter Selasky [Thu, 16 May 2019 16:25:09 +0000 (16:25 +0000)]
MFC r347298:
Remove unused speed enums in mlx5core.

Submitted by: slavash@
Sponsored by:   Mellanox Technologies

5 years agoMFC r347297:
Hans Petter Selasky [Thu, 16 May 2019 16:24:34 +0000 (16:24 +0000)]
MFC r347297:
Control automatic update of firmware on driver load with a tunable in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347296:
Hans Petter Selasky [Thu, 16 May 2019 16:23:58 +0000 (16:23 +0000)]
MFC r347296:
Correct check for the calibration generation in mlx5en(4).

If generation is cleared due to hardware clock failure, check for it before
the divisor is used.  Actually clear generation when failure occurs.

While there, stop doing the calculations inside the generation loop.  Since
all members of mlx5e_clbr_point are used for calculations, get the
local copy of the structure and use it after generation stabilized.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347295:
Hans Petter Selasky [Thu, 16 May 2019 16:21:32 +0000 (16:21 +0000)]
MFC r347295:
Let rx_out_of_buffer be a 32-bit counter in mlx5en(4).

This fixes counting issues when the firmware resets the counter during
allocation of the counter set where the counter belongs.

Sponsored by: Mellanox Technologies

5 years agolibsecureboot: make it easier to customize trust anchors
Simon J. Gerraty [Thu, 16 May 2019 16:15:41 +0000 (16:15 +0000)]
libsecureboot: make it easier to customize trust anchors

Avoid making hash self-tests depend on X.509 certs.
Include OpenPGP keys in trust store count.

MFC of r347408

Reviewed by: stevek
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D20208

5 years agoMFC r347295:
Hans Petter Selasky [Thu, 16 May 2019 16:15:20 +0000 (16:15 +0000)]
MFC r347295:
Add vnic steering drop statistics in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r347293:
Hans Petter Selasky [Thu, 16 May 2019 16:14:43 +0000 (16:14 +0000)]
MFC r347293:
Use software counters for rx_packets and rx_bytes in mlx5en(4).

The physical- and virtual- port counters might not reflect the amount
of data received after address filtering. Use the software counters
instead for rx_packets and rx_bytes to know exactly how much data
was received.

Sponsored by: Mellanox Technologies

5 years agoMFC r347292:
Hans Petter Selasky [Thu, 16 May 2019 16:14:03 +0000 (16:14 +0000)]
MFC r347292:
Add mlx5_firmware_update() in mlx5core.
Add support for upgrading firmware on mlx5 module load.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347291:
Hans Petter Selasky [Thu, 16 May 2019 16:13:29 +0000 (16:13 +0000)]
MFC r347291:
Handle IB_EVENT_DEVICE_FATAL event in ipoib.
Perform flush if IB_EVENT_DEVICE_FATAL was received.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347290:
Hans Petter Selasky [Thu, 16 May 2019 16:12:51 +0000 (16:12 +0000)]
MFC r347290:
Fix for double bus master disable in mlx5core.

mlx5_pci_disable_device is calling pci_disable_device which disables
bus master. No need to explicitly call pci_clear_master.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347289:
Hans Petter Selasky [Thu, 16 May 2019 16:12:17 +0000 (16:12 +0000)]
MFC r347289:
Document userspace firmware flash in mlx5tool(8) and mlx5io(4).

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347288:
Hans Petter Selasky [Thu, 16 May 2019 16:11:42 +0000 (16:11 +0000)]
MFC r347288:
Implement userspace firmware update for ConnectX-4/5/6.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347287:
Hans Petter Selasky [Thu, 16 May 2019 16:11:03 +0000 (16:11 +0000)]
MFC r347287:
Rename mlx5_fwdump_addr to more neutral mlx5_tool_addr in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347286:
Hans Petter Selasky [Thu, 16 May 2019 16:10:24 +0000 (16:10 +0000)]
MFC r347286:
Add mlxfw callbacks in mlx5core.

Add mlx5 implementation for the ones defined by the mlxfw
shared module to be used while flashing the device firmware.

The callbacks do their job through the MCQI, MCC and MCDA registers.

Linux commit:
62bd22cf326dc4ac5be673c11cef4602dc1f5e47

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347285 and r347327:
Hans Petter Selasky [Thu, 16 May 2019 16:09:16 +0000 (16:09 +0000)]
MFC r347285 and r347327:
Initial version of Mellanox in-kernel firmware upgrade support.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347284:
Hans Petter Selasky [Thu, 16 May 2019 16:08:01 +0000 (16:08 +0000)]
MFC r347284:
Convert remaining module parameters into SYSCTLs in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r347283:
Hans Petter Selasky [Thu, 16 May 2019 16:07:26 +0000 (16:07 +0000)]
MFC r347283:
Remove redundant line of code in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r347282:
Hans Petter Selasky [Thu, 16 May 2019 16:06:52 +0000 (16:06 +0000)]
MFC r347282:
Change implicit and probably erronous EPERM to EIO on command status error
in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347281:
Hans Petter Selasky [Thu, 16 May 2019 16:06:18 +0000 (16:06 +0000)]
MFC r347281:
Fix typo.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347280:
Hans Petter Selasky [Thu, 16 May 2019 16:05:42 +0000 (16:05 +0000)]
MFC r347280:
Fix style.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347279:
Hans Petter Selasky [Thu, 16 May 2019 16:05:07 +0000 (16:05 +0000)]
MFC r347279:
Fix netstat counters mapping in mlx5en(4).

The current mapping of driver counters to netstat counters is wrong.
For example, a single jabber packet, will cause the Ierrs counter to
count three times.

The work for mapping the hardware and software counters to their right
place in netstat counters were already done in Linux, take that as is
to the FreeBSD driver.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347278:
Hans Petter Selasky [Thu, 16 May 2019 16:04:23 +0000 (16:04 +0000)]
MFC r347278:
Fix endless loop in ipoib_poll().

ib_req_notify_cq may return negative value which will indicate a
failure. In the case of uncorrectable error, we will end up in an
endless loop. Fix that, by going to another loop with poll_more
only if there is anything left to poll.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347277:
Hans Petter Selasky [Thu, 16 May 2019 16:03:46 +0000 (16:03 +0000)]
MFC r347277:
Avoid leaking send queue mbufs during error recovery in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r347276:
Hans Petter Selasky [Thu, 16 May 2019 16:03:02 +0000 (16:03 +0000)]
MFC r347276:
Add helper functions to set/query MCC/MCDA/MCQI registers in mlx5core.

To be used by the mlx5 callbacks exposed to the mlxfw module.

Linux commit:
d2ad488b0073bd1a2c3f5d2ea50a7eb632103e5d

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347275:
Hans Petter Selasky [Thu, 16 May 2019 16:02:19 +0000 (16:02 +0000)]
MFC r347275:
Enhance MCAM reg to allow query on access reg support in mlx5core.

Enhance MCAM to allow the driver to query which access regs are
supported. For now, expose the regs needed for FW flashing.

Linux commit:
0ab87743cc8c5bcd482daf71961ed5fc45349e01

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347274:
Hans Petter Selasky [Thu, 16 May 2019 16:01:45 +0000 (16:01 +0000)]
MFC r347274:
Add MCC (Management Component Control) register definitions in mlx5core.

MCC (Management Component Control) allows to control a firmware
component update.

MCDA (Management Component Data Access) allows to read and write
a firmware component.

MCQI (Management Component Query Information) allows to query
information about firmware components.

Linux commit:
4717628938423fcba0aa8fa889e9fed4eb6a655f

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347273:
Hans Petter Selasky [Thu, 16 May 2019 16:01:11 +0000 (16:01 +0000)]
MFC r347273:
Add reading the mcam_reg in mlx5core.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347272:
Hans Petter Selasky [Thu, 16 May 2019 16:00:37 +0000 (16:00 +0000)]
MFC r347272:
Query and cache PCAM, MCAM registers on initialization in mlx5core.

On load_one, we now cache our capabilities registers internally, similar
to QUERY_HCA_CAP. Capabilities can later be queried using macros
introduced in this patch.

Linux commit:
71862561f3a62015a11de16d1c306481e8415c08

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347271:
Hans Petter Selasky [Thu, 16 May 2019 16:00:00 +0000 (16:00 +0000)]
MFC r347271:
Implement PCAM, MCAM access register commands in mlx5core.

Introduced registers will expose capabilities of new registers and
features related to port/management.
Driver will query MCAM and PCAM in order to avoid failing on old
firmwares with lack of support.

Linux commit:
c835ad64683bd3e2d1b31ed2cb1ff4366932edb1

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347270:
Hans Petter Selasky [Thu, 16 May 2019 15:59:23 +0000 (15:59 +0000)]
MFC r347270:
Expose PCAM, MCAM registers infrastructure in mlx5core.

PCAM: Ports capabilities mask register.
MCAM: Management capabilities mask register.

PCAM and MCAM registers will provide information regarding firmware
support for different features, in order to avoid cases where new driver
combined with old firmware results in syndromes (for ex. PCIe counters
before this patchset).

Linux commit:
cfdcbceaeffc669b70d904d80a2df9c86c232566

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347269:
Hans Petter Selasky [Thu, 16 May 2019 15:58:37 +0000 (15:58 +0000)]
MFC r347269:
Add sysctl(8) to control fast unload support in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r347268:
Hans Petter Selasky [Thu, 16 May 2019 15:57:59 +0000 (15:57 +0000)]
MFC r347268:
Add Fast teardown support to mlx5core.

Today mlx5 devices support two teardown modes:
1- Regular teardown
2- Force teardown

This change introduces the enhanced version of the "Force teardown" that
allows SW to perform teardown in a faster way without the need to reclaim
all the pages.

Fast teardown provides the following advantages:
1- Fix a FW race condition that could cause command timeout
2- Avoid moving to polling mode
3- Close the vport to prevent PCI ACK to be sent without been
   scattered to memory

Linux commit:
fcd29ad17c6ff885dfae58f557e9323941e63ba2

Sponsored by: Mellanox Technologies

5 years agoMFC r347267:
Hans Petter Selasky [Thu, 16 May 2019 15:57:14 +0000 (15:57 +0000)]
MFC r347267:
Make sure the running variable is properly set for ratelimited SQs in mlx5en(4).

Else the SQs won't be properly released when closing rate-limited connections
leading to wrong state transitions on the SQ.

Sponsored by: Mellanox Technologies

5 years agoMFC r347266:
Hans Petter Selasky [Thu, 16 May 2019 15:56:30 +0000 (15:56 +0000)]
MFC r347266:
Implement get and set nic state as global functions in mlx5core.

Sponsored by: Mellanox Technologies

5 years agoMFC r347265:
Hans Petter Selasky [Thu, 16 May 2019 15:55:54 +0000 (15:55 +0000)]
MFC r347265:
Ticks are integer type in FreeBSD.

Sponsored by: Mellanox Technologies

5 years agoMFC r347264:
Hans Petter Selasky [Thu, 16 May 2019 15:55:08 +0000 (15:55 +0000)]
MFC r347264:
Configure firmware to use RX hash format in mini CQE in mlx5en(4).

When using CQE zipping, one can choose between RX hash and Checksum.
This will indicate the parameter on which a zipping session should be
stopped.

While porting the Linux code, Checksum was chosen. However, the value
of Checksum is not being used anywhere.
For the FreeBSD driver, we prefer to use the RX hash format which will
guarantee the RX hash value for all the mini CQEs.
While at it, make sure to initialize the Checksum value in the
decompressed CQE.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347263:
Hans Petter Selasky [Thu, 16 May 2019 15:53:48 +0000 (15:53 +0000)]
MFC r347263:
Disable CQE zipping by default in mlx5en(4).

After doing performance measurements, it seems like CQE zipping doesn't
have any significant benefit.
Moreover, we know that this feature is disabled by default on other
operating systems (Linux for example).

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347262:
Hans Petter Selasky [Thu, 16 May 2019 15:53:12 +0000 (15:53 +0000)]
MFC r347262:
Split mlx5e_update_stats_work() in mlx5en(4).

Split the function into the mlx5e_update_stats_locked() core and make
mlx5e_update_stats_work() call the _locked helper, similar to many other
places in the kernel. This improves the code structure, making the
locking clean.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347261:
Hans Petter Selasky [Thu, 16 May 2019 15:52:18 +0000 (15:52 +0000)]
MFC r347261:
Implement fast close of RX channel in mlx5en(4).

Instead of waiting for all jobs to be cancelled, simply close the completion
queue to prevent more completion events and let mlx5e_destroy_rq() cleanup
the remaining mbufs.

Sponsored by: Mellanox Technologies

5 years agoMFC r347260 and r347326:
Hans Petter Selasky [Thu, 16 May 2019 15:51:28 +0000 (15:51 +0000)]
MFC r347260 and r347326:
Correct number of elements for priority to traffic class mappings in mlx5en(4).

The number of priorities is always 8, while the number of traffic classes
supported can vary. While at it convert the sysctl node into an array.

Sponsored by: Mellanox Technologies

5 years agoMFC r347259:
Hans Petter Selasky [Thu, 16 May 2019 15:50:11 +0000 (15:50 +0000)]
MFC r347259:
Remove unused module parameter in mlx5ib.

Sponsored by: Mellanox Technologies

5 years agoMFC r347258:
Hans Petter Selasky [Thu, 16 May 2019 15:49:35 +0000 (15:49 +0000)]
MFC r347258:
Make sure to error out when arming the CQ fails in mlx4ib and mlx5ib.

Sponsored by: Mellanox Technologies

5 years agoMFC r347257:
Hans Petter Selasky [Thu, 16 May 2019 15:48:56 +0000 (15:48 +0000)]
MFC r347257:
Make sure to error out when arming the CQ fails in ibcore.

Sponsored by: Mellanox Technologies

5 years agoMFC r347256:
Hans Petter Selasky [Thu, 16 May 2019 15:48:19 +0000 (15:48 +0000)]
MFC r347256:
Destroy port stats debug context in correct order in mlx5en(4).
Destroy children nodes before parent nodes.

Sponsored by: Mellanox Technologies

5 years agoMFC r347255:
Hans Petter Selasky [Thu, 16 May 2019 15:47:33 +0000 (15:47 +0000)]
MFC r347255:
Fix tx_jumbo_packets counter in mlx5en(4).

Instead of reading Ethernet RFC 2819 pXtoYoctets counters from
hardware which counts RX octets, count tx_stat_pXtoYoctets from
Ethernet extended counters which counts TX octets.

TX jumbo counters should be accumulated only after the PPCNT
counters were fetched from hardware with their latest value.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347254:
Hans Petter Selasky [Thu, 16 May 2019 15:46:50 +0000 (15:46 +0000)]
MFC r347254:
Update Ethernet extended counters in mlx5en(4).

Expose all Ethernet extended counters those counters via debug_stats
sysctl:
dev.mce.X.debug_stats

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347253:
Hans Petter Selasky [Thu, 16 May 2019 15:46:04 +0000 (15:46 +0000)]
MFC r347253:
Protect from infinite sw-reset loop in mlx5core.

Avoid an infinite software firmware reset loop that may be caused by a
hardware bug by limiting the maximum number of resets.
The counter between resets is reset by request for reset, and not by a
successful reset.
The interval between two resets can be configured via sysctl:
hw.mlx5.sw_reset_timeout
which is global to all mlx5 devices in the system.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347252:
Hans Petter Selasky [Thu, 16 May 2019 15:45:10 +0000 (15:45 +0000)]
MFC r347252:
Disable all MSIX interrupts before shutdown in mlx5.

Make sure the interrupt handlers don't race with the fast unload one
code in the shutdown handler.

Sponsored by: Mellanox Technologies

5 years agoMFC r347251:
Hans Petter Selasky [Thu, 16 May 2019 15:44:27 +0000 (15:44 +0000)]
MFC r347251:
Import Linux code to implement mlx5_ib_disassociate_ucontext() in mlx5ib.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347250:
Hans Petter Selasky [Thu, 16 May 2019 15:43:34 +0000 (15:43 +0000)]
MFC r347250:
Add temperature warning event to log in mlx5core.

Temperature warning event is sent by FW to indicate high temperature
as detected by one of the sensors on the board.
Add handling of this event by writing the numbers of the alert sensors
to the kernel log.

Linux commit:
1865ea9adbfaf341c5cd5d8f7d384f19948b2fe9

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347249:
Hans Petter Selasky [Thu, 16 May 2019 15:42:47 +0000 (15:42 +0000)]
MFC r347249:
Correctly define the interface state bits in mlx5en(4).

While at it remove unused interface state bits. This also fixes and issue
during shutdown:

There is an issue where the firmware fails during mlx5_load_one,
the health_care timer detects the issue and schedules a health_care call.
Then the mlx5_load_one detects the issue, cleans up and quits. Then
the health_care starts and calls mlx5_unload_one to clean up the resources
that no longer exist and causes kernel panic.

The root cause is that the bit MLX5_INTERFACE_STATE_DOWN is not set
after mlx5_load_one fails. The solution is removing the bit
MLX5_INTERFACE_STATE_DOWN and quit mlx5_unload_one if the
bit MLX5_INTERFACE_STATE_UP is not set. The bit MLX5_INTERFACE_STATE_DOWN
is redundant and we can use MLX5_INTERFACE_STATE_UP instead.

Linux commit:
10a8d00707082955b177164d4b4e758ffcbd4017
b3cb5388499c5e219324bfe7da2e46cbad82bfcf

Sponsored by: Mellanox Technologies

5 years agoMFC r347248:
Hans Petter Selasky [Thu, 16 May 2019 15:42:00 +0000 (15:42 +0000)]
MFC r347248:
Enable FPGA and FPGA QP errors for EQ and call the handler in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347247:
Hans Petter Selasky [Thu, 16 May 2019 15:41:04 +0000 (15:41 +0000)]
MFC r347247:
Add MLX5_FPGA_RELOAD IOCTL(2) to mlx5fpga.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347246:
Hans Petter Selasky [Thu, 16 May 2019 15:40:22 +0000 (15:40 +0000)]
MFC r347246:
Add support for Dynamic Interrupt Moderation, DIM, in mlx5en(4).

Add support for DIM based on Linux,
with some minor adaptions specific to FreeBSD.

Linux commit
f97c3dc3c0e8d23a5c4357d182afeef4c67f5c33

Sponsored by: Mellanox Technologies

5 years agoMFC r347190:
Hans Petter Selasky [Thu, 16 May 2019 15:39:07 +0000 (15:39 +0000)]
MFC r347190:
Use PCIV_INVALID in pci_channel_offline() in the LinuxKPI.

Build tested drm-current-kmod prior to commit.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347188:
Hans Petter Selasky [Thu, 16 May 2019 15:37:49 +0000 (15:37 +0000)]
MFC r347188:
Disabling a PCI device should only disable busmaster in the LinuxKPI.

As Linux comment for this function point:
Signal to the system that the PCI device is not in use by the system
anymore. This only involves disabling PCI bus-mastering, if active.

Build tested drm-current-kmod prior to commit.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347187:
Hans Petter Selasky [Thu, 16 May 2019 15:36:56 +0000 (15:36 +0000)]
MFC r347187:
Implement print_hex_dump_debug() function macro in the LinuxKPI.

Build tested drm-current-kmod prior to commit.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

5 years agoMFC r347185:
Hans Petter Selasky [Thu, 16 May 2019 15:35:50 +0000 (15:35 +0000)]
MFC r347185:
Allow controlling pr_debug at runtime in the LinuxKPI.

Turning on pr_debug at compile time make it non-optional at runtime.
This often means that the amount of the debugging is unbearable.
Allow developer to turn on pr_debug output only when needed.

Build tested drm-current-kmod prior to commit.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r346968, r346973
Ian Lepore [Thu, 16 May 2019 15:30:35 +0000 (15:30 +0000)]
MFC r346968, r346973

r346968:
Update the manpage text to show the output generated by the first-stage
bootloader these days (x86 instead of i386).

r346973:
Add a paragraph that mentions gptboot having an interactive mode, and
direct the user to the boot(8) manpage, which provides the details on that.

5 years agoMFC r343985, r344133, r345273 (by bde):
Konstantin Belousov [Thu, 16 May 2019 14:39:48 +0000 (14:39 +0000)]
MFC r343985, r344133, r345273 (by bde):
Prevent overflow for usertime/systime in caclru1().

PR: 76972

5 years agoMFC r347016:
Dmitry Chagin [Thu, 16 May 2019 10:41:29 +0000 (10:41 +0000)]
MFC r347016:

Remove unneeded includes.

5 years agoMFC r346647:
Oleksandr Tymoshenko [Wed, 15 May 2019 21:52:43 +0000 (21:52 +0000)]
MFC r346647:

[acpi_ibm] Add support for newer Thinkpad models

Add support for newer Thinkpad models with id LEN0268. Was tested on
Thinkpad T480 and ThinkPad X1 Yoga 2nd gen.

PR: 229120
Submitted by: Ali Abdallah <aliovx@gmail.com>

5 years agoMFC r345550:
Oleksandr Tymoshenko [Wed, 15 May 2019 18:56:42 +0000 (18:56 +0000)]
MFC r345550:

Change default value of kern.bootfile to reflect reality

In most cases kernel.bootfile is populated from the information
provided by loader(8). There are certain scenarios when loader
is not available, for instance when kernel is loaded by u-boot
or some other BootROM directly. In this case the default value
"/kernel" points to invalid location and breaks some functinality,
like using installkernel on self-hosted system or dtrace's CTF
lookup. This can be fixed by setting the value manually but the
default that reflects correct location is better than default that
points to invalid one.

Current default was set around FreeBSD 1, when "/kernel" was the
actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.

PR: 221550
Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D18902

5 years agoMFC r347422:
Ian Lepore [Wed, 15 May 2019 17:50:17 +0000 (17:50 +0000)]
MFC r347422:

Allow dcons(4) to be unloaded when loaded as a module.

When the module is unloaded, the tty devices are destroyed.  That requires
implementing the tsw_free callback to avoid a panic.  This driver requires
no particular cleanup to be done from the callback, but the module itself
must remain in memory until the deferred tsw_free callbacks are invoked.
These changes implement that by incrementing a reference count variable in
the detach routine, and decrementing it in the tsw_free callback.  The
MOD_UNLOAD event handler doesn't return until the count drops to zero.

PR: 237758

5 years agoMFC r347368:
Konstantin Belousov [Wed, 15 May 2019 08:15:44 +0000 (08:15 +0000)]
MFC r347368:
x86: Put other CPUs into tight loop when updating Intel microcode from
loaded OS.

5 years agoMFC r347075:
Enji Cooper [Wed, 15 May 2019 07:51:35 +0000 (07:51 +0000)]
MFC r347075:

Fix `clang -Wcast-qual` issues

Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and
deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb`
variable.

This unblocks ^/projects/runtime-coverage-v2 from building cleanly on
universe13a.freebsd.org. I suspect the issue was introduced through some
changes to `bsd.*.mk` inclusion on the branch, which I will continue to
investigate/isolate.

Tested with: clang 8 (arm64)

5 years agoMFC r347240: Fix dataset name comparison in zfs_compare().
Alexander Motin [Wed, 15 May 2019 01:38:34 +0000 (01:38 +0000)]
MFC r347240: Fix dataset name comparison in zfs_compare().

The code never returned match comparing two datasets (not snapshots).
As result, uu_avl_find(), called from zfs_callback(), never succeeded,
allowing to add same dataset into the list multiple times, for example:

        # zfs get name pers pers pers@z pers@z
        NAME    PROPERTY  VALUE   SOURCE
        pers    name      pers    -
        pers    name      pers    -
        pers@z  name      pers@z  -

With the patch:

        # zfs get name pers pers pers@z pers@z
        NAME    PROPERTY  VALUE   SOURCE
        pers    name      pers    -
        pers@z  name      pers@z  -

5 years agoMFC r347148:
Konstantin Belousov [Tue, 14 May 2019 21:11:15 +0000 (21:11 +0000)]
MFC r347148:
imgact_elf: do not relock the text vnode if possible.

5 years agoMFC r346120:
Edward Tomasz Napierala [Tue, 14 May 2019 20:41:24 +0000 (20:41 +0000)]
MFC r346120:

Use shared vnode locks for the ELF interpreter.

Sponsored by: DARPA, AFRL

5 years agoMFC r346076:
Edward Tomasz Napierala [Tue, 14 May 2019 20:31:06 +0000 (20:31 +0000)]
MFC r346076:

Improve vnode lock assertions.

Sponsored by: DARPA, AFRL

5 years agoMFC r346053:
Edward Tomasz Napierala [Tue, 14 May 2019 20:29:12 +0000 (20:29 +0000)]
MFC r346053:

Factor out section loading into a separate function.

Sponsored by: DARPA, AFRL

5 years agoMFC r346030:
Edward Tomasz Napierala [Tue, 14 May 2019 20:27:45 +0000 (20:27 +0000)]
MFC r346030:

Refactor ELF interpreter loading into a separate function.

Sponsored by: DARPA, AFRL

5 years agoMFC r345661:
Edward Tomasz Napierala [Tue, 14 May 2019 20:26:05 +0000 (20:26 +0000)]
MFC r345661:

Factor out retrieving the interpreter path from the main ELF
loader routine.

MFC r345734 by kib:

Fix branding after r345661.

In particular, elf32 FreeBSD binaries were not executed on LP64 hosts.
The interp_name_len value should account for the nul terminator.  This
is needed for strncmp()s in brand checking code to work.

Sponsored by: DARPA, AFRL

5 years agoMFC r345547:
Edward Tomasz Napierala [Tue, 14 May 2019 20:19:29 +0000 (20:19 +0000)]
MFC r345547:

Factor out resource limit enforcement code in the ELF loader.
It makes the code slightly easier to follow, and might make
it easier to fix the resouce accounting to also account for
the interpreter.

The PROC_UNLOCK() is moved earlier - I don't see anything
it should protect; the lim_max() is a wrapper around lim_rlimit(),
and that, differently from lim_rlimit_proc(), doesn't require
the proc lock to be held.

Sponsored by: DARPA, AFRL

5 years agoMFC r345448:
Edward Tomasz Napierala [Tue, 14 May 2019 20:03:19 +0000 (20:03 +0000)]
MFC r345448:

Remove trunc_page_ps() and round_page_ps() macros.  This completes
the undoing of r100384.

Sponsored by: DARPA, AFRL

5 years agoMFC r344705:
Edward Tomasz Napierala [Tue, 14 May 2019 19:52:18 +0000 (19:52 +0000)]
MFC r344705:

Remove sv_pagesize, originally introduced with r100384.

In all of the architectures we have today, we always use PAGE_SIZE.
While in theory one could define different things, none of the
current architectures do, even the ones that have transitioned from
32-bit to 64-bit like i386 and arm. Some ancient mips binaries on
other systems used 8k instead of 4k, but we don't support running
those and likely never will due to their age and obscurity.

Differently from the original commit, the merge leaves the struct
member in place to preserve the ABI.

Sponsored by: DARPA, AFRL

5 years agoMFC r347566:
Konstantin Belousov [Tue, 14 May 2019 17:04:00 +0000 (17:04 +0000)]
MFC r347566:
Mitigations for Microarchitectural Data Sampling.

Reference: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html
Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Security: FreeBSD-SA-19:07.mds
Reviewed by: jhb
Tested by: emaste, lwhsu
Approved by: so (gtetlow)

5 years agoMFC r346028:
Ganbold Tsagaankhuu [Tue, 14 May 2019 03:08:37 +0000 (03:08 +0000)]
MFC r346028:
Fix URE_WDT6_SET_MODE value in the register definition.
Both linux and u-boot sources for RTL8152 driver has this value.
RTL8152 USB ethernet is used in NanoPI R1 board as second ethernet.
This fixes RTL8152 USB ethernet not detected problem after
reboot.

5 years agoMFC r347241 (partial), r347392, r347429: ifconfig(8) ifname <-> kld mapping
Kyle Evans [Tue, 14 May 2019 02:00:12 +0000 (02:00 +0000)]
MFC r347241 (partial), r347392, r347429: ifconfig(8) ifname <-> kld mapping

MFC r347241 (partial): Initial mechanism for mapping ifname <-> kld

if_tun/if_tap mappings have been removed and the vmnet mapping has been
updated to the if_tap module.

MFC r347392: ifconfig(8): Partial revert of r347241

r347241 introduced an ifname <-> kld mapping table, mostly so tun/tap/vmnet
can autoload the correct module on use. It also inadvertently made bogus
some previously valid uses of sizeof().

Revert back to ifkind on the stack for simplicity sake. This reduces the
diff from the previous version of ifmaybeload for easiser auditing.

MFC r347429: ifconfig(8): Add kld mappings for ipsec/enc

Additionally, providing mappings makes the comparison for already loaded
modules a little more strict. This should have been done at initial
introduction, but there was no real reason- however, it proves necessary for
enc which has a standard enc -> if_enc mapping but there also exists an
'enc' module that's actually CAM. The mapping lets us unambiguously
determine the correct module.

5 years agoMFC r347227:
Mark Johnston [Tue, 14 May 2019 00:34:08 +0000 (00:34 +0000)]
MFC r347227:
Simplify the test against maxproc in fork1().

5 years agoMFC r346708:
Stephen Hurd [Mon, 13 May 2019 18:48:08 +0000 (18:48 +0000)]
MFC r346708:

iflib: Better control over queue core assignment

By default, cores are now assigned to queues in a sequential
manner rather than all NICs starting at the first core. On a four-core
system with two NICs each using two queue pairs, the nic:queue -> core
mapping has changed from this:

0:0 -> 0, 0:1 -> 1
1:0 -> 0, 1:1 -> 1

To this:

0:0 -> 0, 0:1 -> 1
1:0 -> 2, 1:1 -> 3

Additionally, a device can now be configured to use separate cores for TX
and RX queues.

Two new tunables have been added, dev.X.Y.iflib.separate_txrx and
dev.X.Y.iflib.core_offset. If core_offset is set, the NIC is not part
of the auto-assigned sequence.

Reviewed by: marius
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D20029

5 years agoMFC r347031: iflib: remove assertion that isc_capabilities is nonzero
Ed Maste [Mon, 13 May 2019 14:52:50 +0000 (14:52 +0000)]
MFC r347031: iflib: remove assertion that isc_capabilities is nonzero

It's atypical, but not invalid, for a driver to pass no capabilities.

Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
Sponsored by: The FreeBSD Foundation

5 years agoMFC r347186: Reformat arm64 linux syscalls.master per current style
Ed Maste [Mon, 13 May 2019 14:50:51 +0000 (14:50 +0000)]
MFC r347186: Reformat arm64 linux syscalls.master per current style

5 years agoMFC r347160: Decode some more ATA commands found in ACS-4.
Alexander Motin [Mon, 13 May 2019 13:29:51 +0000 (13:29 +0000)]
MFC r347160: Decode some more ATA commands found in ACS-4.

5 years agoMFC r347158: Decode Deallocate Logical Block Features.
Alexander Motin [Mon, 13 May 2019 13:28:42 +0000 (13:28 +0000)]
MFC r347158: Decode Deallocate Logical Block Features.

5 years agoMFC r346965:
Dmitry Chagin [Mon, 13 May 2019 10:43:18 +0000 (10:43 +0000)]
MFC r346965:

Follow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator.
It was first introduced in r163734 and missied by me in r283383.

5 years agoMFC r347178:
Andrey V. Elsukov [Mon, 13 May 2019 08:29:28 +0000 (08:29 +0000)]
MFC r347178:
  Add ipsec.ko to required_modules for rc.d/ipsec script.

  Thus it can be automatically loaded if ipsec_enable="YES" and option IPSEC
  is not in the kernel config.

5 years agoMFC r346885:
Andrey V. Elsukov [Mon, 13 May 2019 08:26:21 +0000 (08:26 +0000)]
MFC r346885:
  Handle HAVE_PROTO flag and print "proto" keyword for O_IP4 and O_IP6
  opcodes when it is needed.
  This should fix the problem, when printed by `ipfw show` rule can not
  be added due to missing "proto" keyword.