]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r347640: libbe(3): Descend into children of datasets w/ mountpoint=none
Kyle Evans [Wed, 22 May 2019 22:55:27 +0000 (22:55 +0000)]
MFC r347640: libbe(3): Descend into children of datasets w/ mountpoint=none

These datasets will generally be canmount=noauto,mountpoint=none (e.g.
zroot/var) but have children that may need to be mounted. Instead of
skipping that segment for no good reason, descend.

5 years agoMFC r347578: tun/tap: Defer clearing if_softc until after if_detach
Kyle Evans [Wed, 22 May 2019 22:34:35 +0000 (22:34 +0000)]
MFC r347578: tun/tap: Defer clearing if_softc until after if_detach

(Commit massaged to match stable structure; tun and tap have been merged in
head)

r346670 added an sx to close a race between the ifioctl handler and
interface destruction. Unfortunately, it clears if_softc immediately after
the interface is closed, but before if_detach has been invoked.

Any time before detachment, an interface that's part of a bridge may still
receive traffic that's pushed through tunstart/tunstart_l2 and promptly
lead to a panic because if_softc is now NULL.

Fix it by deferring the clearing of if_softc until after the interface has
detached and thus been removed from the bridge. if_softc still gets cleared
in case another thread has already entered the ioctl handler before it's
replaced with ifdead_ioctl.

5 years agoMFC r347978:
Dimitry Andric [Wed, 22 May 2019 17:42:22 +0000 (17:42 +0000)]
MFC r347978:

Fix OptionalObsoleteFiles copy/paste mistake from r345236, which
connected libomp to the build.  The comparison should not have been
against ${MK_OPENSSH}, but against ${MK_OPENMP}, obviously.

MFC r347979:

To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC
does not ship a -lomp symlink.  Also update OptionalObsoleteFiles for
this, and add 32-bit variants while here.

Submitted by: jbeich
PR: 237975

5 years agoMFC r347204:
Dmitry Chagin [Wed, 22 May 2019 05:37:29 +0000 (05:37 +0000)]
MFC r347204:

Adds sys/class/net devices to linsysfs.

Only two interfaces are created eth0 and lo and they expose
the following properties:
address, addr_len, flags, ifindex, mty, tx_queue_len and type.

Initial patch developed by Carlos Neira in 2017 and finished by me.

MFC r347218:

Remove wrong copyright line. Discussed with Carlos Neira.

5 years agoMFC r347203:
Dmitry Chagin [Wed, 22 May 2019 05:35:35 +0000 (05:35 +0000)]
MFC r347203:

Rewrite linux_ifflags() in more readable Linuxulator style.

5 years agoMFC r347202:
Dmitry Chagin [Wed, 22 May 2019 05:34:44 +0000 (05:34 +0000)]
MFC r347202:

