]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
6 years agousb: host: xhci-rcar: add support for r8a77965
Yoshihiro Shimoda [Tue, 27 Feb 2018 08:15:20 +0000 (17:15 +0900)]
usb: host: xhci-rcar: add support for r8a77965

BugLink: http://bugs.launchpad.net/bugs/1756978
commit 015dbeb2282030bf56762e21d25f09422edfd750 upstream.

This patch adds support for r8a77965 (R-Car M3-N).

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoASoC: rt5651: Fix regcache sync errors on resume
Hans de Goede [Sun, 18 Feb 2018 22:01:44 +0000 (23:01 +0100)]
ASoC: rt5651: Fix regcache sync errors on resume

BugLink: http://bugs.launchpad.net/bugs/1756978
commit 2d30e9494f1ea320aaaad0cff9ddd92c87eac355 upstream.

The ALC5651 does not like multi-write accesses, avoid them. This fixes:

rt5651 i2c-10EC5651:00: Unable to sync registers 0x27-0x28. -121

Errors on resume (and all registers after the registers in the error not
being synced).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoASoC: wm_adsp: For TLV controls only register TLV get/set
Richard Fitzgerald [Wed, 28 Feb 2018 10:31:10 +0000 (10:31 +0000)]
ASoC: wm_adsp: For TLV controls only register TLV get/set

BugLink: http://bugs.launchpad.net/bugs/1756978
commit d7789f5bcdb298c4a302db471b1b20f74a20de95 upstream.

Normal 512-byte get/set of a TLV isn't supported but we were
registering the normal get/set anyway and relying on omitting
the SNDRV_CTL_ELEM_ACCESS_[READ|WRITE] flags to prevent them
being called.

Trouble is if this gets broken in the core ALSA code - as it has
been since at least 4.14 - the standard get/set can be called
unexpectedly and corrupt memory.

There's no point providing functions that won't be called and
it's a trivial change. The benefit is that if the ALSA core gets
broken again we get a big fat immediate NULL dereference instead
of a memory corruption timebomb.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoASoC: sgtl5000: Fix suspend/resume
Fabio Estevam [Fri, 16 Feb 2018 13:58:54 +0000 (11:58 -0200)]
ASoC: sgtl5000: Fix suspend/resume

BugLink: http://bugs.launchpad.net/bugs/1756978
commit a8992973edbb2555e956b90f6fe97c4bc14d761d upstream.

Commit 8419caa72702 ("ASoC: sgtl5000: Do not disable regulators in
SND_SOC_BIAS_OFF") causes the sgtl5000 to fail after a suspend/resume
sequence:

Playing WAVE '/media/a2002011001-e02.wav' : Signed 16 bit Little
Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2051: write error: Input/output error

The problem is caused by the fact that the aforementioned commit
dropped the cache handling, so re-introduce the register map
resync to fix the problem.

Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoASoC: sun4i-i2s: Fix RX slot number of SUN8I
Yong Deng [Mon, 26 Feb 2018 02:43:52 +0000 (10:43 +0800)]
ASoC: sun4i-i2s: Fix RX slot number of SUN8I

BugLink: http://bugs.launchpad.net/bugs/1756978
commit 5a3386790a172cf738194e1574f631cd43c6140a upstream.

I2S's RX slot number of SUN8I should be shifted 4 bit to left.

Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
Signed-off-by: Yong Deng <yong.deng@magewell.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agox86: Treat R_X86_64_PLT32 as R_X86_64_PC32
H.J. Lu [Wed, 7 Feb 2018 22:20:09 +0000 (14:20 -0800)]
x86: Treat R_X86_64_PLT32 as R_X86_64_PC32

BugLink: http://bugs.launchpad.net/bugs/1756978
commit b21ebf2fb4cde1618915a97cc773e287ff49173e upstream.

On i386, there are 2 types of PLTs, PIC and non-PIC.  PIE and shared
objects must use PIC PLT.  To use PIC PLT, you need to load
_GLOBAL_OFFSET_TABLE_ into EBX first.  There is no need for that on
x86-64 since x86-64 uses PC-relative PLT.

On x86-64, for 32-bit PC-relative branches, we can generate PLT32
relocation, instead of PC32 relocation, which can also be used as
a marker for 32-bit PC-relative branches.  Linker can always reduce
PLT32 relocation to PC32 if function is defined locally.   Local
functions should use PC32 relocation.  As far as Linux kernel is
concerned, R_X86_64_PLT32 can be treated the same as R_X86_64_PC32
since Linux kernel doesn't use PLT.

R_X86_64_PLT32 for 32-bit PC-relative branches has been enabled in
binutils master branch which will become binutils 2.31.

[ hjl is working on having better documentation on this all, but a few
  more notes from him:

   "PLT32 relocation is used as marker for PC-relative branches. Because
    of EBX, it looks odd to generate PLT32 relocation on i386 when EBX
    doesn't have GOT.

    As for symbol resolution, PLT32 and PC32 relocations are almost
    interchangeable. But when linker sees PLT32 relocation against a
    protected symbol, it can resolved locally at link-time since it is
    used on a branch instruction. Linker can't do that for PC32
    relocation"

  but for the kernel use, the two are basically the same, and this
  commit gets things building and working with the current binutils
  master   - Linus ]

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoKVM: Expose new cpu features to guest
Yang Zhong [Wed, 22 Nov 2017 07:27:29 +0000 (15:27 +0800)]
KVM: Expose new cpu features to guest

BugLink: http://bugs.launchpad.net/bugs/1739665
Intel IceLake cpu has added new cpu features,AVX512_VBMI2/GFNI/
VAES/VPCLMULQDQ/AVX512_VNNI/AVX512_BITALG. Those new cpu features
need expose to guest VM.

The bit definition:
CPUID.(EAX=7,ECX=0):ECX[bit 06] AVX512_VBMI2
CPUID.(EAX=7,ECX=0):ECX[bit 08] GFNI
CPUID.(EAX=7,ECX=0):ECX[bit 09] VAES
CPUID.(EAX=7,ECX=0):ECX[bit 10] VPCLMULQDQ
CPUID.(EAX=7,ECX=0):ECX[bit 11] AVX512_VNNI
CPUID.(EAX=7,ECX=0):ECX[bit 12] AVX512_BITALG

The release document ref below link:
https://software.intel.com/sites/default/files/managed/c5/15/\
architecture-instruction-set-extensions-programming-reference.pdf

The kernel dependency commit in kvm.git:
(c128dbfa0f879f8ce7b79054037889b0b2240728)

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
(cherry picked from commit 80fef315a74d79d765dbf58d9481843a364c50d6)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoKVM: x86: add support for UMIP
Paolo Bonzini [Tue, 12 Jul 2016 08:36:41 +0000 (10:36 +0200)]
KVM: x86: add support for UMIP

BugLink: http://bugs.launchpad.net/bugs/1739665
Add the CPUID bits, make the CR4.UMIP bit not reserved anymore, and
add UMIP support for instructions that are already emulated by KVM.

Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit ae3e61e1c28338d077b704505570fa181df1e41f)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agolibnvdimm: re-enable deep flush for pmem devices via fsync()
Dave Jiang [Sat, 3 Mar 2018 03:31:40 +0000 (19:31 -0800)]
libnvdimm: re-enable deep flush for pmem devices via fsync()

