]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agoi40e: change Rx hang message into a WARN_ONCE
Jacob Keller [Tue, 3 May 2016 22:13:15 +0000 (15:13 -0700)]
i40e: change Rx hang message into a WARN_ONCE

Orabug: 23176970

Use WARN_ONCE in order to highlight the issue, but don't display
a warning every time. The user should be able to see the ethtool counter
we created if necessary to see how often it is occurring.

Change-ID: I40c4ea159819b64a7d33b7f5716749089791533a
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c420815d12b744ad8cf9312af13af794bad48216)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Refactor ethtool get_settings
Catherine Sullivan [Tue, 3 May 2016 22:13:14 +0000 (15:13 -0700)]
i40e: Refactor ethtool get_settings

Orabug: 23176970

Previously we were only looking at the FW supported PHY types if link
was down, because we want to be more specific when link is up. This
refactor changes this. When link is down, we still rely on the FW
supported PHY types, but when link is up, we select the possible
supported link modes from what we know about the current PHY type, and
AND that with the FW supported PHY types.

Change-ID: Ice5dad83f2a17932b0b8b59f07439696ad6aa013
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 06566e5dd4e53f57fc3daa12fb8b5252772d70de)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: lie to the VF
Mitch Williams [Tue, 3 May 2016 22:13:13 +0000 (15:13 -0700)]
i40e: lie to the VF

Orabug: 23176970

If an untrusted VF attempts to configure promiscuous mode, log a message
pointing out its naughty behavior. But then, instead of returning an
error to the offender, just lie to it and say everything's OK. It will
continue on its way, thinking it's in promiscuous mode, but receiving no
packets except its own.

Change-ID: I63369215b1720f3c531eedfc06af86ff8c0e3dc8
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit eee4172abcdcc610e40eb9513d19ff16c7820270)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add vf-true-promisc-support priv flag
Anjali Singhai Jain [Tue, 3 May 2016 22:13:12 +0000 (15:13 -0700)]
i40e: Add vf-true-promisc-support priv flag

Orabug: 23176970

This patch adds priv-flag knob to configure global true promisc
support. With this patch the user can decide the flavor of
promiscuous that the VFs will see when promiscuous mode is enabled
on the interface. Since this a global setting for the whole device,
the priv-flag is exposed only on the first PF of the device.

The default is true promisc support is off, which means the promisc
mode for the VF will be limited/defport mode.

For the PF, we still will be in limited promisc unless in MFP mode
irrespective of the flavor picked through this knob.

Usage:
On PF0
ethtool --show-priv-flags p261p1
Private flags for p261p1:
MFP                    : off
LinkPolling            : off
flow-director-atr      : on
veb-stats              : off
hw-atr-eviction        : off
vf-true-promisc-support: off

to enable setting true promisc
ethtool --set-priv-flags p261p1 vf-true-promisc-support on

At this point if the VF is set to trust and promisc is enabled
on the VF through
ip link set ... promisc on
The VF/VFs will be able to see ALL ingress traffic

Change-Id: I8fac4b6eb1af9ca77b5376b79c50bdce5055bd94
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b5569892309e2e62641076f43aef6919286343b4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoi40e: Implement the API function for aq_set_switch_config
Shannon Nelson [Tue, 3 May 2016 22:13:11 +0000 (15:13 -0700)]
i40e: Implement the API function for aq_set_switch_config

Orabug: 23176970

Add the support code for calling the AdminQ API call aq_set_switch_config

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f3d5849756f0da14edabb1835e35aea8b6bc7440)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add allmulti support for the VF
Anjali Singhai Jain [Tue, 3 May 2016 22:13:10 +0000 (15:13 -0700)]
i40e: Add allmulti support for the VF

Orabug: 23176970

This patch enables a feature to enable/disable all multicast
for a trusted VF.

Change-Id: I926eba7f8850c8d40f8ad7e08bbe4056bbd3985f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f42a5c74da9996d602093d7760f6916444009a9d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for disabling all link and change bits needed for PHY interactions
Kevin Scott [Tue, 3 May 2016 22:13:09 +0000 (15:13 -0700)]
i40e: Add support for disabling all link and change bits needed for PHY interactions

Orabug: 23176970

Add flag to tell firmware to disable link on all ports.

This patch changes the bits set for telling firmware the PHY needs
to be modified by driver.  Without this patch, the setting will only
set that mode for the current port on the device.  Because the
MDIO interface is common for the copper device. The command needs to
set the mode for all ports.

Change-ID: I8baa7da91d384291ac95b41ae1a516604f8eb67f
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 06c0e39bbefd04b19ca50f29be698eeed21630b5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: constify i40e_client_ops structure
Julia Lawall [Sun, 1 May 2016 12:07:23 +0000 (14:07 +0200)]
i40e: constify i40e_client_ops structure

Orabug: 23176970

The i40e_client_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3949c4ac8cfa8ab3518a326c72eff1a2ff489bb9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/infiniband/hw/i40iw/i40iw_main.c

9 years agoi40e: fix misleading indentation
Arnd Bergmann [Fri, 29 Apr 2016 17:44:05 +0000 (19:44 +0200)]
i40e: fix misleading indentation

Orabug: 23176970

Newly added code in i40e_vc_config_promiscuous_mode_msg() is indented
in a way that gcc rightly complains about:

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c: In function 'i40e_vc_config_promiscuous_mode_msg':
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1543:4: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID)
    ^~
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1550:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
     aq_err = pf->hw.aq.asq_last_status;

From the context, it looks like the aq_err assignment was meant to be
inside of the conditional expression, so I'm adding the appropriate
curly braces now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5676a8b9cd9a ("i40e: Add VF promiscuous mode driver support")
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ce927db48721235b3a08142b6d9f9a906e4e626f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Test memory before ethtool alloc succeeds
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:49 +0000 (11:33 -0700)]
i40e: Test memory before ethtool alloc succeeds

Orabug: 23176970

When testing on systems with very limited amounts of RAM, a bug was
found where, while changing the number of descriptors using ethtool,
the driver didn't test the limits of system memory before permanently
assuming it would be able to get receive buffer memory.

Work around this issue by pre-allocation of the receive buffer
memory, in the "ghost" ring, which is then used during reinit
using the new ring length.

Change-Id: I92d7a5fb59a6c884b2efdd1ec652845f101c3359
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 147e81ec7568933a51fe58b64244383e929870fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Allocate Rx buffers properly
Mitch Williams [Mon, 18 Apr 2016 18:33:48 +0000 (11:33 -0700)]
i40evf: Allocate Rx buffers properly

Orabug: 23176970

Allocate the correct number of RX buffers, and don't fiddle with
next_to_use. The common RX code handles all of this. This fixes a memory
leak of one page each time the driver is opened.

Change-Id: Id06eca353086e084921f047acad28c14745684ee
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b163098ea1eece88a8834952dcbade1f17378731)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Remove unused hardware receive descriptor code
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:47 +0000 (11:33 -0700)]
i40e/i40evf: Remove unused hardware receive descriptor code

Orabug: 23176970

The hardware supports a 16 byte descriptor for receive, but the
driver was never using it in production.  There was no performance
benefit to the real driver of 16 byte descriptors, so drop a whole
lot of complexity while getting rid of the code.

