]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoloader: ptable_print() needs two tabs sometimes
tsoome [Thu, 9 May 2019 11:04:10 +0000 (11:04 +0000)]
loader: ptable_print() needs two tabs sometimes

Since the partition/slice names do vary in length, check the length
of the fixed part of the line against 3 * 8, if the lenth is less than
3 tab stops, print out extra tab.

use snprintf() instead of sprintf.

5 years agoloader: implement proper 8 char tab stops
tsoome [Thu, 9 May 2019 10:37:57 +0000 (10:37 +0000)]
loader: implement proper 8 char tab stops

The current console code is printing out 8 spaces for tab, calculate
the amount of spaces based on tab stops.

5 years agoFix memory leak of PCI BUS structure in the LinuxKPI.
hselasky [Thu, 9 May 2019 10:23:42 +0000 (10:23 +0000)]
Fix memory leak of PCI BUS structure in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix regression issue after r346645 in the LinuxKPI.
hselasky [Thu, 9 May 2019 09:45:19 +0000 (09:45 +0000)]
Fix regression issue after r346645 in the LinuxKPI.
Make sure LinuxKPI PCI devices get a default BUSDMA tag.

Found by: Thomas Laus <lausts@acm.org>
Sponsored by: Mellanox Technologies

5 years agoIn mld_v2_cancel_link_timers() check number of references and disconnect
ae [Thu, 9 May 2019 07:57:33 +0000 (07:57 +0000)]
In mld_v2_cancel_link_timers() check number of references and disconnect
inm before releasing the last reference. This fixes possible panics and
assertion.

PR: 237329
Reviewed by: mmacy
MFC after: 2 weeks

5 years agoReceiver side DSACK implemenation.
tuexen [Thu, 9 May 2019 07:34:15 +0000 (07:34 +0000)]
Receiver side DSACK implemenation.

This adds initial support for RFC 2883.

Submitted by: Richard Scheffenegger
Reviewed by: rrs@
Differential Revision: https://reviews.freebsd.org/D19334

5 years agoPrevent cwnd to collapse down to 1 MSS after exiting recovery.
tuexen [Thu, 9 May 2019 07:11:08 +0000 (07:11 +0000)]
Prevent cwnd to collapse down to 1 MSS after exiting recovery.

This is descrined in RFC 6582, which updates RFC 3782.

Submitted by: Richard Scheffenegger
Reviewed by: lstewart@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17614

5 years agoExistense of PCB route caching doesn't allow us to use new fast route
glebius [Wed, 8 May 2019 23:39:24 +0000 (23:39 +0000)]
Existense of PCB route caching doesn't allow us to use new fast route
lookup KPI in ip_output() like it is already used in ip_forward().
However, when there is no PCB provided we can use fast KPI, gaining
performance advantage.

Typical case when ip_output() is called without a PCB pointer is a
sendto(2) on a not connected UDP socket. In practice DNS servers do
this.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D19804

5 years agoetc/Makefile: Remove empty newline
manu [Wed, 8 May 2019 21:26:11 +0000 (21:26 +0000)]
etc/Makefile: Remove empty newline

This was commited accidently in r347356 and cause distribution with
NO_ROOT set to fail.

Reported by: ci, kib
MFC after: 2 weeks
X-MFC-With: r347356

5 years agoBump EC2 AMI filesystem size up to 4000 MB.
cperciva [Wed, 8 May 2019 21:03:03 +0000 (21:03 +0000)]
Bump EC2 AMI filesystem size up to 4000 MB.

AMIs have been breaking for the past month due to insufficient disk space.

Due to the small amount of overhead in the disk image, the EC2 AMIs end
up with the same (4GB) minimum disk size.

Reported by: Michal Krawczyk

5 years agorename nvme_ctrlr_destroy_qpair to nvme_ctrlr_destroy_qpairs
imp [Wed, 8 May 2019 20:18:11 +0000 (20:18 +0000)]
rename nvme_ctrlr_destroy_qpair to nvme_ctrlr_destroy_qpairs

Maintain symmetry with nvme_ctrlr_create_qpairs, making it easier to
match init/uninit scenarios.

Signed-off-by: John Meneghini <johnm@netapp.com>
Submitted by: Michael Hordijk <hordijk@netapp.com>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D19781