BugLink: http://bugs.launchpad.net/bugs/1730829
Re-enable deep flush so that users always have a way to be sure that a
write makes it all the way out to media. Writes from the PMEM driver
always arrive at the NVDIMM since movnt is used to bypass the cache, and
the driver relies on the ADR (Asynchronous DRAM Refresh) mechanism to
flush write buffers on power failure. The Deep Flush mechanism is there
to explicitly write buffers to protect against (rare) ADR failure.  This
change prevents a regression in deep flush behavior so that applications
can continue to depend on fsync() as a mechanism to trigger deep flush
in the filesystem-DAX case.

Fixes: 06e8ccdab15f4 ("acpi: nfit: Add support for detect platform CPU cache...")
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit 5fdf8e5ba5666fe153bd61f851a40078a6347822)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agolibnvdimm: expose platform persistence attribute for nd_region
Dave Jiang [Wed, 31 Jan 2018 19:45:49 +0000 (12:45 -0700)]
libnvdimm: expose platform persistence attribute for nd_region

BugLink: http://bugs.launchpad.net/bugs/1730829
Providing a sysfs attribute for nd_region that shows the persistence
capabilities for the platform.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
(cherry picked from commit 96c3a239054a367d1a18581384985ab9e97c5ce7)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoacpi: nfit: add persistent memory control flag for nd_region
Dave Jiang [Wed, 31 Jan 2018 19:45:43 +0000 (12:45 -0700)]
acpi: nfit: add persistent memory control flag for nd_region

BugLink: http://bugs.launchpad.net/bugs/1730829
Propagate the ADR attribute flag from the NFIT platform capabilities
sub-table to nd_region.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
(cherry picked from commit 30e6d7bf29daa79d80711d35211c9b60894dbc44)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoacpi: nfit: Add support for detect platform CPU cache flush on power loss
Dave Jiang [Wed, 31 Jan 2018 19:45:38 +0000 (12:45 -0700)]
acpi: nfit: Add support for detect platform CPU cache flush on power loss

BugLink: http://bugs.launchpad.net/bugs/1730829
In ACPI 6.2a the platform capability structure has been added to the NFIT
tables. That provides software the ability to determine whether a system
supports the auto flushing of CPU caches on power loss. If the capability
is supported, we do not need to do dax_flush(). Plumbing the path to set the
property on per region from the NFIT tables.

This patch depends on the ACPI NFIT 6.2a platform capabilities support code
in include/acpi/actbl1.h.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
(cherry picked from commit 06e8ccdab15f46dfd31292e2b75d744bc5fc2a7c)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoACPICA: ACPI 6.0A: Changes to the NFIT ACPI table
Bob Moore [Fri, 17 Nov 2017 23:42:24 +0000 (15:42 -0800)]
ACPICA: ACPI 6.0A: Changes to the NFIT ACPI table

BugLink: http://bugs.launchpad.net/bugs/1730829
ACPICA commit a42a086b8d682ab8dfbc4666cf6b9c8a5ee23a77

Adds a new subtable.

Link: https://github.com/acpica/acpica/commit/a42a086b
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 5ed4e5ca51cad5ddae09f59a95626731d1546244)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoKVM: PPC: Book3S HV: Allow HPT and radix on the same core for POWER9 v2.2
Paul Mackerras [Mon, 19 Mar 2018 14:50:00 +0000 (10:50 -0400)]
KVM: PPC: Book3S HV: Allow HPT and radix on the same core for POWER9 v2.2

BugLink: http://bugs.launchpad.net/bugs/1756254
POWER9 chip versions starting with "Nimbus" v2.2 can support running
with some threads of a core in HPT mode and others in radix mode.
This means that we don't have to prohibit independent-threads mode
when running a HPT guest on a radix host, and we don't have to do any
of the synchronization between threads that was introduced in commit
c01015091a77 ("KVM: PPC: Book3S HV: Run HPT guests on POWER9 radix
hosts", 2017-10-19).

Rather than using up another CPU feature bit, we just do an
explicit test on the PVR (processor version register) at module
startup time to determine whether we have to take steps to avoid
having some threads in HPT mode and some in radix mode (so-called
"mixed mode").  We test for "Nimbus" (indicated by 0 or 1 in the top
nibble of the lower 16 bits) v2.2 or later, or "Cumulus" (indicated by
2 or 3 in that nibble) v1.1 or later.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
(cherry picked from commit 00608e1f007e4cf6031485c5630e0e504bceef9b)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoKVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing
Paul Mackerras [Fri, 2 Mar 2018 04:38:04 +0000 (15:38 +1100)]
KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing

BugLink: http://bugs.launchpad.net/bugs/1754206
The current code for initializing the VRMA (virtual real memory area)
for HPT guests requires the page size of the backing memory to be one
of 4kB, 64kB or 16MB.  With a radix host we have the possibility that
the backing memory page size can be 2MB or 1GB.  In these cases, if the
guest switches to HPT mode, KVM will not initialize the VRMA and the
guest will fail to run.

In fact it is not necessary that the VRMA page size is the same as the
backing memory page size; any VRMA page size less than or equal to the
backing memory page size is acceptable.  Therefore we now choose the
largest page size out of the set {4k, 64k, 16M} which is not larger
than the backing memory page size.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
(cherry picked from commit debd574f4195e205ba505b25e19b2b797f4bcd94)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoKVM: MMU: consider host cache mode in MMIO page check
Haozhong Zhang [Wed, 20 Dec 2017 07:29:29 +0000 (15:29 +0800)]
KVM: MMU: consider host cache mode in MMIO page check

BugLink: http://bugs.launchpad.net/bugs/1745899
Some reserved pages, such as those from NVDIMM DAX devices, are not
for MMIO, and can be mapped with cached memory type for better
performance. However, the above check misconceives those pages as
MMIO.  Because KVM maps MMIO pages with UC memory type, the
performance of guest accesses to those pages would be harmed.
Therefore, we check the host memory type in addition and only treat
UC/UC-/WC pages as MMIO.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reported-by: Cuevas Escareno, Ivan D <ivan.d.cuevas.escareno@intel.com>
Reported-by: Kumar, Karthik <karthik.kumar@intel.com>
Reviewed-by: Xiao Guangrong <xiaoguangrong@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
(cherry picked from commit aa2e063aea7961fb58eafecb924f8818e3d4ecfc)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agox86/mm: add a function to check if a pfn is UC/UC-/WC
Haozhong Zhang [Wed, 20 Dec 2017 07:29:28 +0000 (15:29 +0800)]
x86/mm: add a function to check if a pfn is UC/UC-/WC

BugLink: http://bugs.launchpad.net/bugs/1745899
Check whether the PAT memory type of a pfn cannot be overridden by
MTRR UC memory type, i.e. the PAT memory type is UC, UC- or WC. This
function will be used by KVM to distinguish MMIO pfns and give them
UC memory type in the EPT page tables (on Intel processors, EPT
memory types work like MTRRs).

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Xiao Guangrong <xiaoguangrong@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
(cherry picked from commit b8d7044bcff7a955257b242515bcf1e5045edd9b)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agonfp: fix TLV offset calculation
Edwin Peer [Fri, 2 Feb 2018 03:41:43 +0000 (19:41 -0800)]
nfp: fix TLV offset calculation

BugLink: http://bugs.launchpad.net/bugs/1752818
The data pointer in the config space TLV parser already includes
NFP_NET_CFG_TLV_BASE, it should not be added again. Incorrect
offset values were only used in printed user output, rendering
the bug merely cosmetic.

Fixes: 73a0329b057e ("nfp: add TLV capabilities to the BAR")
Signed-off-by: Edwin Peer <edwin.peer@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1d8ef0c07664dc48f2ff19a90b62dd3f6f425547)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agonfp: read ME frequency from vNIC ctrl memory
Jakub Kicinski [Thu, 18 Jan 2018 02:51:02 +0000 (18:51 -0800)]
nfp: read ME frequency from vNIC ctrl memory