Also since the previous patch made us use no-split mode all the
time, drop any support in the driver for any other value in dtype
and assume it is always zero (aka no-split).

Hooray for code removal!

Change-ID: I2257e902e4dad84a07b94db6d2e6f4ce69b27bc0
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bec60fc42b285344b027c87444c7fd6caade0ceb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: refactor receive routine
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:46 +0000 (11:33 -0700)]
i40evf: refactor receive routine

Orabug: 23176970

This is part 2 of the Rx refactor series, just including
changes to i40evf.

This refactor aligns the receive routine with the one in
ixgbe which was highly optimized.  This reduces the code
we have to maintain and allows for (hopefully) more readable
and maintainable RX hot path.

In order to do this:
- consolidate the receive path into a single function that doesn't
  use packet split but *does* use pages for Rx buffers.
- remove the old _1buf routine
- consolidate several routines into helper functions
- remove VF ethtool control over packet split
- remove priv_flags interface since it is unused

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ab9ad98eb5f95b86490cc4c2ddbde5a0bc9bd5c6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

9 years agoi40evf: Drop packet split receive routine
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:45 +0000 (11:33 -0700)]
i40evf: Drop packet split receive routine

Orabug: 23176970

As part of preparation for the rx-refactor, remove the
packet split receive routine and ancillary code.

Some of the split related context set up code stays in
i40e_virtchnl_pf.c in case an older VF driver tries to load
and still wants to use packet split.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 19b85e677df44b954c23a47395edf5a6c379771b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

9 years agoi40e: Refactor receive routine
Jesse Brandeburg [Thu, 21 Apr 2016 02:43:37 +0000 (19:43 -0700)]
i40e: Refactor receive routine

Orabug: 23176970

This is part 1 of the Rx refactor series, just including
changes to i40e.

This refactor aligns the receive routine with the one in
ixgbe which was highly optimized.  This reduces the code
we have to maintain and allows for (hopefully) more readable
and maintainable RX hot path.

In order to do this:
- consolidate the receive path into a single function that doesn't
  use packet split but *does* use pages for Rx buffers.
- remove the old _1buf routine
- consolidate several routines into helper functions
- remove ethtool control over packet split

Change-ID: I5ca100721de65992aa0114f8b4bac844b84758e0
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1a557afc4dd59b85a5cae2be6d351eaeb31d2664)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_txrx.c

9 years agoi40e/i40evf: Remove reference to ring->dtype
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:43 +0000 (11:33 -0700)]
i40e/i40evf: Remove reference to ring->dtype

Orabug: 23176970

As part of the rx-refactor, the dtype variable in the i40e_ring
struct is no longer used, so remove it.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 04b3b779816502549e5f4bfaf5df90204ce2fe0e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Drop packet split receive routine
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:42 +0000 (11:33 -0700)]
i40e: Drop packet split receive routine

Orabug: 23176970

As part of preparation for the rx-refactor, remove the
packet split receive routine and ancillary code.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b32bfa17246d836125958e39996a674653e899a5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_txrx.c

9 years agoi40e/i40evf: Refactor tunnel interpretation
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:41 +0000 (11:33 -0700)]
i40e/i40evf: Refactor tunnel interpretation

Orabug: 23176970

Refactor the interpretation of a tunnel.  This removes
some code and lets us start using the hardware's parsing.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f8a952cb40407f3c127cab8ec77f1261f1e424b4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: make use of BIT() macro to avoid signed left shift
Jacob Keller [Wed, 13 Apr 2016 23:08:27 +0000 (16:08 -0700)]
i40evf: make use of BIT() macro to avoid signed left shift

Orabug: 23176970

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ae63bff0d7f333677e7ec532e9c315c74a510403)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: make use of BIT() macro to prevent left shift of signed values
Jacob Keller [Wed, 13 Apr 2016 23:08:26 +0000 (16:08 -0700)]
i40e: make use of BIT() macro to prevent left shift of signed values

Orabug: 23176970

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2101bac2d4c26208fa0d1d9ffd8b83ad0199d61a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix I40E_MASK signed shift overflow warnings
Jacob Keller [Wed, 13 Apr 2016 23:08:25 +0000 (16:08 -0700)]
i40e/i40evf: fix I40E_MASK signed shift overflow warnings

Orabug: 23176970

GCC 6 has a new warning which will display when you attempt to left
shift a signed value beyond the storage size of the type. I40E_MASK
generates a mask value for 32bit registers. Properly typecast the mask
value and place the values in parenthesis to prevent macro expansion
issues.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit dcb57456e73f204beff12e4532aaf573d1115114)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf : Bump driver version from 1.5.5 to 1.5.10
Harshitha Ramamurthy [Wed, 13 Apr 2016 10:08:32 +0000 (03:08 -0700)]
i40e/i40evf : Bump driver version from 1.5.5 to 1.5.10

Orabug: 23176970

Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5a6fc256e7b64b3073688cc72fae357612cf31c6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Update device ids for X722
Catherine Sullivan [Wed, 13 Apr 2016 10:08:31 +0000 (03:08 -0700)]
i40e: Update device ids for X722

Orabug: 23176970

Add a device ID for X722.

Change-Id: I574f2345ab341de98a6a1c212d0603af853e48b0
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a3aa5036cf3798c18fe22041fbfbac01642657e0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Drop extra copy of function
Jesse Brandeburg [Wed, 13 Apr 2016 10:08:30 +0000 (03:08 -0700)]
i40e: Drop extra copy of function

Orabug: 23176970

i40e_release_rx_desc was in two files, but was only used
and needed in txrx.c.  Get rid of the extra copy.

Change-Id: I86e18239aa03531fc198b6c052847475084a9200
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit de38fef610f4e72fdf506bb84ddb05b46f4bf653)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Use consistent type for vf_id
Jesse Brandeburg [Wed, 13 Apr 2016 10:08:29 +0000 (03:08 -0700)]
i40e: Use consistent type for vf_id

Orabug: 23176970

The driver was all over the place using signed or unsigned types
for vf_id, when it should always be signed.

This fixes warnings of type unsafe comparisons from gcc with W=2.

Change-Id: I2cb681f83d0f68ca124d2e4131e4ac0d9f8a6b22
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a1b5a24fccc83430bb1fa6e0f9925fb8328abd34)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: PTP - avoid aggregate return warnings
Jesse Brandeburg [Wed, 13 Apr 2016 10:08:28 +0000 (03:08 -0700)]
i40e: PTP - avoid aggregate return warnings

Orabug: 23176970

Aggregate return warnings are when struct types are returned
and must be copied to the lvalue with a struct copy by the compiler.

This fixes warnings of type aggregate-return from gcc with W=2.

Change-Id: I896b1bf514544bf0faeb458869d79914b9f1b168
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit cdc3d93257e162dd12906a6e0207436c2d5c6873)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix uninitialized variable
Catherine Sullivan [Wed, 13 Apr 2016 10:08:27 +0000 (03:08 -0700)]
i40e: Fix uninitialized variable

Orabug: 23176970

We have an uninitialized variable warning for valid_len for one case in
validate_vf_mesg. To fix this, just initialize it to 0 at the top of the
function and remove all of the now redundant assignments to 0 in the
individual cases.

