]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r347244:
Xin LI [Thu, 23 May 2019 05:49:43 +0000 (05:49 +0000)]
MFC r347244:

Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel.
This is a prerequisite of unifying kernel zlib instances.

Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>

5 years agoMFC r346652-r346654
Ian Lepore [Thu, 23 May 2019 02:12:00 +0000 (02:12 +0000)]
MFC r346652-r346654

r346652:
Complain and exit the script if the 'make install' phase fails.  Also,
there is no need to install any debug files.

r346653:
The zfs module has grown a dependency on zcl_nfs4.ko, so copy it into all
the test images.

r346654:
For the geli-gpt-zfs test images, both bios and uefi flavors, add a dummy
ufs partition as p2, and put the zfs partition at p3, to test the ability
of the zfs probe code to find a zfs pool on something other than the first
partition.

5 years agoMFC r346431,r347417,r348019:
Enji Cooper [Thu, 23 May 2019 01:25:34 +0000 (01:25 +0000)]
MFC r346431,r347417,r348019:

r346431 (by lwhsu):

Specify using Python2, these .py files have not been converted to use Python3
yet, but the default Python version in ports has been switched to 3.

r347417:

Refactor tests/sys/opencrypto/runtests

* Convert from plain to TAP for slightly improved introspection when skipping
  the tests due to requirements not being met.
* Test for the net/py-dpkt (origin) package being required when running the
  tests, instead of relying on a copy of the dpkt.py module from 2014. This
  enables the tests to work with py3. Subsequently, remove
  `tests/sys/opencrypto/dpkt.py(c)?` via `make delete-old`.
* Parameterize out `python2` as `$PYTHON`.

PR: 237403

r348019:

Allow the end-user to pass along arguments to cryptotest.py via `$CRYPTOTEST_ARGS`

This allows someone to use `-v` to dump out standard output.

5 years agoRegenerate src.conf(5) after r348138
Enji Cooper [Thu, 23 May 2019 01:13:12 +0000 (01:13 +0000)]
Regenerate src.conf(5) after r348138

5 years agoMFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346081,r346270...
Enji Cooper [Thu, 23 May 2019 01:09:10 +0000 (01:09 +0000)]
MFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346081,r346270,r346574,r346576:

r345203:

Initial googlemock/googletest integration into the build/FreeBSD test suite

This initial integration takes googlemock/googletest release 1.8.1, integrates
the library, tests, and sample unit tests into the build.

googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`.
`MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when
built with a C++11 capable toolchain.

Google tests can be specified via the `GTESTS` variable, which, in comparison
with the other test drivers, is more simplified/streamlined, as Googletest only
supports C++ tests; not raw C or shell tests (C tests can be written in C++
using the standard embedding methods).

No dependent libraries are assumed for the tests. One must specify `gmock`,
`gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program.

More information about googlemock and googletest can be found on the
Googletest [project page](https://github.com/google/googletest), and the
[GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md)
and
[GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs)
docs.

These tests are originally integrated into the build as plain driver tests, but
will be natively integrated into Kyua in a later version.

Known issues/Errata:
* [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172)

r345205:

Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite

This change integrates the unit tests for zfsd into the test suite using the
integration method described in r345203.

This change removes the `LOCALBASE` includes added for the port version of
googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS`
defines, which are included in the `GTEST_CXXFLAGS` variable, as part of
r345203.

r345353 (by asomers):

googletest: backport GTEST_SKIP to googletest 1.8.1

This commit backports revisions 00938b2b228f3b70d3d9e51f29a1505bdad43f1e and
59f90a338bce2376b540ee239cf4e269bf6d68ad from googletest's master branch to
our included version of googletest, which is based on 1.8.1. It adds the
GTEST_SKIP feature, which is very useful for a project like FreeBSD where
some tests depend on particular system configurations.

Obtained from: github.com/google/googletest

r345645:

Spam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS

This makes it easier for googletest users to leverage googletest, instead of
forcing them to plug GTEST_CXXFLAGS into CXXFLAGS manually (resulting in
unnecessary duplication).

I will be following this up with a more proper fix in src.libnames.mk, as
src.libnames.mk should be automatically adding this directory to
CFLAGS/CXXFLAGS when private libraries are referenced. Not doing so can result
in mismatches between base-provided private library's and ports-provided
library's headers.