BugLink: http://bugs.launchpad.net/bugs/1752818
PCIe island clock frequency is used when converting coalescing
parameters from usecs to NFP timestamps.  Most chips don't run
at 1200MHz, allow FW to provide us with the real frequency.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ce991ab6662a1d11923ba17d482a77686f2a4b74)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agonfp: add TLV capabilities to the BAR
Jakub Kicinski [Thu, 18 Jan 2018 02:51:01 +0000 (18:51 -0800)]
nfp: add TLV capabilities to the BAR

BugLink: http://bugs.launchpad.net/bugs/1752818
NFP is entirely programmable, including the PCI data interface.
Using a fixed control BAR layout certainly makes implementations
easier, but require careful considerations when space is allocated.
Once BAR area is allocated to one feature nothing else can use it.
Allocating space statically also requires it to be sized upfront,
which leads to either unnecessary limitation or wastage.

We currently have a 32bit capability word defined which tells drivers
which application FW features are supported.   Most of the bits
are exhausted.  The same bits are also reused for enabling specific
features.  Bulk of capabilities don't have a need for an enable bit,
however, leading to confusion and wastage.

TLVs seems like a better fit for expressing capabilities of applications
running on programmable hardware.

This patch leaves the front of the BAR as is, and declares a TLV
capability start at offset 0x58.  Most of the space up to 0x0d90
is already allocated, but the used space can be wrapped with RESERVED
TLVs.  E.g.:

Address    Type         Length
 0x0058    RESERVED      0xe00  /* Wrap basic structures */
 0x0e5c    FEATURE_A     0x004
 0x0e64    FEATURE_B     0x004
 0x0e6c    RESERVED      0x990  /* Wrap qeueue stats */
 0x1800    FEATURE_C     0x100

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(backported from commit 73a0329b057e9a7ac3e6eead208e7de056d13c9a)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: Start new release
Thadeu Lima de Souza Cascardo [Mon, 19 Mar 2018 12:04:18 +0000 (09:04 -0300)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: Ubuntu-4.15.0-13.14 Ubuntu-4.15.0-13.14
Thadeu Lima de Souza Cascardo [Fri, 16 Mar 2018 18:49:01 +0000 (15:49 -0300)]
UBUNTU: Ubuntu-4.15.0-13.14

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: SAUCE: selftests: add devpts selftests
Christian Brauner [Tue, 13 Mar 2018 16:55:27 +0000 (17:55 +0100)]
UBUNTU: SAUCE: selftests: add devpts selftests

BugLink: http://bugs.launchpad.net/bugs/1755857
This adds tests to check:
- bind-mounts from /dev/pts/ptmx to /dev/ptmx work
- non-standard mounts of devpts work
- bind-mounts of /dev/pts/ptmx to locations that do not resolve to a valid
  slave pty path under the originating devpts mount fail

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: SAUCE: devpts: comment devpts_mntget()
Christian Brauner [Tue, 13 Mar 2018 16:55:26 +0000 (17:55 +0100)]
UBUNTU: SAUCE: devpts: comment devpts_mntget()

BugLink: http://bugs.launchpad.net/bugs/1755857
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: SAUCE: devpts: resolve devpts bind-mounts
Christian Brauner [Tue, 13 Mar 2018 16:55:25 +0000 (17:55 +0100)]
UBUNTU: SAUCE: devpts: resolve devpts bind-mounts

BugLink: http://bugs.launchpad.net/bugs/1755857
Most libcs will still look at /dev/ptmx when opening the master fd of a pty
device. When /dev/ptmx is a bind-mount of /dev/pts/ptmx and the TIOCGPTPEER
ioctl() is used to safely retrieve a file descriptor for the slave side of
the pty based on the master fd, the /proc/self/fd/{0,1,2} symlinks will
point to /. A very simply reproducer for this issue presupposing a libc
that uses TIOCGPTPEER in its openpty() implementation is:

unshare --mount
mount --bind /dev/pts/ptmx /dev/ptmx
chmod 666 /dev/ptmx
script
ls -al /proc/self/fd/0

Having bind-mounts of /dev/pts/ptmx to /dev/ptmx not working correctly is a
regression. In addition, it is also a fairly common scenario in containers
employing user namespaces.

The reason for the current failure is that the kernel tries to verify the
useability of the devpts filesystem without resolving the /dev/ptmx
bind-mount first. This will lead it to detect that the dentry is escaping
its bind-mount. The reason is that while the devpts filesystem mounted at
/dev/pts has the devtmpfs mounted at /dev as its parent mount:

21 -- -- / /dev
-- 21 -- / /dev/pts

devtmpfs and devpts are on different devices

-- -- 0:6  / /dev
-- -- 0:20 / /dev/pts

This has the consequence that the pathname of the parent directory of the
devpts filesystem mount at /dev/pts is /. So if /dev/ptmx is a bind-mount
of /dev/pts/ptmx then the /dev/ptmx bind-mount and the devpts mount at
/dev/pts will end up being located on the same device which is recorded in
the superblock of their vfsmount. This means the parent directory of the
/dev/ptmx bind-mount will be /ptmx:

-- -- ---- /ptmx /dev/ptmx

Without the bind-mount resolution patch the kernel will now perform the
bind-mount escape check directly on /dev/ptmx. The function responsible for
this is devpts_ptmx_path() which calls pts_path() which in turn calls
path_parent_directory(). Based on the above explanation,
path_parent_directory() will yield / as the parent directory for the
/dev/ptmx bind-mount and not the expected /dev. Thus, the kernel detects
that /dev/ptmx is escaping its bind-mount and will set /proc/<pid>/fd/<nr>
to /.

This patch changes the logic to first resolve any bind-mounts. After the
bind-mounts have been resolved (i.e. we have traced it back to the
associated devpts mount) devpts_ptmx_path() can be called. In order to
guarantee correct path generation for the slave file descriptor the kernel
now requires that a pts directory is found in the parent directory of the
ptmx bind-mount. This implies that when doing bind-mounts the ptmx
bind-mount and the devpts mount should have a common parent directory. A
valid example is:

mount -t devpts devpts /dev/pts
mount --bind /dev/pts/ptmx /dev/ptmx

an invalid example is:

mount -t devpts devpts /dev/pts
mount --bind /dev/pts/ptmx /ptmx

This allows us to support:
- calling open on ptmx devices located inside non-standard devpts mounts:
  mount -t devpts devpts /mnt
  master = open("/mnt/ptmx", ...);
  slave = ioctl(master, TIOCGPTPEER, ...);
- calling open on ptmx devices located outside the devpts mount with a
  common ancestor directory:
  mount -t devpts devpts /dev/pts
  mount --bind /dev/pts/ptmx /dev/ptmx
  master = open("/dev/ptmx", ...);
  slave = ioctl(master, TIOCGPTPEER, ...);

while failing on ptmx devices located outside the devpts mount without a
common ancestor directory:
  mount -t devpts devpts /dev/pts
  mount --bind /dev/pts/ptmx /ptmx
  master = open("/ptmx", ...);
  slave = ioctl(master, TIOCGPTPEER, ...);

in which case save path generation cannot be guaranteed.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Eric Biederman <ebiederm@xmission.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: SAUCE: devpts: hoist out check for DEVPTS_SUPER_MAGIC
Christian Brauner [Tue, 13 Mar 2018 16:55:24 +0000 (17:55 +0100)]
UBUNTU: SAUCE: devpts: hoist out check for DEVPTS_SUPER_MAGIC

BugLink: http://bugs.launchpad.net/bugs/1755857
Hoist the check whether we have already found a suitable devpts filesystem
out of devpts_ptmx_path() in preparation for the devpts bind-mount
resolution patch. This is a non-functional change.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: d-i: add hisi_sas_v3_hw to scsi-modules
Manoj Iyer [Thu, 15 Mar 2018 14:48:13 +0000 (09:48 -0500)]
UBUNTU: d-i: add hisi_sas_v3_hw to scsi-modules

Add hisi_sas_v3_hw to scsi-modules so that d-i can detect the drive
during install.

BugLink: https://launchpad.net/bugs/1756103
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: [Config]: enable CONFIG_HNS3_HCLGEVF as module.
Manoj Iyer [Wed, 14 Mar 2018 18:44:47 +0000 (13:44 -0500)]
UBUNTU: [Config]: enable CONFIG_HNS3_HCLGEVF as module.

BugLink: http://bugs.launchpad.net/bugs/1756097
enable HNS3 VF drivers network acceleration engine and hardware
compatibility layer for Hisilicon hip08 SoCs.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add int_gl_idx setup for VF
Fuyun Liang [Fri, 26 Jan 2018 11:31:25 +0000 (19:31 +0800)]
net: hns3: add int_gl_idx setup for VF

BugLink: http://bugs.launchpad.net/bugs/1756097
Just like PF, if the int_gl_idx of VF does not be set, the default
interrupt coalesce index of VF is 0. But it should be GL1 for TX
queues and GL0 for RX queues.

This patch adds the int_gl_idx setup for VF.

Fixes: 200ecda42598 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 79eee41085414c25c788cd98b78e8776551d837f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add get/set_coalesce support to VF
Fuyun Liang [Fri, 26 Jan 2018 11:31:24 +0000 (19:31 +0800)]
net: hns3: add get/set_coalesce support to VF

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds ethtool_ops.get/set_coalesce support to VF.

Since PF and VF share the same get/set_coalesce interface,
we only need to set hns3_get/set_coalesce to the ethtool_ops
when supporting get/set_coalesce for VF.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ad31c7320140fc2fad259d81c3340901b6225f03)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: converting spaces into tabs to avoid checkpatch.pl warning
Salil Mehta [Fri, 19 Jan 2018 15:20:53 +0000 (15:20 +0000)]
net: hns3: converting spaces into tabs to avoid checkpatch.pl warning