Change-Id: Iacbd97f4c521ed8d662eef803a598d8707708cfd
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3ed439c56e0d82fd08275fff2c21278f92ed8ec5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: RSS Hash Option parameters
Carolyn Wyborny [Wed, 13 Apr 2016 10:08:26 +0000 (03:08 -0700)]
i40evf: RSS Hash Option parameters

Orabug: 23176970

This patch syncs the VF code for the changes made to the PF for the RSS
hash tuple settings.  Since the VF still cannot change the RSS hash
settings, change the code to make this clear to the user.  Previously,
the default settings were returned in this function. However, the
default can be changed by the PF so this does not make sense anymore.

Change-Id: I085eaf005fc7978b440d2a1bf2b2dd7cadaff39b
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b29699b39924db73993734a605665cf4bebef9ea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove HMC AQ API implementation
Neerav Parikh [Sun, 1 May 2016 21:29:53 +0000 (14:29 -0700)]
i40e: Remove HMC AQ API implementation

Orabug: 23176970

Remove the code that implements the HMC AQ APIs and call these APIs.
This is done because these are obsolete APIs and are not supported
by firmware.

Change-ID: I5d771d8f37c3e16e7b0a972ff9b27e75aa2d05d4
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2b79c58d80921acb7f784c340fd7532c4a8b8d95)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Limit the number of MAC and VLAN addresses that can be added for VFs
Anjali Singhai Jain [Wed, 13 Apr 2016 10:08:22 +0000 (03:08 -0700)]
i40e: Limit the number of MAC and VLAN addresses that can be added for VFs

Orabug: 23176970

If the VF is privileged/trusted it can do as it may please including
but not limited to hogging resources and playing unfair.
But if the VF is not privileged/trusted it still can add some number
(8) of MAC and VLAN addresses.
Other restrictions with respect to Port VLAN and normal VLAN still apply
to not privileged/trusted VF.

Change-Id: I3a9529201b184c8873e1ad2e300aff468c9e6296
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5f527ba962e277963b08f4c7f12fbeeac3f34e3c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change the default for VFs to be not privileged
Anjali Singhai Jain [Thu, 26 May 2016 17:42:11 +0000 (13:42 -0400)]
i40e: Change the default for VFs to be not privileged

Orabug: 23176970

Make sure a VF is not trusted/privileged until its explicitly
set for trust through the new NDO op interface.

Change-Id: I476385c290d2b4901d8fceb29de43546accdc499
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(backport of commit 692fb0a75e816d2676f222c9db33e91f46ea1e03)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add driver support for promiscuous mode
Anjali Singhai Jain [Tue, 12 Apr 2016 15:30:52 +0000 (08:30 -0700)]
i40evf: Add driver support for promiscuous mode

Orabug: 23176970

Add necessary Linux Ethernet driver support for promiscuous mode
operation. Add a flag so the VF knows it is in promiscuous mode
and two state flags to discreetly track multicast and unicast
promiscuous states.

Change-Id: Ib2f2dc7a7582304fec90fc917ebb7ded21ba1de4
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 47d3483988f649739ad8d6462eaa1723e5d077c3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add VF promiscuous mode driver support
Anjali Singhai Jain [Tue, 12 Apr 2016 15:30:51 +0000 (08:30 -0700)]
i40e: Add VF promiscuous mode driver support

Orabug: 23176970

Add infrastructure for Network Function Virtualization VLAN tagged
packet steering feature.

Change-Id: I9b873d8fcc253858e6baba65ac68ec5b9363944e
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5676a8b9cd9a1c9822cdb3d88109f449eb2126c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add promiscuous on VLAN support
Greg Rose [Tue, 12 Apr 2016 15:30:50 +0000 (08:30 -0700)]
i40e: Add promiscuous on VLAN support

Orabug: 23176970

NFV use cases require the ability to steer packets to VSIs by VLAN tag
alone while being in promiscuous mode for multicast and unicast MAC
addresses.  These two new functions support that ability.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6c41a7606967803702d0b5c2ba57acce71ec8d9d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Only offload VLAN tag if enabled
Jesse Brandeburg [Tue, 12 Apr 2016 15:30:49 +0000 (08:30 -0700)]
i40e/i40evf: Only offload VLAN tag if enabled

Orabug: 23176970

The driver was offloading the VLAN tag into the skb
any time there was a VLAN tag and the hardware stripping was
enabled.  Just check to make sure it's enabled before put_tag.

Change-Id: Ife95290c06edd9a616393b38679923938b382241
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a149f2c323b62bc6cff91d874d853250250e8497)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove zero check
Greg Rose [Tue, 12 Apr 2016 15:30:48 +0000 (08:30 -0700)]
i40e: Remove zero check

Orabug: 23176970

A mirror rule ID may be zero so do not return invalid parameter when the
user passes in a zero value for a rule ID.

Change-ID: I261b8c24725ce2c6ed32f859da81093dfcbe2970
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit db0772782f6b99adbd8548e1d3830fe019c9f250)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add DeviceID for X722 QSFP+
Kamil Krawczyk [Tue, 12 Apr 2016 15:30:47 +0000 (08:30 -0700)]
i40e: Add DeviceID for X722 QSFP+

Orabug: 23176970

Change-ID: I1370fbc7774e815ac1ad56561e97488e829592fc
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bccf474435b668312e9fc8bd9586c2e256b66841)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add device capability which defines if update is available
Michal Kosiarz [Tue, 12 Apr 2016 15:30:46 +0000 (08:30 -0700)]
i40e: Add device capability which defines if update is available

Orabug: 23176970

Add device capability which defines if update is available and security
check is needed during update process.

Change-ID: I380787c878275e1df18b39198df3ee3666342282
Signed-off-by: Michal Kosiarz <michal.kosiarz@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 68a1c5a777f8e94d3bb0b0e287443492316ea5b5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Allow PF driver to configure RSS
Mitch Williams [Tue, 12 Apr 2016 15:30:44 +0000 (08:30 -0700)]
i40evf: Allow PF driver to configure RSS

Orabug: 23176970

If the PF driver reports proper support, allow the PF driver to
configure RSS on the behalf of the VF driver. This will allow for RSS
support on future hardware without changes to the VF driver.

Unfortunately, the old RSS code still needs to stay as the driver needs
to be compatible with PF drivers that don't support this interface. But
this change still simplifies the data structures a bunch and makes this
code simpler to read and maintain.

Change-ID: I0375aad40788ecdc0cb24d5cfeccf07804e69771
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 43a3d9ba34c9ca313573201d3f45de5ab3494cec)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Specify AQ event opcode to wait for
Shannon Nelson [Tue, 12 Apr 2016 15:30:43 +0000 (08:30 -0700)]
i40e: Specify AQ event opcode to wait for

Orabug: 23176970

To add a little flexibility to the nvmupdate facility, this code adds the
ability to specify an AQ event opcode to wait on after the Exec_AQ request.