5 years agox86: Put other CPUs into tight loop when updating Intel microcode from
kib [Wed, 8 May 2019 20:01:09 +0000 (20:01 +0000)]
x86: Put other CPUs into tight loop when updating Intel microcode from
loaded OS.

This should prevent at least some theoretical issues whith code
execution on HT sibling of the core where the update is loaded.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20201

5 years agodts: Import files from Linux 5.1
manu [Wed, 8 May 2019 19:27:30 +0000 (19:27 +0000)]
dts: Import files from Linux 5.1

MFC after: 2 months

5 years agoUpdate dme(4) to reflect that it will not be removed due to FCP-101.
brooks [Wed, 8 May 2019 19:05:58 +0000 (19:05 +0000)]
Update dme(4) to reflect that it will not be removed due to FCP-101.

dme(4) is the built-in NIC on a couple non-expandable mips platforms and
thus should remain.  The FCP has been updated to reflect this fact.

Discussed with: imp

5 years agoImport Linux 5.1 DTS files
manu [Wed, 8 May 2019 19:00:46 +0000 (19:00 +0000)]
Import Linux 5.1 DTS files

5 years agodtb: allwinner: Add the pinebook dtb to the build
manu [Wed, 8 May 2019 18:56:24 +0000 (18:56 +0000)]
dtb: allwinner: Add the pinebook dtb to the build

5 years agoAdd usage example to tree(3).
trasz [Wed, 8 May 2019 18:49:59 +0000 (18:49 +0000)]
Add usage example to tree(3).

Obtained from: OpenBSD
MFC after: 2 weeks
Sponsored by: Klara Inc.

5 years agoMark inline functions with __unused; prevents compiler warning
trasz [Wed, 8 May 2019 18:47:00 +0000 (18:47 +0000)]
Mark inline functions with __unused; prevents compiler warning
when they end up being unused.

Reviewed by: kib
Obtained from: OpenBSD
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D20185

5 years agoFix expected output after r347207
lwhsu [Wed, 8 May 2019 18:46:12 +0000 (18:46 +0000)]
Fix expected output after r347207

While phil is working on fixing in libxo general test parts, updating these
files to stop the test failure warnings

Approved by: phil
MFC with: r347207
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20188

5 years agoEnable sys/disk.h consumers to avoid pulling in networking headers.
mmacy [Wed, 8 May 2019 18:10:19 +0000 (18:10 +0000)]
Enable sys/disk.h consumers to avoid pulling in networking headers.

The networking headers break ZoF.

5 years agopkgbase: Deal with the last etc files
manu [Wed, 8 May 2019 17:46:59 +0000 (17:46 +0000)]
pkgbase: Deal with the last etc files

Add tags=package=runtime for password related files.
Add tags=package=sendmail for rc.sendmail
Add tags=package=ipfw for rc.firewall

Reviewed by: bapt
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20173

5 years agoReduce umtx-related work on exec and exit
mjg [Wed, 8 May 2019 16:30:38 +0000 (16:30 +0000)]
Reduce umtx-related work on exec and exit

- there is no need to take the process lock to iterate the thread
  list after single-threading is enforced
- typically there are no mutexes to clean up (testable without taking
  the global umtx lock)
- typically there is no need to adjust the priority (testable without
  taking thread lock)

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

5 years agopowerpc/booke: Rewrite pmap_sync_icache() a bit
jhibbits [Wed, 8 May 2019 16:15:28 +0000 (16:15 +0000)]
powerpc/booke: Rewrite pmap_sync_icache() a bit

* Make mmu_booke_sync_icache() use the DMAP on 64-bit prcoesses, no need to
  map the page into the user's address space.  This removes the
  pvh_global_lock from the equation on 64-bit.
* Don't map the page with user-readability on 32-bit.  I don't know what the
  chance of a given user process being able to access the NULL page when
  another process's page is added there, but it doesn't seem like a good
  idea to map it to NULL with user read permissions.
* Only sync as much as we need to.  There are only two significant places
  where pmap_sync_icache is used: proc_rwmem(), and the SIGILL second-chance
  for powerpc.  The SIGILL second chance is likely the most common, and only
  syncs 4 bytes, so avoid the other 127 loop iterations (4096 / 32 byte
  cacheline) in __syncicache().

5 years agoConnect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build.
br [Wed, 8 May 2019 16:06:54 +0000 (16:06 +0000)]
Connect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build.

Sponsored by: DARPA, AFRL