BugLink: http://bugs.launchpad.net/bugs/1756097
Spaces were mistakenly used instead of tabs in some of the code related
to reset functionality, which caused checkpatch.pl errors. These were
missed earlier so fixing them now.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e158624155f194da6fcaea67639f91c2a467bddf)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add net status led support for fiber port
Jian Shen [Fri, 19 Jan 2018 06:41:12 +0000 (14:41 +0800)]
net: hns3: add net status led support for fiber port

BugLink: http://bugs.launchpad.net/bugs/1756097
Check the net status per second, include port speed, total rx/tx packets
and link status. Updating the led status for fiber port.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 716aaac1f3f3ee141f550d2d6d7934eab42c1c29)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add ethtool -p support for fiber port
Jian Shen [Fri, 19 Jan 2018 06:41:11 +0000 (14:41 +0800)]
net: hns3: add ethtool -p support for fiber port

BugLink: http://bugs.launchpad.net/bugs/1756097
Add led location support for fiber port. The led will keep blinking
when locating.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 07f8e94011d7d14d4633f076bae6e341fea5076e)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add manager table initialization for hardware
Fuyun Liang [Fri, 19 Jan 2018 06:41:10 +0000 (14:41 +0800)]
net: hns3: add manager table initialization for hardware

BugLink: http://bugs.launchpad.net/bugs/1756097
The manager table is empty by default. If it is not initialized, the
management pkgs like LLDP will be dropped by hardware. Default entries
need to be added to manager table.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f5aac71c032719ef9159dae10bc83192bddd2424)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add support for get_regs
Fuyun Liang [Fri, 19 Jan 2018 06:41:09 +0000 (14:41 +0800)]
net: hns3: add support for get_regs

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds get_regs support for ethtool cmd.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 77b34110112a48286bf83526ebb14cfbd326bef2)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns: Fix for variable may be used uninitialized warnings
Huazhong Tan [Thu, 18 Jan 2018 02:37:34 +0000 (10:37 +0800)]
net: hns: Fix for variable may be used uninitialized warnings

BugLink: http://bugs.launchpad.net/bugs/1756097
When !CONFIG_REGMAP hns throws compiler warnings since
dsaf_read_syscon ignores the return result from regmap_read,
which allows val to be uninitialized.

Fixes: 86897c960b49 ("net: hns: add syscon operation for dsaf")
Reported-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5e89cfac2e1e74df075047ca5162a4df1aa11f63)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: check for NULL function pointer in hns3_nic_set_features
Jian Shen [Fri, 12 Jan 2018 08:23:17 +0000 (16:23 +0800)]
net: hns3: check for NULL function pointer in hns3_nic_set_features

BugLink: http://bugs.launchpad.net/bugs/1756097
It's necessary to check hook whether being defined before
calling, improve the reliability.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bd368416c3c432acd5b525f3e6b038bef5ee9e40)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add feature check when feature changed
Jian Shen [Fri, 12 Jan 2018 08:23:16 +0000 (16:23 +0800)]
net: hns3: add feature check when feature changed

BugLink: http://bugs.launchpad.net/bugs/1756097
Local variable "changed" was defined to indicates features changed,
but was used only for feature NETIF_F_HW_VLAN_CTAG_RX. Add checking
for other features.

Fixes: 052ece6dc19c ("net: hns3: add ethtool related offload command")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 181d454b7220c0bfe8af6e21d5d5c80188635d08)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add int_gl_idx setup for TX and RX queues
Fuyun Liang [Fri, 12 Jan 2018 08:23:15 +0000 (16:23 +0800)]
net: hns3: add int_gl_idx setup for TX and RX queues

BugLink: http://bugs.launchpad.net/bugs/1756097
If the int_gl_idx does not be set, the default interrupt coalesce index
is 0. The TX queues and the RX queues will both use the GL0 as the
interrupt coalesce GL switch. But it should be GL1 for TX queues and GL0
for RX queues.

This patch adds the int_gl_idx setup for TX queues and RX queues.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 11af96a47beda880e07b6f2f68efaae60794ae78)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: change the unit of GL value macro
Fuyun Liang [Fri, 12 Jan 2018 08:23:14 +0000 (16:23 +0800)]
net: hns3: change the unit of GL value macro

BugLink: http://bugs.launchpad.net/bugs/1756097
Previously, driver used 2us as the GL unit. The time unit ethtool
command "-c" and "-C" use is 1us, so now the GL unit driver uses
actually is 1us.

This patch changes the unit of GL value macro from
2us to 1us.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b81c59e1f70914b6958fd342608dbc5aa6b487e4)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: remove unused GL setup function
Fuyun Liang [Fri, 12 Jan 2018 08:23:13 +0000 (16:23 +0800)]
net: hns3: remove unused GL setup function

BugLink: http://bugs.launchpad.net/bugs/1756097
Since the TX GL and the RX GL need to be set separately,
hns3_set_vector_coalesc_gl() has been replaced with
hns3_set_vector_coalesce_rx_gl() and hns3_set_vector_coalesce_tx_gl().