Change-ID: Iddbfd63c3de8df3edb9d3e90678b08989bc4946e
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fed2db99824334b3a7219da6b45d70f448449d7d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Code cleanup in i40e_add_fdir_ethtool
Shannon Nelson [Tue, 12 Apr 2016 15:30:42 +0000 (08:30 -0700)]
i40e: Code cleanup in i40e_add_fdir_ethtool

Orabug: 23176970

A little bit of code cleanup in prep for more cloud filter work.

Change-ID: I0dc33ce0d4c207944336a07437640fef920c100c
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bab3a34bb5f0b4056e37edf1bf6d097b147de453)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Don't Panic
Mitch Williams [Tue, 12 Apr 2016 15:30:41 +0000 (08:30 -0700)]
i40evf: Don't Panic

Orabug: 23176970

Under some circumstances the driver remove function may be called before
the driver is fully initialized. So we can't assume that we know where
our towel is at, or that all of the data structures are initialized.

To ensure that we don't panic, check that the vsi_res pointer is valid
before dereferencing it. Then drink beer and eat peanuts.

Change-ID: If697b4db57348e39f9538793e16aa755e3e1af03
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c0913c2e431c86026acba667f8655d90979bb79c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for configuring VF RSS
Mitch Williams [Tue, 12 Apr 2016 15:30:40 +0000 (08:30 -0700)]
i40e: Add support for configuring VF RSS

Orabug: 23176970

Add support for configuring RSS on behalf of the VFs. This removes the
burden of dealing with different hardware interfaces from the VF
drivers, allowing for better future compatibility.

Change-ID: Icea75d3f37241ee8e447be5779e5abb53ddf04c0
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c4e1868c3aa1992de1cba600e7083fcd49bd20b8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add support for IPIP and SIT offloads
Alexander Duyck [Sat, 2 Apr 2016 07:06:56 +0000 (00:06 -0700)]
i40e/i40evf: Add support for IPIP and SIT offloads

Orabug: 23176970

Looking over the documentation it turns out enabling IPIP and SIT offloads
for i40e is pretty straightforward.  As such I decided to enable them with
this patch.  In my testing I am seeing an improvement of 8 to 10 Gb/s
for IPIP and SIT tunnels with this offload enabled.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 577389a5db766c44400e75e6a79f39d9b0d585f8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Clean up feature flags
Alexander Duyck [Sat, 2 Apr 2016 07:05:14 +0000 (00:05 -0700)]
i40e/i40evf: Clean up feature flags

Orabug: 23176970

The feature flags list for i40e and i40evf is beginning to become pretty
massive.  I plan to add another 4 or so features to these drivers and
duplicating the flags for each and every flags list is becoming a bit
repetitive.

The primary change here is that we now build our features list around
hw_encap_features.  After that we assign that to vlan_features,
hw_features, and finally map that onto features.  In addition we end up
throwing features onto hw_encap_features that end up having no effect such
as the Rx offloads and SCTP_CRC.  However that should have no impact and
makes things a bit easier for us as hw_encap_features is one of the less
updated features maps available.

For i40evf I went through and sanity checked a few features as well.
Specifically RXCSUM was being set as a read-only feature which didn't make
much sense.  I have updated things so we can clear the NETIF_F_RXCSUM flag
since that is really a software feature and not a hardware one anyway so
disabling it is just a matter of ignoring the result from the hardware.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b0fe3306432796c8f7adbede8ccd479bb7b53d0a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40evf/i40evf_main.c

9 years agoi40evf: properly handle VLAN features
Mitch Williams [Fri, 1 Apr 2016 20:34:31 +0000 (13:34 -0700)]
i40evf: properly handle VLAN features

Orabug: 23176970

Correctly set the VLAN feature flags after setting the rest of the
netdev flags. And don't set them in hw_features, because these can't be
controlled by the VF driver.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ba6cc7f6f194e3645368f87d951bedd7e3b75f39)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump patch from 1.5.2 to 1.5.5
Harshitha Ramamurthy [Fri, 1 Apr 2016 10:56:13 +0000 (03:56 -0700)]
i40e/i40evf: Bump patch from 1.5.2 to 1.5.5

Orabug: 23176970

Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 47c46778e1905721433a413b2522a8e2b3d6c354)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Input set mask constants for RSS, flow director, and flex bytes
Kiran Patil [Mon, 4 Apr 2016 14:01:10 +0000 (07:01 -0700)]
i40e: Input set mask constants for RSS, flow director, and flex bytes

Orabug: 23176970

Add defines for input set mask (RSS, flow director, flexible payload),
including defines specific to IPv6.

Change-ID: Ie95ef7d0916a4d6ca011c194283f959774c8dce9
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 17a035be959ef0316ec86adb0c82ed3f057a853b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move NVM event wait check to NVM code
Shannon Nelson [Fri, 1 Apr 2016 10:56:11 +0000 (03:56 -0700)]
i40e: Move NVM event wait check to NVM code

Orabug: 23176970

The logic that checks AQ events for NVM done events is better kept
in nvm.c with the rest of the nvmupdate handling code.

Change-ID: I2ea58980df8ecaa3726b28a37bff3dfcb8df03dc
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bab2fb60dcdd0f9d8715749d056ddd6c465b1875)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add RSS configuration to virtual channel
Mitch Williams [Fri, 1 Apr 2016 10:56:10 +0000 (03:56 -0700)]
i40e: Add RSS configuration to virtual channel

Orabug: 23176970

Add opcodes and structures to support RSS configuration by PF driver on
behalf of the VF drivers. This reduces complexity in the VF driver and
allows us to support future hardware designs without modifying the VF
driver.

Change-ID: I8c75765c630eacb71f95967f1109a198542593ac
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 585954f8b808def857771037392c1621f167fa92)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move NVM variable out of AQ struct
Shannon Nelson [Fri, 1 Apr 2016 10:56:09 +0000 (03:56 -0700)]
i40e: Move NVM variable out of AQ struct

Orabug: 23176970

The NVM update status info should stay collected together, not
spread across different structs.

Change-ID: Ic16f9e9fd79945d865bb7226184c889884585025
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 437f82a2290ed94f0d6a86b749101f1ad5ed6231)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Restrict VF poll mode to only single function mode devices
Shannon Nelson [Fri, 1 Apr 2016 10:56:08 +0000 (03:56 -0700)]
i40e: Restrict VF poll mode to only single function mode devices

Orabug: 23176970

The VFs can request their queues to be set up into polling mode, rather
than interrupt mode, which works well for supporting things like DPDK,
but this should not be available when working in an multi-function
support device.

Change-ID: Id36792e4e7422db8f2033336507211f68f14ff6f
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 14c5f5d264c3ee28e8ec9fd4dffb29f5d1ea1d02)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Faster RX via avoiding FCoE
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:06 +0000 (03:56 -0700)]
i40e/i40evf: Faster RX via avoiding FCoE

Orabug: 23176970

As it turns out, calling into other files from hot path hurts
performance a lot.  In this case the majority of the time we
call "check FCoE" and the packet is *not* FCoE, but this call
was taking 5% of our total cycles spent on receive.

Change-ID: I080552c26e7060bc7b78504dc2763f6f0b3d8c76
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1f15d66712bb64e39fe2c23b1b32f68f9e1d4ee7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Drop unused tx_ring argument
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:05 +0000 (03:56 -0700)]
i40e/i40evf: Drop unused tx_ring argument