While here, tweak the comment to clarify what the intent is behind spamming
CXXFLAGS.

r345708:

Standardize `-std=c++* as `CXXSTD`

CXXSTD was added as the C++ analogue to CSTD.

CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`,
otherwise for older versions of g++.

This change standardizes the CXXSTD variable, originally added to
googletest.test.inc.mk as part of r345203.

As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`.

Notes:

This value is not sanity checked in bsd.sys.mk, however, given the two
most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is
likely to work with both toolchains. This method will be refined in the future
to support more variants of C++, as not all versions of clang++ and g++ (for
instance) support C++14, C++17, etc.

Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD.
Example:

Before this commit:
```
CXXFLAGS+= -std=c++14
```

After this commit:
```
CXXSTD= c++14
```

Relnotes: yes
Tested with: make tinderbox

r345709:

Allow users to override CSTD/CXXSTD on a per-prog basis

The current logic for CSTD/CXXSTD requires homogenity as far as the
supported C/C++ standards, which is a sensible default. However, when
dealing with differing versions of C++, some code may compile with C++11, but
not C++17 (for instance). So in order to avoid having people convert over their
code to the new standard, give the users the ability to specify the standard on
a per-program basis.

This will allow a user to override the supporting standard for a set of
programs, mixing C++11 with C++14 (for instance).

Apprved by: emaste (mentor)

r345735:

Allow programs to set `NO_SHARED` on a per-PROG basis

This is particularly useful when installing programs for tests that need to be
linked statically, e.g., mini-me from capsicum-test, which is linked statically
to avoid the dynamic library lookup in the upstream project.

r345770:

Import proof-of-concept for handling `GTEST_SKIP()` in `Environment::SetUp`

Per the upstream pull-request [1]:

```
  gtest prior to this change would completely ignore `GTEST_SKIP()` if
  called in `Environment::SetUp()`, instead of bailing out early, unlike
  `Test::SetUp()`, which would cause the tests themselves to be skipped.
  The only way (prior to this change) to skip the tests would be to
  trigger a fatal error via `GTEST_FAIL()`.

  Desirable behavior, in this case, when dealing with
  `Environment::SetUp()` is to check for prerequisites on a system
  (example, kernel supports a particular featureset, e.g., capsicum), and
  skip the tests. The alternatives prior to this change would be
  undesirable:

  - Failing sends the wrong message to the test user, as the result of the
    tests is indeterminate, not failed.
  - Having to add per-test class abstractions that override `SetUp()` to
    test for the capsicum feature set, then skip all of the tests in their
    respective SetUp fixtures, would be a lot of human and computational
    work; checking for the feature would need to be done for all of the
    tests, instead of once for all of the tests.

  For those reasons, making `Environment::SetUp()` handle `GTEST_SKIP()`,
  by not executing the testcases, is the most desirable solution.

  In order to properly diagnose what happened when running the tests if
  they are skipped, print out the diagnostics in an ad hoc manner.

  Update the documentation to note this change and integrate a new test,
  gtest_skip_in_environment_setup_test, into the test suite.

  This change addresses #2189.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