5 years agopowerpc/booke: Do as much work outside of TLB locks as possible
jhibbits [Wed, 8 May 2019 16:05:18 +0000 (16:05 +0000)]
powerpc/booke: Do as much work outside of TLB locks as possible

Reduce the surface area of the TLB locks.  Unfortunately the same trick for
serializing the tlbie instruction on OEA64 cannot be used here to reduce the
scope of the tlbivax mutex to the tlbsync only, as the mutex also serializes
the TLB miss lock as a side effect, so contention on this lock may not be
reducible any further.

5 years agoAdd driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller
br [Wed, 8 May 2019 15:43:17 +0000 (15:43 +0000)]
Add driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller
found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoAdd support for USB 3.0 XHCI via ACPI
manu [Wed, 8 May 2019 15:42:39 +0000 (15:42 +0000)]
Add support for USB 3.0 XHCI via ACPI

Ampere eMAG systems have XHCI just described in ACPI, not on PCI.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: andrew
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19986

5 years agoAdd driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found
br [Wed, 8 May 2019 15:36:57 +0000 (15:36 +0000)]
Add driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found
in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoo Implement a bounce buffer based on device reserved memory.
br [Wed, 8 May 2019 15:22:27 +0000 (15:22 +0000)]
o Implement a bounce buffer based on device reserved memory.
  Grab device reserved physical memory regions from FDT using standard
  "memory-region" property and use vmem(9) to allocate buffers from it.
  The same vmem could be used by DMA engine drivers to allocate memory for
  DMA descriptors.
  This is required for platforms that provide uncached memory region
  reserved exclusively for DMA operations.
o Change sleepable sx(9) lock type to non-sleepable mutex(9) since
  network drivers usually hold mutex during DMA operations. So we don't
  take sleepable lock after non-sleepable.

Tested on U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores.

Sponsored by: DARPA, AFRL

5 years agoAdd wc(1) to native-xtools so that it can be used in qemu-user jails
antoine [Wed, 8 May 2019 15:17:36 +0000 (15:17 +0000)]
Add wc(1) to native-xtools so that it can be used in qemu-user jails

5 years agorandom(4): Don't complain noisily when an entropy source is slow
cem [Wed, 8 May 2019 14:54:32 +0000 (14:54 +0000)]
random(4): Don't complain noisily when an entropy source is slow

Mjg@ reports that RDSEED (r347239) causes a lot of logspam from this printf,
and I don't feel that it is especially useful (even ratelimited).  There are
many other quality/quantity checks we're not performing on entropy sources;
lack of high frequency availability does not disqualify a good entropy
source.

There is some discussion in the linked Differential about what logging might
be appropriate and/or polling policy for slower TRNG sources.  Please feel
free to chime in if you have opinions.

Reported by: mjg
Reviewed by: markm, delphij
Approved by: secteam(delphij)
X-MFC-With: r347239
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20195

5 years agoAvoid literal @generated tag in file-generating scripts
emaste [Wed, 8 May 2019 13:35:51 +0000 (13:35 +0000)]
Avoid literal @generated tag in file-generating scripts

We don't want the generator itself tagged as a generated file.

Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20182

5 years agoFix LINT linking issue.
hselasky [Wed, 8 May 2019 12:28:11 +0000 (12:28 +0000)]
Fix LINT linking issue.

Add missing mlxfw symbols to LINT builds.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix LINT compilation issue.
hselasky [Wed, 8 May 2019 12:27:16 +0000 (12:27 +0000)]
Fix LINT compilation issue.

"mdev" is unused when building LINT targets.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoBump the Mellanox driver version numbers and the FreeBSD version number.
hselasky [Wed, 8 May 2019 11:15:07 +0000 (11:15 +0000)]
Bump the Mellanox driver version numbers and the FreeBSD version number.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake command workqueue persistant in mlx5core.
hselasky [Wed, 8 May 2019 11:09:08 +0000 (11:09 +0000)]
Make command workqueue persistant in mlx5core.

There is no reason to re-create the command workqueue during healthcare.
This also fixes an issue where a previous work struct may refer to a
destroyed workqueue.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix race between driver unload and dumping firmware in mlx5core.
hselasky [Wed, 8 May 2019 11:08:48 +0000 (11:08 +0000)]
Fix race between driver unload and dumping firmware in mlx5core.