Orabug: 23176970

Some of the tx_ring arguments can be deleted since they are not used.

Change-ID: I99275b0f191d7f63ec2f05061919904940c36f31
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 84b079928a10559ebc6679e1e973a3ee5b20ba83)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Move stack var deeper
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:04 +0000 (03:56 -0700)]
i40e/i40evf: Move stack var deeper

Orabug: 23176970

A local variable could move down inside the context where it is used.

Change-ID: I9caba9e1eacf921037077f2665cbce83fd8e95d6
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d1bd743b5b4d675e739b574284d1412ba996fe07)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move HW flush
Akeem G Abodunrin [Fri, 1 Apr 2016 10:56:03 +0000 (03:56 -0700)]
i40e: Move HW flush

Orabug: 23176970

This patch moves the HW flush routine to the end of the reset flow,
after the completion of writing to the device VFLR registers- the
benefit is to avoid problems in the passthrough routines.

Change-ID: Ieb56866f21895e6c1fc514b7328c3df79807a57c
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 30728c5bdf2ac6618eebf6949a2e59b3c4cf640f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Leave debug_mask cleared at init
Shannon Nelson [Fri, 1 Apr 2016 10:56:02 +0000 (03:56 -0700)]
i40e: Leave debug_mask cleared at init

Orabug: 23176970

Don't set our internal debug_mask at startup unless we get specific signal
to from the debug module parameter.

This should take care of the issue with all the device capabilities getting
printed even when we hadn't asked for the debug info.

Change-ID: I7fbc6bd8b11ed9b0631ec018ff36015a04100b6c
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 89dd05512b79ee9ba0950f1ba1fb8077ec898ea2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Inserting a HW capability display info
Deepthi Kavalur [Fri, 1 Apr 2016 10:56:01 +0000 (03:56 -0700)]
i40e: Inserting a HW capability display info

Orabug: 23176970

Display MSIx vector count for HW capabilities.

Change-ID: I4b41e9b50360cf660e7fbcb85b9390fedcf313b1
Signed-off-by: Deepthi Kavalur <deepthi.kavalur@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 453e16e8e8b96821111e8d90252f4df8ec418eea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix TSO checksum pseudo-header adjustment
Alexander Duyck [Wed, 25 May 2016 17:00:36 +0000 (13:00 -0400)]
i40e/i40evf: Fix TSO checksum pseudo-header adjustment

Orabug: 23176970

With IPv4 and IPv6 now using the same format for checksums based on the
length of the frame we need to update the i40e and i40evf drivers so that
they correctly account for lengths greater than or equal to 64K.

With this patch the driver should now correctly update checksums for frames
up to 16776960 in length which should be more than large enough for all
possible TSO frames in the near future.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 24d41e5e2c9afe99b0584832206ba8779dfb783e)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump patch from 1.5.1 to 1.5.2
Avinash Dayanand [Fri, 18 Mar 2016 19:18:16 +0000 (12:18 -0700)]
i40e/i40evf: Bump patch from 1.5.1 to 1.5.2

Orabug: 23176970

Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 066439ce791b5d8533556a89836c0849589c2b41)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Request PHY media event at reset time
Shannon Nelson [Fri, 18 Mar 2016 19:18:15 +0000 (12:18 -0700)]
i40e: Request PHY media event at reset time

Orabug: 23176970

Add the Media Not Available flag to the link event mask.  It seems
that event comes first if you have a DA cable pulled out, but there's no
follow-up event for Link Down; if you're not looking for MEDIA_NA you will
get no event, even though there's now no Link.

Change-ID: cb3340a2849805bb881f64f6f2ae810eef46eba7
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 867a79e37ed9a3a5a2051cc11df21a57a8a00bfe)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Lower some message levels
Mitch Williams [Fri, 18 Mar 2016 19:18:14 +0000 (12:18 -0700)]
i40e: Lower some message levels

Orabug: 23176970

These conditions can happen any time VFs are enabled or disabled and are
not really indicative of fatal problems unless they happen continuously.

Lower the log level so that people don't get scared.

Change-ID: I1ceb4adbd10d03cbeed54d1f5b7f20d60328351d
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 18b7af57d9c1165c2b8f13ec4668d6d7f51708cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix for supported link modes in 10GBaseT PHY's
Avinash Dayanand [Fri, 18 Mar 2016 19:18:13 +0000 (12:18 -0700)]
i40e: Fix for supported link modes in 10GBaseT PHY's

Orabug: 23176970

100baseT/Full is now listed and supported link mode for 10GBaseT PHY.
This is a fix to list all the supported link modes of 10GBaseT PHY.

Change-ID: If2be3212ef0fef85fd5d6e4550c7783de2f915e9
Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 16badc34695ff489a39e450b4e4e5a241ac85a31)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Fix get_rss_aq
Catherine Sullivan [Fri, 18 Mar 2016 19:18:12 +0000 (12:18 -0700)]
i40evf: Fix get_rss_aq

Orabug: 23176970

We were passing in the seed where we should just be passing false
because we want the VSI table not the pf table.

Change-ID: I9b633ab06eb59468087f0c0af8539857e99f9495
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 539a379c50220d6ac19c7300671fe25819bd3f1b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Disable link polling
Shannon Nelson [Fri, 18 Mar 2016 19:18:11 +0000 (12:18 -0700)]
i40e: Disable link polling

Orabug: 23176970

Periodic link polling was added when the link events were found not to be
trustworthy.  This was the case early on, but was likely because the link
event mask was being used incorrectly.  As this has been fixed in recent
code, we can disable the link polling to lessen the AQ traffic.

Change-ID: Id890b5ee3c2d04381fc76ffa434777644f5d8eb0
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8c806b676d21a49628250731f4e30a8a071d080c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add longer wait after remove module
Mitch Williams [Fri, 18 Mar 2016 19:18:10 +0000 (12:18 -0700)]
i40evf: Add longer wait after remove module

Orabug: 23176970

Upon module remove, wait a little longer after requesting a reset before
checking to see if the firmware responded. This change prevents double
resets when the firmware is busy.

Change-ID: Ieedc988ee82fac1f32a074bf4d9e4dba426bfa58
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 22ead37f8af83b4fa32c15cc21d3541e74661339)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Make VF resets more reliable
Mitch Williams [Fri, 18 Mar 2016 19:18:09 +0000 (12:18 -0700)]
i40e: Make VF resets more reliable

Orabug: 23176970

Clear the VFLR bit immediately after triggering a reset instead of
waiting until after cleanup is complete. Make sure to trigger a reset
every time, not just if the PF is up.

These changes fix a problem where VF resets would get lost by the PF,
preventing the VF driver from initializing.

Change-ID: I5945cf2884095b7b0554867c64df8617e71d9d29
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7369ca8745499d001663e1dccf15064a3eb34b4d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add new device ID for X722
Catherine Sullivan [Fri, 18 Mar 2016 19:18:08 +0000 (12:18 -0700)]
i40e: Add new device ID for X722

Orabug: 23176970

The new device ID is 0x37D3 and it should follow the same flows and
branding string as for 0x37D0.