This patch removes hns3_set_vector_coalesc_gl().

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0c8b769b7c7790d5cd0bbb2986cf438fb3f6a0df)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: refactor GL update function
Fuyun Liang [Fri, 12 Jan 2018 08:23:12 +0000 (16:23 +0800)]
net: hns3: refactor GL update function

BugLink: http://bugs.launchpad.net/bugs/1756097
The GL update function uses the max GL value between tx_int_gl and
rx_int_gl to set both new tx_int_gl and new rx_int_gl. Therefore, User
can not enable TX GL self-adaptive or RX GL self-adaptive individually.

This patch refactors the code to update the TX GL and the RX GL
separately, making user can enable TX GL self-adaptive or RX GL
self-adaptive individually.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8b1ff1ea2ccb09907d1af268e6450c061f477112)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: refactor interrupt coalescing init function
Fuyun Liang [Fri, 12 Jan 2018 08:23:11 +0000 (16:23 +0800)]
net: hns3: refactor interrupt coalescing init function

BugLink: http://bugs.launchpad.net/bugs/1756097
In the hardware, the coalesce configurable registers include GL0, GL1,
GL2. In the driver, the TX queues use the register GL1 and the RX queues
use the register GL0. This function initializes the configuration of the
interrupt coalescing, but does not distinguish between the TX direction
and the RX direction. It will cause some confusion.

This patch refactors the function to initialize the TX GL and the RX GL
separately. And the initialization of related variables also is added to
this patch.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5fd4789a98f8661a0e8db3daf21b774213c99487)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add ethtool_ops.set_coalesce support to PF
Fuyun Liang [Fri, 12 Jan 2018 08:23:10 +0000 (16:23 +0800)]
net: hns3: add ethtool_ops.set_coalesce support to PF

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds ethtool_ops.set_coalesce support to PF.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 434776a5fae2633ab524eb7dceb4d105c40852bb)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add ethtool_ops.get_coalesce support to PF
Fuyun Liang [Fri, 12 Jan 2018 08:23:09 +0000 (16:23 +0800)]
net: hns3: add ethtool_ops.get_coalesce support to PF

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds ethtool_ops.get_coalesce support to PF.

Whilst our hardware supports per queue values, external interfaces
support only a single shared value. As such we use the values for
queue 0.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7e96adc46633b7283b20dc58bc9ab3693cea0df4)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: remove TSO config command from VF driver
Peng Li [Fri, 12 Jan 2018 08:23:08 +0000 (16:23 +0800)]
net: hns3: remove TSO config command from VF driver

BugLink: http://bugs.launchpad.net/bugs/1756097
Only main PF can config TSO MSS length according to hardware.
This patch removes TSO config command from VF driver.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 27cdfed04f20da0909be57c1f4b98e35f82b7492)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add ethtool_ops.get_channels support for VF
Peng Li [Fri, 12 Jan 2018 08:23:07 +0000 (16:23 +0800)]
net: hns3: add ethtool_ops.get_channels support for VF

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch supports the ethtool's get_channels() for VF.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 849e460776898e465e2d3e27a34399fb1adc0061)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: report the function type the same line with hns3_nic_get_stats64
Peng Li [Tue, 9 Jan 2018 06:50:59 +0000 (14:50 +0800)]
net: hns3: report the function type the same line with hns3_nic_get_stats64

BugLink: http://bugs.launchpad.net/bugs/1756097
The function type should be on the same line with the function
name, or it may cause display error if a patch edit the
function. There is am example following:
https://www.spinics.net/lists/netdev/msg476141.html

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6c88d9d7eee0f1a5ac982bebca54a3a322876fb3)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRevert "net: hns3: Add packet statistics of netdev"
Peng Li [Tue, 9 Jan 2018 06:50:58 +0000 (14:50 +0800)]
Revert "net: hns3: Add packet statistics of netdev"

BugLink: http://bugs.launchpad.net/bugs/1756097
This reverts commit 8491000754796c838a0081c267f9dd54ad2ccba3.

It is duplicate to add statistics of netdev for ethtool -S.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bf909456f6a89654cb65c01fe83a4f9b133bf978)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add more packet size statisctics
Jian Shen [Fri, 5 Jan 2018 10:18:24 +0000 (18:18 +0800)]
net: hns3: Add more packet size statisctics

BugLink: http://bugs.launchpad.net/bugs/1756097
The statistics of rx/tx packets size greater than 1518
are not detailed. This patch adds more statistics for
different packet size range.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 91f384f67e0c84e8a41a93176992732128cd0bf4)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: remove redundant semicolon
Peng Li [Fri, 5 Jan 2018 10:18:23 +0000 (18:18 +0800)]
net: hns3: remove redundant semicolon

BugLink: http://bugs.launchpad.net/bugs/1756097
There is a redundant semicolon, this patch removes it.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2e1ea493cc79dfb640a34398b9ea12c019e4a8cd)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: fix for not setting pause parameters
Fuyun Liang [Fri, 5 Jan 2018 10:18:22 +0000 (18:18 +0800)]
net: hns3: fix for not setting pause parameters

BugLink: http://bugs.launchpad.net/bugs/1756097
Pause parameters include source address, transmit gap and pause time.
The default value of the pause source address is zero in the hardware.
Default pause parameters need to be set to the hardware. Also, when
setting new mac address, the pause source address need to be updated.

Fixes: 9dc2145d910e ("net: hns3: Add support for PFC setting in TM module")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 18838d0cc02612c760547455ae3f5dc812400288)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add MTU initialization for hardware
Fuyun Liang [Fri, 5 Jan 2018 10:18:21 +0000 (18:18 +0800)]
net: hns3: add MTU initialization for hardware

BugLink: http://bugs.launchpad.net/bugs/1756097
When initializing the MAC, the MTU vlaue need to be set to the hardware
too. Otherwise, the MTU value of software will be different from the MTU
value of hardware.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f9fd82a9f1e4e228baa8f484f0dbc6e3b26c3b29)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: fix for changing MTU
Fuyun Liang [Fri, 5 Jan 2018 10:18:20 +0000 (18:18 +0800)]
net: hns3: fix for changing MTU

BugLink: http://bugs.launchpad.net/bugs/1756097
when changing MTU, The new MTU must need to be set to netdevice.

Fixes: a8e8b7ff3517 ("net: hns3: Add support to change MTU in HNS3 hardware")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5bad95a1e55f4d5bb41e130db859d57eaf1b1549)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: fix for setting MTU
Fuyun Liang [Fri, 5 Jan 2018 10:18:19 +0000 (18:18 +0800)]
net: hns3: fix for setting MTU

BugLink: http://bugs.launchpad.net/bugs/1756097
When setting MTU, actually what we do is configuring the max frame size
for the hardware. ETH_HLEN、ETH_FCS_LEN and VLAN_HLEN must need to be
considered. And the frame size which is less than the default value
should not be set to the hardware. Because in the hardware, the the max
frame size not only controls the RX packet size, but also controls the
TX packet size. the RX packets whose size are greater than the setting
value will be dropped.

This patch fixes the bug setting a error max frame size to hardware.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2866ccb2b8f8df48c73f2fcc76454cac6c7cc557)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: fix for updating fc_mode_last_time
Fuyun Liang [Fri, 5 Jan 2018 10:18:18 +0000 (18:18 +0800)]
net: hns3: fix for updating fc_mode_last_time