Present code uses lock-less accesses to the dump data to prevent top
level ioctls from blocking bottom-level call to dump.  Unfortunately, this
depends on the type stability of the dump data structure, which makes it
non-functional during driver teardown.

Switch to the mutex locking scheme where top levels use the mutex in the
bound regions, while copyouts and drain for completion utilize condvars.
The mutex lifetime is guaranteed to be strictly larger than the time
interval where driver can initiate dump, and most of the control fields
of the old struct mlx5_dump_data are directly embedded into struct
mlx5_core_dev.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoEnsure the flowtable rules are not freed twice in mlx5en(4).
hselasky [Wed, 8 May 2019 11:08:21 +0000 (11:08 +0000)]
Ensure the flowtable rules are not freed twice in mlx5en(4).
This can happen when re-loading the driver.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoUndo previous steps upon returning failure in mlx5en(4).
hselasky [Wed, 8 May 2019 11:08:01 +0000 (11:08 +0000)]
Undo previous steps upon returning failure in mlx5en(4).

Else flowtable resources may not be properly freed.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake sure the flow destination structure does not use values off the stack
hselasky [Wed, 8 May 2019 11:07:42 +0000 (11:07 +0000)]
Make sure the flow destination structure does not use values off the stack
in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFlush command workqueue when command completion is triggered in mlx5core.
hselasky [Wed, 8 May 2019 11:07:20 +0000 (11:07 +0000)]
Flush command workqueue when command completion is triggered in mlx5core.

Avoid race for command completion when triggering a command completions event.
Serialize operation by queueing all commands on the same work queue.
This can happen when healthcare triggers.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake command timeout way shorter in mlx5core.
hselasky [Wed, 8 May 2019 11:07:00 +0000 (11:07 +0000)]
Make command timeout way shorter in mlx5core.

The command timeout is terribly long, whole two hours. Make it 60s so if
things do go wrong, the user gets feedback in relatively short time, so
they can take corrective actions and/or investigate using tools and such.

Linux commit:
6b6c07bdcdc97ccac2596063bfc32a5faddfe884

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRemove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4).
hselasky [Wed, 8 May 2019 11:06:42 +0000 (11:06 +0000)]
Remove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix for compilation warning in mlx5en(4).
hselasky [Wed, 8 May 2019 11:06:22 +0000 (11:06 +0000)]
Fix for compilation warning in mlx5en(4).

Function 'mlx5e_alloc_rx_wqe' can never be inlined because it uses alloca
(override using the always_inline attribute)

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRename functions from mlx5_fwdump to mlx5_ctl in mlx5core.
hselasky [Wed, 8 May 2019 11:05:59 +0000 (11:05 +0000)]
Rename functions from mlx5_fwdump to mlx5_ctl in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoEnsure that only one command is specified at a time in mlx5tool(8).
hselasky [Wed, 8 May 2019 11:05:30 +0000 (11:05 +0000)]
Ensure that only one command is specified at a time in mlx5tool(8).

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement firmware reset from userspace in mlx5tool(8).
hselasky [Wed, 8 May 2019 11:05:09 +0000 (11:05 +0000)]
Implement firmware reset from userspace in mlx5tool(8).

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd Firmware Reset Level, MFRL, register accessors in mlx5core.
hselasky [Wed, 8 May 2019 11:04:40 +0000 (11:04 +0000)]
Add Firmware Reset Level, MFRL, register accessors in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd ConnectX-6 DX HCA ID to libmlx5.
hselasky [Wed, 8 May 2019 11:04:09 +0000 (11:04 +0000)]
Add ConnectX-6 DX HCA ID to libmlx5.