Change-ID: Ia5ad4a1910268c4666a3fd46a7afffbec55b4fc2
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d6bf58c2e88f9e0cfc029c158e1182eb1f07d7eb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Fix VLAN features
Mitch Williams [Fri, 18 Mar 2016 19:18:07 +0000 (12:18 -0700)]
i40evf: Fix VLAN features

Orabug: 23176970

Users of ethtool were being given the mistaken impression that this
driver was able to change its VLAN tagging features, and were
disappointed that this was not actually the case. Implement
ndo_fix_features method so that we can adjust these flags as needed to
avoid false impressions.

Change-ID: I08584f103a4fa73d6a4128d472e4ef44dcfda57f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c4445aedfe092907c2e792ff76ed4338d9a1cd52)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove unused variable
Mitch Williams [Fri, 18 Mar 2016 19:18:06 +0000 (12:18 -0700)]
i40e: Remove unused variable

Orabug: 23176970

This variable is vestigial, a remnant of the primordial code from which
this driver spawned. We can safely remove it.

Change-ID: I24e0fe338e7c7c50d27dc5515564f33caefbb93a
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 442b25e455f5e693c23f9d3a32b208ca9ab25cf0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices
Anjali Singhai Jain [Fri, 18 Mar 2016 19:18:05 +0000 (12:18 -0700)]
i40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices

Orabug: 23176970

This patch enables the Capability for XL710/X710 devices with FW API
version higher than 1.4 to do geneve Rx offload.

Change-ID: I9a8f87772c48d7d67dc85e3701d2e0b845034c0b
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3845ccea34df30680b5be7ec119f5c74ab57fdc0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove redundant check on vsi->active_vlans
Colin King [Sat, 13 Feb 2016 23:57:16 +0000 (23:57 +0000)]
i40e: remove redundant check on vsi->active_vlans

Orabug: 23176970

active_vlans is an unsigned long array, hence a null check on this
array is superfluous and can be removed.

Detected with static analysis by smatch:

drivers/net/ethernet/intel/i40e/i40e_debugfs.c:386
  i40e_dbg_dump_vsi_seid() warn: this array is probably
  non-NULL. 'vsi->active_vlans'

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit afb8ece4326f2151771f4c40b8d9f799cee5ae6e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump patch from 1.4.25 to 1.5.1
Catherine Sullivan [Thu, 10 Mar 2016 22:59:51 +0000 (14:59 -0800)]
i40e/i40evf: Bump patch from 1.4.25 to 1.5.1

Orabug: 23176970

Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 50f26a507664499ccef017607a29cc1456695343)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change comment to reflect correct function name
Mitch Williams [Thu, 10 Mar 2016 22:59:50 +0000 (14:59 -0800)]
i40e: Change comment to reflect correct function name

Orabug: 23176970

Minor correction in the comment to reflect the correct function name

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 55f7d7233bd15c8a3fcf7051c681b05de5980a18)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add additional check for reset
Mitch Williams [Thu, 10 Mar 2016 22:59:49 +0000 (14:59 -0800)]
i40evf: Add additional check for reset

Orabug: 23176970

If the driver happens to read a register during the time in which the
device is undergoing reset, it will receive a value of 0xdeadbeef
instead of a valid value. Unfortunately, the driver may misinterpret
this as a valid value, especially if it's just looking for individual
bits.

Add an explicit check for this value when we are looking for admin queue
errors, and trigger reset recovery if we find it.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 19b73d8efaa459a66665b5e0a3e7acedd05f4901)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change unknown event error msg to ignore message
Shannon Nelson [Thu, 10 Mar 2016 22:59:48 +0000 (14:59 -0800)]
i40e: Change unknown event error msg to ignore message

Orabug: 23176970

There's no real error in an unknown event from the Firmware, we're just
posting a useful FYI notice, so this patch simply removes the "Error" word.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 56e5ca688f3d334ddc2acab27cb7efa83b238557)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Added code to prevent double resets
Mitch Williams [Thu, 10 Mar 2016 22:59:47 +0000 (14:59 -0800)]
i40e: Added code to prevent double resets

Orabug: 23176970

Clear the VFLR bit after reset processing, instead of before. This
prevents double resets on VF init.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7e5a313ed9b18ba9f35df2523eb9e386a195a2c4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Notify VFs of all resets
Mitch Williams [Thu, 10 Mar 2016 22:59:46 +0000 (14:59 -0800)]
i40e: Notify VFs of all resets

Orabug: 23176970

Notify VFs in the reset interrupt handler, instead of the actual
reset initiation code. This allows the VFs to get properly notified for
all resets, including resets initiated by different PFs on the same
physical device.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d3ce57344100023faa8f514eb66dfb110b53629c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove timer and task only if created
Shannon Nelson [Thu, 10 Mar 2016 22:59:45 +0000 (14:59 -0800)]
i40e: Remove timer and task only if created

Orabug: 23176970

In some error scenarios, we may find ourselves trying to remove a
non-existent timer or worktask.  This causes the kernel some bit
of consternation, so don't do it.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c99abb4cb8227bf8172c085213c91bf155c6618a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Assure that adminq is alive in debug mode
Shannon Nelson [Thu, 10 Mar 2016 22:59:44 +0000 (14:59 -0800)]
i40e: Assure that adminq is alive in debug mode

Orabug: 23176970

When dropping into debug mode in a failed probe, make sure that
the AdminQ is left alive for possible hand debug of driver and
firmware states.

Move the mutex_init calls earlier in probe so that if init fails,
the admin queue interface is still available for debugging purposes.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit de03d2b0ef6520cf9da2e429cd7afb534782b737)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove MSIx only if created
Shannon Nelson [Thu, 10 Mar 2016 22:59:43 +0000 (14:59 -0800)]
i40e: Remove MSIx only if created

Orabug: 23176970

When cleaning up the interrupt handling, clean up the IRQs only if
we actually got them set up.  There are a couple of error recovery
paths that were violating this and causing the kernel a bit of
indigestion.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Reviewed-by: Williams, Mitch A <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 692783980ad6163e8586baa36c066cd0d22fc7ce)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix up return code
Jesse Brandeburg [Thu, 10 Mar 2016 22:59:42 +0000 (14:59 -0800)]
i40e: Fix up return code

Orabug: 23176970

The i40e_common.c typically uses i40e_status as a return code,
but got missed this one case.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 618290262e960469758d4ab67457fcb2ea356d51)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Save off VSI resource count when updating VSI
Kevin Scott [Thu, 10 Mar 2016 22:59:41 +0000 (14:59 -0800)]
i40e: Save off VSI resource count when updating VSI

Orabug: 23176970

When updating a VSI, save off the number of allocated and unallocated
VSIs as we do when adding a VSI.

Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b6caccaccf749dddd296f3056111d6c4b94500c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Remove I40E_MAX_USER_PRIORITY define
Catherine Sullivan [Thu, 10 Mar 2016 22:59:40 +0000 (14:59 -0800)]
i40e/i40evf: Remove I40E_MAX_USER_PRIORITY define

Orabug: 23176970