BugLink: http://bugs.launchpad.net/bugs/1756097
commit a9c782822166 ("net: hns3: add support for set_pauseparam")
adds set_pauseparam support for ethtool cmd, but forgets to update
fc_mode_last_time when PFC mode is disabled in hclge_cfg_pauseparam().
The wrong fc_mode_last_time will be used to update flow control mode
when lldpad has been running. As a result, when using the ethtool
command "-a", user will get a wrong pause parameter.

This patch adds the fc_mode_last_time update when PFC mode is disabled.

Fixes: a9c782822166 ("net: hns3: add support for set_pauseparam")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 40173a2ec70c6386f5b342dfd612c26453a3f6b4)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Fix a response data read error of tqp statistics query
Jian Shen [Fri, 5 Jan 2018 10:18:17 +0000 (18:18 +0800)]
net: hns3: Fix a response data read error of tqp statistics query

BugLink: http://bugs.launchpad.net/bugs/1756097
The result of tqp statistics query was read with an
error position, fix it according to the user manual.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cf72fa63162c9adbc690d0145daa8b1dce9eaf6f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add packet statistics of netdev
Jian Shen [Fri, 5 Jan 2018 10:18:16 +0000 (18:18 +0800)]
net: hns3: Add packet statistics of netdev

BugLink: http://bugs.launchpad.net/bugs/1756097
Add packet statistics of netdev for ethtool -S, in
order to show the statistics data for current net
device.

Remove update_stats() calling because it has been
completed in hns3_get_netdev_stats().

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8491000754796c838a0081c267f9dd54ad2ccba3)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Remove a useless member of struct hns3_stats
Jian Shen [Fri, 5 Jan 2018 10:18:15 +0000 (18:18 +0800)]
net: hns3: Remove a useless member of struct hns3_stats

BugLink: http://bugs.launchpad.net/bugs/1756097
The member "stats_size" of struct hns3_stats is useless,
remove it and fix the macro definition which has uses this
struct.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b59f558c6a7ce8731035621f0b175b24ba443da1)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Fix an error macro definition of HNS3_TQP_STAT
Jian Shen [Fri, 5 Jan 2018 10:18:14 +0000 (18:18 +0800)]
net: hns3: Fix an error macro definition of HNS3_TQP_STAT

BugLink: http://bugs.launchpad.net/bugs/1756097
The member "stats_offset" was designed to indicate the offset
of each member of struct ring_stats in struct hns3_enet_ring,
but forgot to add the offset of the member in struct ring_stats.

Fixes: 496d03e960a ("net: hns3: Add Ethtool support to HNS3 driver")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 57ffee737b36dbb81e8e60a37e01791553157a5e)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Fix a loop index error of tqp statistics query
Jian Shen [Fri, 5 Jan 2018 10:18:13 +0000 (18:18 +0800)]
net: hns3: Fix a loop index error of tqp statistics query

BugLink: http://bugs.launchpad.net/bugs/1756097
An error loop index was used while querying statistics data
of tqps, which may cause call trace.

Fixes: 496d03e960ae ("net: hns3: Add Ethtool support to HNS3 driver")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 94bfaafac9d2a3c0bcca00d01e38f7597b741799)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Fix an error of total drop packet statistics
Jian Shen [Fri, 5 Jan 2018 10:18:12 +0000 (18:18 +0800)]
net: hns3: Fix an error of total drop packet statistics

BugLink: http://bugs.launchpad.net/bugs/1756097
The dropped tx/rx packets number of each tqp should also
be counted into the total drop tx/rx packets numbers.

Fixes: 76ad4f0ee74 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d2a5dca8404871be683c6bbc175ebf9c56dd2865)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Mask the packet statistics query when NIC is down
Jian Shen [Fri, 5 Jan 2018 10:18:11 +0000 (18:18 +0800)]
net: hns3: Mask the packet statistics query when NIC is down

BugLink: http://bugs.launchpad.net/bugs/1756097
Update the HNS3_NIC_STATE_DOWN bit when NIC state changes.
When NIC is down, mask the packet statistics for querying
with ifconfig command. It's a common practice.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b875cc379de4cb4bcc7e189998667286baf916b8)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Modify the update period of packet statistics
Jian Shen [Fri, 5 Jan 2018 10:18:10 +0000 (18:18 +0800)]
net: hns3: Modify the update period of packet statistics

BugLink: http://bugs.launchpad.net/bugs/1756097
It takes more than 200 query response messages between
driver and IMP, while updating the packet statistics.
It's too heavy for IMP to update it per second.

Extend the update period of packet statistics data from
1 second to 300 seconds(if too long, the statistics may
overflow).

As a result, we need to update it while querying with
ifconfig tool to keep the statistics data fresh.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c5f654805c9b145f035e06551c5c3dcf3d8db652)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Remove repeat statistic of rx_errors
Jian Shen [Fri, 5 Jan 2018 10:18:09 +0000 (18:18 +0800)]
net: hns3: Remove repeat statistic of rx_errors

BugLink: http://bugs.launchpad.net/bugs/1756097
The igu_rx_err_pkt indicates the same error with
mac_rx_fcs_err_pkt_num, so remove it.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7ea5cbdc66097f501398ef4810f0c94f4120647f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Fix spelling errors
Jian Shen [Fri, 5 Jan 2018 10:18:08 +0000 (18:18 +0800)]
net: hns3: Fix spelling errors

BugLink: http://bugs.launchpad.net/bugs/1756097
Fix spelling error "overrsize" --> "oversize".

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 200a88c69d26cafc00b1d4a729f19341a16734e8)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Unify the strings display of packet statistics
Jian Shen [Fri, 5 Jan 2018 10:18:07 +0000 (18:18 +0800)]
net: hns3: Unify the strings display of packet statistics

BugLink: http://bugs.launchpad.net/bugs/1756097
Some members of packet statistics are named in different styles.
This patch unifies them with new internal name rules, the main
modification are below:
trans --> tx
rcv --> rx
rcb_q%d_tx -->  txq#%d
rcb_q%d_rx -->  rxq#%d
sw_err_cnt(tx side) --> tx_dropped
sw_err_cnt(rx side) --> rx_dropped
pkts --> packets
tx_err_cnt --> errors
rx_err_cnt --> errors

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a6c51c2608f404419652121d8236b526d0bd2cd9)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Disable VFs change rxvlan offload status
Jian Shen [Fri, 5 Jan 2018 10:18:06 +0000 (18:18 +0800)]
net: hns3: Disable VFs change rxvlan offload status

BugLink: http://bugs.launchpad.net/bugs/1756097
Rxvlan offload status can only be changed by PF. Initialize
the value of NETIF_F_HW_VLAN_CTAG_RX bit of hw_features for
VFS to false, make sure user can't be able to change it.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 30ba2ab94019b562bdbaf9b347455870b4b2d15f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add ethtool interface for vlan filter
Jian Shen [Fri, 5 Jan 2018 10:18:05 +0000 (18:18 +0800)]
net: hns3: Add ethtool interface for vlan filter

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds vlan filter enable switch to
support ethtool -K ethX rx-vlan-filter on/off.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 391b5e935633acdb84e2e65574ba747f176b3d5e)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: hns3_get_channels() can be static
kbuild test robot [Thu, 28 Dec 2017 01:09:59 +0000 (09:09 +0800)]
net: hns3: hns3_get_channels() can be static

BugLink: http://bugs.launchpad.net/bugs/1756097
Fixes: 482d2e9c1cc7 ("net: hns3: add support to query tqps number")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 836df24a7062719002f4246019b44cc2c5184830)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: change TM sched mode to TC-based mode when SRIOV enabled
Peng Li [Fri, 22 Dec 2017 04:21:56 +0000 (12:21 +0800)]
net: hns3: change TM sched mode to TC-based mode when SRIOV enabled