In addition, add "ConnectX family mlx5Gen Virtual Function" device ID.
Every new HCA VF will be identified with this device ID.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoExpose per-lane counters before correction mechanism in mlx5en(4).
hselasky [Wed, 8 May 2019 11:03:29 +0000 (11:03 +0000)]
Expose per-lane counters before correction mechanism in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd support for extended PCIe counters in mlx5en(4).
hselasky [Wed, 8 May 2019 11:02:36 +0000 (11:02 +0000)]
Add support for extended PCIe counters in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoExtend the counters framework in mlx5en(4).
hselasky [Wed, 8 May 2019 10:59:16 +0000 (10:59 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoUpdate performance counter bits in mlx5core.
hselasky [Wed, 8 May 2019 10:58:41 +0000 (10:58 +0000)]
Update performance counter bits in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement reading PCI power status in mlx5core.
hselasky [Wed, 8 May 2019 10:58:06 +0000 (10:58 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMove workqueue from mlx5en(4) to mlx5core.
hselasky [Wed, 8 May 2019 10:57:37 +0000 (10:57 +0000)]
Move workqueue from mlx5en(4) to mlx5core.

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

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAlways return success for RoCE modify port in mlx5ib.
hselasky [Wed, 8 May 2019 10:57:16 +0000 (10:57 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd support for new rates to mlx5ib.
hselasky [Wed, 8 May 2019 10:56:51 +0000 (10:56 +0000)]
Add support for new rates to mlx5ib.

Submitted by: slavash@
MFC after:      3 days
Sponsored by:   Mellanox Technologies

5 years agoAdd support for 200Gbit speeds to libibverbs.
hselasky [Wed, 8 May 2019 10:56:22 +0000 (10:56 +0000)]
Add support for 200Gbit speeds to libibverbs.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd new rates to ibcore.
hselasky [Wed, 8 May 2019 10:55:47 +0000 (10:55 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoDo not add IFM_10G_LR and IFM_40G_ER4 to supported media types by default in
hselasky [Wed, 8 May 2019 10:55:15 +0000 (10:55 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd support for 200Gb ethernet speeds to mlx5core.
hselasky [Wed, 8 May 2019 10:54:54 +0000 (10:54 +0000)]
Add support for 200Gb ethernet speeds to mlx5core.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRemove unused speed enums in mlx5core.
hselasky [Wed, 8 May 2019 10:54:24 +0000 (10:54 +0000)]
Remove unused speed enums in mlx5core.

Submitted by: slavash@
MFC after:      3 days
Sponsored by:   Mellanox Technologies

5 years agoControl automatic update of firmware on driver load with a tunable in mlx5core.
hselasky [Wed, 8 May 2019 10:54:05 +0000 (10:54 +0000)]
Control automatic update of firmware on driver load with a tunable in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoCorrect check for the calibration generation in mlx5en(4).
hselasky [Wed, 8 May 2019 10:53:47 +0000 (10:53 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoLet rx_out_of_buffer be a 32-bit counter in mlx5en(4).
hselasky [Wed, 8 May 2019 10:53:25 +0000 (10:53 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd vnic steering drop statistics in mlx5en(4).
hselasky [Wed, 8 May 2019 10:53:01 +0000 (10:53 +0000)]
Add vnic steering drop statistics in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoUse software counters for rx_packets and rx_bytes in mlx5en(4).
hselasky [Wed, 8 May 2019 10:52:32 +0000 (10:52 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd mlx5_firmware_update() in mlx5core.
hselasky [Wed, 8 May 2019 10:52:11 +0000 (10:52 +0000)]
Add mlx5_firmware_update() in mlx5core.
Add support for upgrading firmware on mlx5 module load.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoHandle IB_EVENT_DEVICE_FATAL event in ipoib.
hselasky [Wed, 8 May 2019 10:51:49 +0000 (10:51 +0000)]
Handle IB_EVENT_DEVICE_FATAL event in ipoib.
Perform flush if IB_EVENT_DEVICE_FATAL was received.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix for double bus master disable in mlx5core.
hselasky [Wed, 8 May 2019 10:51:29 +0000 (10:51 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoDocument userspace firmware flash in mlx5tool(8) and mlx5io(4).
hselasky [Wed, 8 May 2019 10:51:07 +0000 (10:51 +0000)]
Document userspace firmware flash in mlx5tool(8) and mlx5io(4).

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement userspace firmware update for ConnectX-4/5/6.
hselasky [Wed, 8 May 2019 10:50:35 +0000 (10:50 +0000)]
Implement userspace firmware update for ConnectX-4/5/6.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRename mlx5_fwdump_addr to more neutral mlx5_tool_addr in mlx5core.
hselasky [Wed, 8 May 2019 10:50:08 +0000 (10:50 +0000)]
Rename mlx5_fwdump_addr to more neutral mlx5_tool_addr in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd mlxfw callbacks in mlx5core.
hselasky [Wed, 8 May 2019 10:49:36 +0000 (10:49 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoInitial version of Mellanox in-kernel firmware upgrade support.
hselasky [Wed, 8 May 2019 10:49:05 +0000 (10:49 +0000)]
Initial version of Mellanox in-kernel firmware upgrade support.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoConvert remaining module parameters into SYSCTLs in mlx5core.
hselasky [Wed, 8 May 2019 10:44:53 +0000 (10:44 +0000)]
Convert remaining module parameters into SYSCTLs in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoRemove redundant line of code in mlx5core.
hselasky [Wed, 8 May 2019 10:44:27 +0000 (10:44 +0000)]
Remove redundant line of code in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoChange implicit and probably erronous EPERM to EIO on command status error
hselasky [Wed, 8 May 2019 10:44:02 +0000 (10:44 +0000)]
Change implicit and probably erronous EPERM to EIO on command status error
in mlx5core.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix typo.
hselasky [Wed, 8 May 2019 10:43:35 +0000 (10:43 +0000)]
Fix typo.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix style.
hselasky [Wed, 8 May 2019 10:42:51 +0000 (10:42 +0000)]
Fix style.

Submitted by: kib@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix netstat counters mapping in mlx5en(4).
hselasky [Wed, 8 May 2019 10:42:33 +0000 (10:42 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix endless loop in ipoib_poll().
hselasky [Wed, 8 May 2019 10:42:05 +0000 (10:42 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAvoid leaking send queue mbufs during error recovery in mlx5en(4).
hselasky [Wed, 8 May 2019 10:41:44 +0000 (10:41 +0000)]
Avoid leaking send queue mbufs during error recovery in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd helper functions to set/query MCC/MCDA/MCQI registers in mlx5core.
hselasky [Wed, 8 May 2019 10:41:21 +0000 (10:41 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoEnhance MCAM reg to allow query on access reg support in mlx5core.
hselasky [Wed, 8 May 2019 10:41:00 +0000 (10:41 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd MCC (Management Component Control) register definitions in mlx5core.
hselasky [Wed, 8 May 2019 10:40:41 +0000 (10:40 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd reading the mcam_reg in mlx5core.
hselasky [Wed, 8 May 2019 10:40:13 +0000 (10:40 +0000)]
Add reading the mcam_reg in mlx5core.

Submitted by: slavash@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoQuery and cache PCAM, MCAM registers on initialization in mlx5core.
hselasky [Wed, 8 May 2019 10:39:53 +0000 (10:39 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement PCAM, MCAM access register commands in mlx5core.
hselasky [Wed, 8 May 2019 10:39:25 +0000 (10:39 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoExpose PCAM, MCAM registers infrastructure in mlx5core.
hselasky [Wed, 8 May 2019 10:39:01 +0000 (10:39 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd sysctl(8) to control fast unload support in mlx5core.
hselasky [Wed, 8 May 2019 10:38:31 +0000 (10:38 +0000)]
Add sysctl(8) to control fast unload support in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoAdd Fast teardown support to mlx5core.
hselasky [Wed, 8 May 2019 10:38:06 +0000 (10:38 +0000)]
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

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoMake sure the running variable is properly set for ratelimited SQs in mlx5en(4).
hselasky [Wed, 8 May 2019 10:37:31 +0000 (10:37 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement get and set nic state as global functions in mlx5core.
hselasky [Wed, 8 May 2019 10:37:03 +0000 (10:37 +0000)]
Implement get and set nic state as global functions in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoTicks are integer type in FreeBSD.
hselasky [Wed, 8 May 2019 10:36:32 +0000 (10:36 +0000)]
Ticks are integer type in FreeBSD.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoConfigure firmware to use RX hash format in mini CQE in mlx5en(4).
hselasky [Wed, 8 May 2019 10:35:55 +0000 (10:35 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoDisable CQE zipping by default in mlx5en(4).
hselasky [Wed, 8 May 2019 10:35:35 +0000 (10:35 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoSplit mlx5e_update_stats_work() in mlx5en(4).
hselasky [Wed, 8 May 2019 10:35:14 +0000 (10:35 +0000)]
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@
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoImplement fast close of RX channel in mlx5en(4).
hselasky [Wed, 8 May 2019 10:34:42 +0000 (10:34 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoCorrect number of elements for priority to traffic class mappings in mlx5en(4).
hselasky [Wed, 8 May 2019 10:34:14 +0000 (10:34 +0000)]
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.

MFC after: 3 days
Sponsored by: Mellanox Technologies