This patch removes the duplicate definition of I40E_MAX_USER_PRIORITY
in i40e.h that is not needed.

Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b7c359376429953dc1672224dbc9845eadf2a29c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix casting in transmit code
Jesse Brandeburg [Thu, 10 Mar 2016 22:59:39 +0000 (14:59 -0800)]
i40e/i40evf: Fix casting in transmit code

Orabug: 23176970

Simple cast to fix a sparse warning.

Fixes: commit 5453205cd097 ("i40e/i40evf: Enable support for
SKB_GSO_UDP_TUNNEL_CSUM")

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4ea623922d1d73c162da53e02cce1d0d3fd55893)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix handling of boolean logic in polling routines
Alexander Duyck [Mon, 7 Mar 2016 17:29:57 +0000 (09:29 -0800)]
i40e/i40evf: Fix handling of boolean logic in polling routines

Orabug: 23176970

In the polling routines for i40e and i40evf we were using bitwise operators
to avoid the side effects of the logical operators, specifically the fact
that if the first case is true with "||" we skip the second case, or if it
is false with "&&" we skip the second case.  This fixes an earlier patch
that converted the bitwise operators over to the logical operators and
instead replaces the entire thing with just an if statement since it should
be more readable what we are trying to do this way.

Fixes: 1a36d7fadd14 ("i40e/i40evf: use logical operators, not bitwise")
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f2edaaaa392bc21c24f532ea9bcc952a54a22367)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

9 years agoi40evf: remove dead code
Alan Cox [Wed, 2 Mar 2016 00:02:15 +0000 (16:02 -0800)]
i40evf: remove dead code

Orabug: 23176970

The only error case is when the malloc fails, in which case the clean up
loop does nothing at all, so remove it

Signed-off-by: Alan Cox <alan@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 311f23e9a4314f62fed6c13e112c998b07e37e63)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Allow up to 12K bytes of data per Tx descriptor instead of 8K
Alexander Duyck [Fri, 19 Feb 2016 20:17:08 +0000 (12:17 -0800)]
i40e/i40evf: Allow up to 12K bytes of data per Tx descriptor instead of 8K

Orabug: 23176970

From what I can tell the practical limitation on the size of the Tx data
buffer is the fact that the Tx descriptor is limited to 14 bits.  As such
we cannot use 16K as is typically used on the other Intel drivers.  However
artificially limiting ourselves to 8K can be expensive as this means that
we will consume up to 10 descriptors (1 context, 1 for header, and 9 for
payload, non-8K aligned) in a single send.

I propose that we can reduce this by increasing the maximum data for a 4K
aligned block to 12K.  We can reduce the descriptors used for a 32K aligned
block by 1 by increasing the size like this.  In addition we still have the
4K - 1 of space that is still unused.  We can use this as a bit of extra
padding when dealing with data that is not aligned to 4K.

By aligning the descriptors after the first to 4K we can improve the
efficiency of PCIe accesses as we can avoid using byte enables and can fetch
full TLP transactions after the first fetch of the buffer.  This helps to
improve PCIe efficiency.  Below is the results of testing before and after
with this patch:

Recv   Send   Send                         Utilization      Service Demand
Socket Socket Message  Elapsed             Send     Recv    Send    Recv
Size   Size   Size     Time    Throughput  local    remote  local   remote
bytes  bytes  bytes    secs.   10^6bits/s  % S      % U     us/KB   us/KB
Before:
87380  16384  16384    10.00     33682.24  20.27    -1.00   0.592   -1.00
After:
87380  16384  16384    10.00     34204.08  20.54    -1.00   0.590   -1.00

So the net result of this patch is that we have a small gain in throughput
due to a reduction in overhead for putting together the frame.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5c4654daf2e2f25dfbd7fa572c59937ea6d4198b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: call ndo_stop() instead of dev_close() when running offline selftest
Stefan Assmann [Wed, 3 Feb 2016 08:20:47 +0000 (09:20 +0100)]
i40e: call ndo_stop() instead of dev_close() when running offline selftest

Orabug: 23176970

Calling dev_close() causes IFF_UP to be cleared which will remove the
interfaces routes and some addresses. That's probably not what the user
intended when running the offline selftest. Besides this does not happen
if the interface is brought down before the test, so the current
behaviour is inconsistent.
Instead call the net_device_ops ndo_stop function directly and avoid
touching IFF_UP at all.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 08ca38742b63ae3825096e943de371a3b372c4a0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h

9 years agoi40e/i40evf: Limit TSO to 7 descriptors for payload instead of 8 per packet
Alexander Duyck [Wed, 30 Mar 2016 23:15:37 +0000 (16:15 -0700)]
i40e/i40evf: Limit TSO to 7 descriptors for payload instead of 8 per packet

Orabug: 23176970

This patch addresses a bug introduced based on my interpretation of the
XL710 datasheet.  Specifically section 8.4.1 states that "A single transmit
packet may span up to 8 buffers (up to 8 data descriptors per packet
including both the header and payload buffers)."  It then later goes on to
say that each segment for a TSO obeys the previous rule, however it then
refers to TSO header and the segment payload buffers.

I believe the actual limit for fragments with TSO and a skbuff that has
payload data in the header portion of the buffer is actually only 7
fragments as the skb->data portion counts as 2 buffers, one for the TSO
header, and one for a segment payload buffer.

Fixes: 2d37490b82af ("i40e/i40evf: Rewrite logic for 8 descriptor per packet check")
Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3f3f7cb875c0f621485644d4fd7453b0d37f00e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix errant PCIe bandwidth message
Jesse Brandeburg [Mon, 29 Feb 2016 19:00:24 +0000 (11:00 -0800)]
i40e: fix errant PCIe bandwidth message

Orabug: 23176970

There was an error introduced with commit 3fced535079a ("i40e: X722 is
on the IOSF bus and does not report the PCI bus info"), where code was
added but the enabling flag is never set.

CC: Anjali Singhai Jain <anjali.singhai@intel.com>
CC: Stefan Assman <sassman@redhat.com>
Fixes: 3fced535079a ("i40e: X722 is on the IOSF bus ...")
Reported-by: Steve Best <sbest@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8e2cc0e67f4aa33931cd15a553938163a19dcab3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for client interface for IWARP driver
Anjali Singhai Jain [Wed, 20 Jan 2016 19:40:01 +0000 (13:40 -0600)]
i40e: Add support for client interface for IWARP driver

Orabug: 23176970

This patch adds a Client interface for i40iw driver
support. Also expands the Virtchannel to support messages
from i40evf driver on behalf of i40iwvf driver.

This client API is used by the i40iw and i40iwvf driver
to access the core driver resources brokered by the i40e driver.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit e3219ce6a775468368fb270fae3eb82a6787b436)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoRevert "IPoIB: Protect tx_outstanding from parallel access"
Wengang Wang [Tue, 5 Jul 2016 20:48:43 +0000 (13:48 -0700)]
Revert "IPoIB: Protect tx_outstanding from parallel access"

This reverts commit 1cb6be04345014198fecaee2bc8edee8665b610e.

Orabug: 23480903 (uek4)
The above commit doesn't help fixing the issue, revert it.
tx_outstanding is protected by netif_tx_lock.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
9 years agoDriver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets
Shrikrishna Khare [Thu, 21 Apr 2016 01:12:29 +0000 (18:12 -0700)]
Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets

For IPv6, if the device indicates that the checksum is correct, set
CHECKSUM_UNNECESSARY.

Reported-by: Subbarao Narahari <snarahari@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: Jin Heo <heoj@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23472394
(cherry picked from commit f0d437809d23999cb25207cfbe80c61e5703fdc1)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
Conflict:

drivers/net/vmxnet3/vmxnet3_int.h

9 years agoppp: take reference on channels netns
Guillaume Nault [Wed, 23 Mar 2016 15:38:55 +0000 (16:38 +0100)]
ppp: take reference on channels netns

Let channels hold a reference on their network namespace.
Some channel types, like ppp_async and ppp_synctty, can have their
userspace controller running in a different namespace. Therefore they
can't rely on them to preclude their netns from being removed from
under them.

==================================================================
BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at
addr ffff880064e217e0
Read of size 8 by task syz-executor/11581
=============================================================================
BUG net_namespace (Not tainted): kasan: bad access detected
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906
[<      none      >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440
[<      none      >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469
[<     inline     >] slab_alloc_node kernel/mm/slub.c:2532
[<     inline     >] slab_alloc kernel/mm/slub.c:2574
[<      none      >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579
[<     inline     >] kmem_cache_zalloc kernel/include/linux/slab.h:597
[<     inline     >] net_alloc kernel/net/core/net_namespace.c:325
[<      none      >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360
[<      none      >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95
[<      none      >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150
[<      none      >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451
[<     inline     >] copy_process kernel/kernel/fork.c:1274
[<      none      >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723
[<     inline     >] SYSC_clone kernel/kernel/fork.c:1832
[<      none      >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826
[<      none      >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185

INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631
[<      none      >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650
[<     inline     >] slab_free kernel/mm/slub.c:2805
[<      none      >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814
[<     inline     >] net_free kernel/net/core/net_namespace.c:341
[<      none      >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348
[<      none      >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448
[<      none      >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036
[<      none      >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170
[<      none      >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303
[<      none      >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468
INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000
flags=0x5fffc0000004080
INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200

CPU: 1 PID: 11581 Comm: syz-executor Tainted: G    B           4.4.0+
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
 00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300
 ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054
 ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000
Call Trace:
 [<     inline     >] __dump_stack kernel/lib/dump_stack.c:15
 [<ffffffff8292049d>] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50
 [<ffffffff816f2054>] print_trailer+0xf4/0x150 kernel/mm/slub.c:654
 [<ffffffff816f875f>] object_err+0x2f/0x40 kernel/mm/slub.c:661
 [<     inline     >] print_address_description kernel/mm/kasan/report.c:138
 [<ffffffff816fb0c5>] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236
 [<     inline     >] kasan_report kernel/mm/kasan/report.c:259
 [<ffffffff816fb4de>] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280
 [<     inline     >] ? ppp_pernet kernel/include/linux/compiler.h:218
 [<ffffffff83ad71b2>] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<     inline     >] ppp_pernet kernel/include/linux/compiler.h:218
 [<ffffffff83ad71b2>] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<     inline     >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293
 [<ffffffff83ad6f26>] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
 [<ffffffff83ae18f3>] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241
 [<ffffffff83ae1850>] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000
 [<ffffffff82c33239>] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478
 [<ffffffff82c332c0>] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744
 [<ffffffff82c34943>] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772
 [<ffffffff82c1ef21>] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901
 [<ffffffff82c1e460>] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688
 [<ffffffff8174de36>] __fput+0x236/0x780 kernel/fs/file_table.c:208
 [<ffffffff8174e405>] ____fput+0x15/0x20 kernel/fs/file_table.c:244
 [<ffffffff813595ab>] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115
 [<     inline     >] exit_task_work kernel/include/linux/task_work.h:21
 [<ffffffff81307105>] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750
 [<ffffffff813fdd20>] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123
 [<ffffffff81306850>] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357
 [<ffffffff813215e6>] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550
 [<ffffffff8132067b>] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145
 [<ffffffff81309628>] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880
 [<ffffffff8132b9d4>] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307
 [<     inline     >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113
 [<ffffffff8151d355>] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158
 [<ffffffff8115f7d3>] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712
 [<ffffffff8151d2a0>] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655
 [<ffffffff8115f750>] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165
 [<ffffffff81380864>] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692
 [<     inline     >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099
 [<ffffffff81380560>] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678
 [<     inline     >] ? context_switch kernel/kernel/sched/core.c:2807
 [<ffffffff85d794e9>] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283
 [<ffffffff81003901>] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247
 [<     inline     >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282
 [<ffffffff810062ef>] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344
 [<ffffffff85d88022>] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281
Memory state around the buggy address:
 ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2")
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1f461dcdd296eecedaffffc6bae2bfa90bd7eb89)

Orabug: 23276689
CVE: CVE-2016-4805

Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnxt_en: Support new ETHTOOL_{G|S}LINKSETTINGS API.
Michael Chan [Wed, 22 Jun 2016 21:40:06 +0000 (17:40 -0400)]
bnxt_en: Support new ETHTOOL_{G|S}LINKSETTINGS API.

Orabug: 23221795

To fully support 25G and 50G link settings.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 00c04a928572991d30b2473a7e992c1be8e646f3)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Don't allow autoneg on cards that don't support it.
Michael Chan [Mon, 13 Jun 2016 06:25:37 +0000 (02:25 -0400)]
bnxt_en: Don't allow autoneg on cards that don't support it.

Orabug: 23221795

Some cards do not support autoneg.  The current code does not prevent the
user from enabling autoneg with ethtool on such cards, causing confusion.
Firmware provides the autoneg capability information and we just need to
store it in the support_auto_speeds field in bnxt_link_info struct.
The ethtool set_settings() call will check this field before proceeding
with autoneg.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 93ed8117336485af2cedb069d28f3d4270fb90a1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add BCM5731X and BCM5741X device IDs.
Michael Chan [Mon, 13 Jun 2016 06:25:36 +0000 (02:25 -0400)]
bnxt_en: Add BCM5731X and BCM5741X device IDs.

Orabug: 23221795

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b24eb6ae7058ca1a42b0532489e5f5796c107d65)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Add GRO logic for BCM5731X chips.
Michael Chan [Mon, 13 Jun 2016 06:25:35 +0000 (02:25 -0400)]
bnxt_en: Add GRO logic for BCM5731X chips.

Orabug: 23221795

Add bnxt_gro_func_5731x() to handle GRO packets for this chip.  The
completion structures used in the new chip have new data to help determine
the header offsets.  The offsets can be off by 4 if the packet is an
internal loopback packet (e.g. from one VF to another VF).  Some additional
logic is added to adjust the offsets if it is a loopback packet.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 94758f8de037cf5c62eb56287f5d5e937cda8c9b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agobnxt_en: Refactor bnxt_gro_skb().
Michael Chan [Mon, 13 Jun 2016 06:25:34 +0000 (02:25 -0400)]
bnxt_en: Refactor bnxt_gro_skb().

Orabug: 23221795

Newer chips require different logic to handle GRO packets.  So refactor
the code so that we can call different functions depending on the chip.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 309369c9b3f6a8665e581d9014f222b602f6845a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>