```

The goal with my merging in this change is to avoid requiring extensive
refactoring/retesting of test suites when ensuring prerequisites are met,
e.g., checking for a CAPABILITIES-enabled kernel before running capsicum-test
(see D19758 for more details).

The proof-of-concept is being imported before accepted by the upstream
project due to the fact that the upstream project is undergoing a potential
development freeze and the maintainers aren't responding to my PR.

1. https://github.com/google/googletest/pull/2203

r346081 (by trasz):

Make zfsd(8) build obey CFLAGS.

Obtained from: CheriBSD

r346270 (by trasz):

Drop -g from CFLAGS for zfsd(8).  No idea why it was ever there.

r346574:

Rework CXXSTD setting via r345708

This change allows the user to once again override the C++ standard, restoring
high-level pre-r345708 behavior.

This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11
capable compiler, e.g., g++ 4.2.1, as the library supported being built with
older C++ standards.

r346576:

Fix up CXXSTD support originally added in r345708

r345708 worked for the base system, but unfortunately, caused a lot of
disruption for third-party packages that relied on C++, since bsd.sys.mk is
used by applications outside the base system. The defaults picked didn't match
the compiler's defaults and broke some builds that didn't specify a standard,
as well as some that overrode the value by setting `-std=gnu++14` (for
example) manually.

This change takes a more relaxed approach to appending `-std=${CXXSTD}` to
CXXFLAGS, by only doing so when the value is specified, as opposed to
overriding the standard set by an end-user. This avoids the need for having
to bake NOP default into bsd.sys.mk for supported compiler-toolchain
versions.

In order to make this change possible, add CXXSTD to Makefile snippets which
relied on the default value (c++11) added in r345708.

5 years agoRevert r348136
Enji Cooper [Thu, 23 May 2019 00:59:05 +0000 (00:59 +0000)]
Revert r348136

I accidentally committed some unrelated local changes to
`.../tests/sys/opencrypto` along with this MFC set.

5 years agoMFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346574,r346576:
Enji Cooper [Thu, 23 May 2019 00:55:28 +0000 (00:55 +0000)]
MFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346574,r346576:

r345203:

Initial googlemock/googletest integration into the build/FreeBSD test suite

This initial integration takes googlemock/googletest release 1.8.1, integrates
the library, tests, and sample unit tests into the build.

googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`.
`MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when
built with a C++11 capable toolchain.

Google tests can be specified via the `GTESTS` variable, which, in comparison
with the other test drivers, is more simplified/streamlined, as Googletest only
supports C++ tests; not raw C or shell tests (C tests can be written in C++
using the standard embedding methods).

No dependent libraries are assumed for the tests. One must specify `gmock`,
`gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program.