BugLink: http://bugs.launchpad.net/bugs/1756097
TC-based sched mode supports SRIOV enabled and SRIOV disabled. This
patch change the TM sched mode to TC-based mode in initialization
process.

Fixes: cc9bb43ab394 ("net: hns3: Add tc-based TM support for sriov enabled port")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 71b83869a5e3b981ffb0660917b7331b76b7423f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Increase the default depth of bucket for TM shaper
Peng Li [Fri, 22 Dec 2017 04:21:55 +0000 (12:21 +0800)]
net: hns3: Increase the default depth of bucket for TM shaper

BugLink: http://bugs.launchpad.net/bugs/1756097
Burstiness of a flow is determined by the depth of a bucket, When the
upper rate of shaper is large, the current depth of a bucket is not
enough.

The default upper rate of shaper is 100G, so increase the depth of
a bucket according to UM.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3a7d59588ab282f105a2a82a38f0fa4a2c9c5032)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add support for querying advertised pause frame by ethtool ethx
Peng Li [Fri, 22 Dec 2017 04:21:54 +0000 (12:21 +0800)]
net: hns3: add support for querying advertised pause frame by ethtool ethx

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds support for querying advertised pause frame by using
ethtool command(ethtool ethx).

Fixes: 496d03e960ae ("net: hns3: Add Ethtool support to HNS3 driver")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f34ffffdcf06c779ac1ee303bf198152f0841386)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add Asym Pause support to phy default features
Fuyun Liang [Fri, 22 Dec 2017 04:21:53 +0000 (12:21 +0800)]
net: hns3: add Asym Pause support to phy default features

BugLink: http://bugs.launchpad.net/bugs/1756097
commit c4fb2cdf575d ("net: hns3: fix a bug for phy supported feature
initialization") adds default supported features for phy, but our hardware
also supports Asym Pause. This patch adds Asym Pause support to phy
default features to prevent Asym Pause can not be advertised when the phy
negotiates flow control.

Fixes: c4fb2cdf575d ("net: hns3: fix a bug for phy supported feature initialization")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f16121c80c8ee4dab3c41363cb8b24f8d8eaf45f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add support to update flow control settings after autoneg
Peng Li [Fri, 22 Dec 2017 04:21:52 +0000 (12:21 +0800)]
net: hns3: add support to update flow control settings after autoneg

BugLink: http://bugs.launchpad.net/bugs/1756097
When auto-negotiation is enabled, the MAC flow control settings is
based on the flow control negotiation result. And it should be configured
after a valid link has been established. This patch adds support to update
flow control settings after auto-negotiation has completed.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1770a7a3aeb23c0a1232486c8c4f50964725de46)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add support for set_pauseparam
Peng Li [Fri, 22 Dec 2017 04:21:51 +0000 (12:21 +0800)]
net: hns3: add support for set_pauseparam

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds set_pauseparam support for ethtool cmd.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 61387774d96ef5d2c6b876efa6a35c9c124ae4ae)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: fix for getting auto-negotiation state in hclge_get_autoneg
Fuyun Liang [Fri, 22 Dec 2017 04:21:50 +0000 (12:21 +0800)]
net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg

BugLink: http://bugs.launchpad.net/bugs/1756097
When phy exists, we use the value of phydev.autoneg to represent the
auto-negotiation state of hardware. Otherwise, we use the value of
mac.autoneg to represent it.

This patch fixes for getting a error value of auto-negotiation state in
hclge_get_autoneg().

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 27b5bf49f0924fd62d2b1ef8467b40773973da34)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: cleanup mac auto-negotiation state query
Fuyun Liang [Fri, 22 Dec 2017 04:21:49 +0000 (12:21 +0800)]
net: hns3: cleanup mac auto-negotiation state query

BugLink: http://bugs.launchpad.net/bugs/1756097
When checking whether auto-negotiation is on, driver only needs to
check the value of mac.autoneg(SW) directly, and does not need to
query it from hardware. Because this value is always synchronized
with the auto-negotiation state of hardware.

This patch removes the mac auto-negotiation state query.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 492cd1db582d9e91c6db23a054bf63365ac84dc7)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add handling vlan tag offload in bd
Peng Li [Fri, 22 Dec 2017 04:21:48 +0000 (12:21 +0800)]
net: hns3: add handling vlan tag offload in bd

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch deals with the vlan tag information between
sk_buff and rx/tx bd.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9699cffe97fee6eb957a23b58d814a2e62dd43e9)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add ethtool related offload command
Peng Li [Fri, 22 Dec 2017 04:21:47 +0000 (12:21 +0800)]
net: hns3: add ethtool related offload command

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds offload command related to "ethtool -K".

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 052ece6dc19c610a48c1cedeee1b2f1478838e99)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add vlan offload config command
Peng Li [Fri, 22 Dec 2017 04:21:46 +0000 (12:21 +0800)]
net: hns3: add vlan offload config command

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds vlan offload config commands, initializes
the rules of tx/rx vlan tag handle for hw.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5f6ea83fc9784f1edc8b11238722604fb36fa7ad)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add a mask initialization for mac_vlan table
Peng Li [Fri, 22 Dec 2017 04:21:45 +0000 (12:21 +0800)]
net: hns3: add a mask initialization for mac_vlan table

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch sets vlan masked, in order to avoid the received
packets being filtered.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7564094cd91472c7db215b9440d2664274736897)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: get rss_size_max from configuration but not hardcode
Peng Li [Fri, 22 Dec 2017 04:21:44 +0000 (12:21 +0800)]
net: hns3: get rss_size_max from configuration but not hardcode

BugLink: http://bugs.launchpad.net/bugs/1756097
Add configuration for rss_size_max in hdev but not hardcode it.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0e7a40cdac0a2aa7c6946a571b8428b3307bed85)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: free the ring_data structrue when change tqps
Peng Li [Fri, 22 Dec 2017 04:21:43 +0000 (12:21 +0800)]
net: hns3: free the ring_data structrue when change tqps

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch fixes a memory leak problems in change tqps process,
the function hns3_uninit_all_ring and hns3_init_all_ring
may be called many times.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 99fdf6b1cadf41bb253408589788f025027274f3)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: change the returned tqp number by ethtool -x
Peng Li [Fri, 22 Dec 2017 04:21:42 +0000 (12:21 +0800)]
net: hns3: change the returned tqp number by ethtool -x

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch modifies the return data of get_rxnfc, it will return
the current handle's rss_size but not the total tqp number.
because the tc_size has been change to the log2 of roundup
power of two of rss_size.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f0e98c97fa8f169952ca2c1187f9270902c1800d)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add support to modify tqps number
Peng Li [Fri, 22 Dec 2017 04:21:41 +0000 (12:21 +0800)]
net: hns3: add support to modify tqps number

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds the support to change tqps number for PF driver
by using ehtool -L command.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 09f2af6405b8cd4b2d91ec88188df6f06da38853)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: add support to query tqps number
Peng Li [Fri, 22 Dec 2017 04:21:40 +0000 (12:21 +0800)]
net: hns3: add support to query tqps number

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds the support to query tqps number for PF driver
by using ehtool -l command.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 482d2e9c1cc7c0e154464e3e052db09e5e62541f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add mailbox interrupt handling to PF driver
Salil Mehta [Thu, 14 Dec 2017 18:03:09 +0000 (18:03 +0000)]
net: hns3: Add mailbox interrupt handling to PF driver