Complete r347052 (https://reviews.freebsd.org/D20137) as it it was not
a final revision.

Fix style issues and change bool-like variables from int to bool.

5 years agoMFC r347196:
Dmitry Chagin [Wed, 22 May 2019 05:33:47 +0000 (05:33 +0000)]
MFC r347196:

The build process generates assym.inc from genassym.o, so don't forget
to clean genassym.o

5 years agoMFC r347052:
Dmitry Chagin [Wed, 22 May 2019 05:32:39 +0000 (05:32 +0000)]
MFC r347052:

In order to reduce duplication between MD parts of the Linuxulator
move bits that are MI out into the headers in compat/linux.
For that remove bogus _packed attribute from struct l_sockaddr
and use MI types for struct members.

And continue to move into the linux_common module a code that is
intended for both Linuxulator modules (both instruction set - 32 & 64 bit)
or for external modules like linsysfs or linprocfs.

To avoid header pollution introduce new sys/compat/linux_common.h header.

5 years agoMFC r347621:
Johannes Lundberg [Wed, 22 May 2019 04:10:24 +0000 (04:10 +0000)]
MFC r347621:
LinuxKPI: Add get_random_u32 function.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347619:
Johannes Lundberg [Wed, 22 May 2019 04:08:45 +0000 (04:08 +0000)]
MFC r347619:
LinuxKPI: Expand ktime functionality.

Also, make ktime_get_raw call getnanouptime instead of getnanotime
to match (the correct) ktime_get_raw_ns.
This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347623:
Johannes Lundberg [Wed, 22 May 2019 04:02:10 +0000 (04:02 +0000)]
MFC r347623:
LinuxKPI: Move {lower|upper}_32_bits macros from port to base.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347626:
Johannes Lundberg [Wed, 22 May 2019 04:00:13 +0000 (04:00 +0000)]
MFC r347626:
LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347620:
Johannes Lundberg [Wed, 22 May 2019 03:58:41 +0000 (03:58 +0000)]
MFC r347620:
LinuxKPI: Update user_access_begin for Linux v5.0.

Check the new LINUXKPI_VERSION macro for backwards compatibility.
This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347622:
Johannes Lundberg [Wed, 22 May 2019 03:54:25 +0000 (03:54 +0000)]
MFC r347622:
LinuxKPI: Include asm/atomic-long.h from atomic.h.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoRevert r348012, MFC r347963.
Brooks Davis [Tue, 21 May 2019 16:36:28 +0000 (16:36 +0000)]
Revert r348012, MFC r347963.

Several of the changes touch actual defaults. These defaults are all
mistakes and no one should rely on them, but changing them in a stable
branch is clearly inappropriate.

Reported by: rgrimes

5 years agoMFC r347216:
Konstantin Belousov [Tue, 21 May 2019 15:19:49 +0000 (15:19 +0000)]
MFC r347216:
amd64: fix BUS_SPACE_MAXSIZE to 64bit max value.

5 years agoBump FreeBSD version after change to struct in linuxkpi from r348035.
Johannes Lundberg [Tue, 21 May 2019 02:42:42 +0000 (02:42 +0000)]
Bump FreeBSD version after change to struct in linuxkpi from r348035.

5 years agoMFC r347601:
Johannes Lundberg [Tue, 21 May 2019 02:38:21 +0000 (02:38 +0000)]
MFC r347601:
LinuxKPI: Add prepare to pm_ops and bump FreeBSD version.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347600:
Johannes Lundberg [Tue, 21 May 2019 02:36:12 +0000 (02:36 +0000)]
MFC r347600:
LinuxKPI: Add vm_fault_t type.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347592:
Johannes Lundberg [Tue, 21 May 2019 02:31:34 +0000 (02:31 +0000)]
MFC r347592:
LinuxKPI: Let del_timer return a value to match Linux.

This patch is part of https://reviews.freebsd.org/D19565.

Reviewed by: hps
Approved by: imp (mentor), hps

5 years agoMFC r347570:
Mark Johnston [Tue, 21 May 2019 01:27:08 +0000 (01:27 +0000)]
MFC r347570:
Specify -z notext when building with -z ifunc-noplt.

5 years agoMFC r347963:
Brooks Davis [Mon, 20 May 2019 21:33:22 +0000 (21:33 +0000)]
MFC r347963:

Change ed(4), ep(4), and fxp(4) examples to em(4).

ed(4) and ep(4) will be removed in FreeBSD 13. fxp(4) remains
popular in older systems, but isn't as future proof as em(4).

Reviewed by: bz, jhb
Differential Revision: https://reviews.freebsd.org/D20311

5 years agoMFC r347565:
Guangyuan Yang [Sun, 19 May 2019 23:56:04 +0000 (23:56 +0000)]
MFC r347565:

Fix some spelling errors in ng_eiface(4).

PR: 237764
Submitted by: Tom Marcoen <tom.marcoen@gmail.com>

5 years agoMFC r347690, r347946:
Konstantin Belousov [Sun, 19 May 2019 09:24:51 +0000 (09:24 +0000)]
MFC r347690, r347946:
imgact_elf.c: Add comment explaining the malloc/VOP_UNLOCK() dance
from r347148.

5 years agoMFC r347488,347606: Update leap-seconds to leap-seconds.3676924800.
Xin LI [Sun, 19 May 2019 04:56:02 +0000 (04:56 +0000)]
MFC r347488,347606: Update leap-seconds to leap-seconds.3676924800.

5 years agoMFC r347940
Brooks Davis [Sat, 18 May 2019 17:30:03 +0000 (17:30 +0000)]
MFC r347940

Remove the notice that ae(4) will be removed in FreeBSD 13.

5 years agoMFC
Johannes Lundberg [Sat, 18 May 2019 13:27:09 +0000 (13:27 +0000)]
MFC
------------------------------------------------------------------------
r347470 | johalun | 2019-05-10 16:10:22 -0700 (Fri, 10 May 2019) | 9 lines

Implement linux_pci_unregister_drm_driver in linuxkpi so that drm drivers
can be unloaded.

This patch is a part of D19565.

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

------------------------------------------------------------------------

5 years agoMFC r347617:
Benedict Reuschling [Sat, 18 May 2019 03:15:07 +0000 (03:15 +0000)]
MFC r347617:
Add small EXAMPLE section to bsearch.3.

Submitted by:     fernape (via Phabricator)
Reviewed by:     bcr, jilles, dab
Approved by:     bcr (man pages), jilles (src)
Differential Revision:     https://reviews.freebsd.org/D19902

5 years agoMFC r347625:
Konstantin Belousov [Fri, 17 May 2019 20:59:59 +0000 (20:59 +0000)]
MFC r347625:
Properly announce MD_CLEAR.

5 years agoMFC r346390: Change the way FreeBSD GID inheritance is hacked.
Alexander Motin [Fri, 17 May 2019 16:41:18 +0000 (16:41 +0000)]
MFC r346390: Change the way FreeBSD GID inheritance is hacked.

I believe previous ifdef caused NULL dereference in later zfs_log_create()
on attempt to create file inside directory belonging to ephemeral group
created on illumos, trying to write to log information about GID domain
of the newly created file, inheriting the ephemeral GID.

This patch reuses original illumos SGID code with exception that due to
lack of ID mapping code on FreeBSD ephemeral GID will turn into GID_NOBODY
by another ifdef inside zfs_fuid_map_id().

Sponsored by: iXsystems, Inc.

5 years agoMFC r345008:
Kenneth D. Merry [Fri, 17 May 2019 14:29:56 +0000 (14:29 +0000)]
MFC r345008:
  ------------------------------------------------------------------------
  r345008 | ken | 2019-03-11 10:21:14 -0400 (Mon, 11 Mar 2019) | 59 lines

  Fix CRN resets in the isp(4) driver in certain situations.

  The Command Reference Number (CRN) is part of the FC-Tape features
  that we enable when talking to tape drives.  It starts at 1, and
  goes to 255 and wraps around to 1.  There are a number of reset
  type conditions that result in the CRN getting reset to 1.  These
  are detailed in section 4.10 (table 8) of the FCP-4r02b specification.

  One of the conditions is when a PRLI (Process Login) is sent by
  the initiator, and the Establish Image Pair bit is set in Word 0
  of the PRLI.

  Previously, the isp(4) driver core sent a notification via
  isp_async() that the target had changed or stayed in place, but
  there was no indication of whether a PRLI was sent and whether the
  Establish Image Pair bit was set.

  The result of this was that in some situations, notably
  switching back and forth between a direct connection and a switch
  connection to a tape drive, the isp(4) driver would fail to reset
  the CRN in situations that require it according to the spec.  When
  the CRN isn't reset in a situation that requires it, the tape drive
  then rejects every subsequent command that is sent to the drive.
  It is assuming that the commands are being sent out of order.

  So, modify the isp(4) driver to include Word 0 of the PRLI command
  when it sends isp_async() notifications of target changes.  Look at
  the Establish Image Pair bit, and reset the CRN if that bit is set.

  With this change, I am able to switch a tape drive back and forth
  between a direct connection and a switch connection, and the isp(4)
  driver resets the CRN when it should.

  sys/dev/isp_stds.h:
   Add bit definitions for PRLI Word 0.

  sys/dev/ispmbox.h:
   Add PRLI Word 0 to the port database type, isp_pdb_t.

  sys/dev/ispvar.h
   Add PRLI Word 0 to fcportdb_t.

  sys/dev/isp.c:
   Populate the new prli_word0 parameter in the port database.

   In isp_pdb_add_update(), add a check to see if the
   Establish Image Pair bit is set in PRLI Word 0.  If it is,
   then that is an additional reason to create a change
   notification.

  sys/dev/isp_freebsd.c:
   In isp_async(), if the device changed or stayed, look at
   PRLI Word 0 to see if the Establish Image Pair bit is set.
   If it is, reset the CRN if we haven't already.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
Differential Revision: https://reviews.freebsd.org/D19472

5 years agoMFC r347569:
Mark Johnston [Fri, 17 May 2019 14:09:33 +0000 (14:09 +0000)]
MFC r347569:
Remove redundant -Wl uses from the kernel's LDFLAGS.

5 years agoMFC r347564:
Mark Johnston [Fri, 17 May 2019 14:08:58 +0000 (14:08 +0000)]
MFC r347564:
Fix formatting.

5 years agoMFC r347382:
Michael Tuexen [Fri, 17 May 2019 08:25:31 +0000 (08:25 +0000)]
MFC r347382:

Receiver side DSACK implemenation.
This adds initial support for RFC 2883.
This was submitted by Richard Scheffeneffer.

MFC r347407:

Don't use C++ style comments.
Thanks to ngie@ for reporting the issue.

5 years agoMFC r347381:
Michael Tuexen [Fri, 17 May 2019 08:21:27 +0000 (08:21 +0000)]
MFC r347381:

Prevent cwnd to collapse down to 1 MSS after exiting recovery.

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

5 years agoMFC r347233:
Michael Tuexen [Fri, 17 May 2019 08:19:43 +0000 (08:19 +0000)]
MFC r347233:

Remove non-functional SCTP checksum offload support for virtio.

Checksum offloading for SCTP is not currently specified for virtio.
If the hypervisor announces checksum offloading support, it means TCP
and UDP checksum offload. If an SCTP packet is sent and the host announced
checksum offload support, the hypervisor inserts the IP checksum (16-bit)
at the correct offset, but this is not the right checksum, which is a CRC32c.
This results in all outgoing packets having the wrong checksum and therefore
breaking SCTP based communications.

This patch removes SCTP checksum offloading support from the virtio
network interface.

Thanks to Felix Weinrank for making me aware of the issue.

5 years agoMFC 344761:
Kenneth D. Merry [Thu, 16 May 2019 18:50:18 +0000 (18:50 +0000)]
MFC 344761:
  ------------------------------------------------------------------------
  r344761 | ken | 2019-03-04 09:30:37 -0500 (Mon, 04 Mar 2019) | 18 lines

  Add IBM TS1160 density codes to libmt and the mt(1) man page.

  These are taken directly from the density report from a TS1160
  tape drive.  (Using mt getdensity)

  A TS1160 drive stores 20TB raw (60TB with compression) on a JE tape.

  lib/libmt/mtlib.c:
   Add 3592A6 encrypted/unencrypted density codes, and bpmm/bpi
   values.

  usr.bin/mt/mt.1:
   Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
   values and number of tracks.  Bump the man page date.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

5 years agoMFC r347365, r347703
Brooks Davis [Thu, 16 May 2019 18:00:17 +0000 (18:00 +0000)]
MFC r347365, r347703

r347365:
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

r347703:
FCP-101: ae(4) is sufficently popular to be moved to the keep list.

5 years agoMFC r347325:
Hans Petter Selasky [Thu, 16 May 2019 16:44:40 +0000 (16:44 +0000)]
MFC r347325:
Bump the Mellanox driver version numbers and the FreeBSD version number.

Sponsored by: Mellanox Technologies

5 years agoMFC r347324:
Hans Petter Selasky [Thu, 16 May 2019 16:43:16 +0000 (16:43 +0000)]
MFC r347324:
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.

Sponsored by: Mellanox Technologies

5 years agoMFC r347323:
Hans Petter Selasky [Thu, 16 May 2019 16:42:40 +0000 (16:42 +0000)]
MFC r347323:
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@
Sponsored by: Mellanox Technologies

5 years agoMFC r347322:
Hans Petter Selasky [Thu, 16 May 2019 16:41:54 +0000 (16:41 +0000)]
MFC r347322:
Ensure the flowtable rules are not freed twice in mlx5en(4).
This can happen when re-loading the driver.

Sponsored by: Mellanox Technologies

5 years agoMFC r347321:
Hans Petter Selasky [Thu, 16 May 2019 16:41:21 +0000 (16:41 +0000)]
MFC r347321:
Undo previous steps upon returning failure in mlx5en(4).

Else flowtable resources may not be properly freed.

Sponsored by: Mellanox Technologies

5 years agoMFC r347320:
Hans Petter Selasky [Thu, 16 May 2019 16:40:47 +0000 (16:40 +0000)]
MFC r347320:
Make sure the flow destination structure does not use values off the stack
in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r347319:
Hans Petter Selasky [Thu, 16 May 2019 16:40:12 +0000 (16:40 +0000)]
MFC r347319:
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.

Sponsored by: Mellanox Technologies

5 years agoMFC r347318:
Hans Petter Selasky [Thu, 16 May 2019 16:39:37 +0000 (16:39 +0000)]
MFC r347318:
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

Sponsored by: Mellanox Technologies

5 years agoMFC r347317:
Hans Petter Selasky [Thu, 16 May 2019 16:39:02 +0000 (16:39 +0000)]
MFC r347317:
Remove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r347316:
Hans Petter Selasky [Thu, 16 May 2019 16:38:19 +0000 (16:38 +0000)]
MFC r347316:
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)

Sponsored by: Mellanox Technologies

5 years agoMFC r347315:
Hans Petter Selasky [Thu, 16 May 2019 16:37:36 +0000 (16:37 +0000)]
MFC r347315:
Rename functions from mlx5_fwdump to mlx5_ctl in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347314:
Hans Petter Selasky [Thu, 16 May 2019 16:37:00 +0000 (16:37 +0000)]
MFC r347314:
Ensure that only one command is specified at a time in mlx5tool(8).

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347313:
Hans Petter Selasky [Thu, 16 May 2019 16:36:10 +0000 (16:36 +0000)]
MFC r347313:
Implement firmware reset from userspace in mlx5tool(8).

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347312:
Hans Petter Selasky [Thu, 16 May 2019 16:35:27 +0000 (16:35 +0000)]
MFC r347312:
Add Firmware Reset Level, MFRL, register accessors in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

5 years agoMFC r347311:
Hans Petter Selasky [Thu, 16 May 2019 16:34:48 +0000 (16:34 +0000)]
MFC r347311:
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@
Sponsored by: Mellanox Technologies

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