More information about googlemock and googletest can be found on the
Googletest [project page](https://github.com/google/googletest), and the
[GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md)
and
[GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs)
docs.

These tests are originally integrated into the build as plain driver tests, but
will be natively integrated into Kyua in a later version.

Known issues/Errata:
* [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172)

r345205:

Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite

This change integrates the unit tests for zfsd into the test suite using the
integration method described in r345203.

This change removes the `LOCALBASE` includes added for the port version of
googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS`
defines, which are included in the `GTEST_CXXFLAGS` variable, as part of
r345203.

r345353 (by asomers):

googletest: backport GTEST_SKIP to googletest 1.8.1

This commit backports revisions 00938b2b228f3b70d3d9e51f29a1505bdad43f1e and
59f90a338bce2376b540ee239cf4e269bf6d68ad from googletest's master branch to
our included version of googletest, which is based on 1.8.1. It adds the
GTEST_SKIP feature, which is very useful for a project like FreeBSD where
some tests depend on particular system configurations.

Obtained from: github.com/google/googletest

r345645:

Spam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS

This makes it easier for googletest users to leverage googletest, instead of
forcing them to plug GTEST_CXXFLAGS into CXXFLAGS manually (resulting in
unnecessary duplication).

I will be following this up with a more proper fix in src.libnames.mk, as
src.libnames.mk should be automatically adding this directory to
CFLAGS/CXXFLAGS when private libraries are referenced. Not doing so can result
in mismatches between base-provided private library's and ports-provided
library's headers.

While here, tweak the comment to clarify what the intent is behind spamming
CXXFLAGS.

r345708:

Standardize `-std=c++* as `CXXSTD`

CXXSTD was added as the C++ analogue to CSTD.

CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`,
otherwise for older versions of g++.

This change standardizes the CXXSTD variable, originally added to
googletest.test.inc.mk as part of r345203.

As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`.

Notes:

This value is not sanity checked in bsd.sys.mk, however, given the two
most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is
likely to work with both toolchains. This method will be refined in the future
to support more variants of C++, as not all versions of clang++ and g++ (for
instance) support C++14, C++17, etc.

Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD.
Example:

Before this commit:
```
CXXFLAGS+= -std=c++14
```

After this commit:
```
CXXSTD= c++14
```

Relnotes: yes
Tested with: make tinderbox

r345709:

Allow users to override CSTD/CXXSTD on a per-prog basis

The current logic for CSTD/CXXSTD requires homogenity as far as the
supported C/C++ standards, which is a sensible default. However, when
dealing with differing versions of C++, some code may compile with C++11, but
not C++17 (for instance). So in order to avoid having people convert over their
code to the new standard, give the users the ability to specify the standard on
a per-program basis.

This will allow a user to override the supporting standard for a set of
programs, mixing C++11 with C++14 (for instance).

Approved by: emaste (mentor)

r345735:

Allow programs to set `NO_SHARED` on a per-PROG basis

This is particularly useful when installing programs for tests that need to be
linked statically, e.g., mini-me from capsicum-test, which is linked statically
to avoid the dynamic library lookup in the upstream project.

r345770:

Import proof-of-concept for handling `GTEST_SKIP()` in `Environment::SetUp`

Per the upstream pull-request [1]:

```
  gtest prior to this change would completely ignore `GTEST_SKIP()` if
  called in `Environment::SetUp()`, instead of bailing out early, unlike
  `Test::SetUp()`, which would cause the tests themselves to be skipped.
  The only way (prior to this change) to skip the tests would be to
  trigger a fatal error via `GTEST_FAIL()`.

  Desirable behavior, in this case, when dealing with
  `Environment::SetUp()` is to check for prerequisites on a system
  (example, kernel supports a particular featureset, e.g., capsicum), and
  skip the tests. The alternatives prior to this change would be
  undesirable:

  - Failing sends the wrong message to the test user, as the result of the
    tests is indeterminate, not failed.
  - Having to add per-test class abstractions that override `SetUp()` to
    test for the capsicum feature set, then skip all of the tests in their
    respective SetUp fixtures, would be a lot of human and computational
    work; checking for the feature would need to be done for all of the
    tests, instead of once for all of the tests.

  For those reasons, making `Environment::SetUp()` handle `GTEST_SKIP()`,
  by not executing the testcases, is the most desirable solution.

  In order to properly diagnose what happened when running the tests if
  they are skipped, print out the diagnostics in an ad hoc manner.

  Update the documentation to note this change and integrate a new test,
  gtest_skip_in_environment_setup_test, into the test suite.

  This change addresses #2189.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
```

The goal with my merging in this change is to avoid requiring extensive
refactoring/retesting of test suites when ensuring prerequisites are met,
e.g., checking for a CAPABILITIES-enabled kernel before running capsicum-test
(see D19758 for more details).

The proof-of-concept is being imported before accepted by the upstream
project due to the fact that the upstream project is undergoing a potential
development freeze and the maintainers aren't responding to my PR.

1. https://github.com/google/googletest/pull/2203

r346574:

Rework CXXSTD setting via r345708

This change allows the user to once again override the C++ standard, restoring
high-level pre-r345708 behavior.

This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11
capable compiler, e.g., g++ 4.2.1, as the library supported being built with
older C++ standards.

r346576:

Fix up CXXSTD support originally added in r345708

r345708 worked for the base system, but unfortunately, caused a lot of
disruption for third-party packages that relied on C++, since bsd.sys.mk is
used by applications outside the base system. The defaults picked didn't match
the compiler's defaults and broke some builds that didn't specify a standard,
as well as some that overrode the value by setting `-std=gnu++14` (for
example) manually.

This change takes a more relaxed approach to appending `-std=${CXXSTD}` to
CXXFLAGS, by only doing so when the value is specified, as opposed to
overriding the standard set by an end-user. This avoids the need for having
to bake NOP default into bsd.sys.mk for supported compiler-toolchain
versions.

In order to make this change possible, add CXXSTD to Makefile snippets which
relied on the default value (c++11) added in r345708.

5 years agoload_key_buf do not free data from dearmor
Simon J. Gerraty [Wed, 22 May 2019 23:23:16 +0000 (23:23 +0000)]
load_key_buf do not free data from dearmor

The data returned by dearmor is referenced by the key
leave it alone!

MFC r347980

Reviewed by: stevek

5 years agolibsecureboot: allow control of when pseudo pcr is updated
Simon J. Gerraty [Wed, 22 May 2019 23:19:20 +0000 (23:19 +0000)]
libsecureboot: allow control of when pseudo pcr is updated

During boot we only want to measure things which *must*
be verified - this should provide more deterministic ordering.

MFC r347981

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

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