BugLink: http://bugs.launchpad.net/bugs/1756097
All PF mailbox events are conveyed through a common interrupt
(vector 0). This interrupt vector is shared by reset and mailbox.

This patch adds the handling of mailbox interrupt event and its
deferred processing in context to a separate mailbox task.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c1a81619d73a436f4b796b44c2711c68aec9b787)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Change PF to add ring-vect binding & resetQ to mailbox
Salil Mehta [Thu, 14 Dec 2017 18:03:08 +0000 (18:03 +0000)]
net: hns3: Change PF to add ring-vect binding & resetQ to mailbox

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch is required to support ring-vector binding and reset
of TQPs requested by the VF driver to the PF driver. Mailbox
handler is added with corresponding VF commands/messages to
handle the request.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 84e095d64ed974bd46351650fc8188d372b89fde)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add mailbox support to PF driver
Salil Mehta [Thu, 14 Dec 2017 18:03:07 +0000 (18:03 +0000)]
net: hns3: Add mailbox support to PF driver

BugLink: http://bugs.launchpad.net/bugs/1756097
Command queue provides the provision of Mailbox command which
can be used for communication between PF and VF. PF handles
messages from various VFs for fetching various information like,
queue, vlan, link status related etc. It also handles the request
from various VFs to perform certain privileged operations.

This patch adds the support of a message handler for handling
such various command requests from VF.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit dde1a86e93cadf9b17ec0a95a78c99505c48fd83)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC
Salil Mehta [Thu, 14 Dec 2017 18:03:06 +0000 (18:03 +0000)]
net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC

BugLink: http://bugs.launchpad.net/bugs/1756097
Most of the NAPI handling interface, skb buffer management,
management of the RX/TX descriptors, ethool interface etc.
has quite a bit of code which is common to VF and PF driver.

This patch makes the exisitng PF's HNS3 ENET driver as the
common ENET driver for both Virtual & Physical Function. This
will help in reduction of redundancy and better management of
code.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 424eb834a9be49273c4b32d0d6395dfdbe768a1a)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add HNS3 VF driver to kernel build framework
Salil Mehta [Thu, 14 Dec 2017 18:03:05 +0000 (18:03 +0000)]
net: hns3: Add HNS3 VF driver to kernel build framework

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch introduces the new Makefiles and updates existing
Makefiles required to build the HNS3 Virtual Function driver.
This also updates the Kconfig for introduction of new menuconfig
entries related to VF driver.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e963cb789a29b890678b58ef7da5d7c497510b7e)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support
Salil Mehta [Thu, 14 Dec 2017 18:03:04 +0000 (18:03 +0000)]
net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds the support of hardware compatibiltiy layer to the
HNS3 VF Driver. This layer implements various {set|get} operations
over MAC address for a virtual port, RSS related configuration,
fetches the link status info from PF, does various VLAN related
configuration over the virtual port, queries the statistics from
the hardware etc.

This layer can directly interact with hardware through the
IMP(Integrated Mangement Processor) interface or can use mailbox
to interact with the PF driver.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e2cb1dec9779ba2d89302a653eb0abaeb8682196)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add mailbox support to VF driver
Salil Mehta [Thu, 14 Dec 2017 18:03:03 +0000 (18:03 +0000)]
net: hns3: Add mailbox support to VF driver

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds the support of the mailbox to the VF driver. The
mailbox shall be used as an interface to communicate with the
PF driver for various purposes like {set|get} MAC related
operations, reset, link status etc. The mailbox supports both
synchronous and asynchronous command send to PF driver.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b11a0bb231f3d83429c5e88451ca85ce27c4a9dd)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add HNS3 VF IMP(Integrated Management Proc) cmd interface
Salil Mehta [Thu, 14 Dec 2017 18:03:02 +0000 (18:03 +0000)]
net: hns3: Add HNS3 VF IMP(Integrated Management Proc) cmd interface

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch adds support of command interface for communication with
the IMP(Integrated Management Processor) for HNS3 Virtual Function
Driver.

Each VF has support of CQP(Command Queue Pair) ring interface.
Each CQP consis of send queue CSQ and receive queue CRQ.
There are various commands a VF may support, like to query frimware
version, TQP management, statistics, interrupt related, mailbox etc.

This also contains code to initialize the command queue, manage the
command queue descriptors and Rx/Tx protocol with the command processor
in the form of various commands/results and acknowledgements.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fedd0c15d2885e393d4ef4db818b462c3bbfc337)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Refactors the requested reset & pending reset handling code
Salil Mehta [Mon, 4 Dec 2017 01:29:55 +0000 (01:29 +0000)]
net: hns3: Refactors the requested reset & pending reset handling code

BugLink: http://bugs.launchpad.net/bugs/1756097
In exisiting code, the way to detect if driver/client reset should
be executed or if hardware should be be soft resetted was overly
complex.

Existing code use to read the interrupt status register from task
context to figure out if the interrupt source event was reset and
then use clear the interrupt source for reset while waiting for the
hardware to finish the reset. This behaviour again was confusing
and overly complex in terms of the flow.

This patch simplifies the handling of the requested reset and the
pending reset(i.e. reset which have already been asserted by the
software and hardware has acknowledged back to driver that it is
processing the hardware reset through interrupt)

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f2f432f2c37942504f491d9375ecd4fee977dfac)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Add reset service task for handling reset requests
Salil Mehta [Mon, 4 Dec 2017 01:29:54 +0000 (01:29 +0000)]
net: hns3: Add reset service task for handling reset requests

BugLink: http://bugs.launchpad.net/bugs/1756097
Existing common service task was being used to service the reset
requests. This patch tries to make the handling of reset cleaner
by separating task to handle the reset requests. This might in
turn help in adapting similar handling approach for other
interrupt events like mailbox, sharing vector 0 interrupt.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cb1b9f77c48fb014da7d020f1395eca4fdfcbd9a)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agonet: hns3: Refactor of the reset interrupt handling logic
Salil Mehta [Mon, 4 Dec 2017 01:29:53 +0000 (01:29 +0000)]
net: hns3: Refactor of the reset interrupt handling logic

BugLink: http://bugs.launchpad.net/bugs/1756097
The reset interrupt event shares common miscellaneous interrupt
Vector 0. In the existing reset interrupt handling we disable
the Vector 0 interrupt in misc interrupt handler and re-enable
them later in context to common service task.

This also means other event sources like mailbox would also be
deferred or if the interrupt event was due to mailbox(which shall
be supported for VF soon), it could delay the reset handling.

This patch reorganizes the reset interrupt handling logic and
makes it more fair to other events.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ca1d7669b714d35903fc5dfbf54c990c6122a1d4)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Set the guid for hip08 RoCE device
oulijun [Wed, 10 Jan 2018 06:39:53 +0000 (14:39 +0800)]
RDMA/hns: Set the guid for hip08 RoCE device

BugLink: http://bugs.launchpad.net/bugs/1756097
This patch assign a guid(Global Unique identifer) value to the hip08
device.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit d4994d2f1f7a7b24622f990d4bb437eacf69b816)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Update the verbs of polling for completion
oulijun [Wed, 10 Jan 2018 06:39:52 +0000 (14:39 +0800)]
RDMA/hns: Update the verbs of polling for completion

BugLink: http://bugs.launchpad.net/bugs/1756097
If the port is a RoCEv2 port, the remote port address and QP information
which returned for UD will be modified.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 2eade675351b0ef9e054ccb62334efd716aa853c)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>