]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agoi40e: add a little more to an NVM update debug message
Shannon Nelson [Wed, 23 Dec 2015 20:05:51 +0000 (12:05 -0800)]
i40e: add a little more to an NVM update debug message

Orabug: 22342532

Add a little more detail to an NVM update debug message in order to
see the full ethtool request data.

Change-ID: Iab10437cb32d6fddc67ee347e7c0b42511e152cd
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 1d73b2db4b9f4c12d42451efd09887ff7b37b02d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: refactor DCB function
Jesse Brandeburg [Wed, 23 Dec 2015 20:05:50 +0000 (12:05 -0800)]
i40e: refactor DCB function

Orabug: 22342532

This is a simple refactor suggested by the community
to change a multi-level if statement into a switch.

Change-ID: I831cf3c40426022220aa9b43990022d22dfd50db
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.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 dd54a1ada9cea9275c53c89ad869214be6e9731a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add 20G speed for Tx bandwidth calculations
Mitch Williams [Wed, 23 Dec 2015 20:05:49 +0000 (12:05 -0800)]
i40e: add 20G speed for Tx bandwidth calculations

Orabug: 22342532

When calculating TX bandwidth for VFs, we need to know the link speed to
make sure we don't allocate more bandwidth than is available. Add 20G
link speed to the switch statement so we can support devices that link
at that speed.

Change-ID: I5409f6139d549e5832777db9c22ca0664e0c5f8b
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 07f169c3e9df898afe951d74734a0e54ac89ee9d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add counter for arq overflows
Mitch Williams [Wed, 23 Dec 2015 20:05:48 +0000 (12:05 -0800)]
i40e: add counter for arq overflows

Orabug: 22342532

Sometimes, ARQ overflows are a big deal and tell us that the
firmware/hardware/driver/something is having problems. But normally
they're no big deal. To assist in assessing this, add a counter to
our Ethtool stats. A handful of ARQ overflows during VF init is no
problem. A large, ever-growing number indicates that Something Bad is
happening.

Change-ID: Ie5348bfbc8a54a890559cb00279c28d976a55096
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 1d0a4ada8401c73b360fc8492064a1107fca019b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix write-back-on-itr to work with legacy itr
Anjali Singhai Jain [Wed, 23 Dec 2015 20:05:47 +0000 (12:05 -0800)]
i40e: fix write-back-on-itr to work with legacy itr

Orabug: 22342532

We were not doing write-back on interrupt throttle for Legacy case in X722.
This patch fixes that, so we do WB_ON_ITR for Legacy as well. Plus the issue
that we should still be setting NO_ITR if we are touching the DYN_CTLN register
since we do not want to change ITR setting here.

Change-ID: I5db8491ee1544118a389db839cecc93e1bbc480e
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 a3d772a3925d85721ad8518db14603fb1cd99295)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Store lan_vsi_idx and lan_vsi_id in the right size
Pandi Maharajan [Wed, 23 Dec 2015 20:05:46 +0000 (12:05 -0800)]
i40e: Store lan_vsi_idx and lan_vsi_id in the right size

Orabug: 22342532

lan_vsi_idx and lan_vsi_id are assigned to u16 data sized variables but
declared in u8. This patch fixes the width of the datatype.

Change-ID: If4bcbcc7d32f2b287c51cb33d17879691258dce2
Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 071c859b878a05c3f603669bfda2e5b4332dd695)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Bump AQ minor version to 1.5 for new FW features
Shannon Nelson [Wed, 23 Dec 2015 20:05:45 +0000 (12:05 -0800)]
i40e: Bump AQ minor version to 1.5 for new FW features

Orabug: 22342532

Bump AQ minor version to 1.5 for new FW features.

Change-ID: I5a790f7f519a2a8921aaa1c5663727dd1897ffec
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 97b884fecd6186ac1bcc932c453dce305d81040b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ thermal sensor control struct
Shannon Nelson [Wed, 23 Dec 2015 20:05:44 +0000 (12:05 -0800)]
i40e: AQ thermal sensor control struct

Orabug: 22342532

Add the new AQ command and struct for managing a thermal sensor.

Change-ID: I6f5631839a0f3dca352a6c222f1269a960e2310a
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 6774faf96437e8192e4ee2d16f1399ec9f842b80)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ Add VXLAN-GPE tunnel type
Shannon Nelson [Wed, 23 Dec 2015 20:05:43 +0000 (12:05 -0800)]
i40e: AQ Add VXLAN-GPE tunnel type

Orabug: 22342532

Add the new Cisco VXLAN-GPE cloud tunnel type for the Add Cloud Filter
and UDP tunnel AQ commands.

Change-ID: I2c093c7d79726c7fca08a36e5c63581a905da3d2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 2fcc1a401eb06ff41cd551672ea588c6efd8c4e6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ Add set_switch_config
Shannon Nelson [Wed, 23 Dec 2015 20:05:42 +0000 (12:05 -0800)]
i40e: AQ Add set_switch_config

Orabug: 22342532

Add the new Set Switch Config AdminQ command, and mark the L2 Filter
bit as deprecated in the Add VEB command.

Change-ID: I5b24790f14c56f0ddf3f70df1e486844146b039f
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 fa5623a6e6807baa7f3b8e65896199e23e3f939e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ Shared resource flags
Shannon Nelson [Wed, 23 Dec 2015 20:05:41 +0000 (12:05 -0800)]
i40e: AQ Shared resource flags

Orabug: 22342532

Add flags to MAC allocation requests to signify that the MAC VLAN filters
should come from the shared resource pool rather than the dedicated PF
resource pools.

Change-ID: I4c2da64c01856edcb0982bc4aab75c5a91047a7a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 906807793092f7d659a8933ddd7b9fa97cd6cf39)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add 100Mb ethtool reporting
Catherine Sullivan [Tue, 22 Dec 2015 22:25:14 +0000 (14:25 -0800)]
i40e: add 100Mb ethtool reporting

Orabug: 22342532

Add some missing reporting/advertisement of 100Mb capability
for adapters that support it.

Change-ID: I8b8523fbdc99517bec29d90c71b3744db11542ac
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 f8db54cc4df7b065b0028f8c919e2f47983f2043)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ Add external power class to get link status
Shannon Nelson [Tue, 22 Dec 2015 22:25:13 +0000 (14:25 -0800)]
i40e: AQ Add external power class to get link status

Orabug: 22342532

Add the new External Device Power Ability field to the get_link_status data
structure, using space from the reserved field at the end of the struct.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 5eb772f7ca86267565ef40c7b987c88405689b96)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ Geneve cloud tunnel type
Shannon Nelson [Tue, 22 Dec 2015 22:25:12 +0000 (14:25 -0800)]
i40e: AQ Geneve cloud tunnel type

Orabug: 22342532

Fix the name of the new cloud tunnel type from the place-holder NGE
name to the official Geneve.  Also fix the spelling of the VXLAN type.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
(cherry picked from commit 5926425368ba8f1b186d45d96020c288e3bb9b8d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: AQ Add Run PHY Activity struct
Shannon Nelson [Tue, 22 Dec 2015 22:25:11 +0000 (14:25 -0800)]
i40e: AQ Add Run PHY Activity struct

Orabug: 22342532

Add the AQ opcode and struct definitions for the Run PHY Activity command

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 5394f02f0c0553f97bb4c5596a34c9a7333c032b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Limit DCB FW version checks to X710/XL710 devices
Greg Bowers [Tue, 22 Dec 2015 22:25:10 +0000 (14:25 -0800)]
i40e: Limit DCB FW version checks to X710/XL710 devices

Orabug: 22342532

X710/XL710 devices require FW version checks to properly handle DCB
configurations from the FW.  Newer devices do not, so limit these checks
to X710/XL710.

Signed-off-by: Greg Bowers <gregory.j.bowers@intel.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 6dfae3892473e91080accdb2da8476481393f769)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add new proxy-wol bit for X722
Shannon Nelson [Tue, 22 Dec 2015 22:25:09 +0000 (14:25 -0800)]
i40e: add new proxy-wol bit for X722

Orabug: 22342532

Add the new proxy-wake-on-lan capability bit available with the
new X722 device.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 4ba40bcea7046a1fa9b57a8cb4bcb8776e86e7ed)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Use private workqueue
Jesse Brandeburg [Tue, 22 Dec 2015 22:25:08 +0000 (14:25 -0800)]
i40e/i40evf: Use private workqueue

Orabug: 22342532

As done per ixgbe, use a private workqueue to avoid blocking the
system workqueue.  This avoids some strange side effects when
some other entity is depending on the system work queue.

Change-ID: Ic8ba08f5b03696cf638b21afd25fbae7738d55ee
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 2803b16c10ea7eec170c485388f5f26ae30e92fe)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: add new write-back mode
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:07 +0000 (14:25 -0800)]
i40evf: add new write-back mode

Orabug: 22342532

Add write-back on interrupt throttle rate timer expiration support
for the i40evf driver, when running on X722 devices.

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 f6d83d1376f496e6218080dd6eb663830672813f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix for UDP/TCP RSS for X722
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:05 +0000 (14:25 -0800)]
i40e/i40evf: Fix for UDP/TCP RSS for X722

Orabug: 22342532

The PCTYPES for the X710 and X722 families are different. This patch
makes adjustments for that.

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 3d0da5b78262c1f86294419c7a70e4c837aca159)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Extend ethtool RSS hooks for X722
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:04 +0000 (14:25 -0800)]
i40e: Extend ethtool RSS hooks for X722

Orabug: 22342532

This patch adds another way to access the RSS keys and lut using the AQ
for X722 devices.

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 95a73780921aecc5e66022e000fcf8aeecfb53cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add new device IDs for X722
Anjali Singhai Jain [Tue, 22 Dec 2015 22:25:03 +0000 (14:25 -0800)]
i40e: add new device IDs for X722

Orabug: 22342532

Add the KX and QSFP device IDs for X722.

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 35dae51de3e99db10f355642f5fc67719b93f558)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: bump version to 1.4.10
Catherine Sullivan [Thu, 10 Dec 2015 19:38:51 +0000 (11:38 -0800)]
i40e: bump version to 1.4.10

Orabug: 22342532

Bump.

Change-ID: Ic9a495feb9ab0606f953c3848b0acf67169d3930
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 4f9e697ebbf40ba482ad0481da1e978440f2a53e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: update features with right offload
Jesse Brandeburg [Thu, 10 Dec 2015 19:38:50 +0000 (11:38 -0800)]
i40e: update features with right offload

Orabug: 22342532

Synchronize code bases and add SCTP offload support.

Change-ID: I9f99071f7176225479026930c387bf681a47494e
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 5afdaaa0555257f3c42b141908567d40aca0e1d1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoi40e: Cleanup the code with respect to restarting autoneg
Anjali Singhai Jain [Wed, 9 Dec 2015 23:50:31 +0000 (15:50 -0800)]
i40e: Cleanup the code with respect to restarting autoneg

Orabug: 22342532

The restart-autoneg work around does not apply to X722.
Added a flag to set it only for the right MAC and right FW version
where the work around should be applied.

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

9 years agoi40evf: null out ring pointers on free
Mitch Williams [Wed, 9 Dec 2015 23:50:30 +0000 (15:50 -0800)]
i40evf: null out ring pointers on free

Orabug: 22342532

Since we check these ring pointers to make sure we don't double-allocate
or double-free the rings, we had better null them out after we free
them. In very rare cases this can cause a panic if the driver is removed
during reset recovery.

Change-ID: Ib06eb4910a3058275c8f7ec5ef7f45baa4674f96
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 10311540fab76c7e5530bf5f0267a3d1b8d5818e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: define function capabilities in only one place
Shannon Nelson [Thu, 10 Dec 2015 19:38:49 +0000 (11:38 -0800)]
i40e: define function capabilities in only one place

Orabug: 22342532

The device capabilities were defined in two places, and neither had all
the definitions.  It really belongs with the AQ API definition, so this
patch removes the other set of definitions and fills out the missing item.

Change-ID: I273ba7d79a476cd11d2e0ca5825fec1716740de2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-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 406e734aa893fa5841e67de6d4f688ba70a82e4f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: allow channel bonding of VFs
Mitch Williams [Wed, 9 Dec 2015 23:50:27 +0000 (15:50 -0800)]
i40evf: allow channel bonding of VFs

Orabug: 22342532

In some modes, bonding would not enslave VF interfaces. This is due to
bonding calling change_mtu and the immediately calling open. Because of
the asynchronous nature of the admin queue mechanism, the VF returns
-EBUSY to the open call, because it knows the previous operation hasn't
finished yet. This causes bonding to fail with a less-than-useful error
message.

To fix this, remove the check for pending operations at the beginning of
open. But this introduces a new bug where the driver will panic on a
quick close/open cycle. To fix that, we add a new driver state,
__I40EVF_DOWN_PENDING, that the driver enters when down is called. The
driver finally transitions to a fully DOWN state when it receives
confirmation from the PF driver that all the queues are disabled. This
allows open to complete even if there is a pending mtu change, and
bonding is finally happy.

Change-ID: I06f4c7e435d5bacbfceaa7c3f209e0ff04be21cc
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 209dc4daf23f92b3e0bc6d602411506c4083e421)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Replace X722 mac check in ethtool get_settings
Catherine Sullivan [Wed, 9 Dec 2015 23:50:25 +0000 (15:50 -0800)]
i40e: Replace X722 mac check in ethtool get_settings

Orabug: 22342532

100M SGMII is only supported on X722.  Replace the mac check with
a feature flag check that is only set for the X722 device.

Change-ID: I53452d9af6af8cd9dca8500215fbc6ce93418f52
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 48b1804ee3cdad7bf115666eb35edf12a734710f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h

9 years agoi40e/i40evf: Fix RSS rx-flow-hash configuration through ethtool
Anjali Singhai Jain [Wed, 9 Dec 2015 23:50:24 +0000 (15:50 -0800)]
i40e/i40evf: Fix RSS rx-flow-hash configuration through ethtool

Orabug: 22342532

This patch fixes the Hash PCTYPE enable for X722 since it supports
a broader selection of PCTYPES for TCP and UDP.

This patch also fixes a bug in XL710, X710, X722 support for RSS,
as of now we cannot reduce the (4)tuple for RSS for TCP/IPv4/IPV6 or
UDP/IPv4/IPv6 packets since this requires a product feature change
that comes in a later release.

A VF should never be allowed to change the tuples for RSS for any
PCTYPE since that's a global setting for the device in case of i40e
devices.

Change-ID: I0ee7203c9b24813260f58f3220798bc9d9ac4a12
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 6e35c04cf633e55648acb9ccabff42aa37bd4044)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add mac_filter_element at the end of the list instead of HEAD
Kiran Patil [Wed, 9 Dec 2015 23:50:23 +0000 (15:50 -0800)]
i40e: Add mac_filter_element at the end of the list instead of HEAD

Orabug: 22342532

Add MAC filter element to the end of the list in the given order,
just to be tidy, and just in case there are ever any ordering issues in
the future.

Change-ID: Idc15276147593ea9393ac72c861f9c7905a791b4
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 04d5a21d62887b9bc5383fc68ab2756287da4532)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix build warnings
Eric Dumazet [Thu, 21 Jan 2016 03:53:02 +0000 (19:53 -0800)]
i40e: fix build warnings

Orabug: 22342532

Fixes following build warnings :

drivers/net/ethernet/intel/i40e/i40e_main.c:7057:13: warning:
'i40e_sync_udp_filters_subtask' defined but not used [-Wunused-function]
drivers/net/ethernet/intel/i40e/i40e_main.c:8524:13: warning:
'i40e_add_vxlan_port' defined but not used [-Wunused-function]
drivers/net/ethernet/intel/i40e/i40e_main.c:8569:13: warning:
'i40e_del_vxlan_port' defined but not used [-Wunused-function]
drivers/net/ethernet/intel/i40e/i40e_main.c:8604:13: warning:
'i40e_add_geneve_port' defined but not used [-Wunused-function]
drivers/net/ethernet/intel/i40e/i40e_main.c:8651:13: warning:
'i40e_del_geneve_port' defined but not used [-Wunused-function]

Fixes: 6a899024058d ("i40e: geneve tunnel offload support")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5cae7615b613381a04d3dd06b8237234cc3f7cc9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove forever unused ID
Jesse Brandeburg [Wed, 9 Dec 2015 23:50:22 +0000 (15:50 -0800)]
i40e: remove forever unused ID

Orabug: 22342532

Somehow an ID that has never been productized is in the
code.  There are no plans to use it, so just get
rid of it.

Change-ID: I59117d48ea9ee0360b0fe33833ac8092f8a24b4c
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 56028154caafab34063324916095618b2cd30c73)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix Rx hash reported to the stack by our driver
Anjali Singhai Jain [Wed, 9 Dec 2015 23:50:21 +0000 (15:50 -0800)]
i40e: Fix Rx hash reported to the stack by our driver

Orabug: 22342532

If the driver calls skb_set_hash even with a zero hash, that
indicates to the stack that the hash calculation is offloaded
in hardware. So the Stack doesn't do a SW hash which is required
for load balancing if the user decides to turn of rx-hashing
on our device.

This patch fixes the path so that we do not call skb_set_hash
if the feature is disabled.

Change-ID: Ic4debfa4ff91b5a72e447348a75768ed7a2d3e1b
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 857942fd1aa15edf7356a4a4bad5369c8e70a633)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: allow zero MAC address for VFs
Mitch Williams [Tue, 22 Dec 2015 23:34:43 +0000 (15:34 -0800)]
i40e: allow zero MAC address for VFs

Orabug: 22342532

Allow the user to specify a zero MAC address for VFs. This removes the
existing MAC address and allows the VF to use a random address. Libvirt
does this normally when removing a VF from a VM.

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 efd8e39acc51cafe7dbc656ba63eea9034238ee7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: change log messages and error returns
Mitch Williams [Tue, 22 Dec 2015 23:34:42 +0000 (15:34 -0800)]
i40e: change log messages and error returns

Orabug: 22342532

When VFs are being reset, there is a brief window of time when they
cannot be configured because they don't have a VSI to configure. If
a script is quick, it can fall through that window. To avoid
defenestration, log a useful error message and return -EAGAIN.

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 2d166c304065c57925278a69309f15a6a65eff97)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: avoid mutex re-init
Jesse Brandeburg [Wed, 18 Nov 2015 23:47:06 +0000 (15:47 -0800)]
i40e/i40evf: avoid mutex re-init

Orabug: 22342532

If the driver were to happen to have a mutex held while
the i40e_init_adminq call was called, the init_adminq might
inadvertently call mutex_init on a lock that was held
which is a violation of the calling semantics.

Fix this by avoiding adminq.c code allocating/freeing this memory, and
then do the same work only once in probe/remove.

Testing Hints (Required if no HSD): for VF, load i40evf in bare metal
and echo 32 > sriov_numvfs; echo 0 > sriov_numvfs in a loop.  Yes this
is a horrible thing to do.

Change-ID: Ida263c51b34e195252179e7e5e400d73a99be7a2
Reported-by: Stefan Assmann <sassmann@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 8ddb33268902c80ecd9a0e1bc766a2dc4bc9fede)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Call geneve_get_rx_port to get the existing Geneve ports
Singhai, Anjali [Mon, 14 Dec 2015 20:21:21 +0000 (12:21 -0800)]
i40e: Call geneve_get_rx_port to get the existing Geneve ports

Orabug: 22342532

This patch adds a call to geneve_get_rx_port in i40e so that when it
comes up it can learn about the existing geneve tunnels.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cd866606c91b1e99517fd866de0049276f011ea7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: geneve tunnel offload support
Singhai, Anjali [Thu, 18 Feb 2016 22:54:39 +0000 (17:54 -0500)]
i40e: geneve tunnel offload support

Orabug: 22342532

This patch adds driver hooks to implement ndo_ops to add/del
udp port in the HW to identify GENEVE tunnels.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: bring firmware API version inline with sourceforge
Brian Maly [Tue, 2 Feb 2016 17:13:52 +0000 (12:13 -0500)]
i40e: bring firmware API version inline with sourceforge

Orabug: 22342532

Firmware version should match sourceforge driver, otherwise firmware
version checks will fail with latest FVL5 firmware.

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: only report NVM image is newer than expected
Brian Maly [Tue, 2 Feb 2016 16:55:31 +0000 (11:55 -0500)]
i40e: only report NVM image is newer than expected

Orabug: 22342532

Only report NVM image is newer than expected as we only support
the driver version we ship with UEK.

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump i40e to 1.4.8 and i40evf to 1.4.4
Catherine Sullivan [Thu, 19 Nov 2015 19:34:25 +0000 (11:34 -0800)]
i40e/i40evf: Bump i40e to 1.4.8 and i40evf to 1.4.4

Orabug: 22342532

Bump.

Change-ID: I2b8976bde070244de144e2ed8990b083de39f332
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 c9c9f1ba75fa1260a9087ba229559175cd4a2b40)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: change version string generation
Mitch Williams [Thu, 19 Nov 2015 19:34:24 +0000 (11:34 -0800)]
i40evf: change version string generation

Orabug: 22342532

Generate version strings like the PF driver does. This gives us more
flexibility to add suffixes to the version string at build time.

Change-ID: I0a5ca0783dd8fb849516bfc1e37ea070127847bd
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 69ebe955be358fe8f8c73b3aa7395760f337845f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: clean whole mac filter list
Shannon Nelson [Thu, 19 Nov 2015 19:34:23 +0000 (11:34 -0800)]
i40e: clean whole mac filter list

Orabug: 22342532

Clean the whole mac filter list when resetting after an intermediate
add or delete push to the firmware.  The code had evolved from using
a list from the stack to a heap allocation, but the memset() didn't
follow the change correctly.  This now cleans the whole list rather
that just part of the first element.

Change-ID: I4cd03d5a103b7407dd8556a3a231e800f2d6f2d5
Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
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 f11999987bc0b5559ab56dedc6f4ca32fab5438a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add a new offload for RSS PCTYPE V2 for X722
Anjali Singhai Jain [Thu, 19 Nov 2015 19:34:22 +0000 (11:34 -0800)]
i40e/i40evf: Add a new offload for RSS PCTYPE V2 for X722

Orabug: 22342532

X722 supports Expanded version of TCP, UDP PCTYPES for RSS.
Add a Virtchnl offload to support this.

Without this patch with X722 devices, driver will set wrong PCTYPES
for VF and UDP flows will not fan out.

Change-ID: I04fe4988253b7cd108c9179a643c969764efcb76
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 b9eacec3e66cd7e3db11882474024d1586d1f832)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: hush little warnings
Mitch Williams [Thu, 19 Nov 2015 19:34:21 +0000 (11:34 -0800)]
i40e: hush little warnings

Orabug: 22342532

These messages seem big and scary, but they're really not. The driver
can fully recover from any of these. The overflow error in particular
can happen when enabling a bunch of VFs and the VF driver is not
blacklisted.

Since these messages are really for debugging purposes, reclassify
them as such.

Change-ID: I628d0f5e135e7063450ba05393a50b7af23aa6d7
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 75eb73c127beaccf1b2c825f5d583ebca17ab2ba)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Opcode and structures required by OEM Post Update AQ command and add new NVM...
Michal Kosiarz [Thu, 19 Nov 2015 19:34:20 +0000 (11:34 -0800)]
i40e: Opcode and structures required by OEM Post Update AQ command and add new NVM arq message

Orabug: 22342532

This is a part of implementation which contains data structures and
opcode for new AQ command. There's a new ARQ message that gets sent
near the end of the NVM update process that the driver should recognize
and ignore, rather than printing an Unknown Event error.

Change-ID: I04830a5bcae14823e16b9424cc4165e169336c1f
Signed-off-by: Michal Kosiarz <michal.kosiarz@intel.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 00ada50d8989ed14b160d831d25fe09bf9ea9115)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: use explicit cast from u16 to u8
Kamil Krawczyk [Thu, 19 Nov 2015 19:34:19 +0000 (11:34 -0800)]
i40e: use explicit cast from u16 to u8

Orabug: 22342532

Current implementation generates compilation warnings.

Change-ID: Icceefb50fe62aefaf90a64afb7192e08355a4ec5
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.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 6621e4b2518a2ea5e1f3aab041bfbb0e4fc91239)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: check rings before freeing resources
Mitch Williams [Thu, 19 Nov 2015 19:34:18 +0000 (11:34 -0800)]
i40evf: check rings before freeing resources

Orabug: 22342532

If the driver gets unloaded during reset recovery, it's possible
that it will attempt to free resources when they're already free.

Add a check to make sure that the Tx and Rx rings actually exist
before dereferencing them to free resources.

Change-ID: I4d2b7e9ede49f634d421a4c5deaa5446bc755eee
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 fdb47ae87af537b24977a03bc69cfe1c5c55ca62)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: don't add zero MAC filter
Mitch Williams [Thu, 19 Nov 2015 19:34:17 +0000 (11:34 -0800)]
i40e: don't add zero MAC filter

Orabug: 22342532

When VFs are created, the MAC address defaults to all zeros, indicating
to the VF driver that it should use a random MAC address. However, the
PF driver was incorrectly adding this zero MAC to the filter table,
along with the VF's randomly generated MAC address.

Check for a good address before adding the default filter. While we're
at it, make the error message a bit more useful.

Change-ID: Ia100947d68140e0f73a19ba755cbffc3e79a8fcf
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 b7b713a8eaf325607d37229f024ad0b9f3e7f320)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: properly delete VF MAC filters
Mitch Williams [Thu, 19 Nov 2015 19:34:16 +0000 (11:34 -0800)]
i40e: properly delete VF MAC filters

Orabug: 22342532

The virtual channel interface was using incorrect semantics to remove
MAC addresses, which would leave incorrect filters active when using
VLANs. To correct this, add a new function that unconditionally removes
MAC addresses from all VLANs, and call this function when the VF
requests a MAC filter removal.

Change-ID: I69826908ae4f6c847f5bf9b32f11faa760189c74
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 b36e9ab59b7e3a5b14bf88dc0536e6579db7b54d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: chomp the BIT(_ULL)
Jesse Brandeburg [Thu, 19 Nov 2015 19:34:14 +0000 (11:34 -0800)]
i40e: chomp the BIT(_ULL)

Orabug: 22342532

BIT_ULL was used on a u32 or less where it can simply be BIT. This
fixes some trivial static analyzer warnings. Chomp, chomp.

Tested with objdump of binary before and after, no changes to code.

Change-ID: I6245e9abd447192dbde1669c747aeb2878126c7d
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 75f5cea9ddef6a8f8cedb86c0ac8c696b258824d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoRevert "i40e: remove CONFIG_I40E_VXLAN"
Singhai, Anjali [Fri, 4 Dec 2015 07:49:31 +0000 (23:49 -0800)]
Revert "i40e: remove CONFIG_I40E_VXLAN"

Orabug: 22342532

This reverts commit 8fe269991aece394a7ed274f525d96c73f94109a.
The case where VXLAN is a module and i40e driver is inbuilt
will not be handled properly with this change since i40e
will have an undefined symbol vxlan_get_rx_port in it.

v2: Add a signed-off-by.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6633d3815c099a0aaf28e4853f7a8994331b8c05)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: trivial fixes
Jesse Brandeburg [Thu, 19 Nov 2015 01:35:42 +0000 (17:35 -0800)]
i40e: trivial fixes

Orabug: 22342532

1) remove duplicate include of tcp.h
2) put an ampersand at the end of a line instead of the beginning
3) remove a useless dev_info
4) match declaration of function to the implementation
5) repair incorrect comment
6) correct whitespace
7) remove unused define

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 4eeb1fff27f4578386955b0e88f4cffc3814df24)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump version to 1.4.7 for i40e and 1.4.3 for i40evf
Catherine Sullivan [Fri, 6 Nov 2015 23:26:12 +0000 (15:26 -0800)]
i40e/i40evf: Bump version to 1.4.7 for i40e and 1.4.3 for i40evf

Orabug: 22342532

Bump.

Change-ID: Id8c83c64c973349a722bab40d285ad8ded8c28f7
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 1e590660cb7ac675c735dd74d99dbca2103abf41)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: use logical operator
Mitch Williams [Fri, 6 Nov 2015 23:26:11 +0000 (15:26 -0800)]
i40e/i40evf: use logical operator

Orabug: 22342532

We shouldn't be using a bitwise operator here; it's not a bitwise
operation. Use a logical operator instead. Why doesn't c have a
logical-or-and-assign operator?

Change-ID: Id84f3ca884910bed7073c84b1e16a102e958d0de
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 44cdb791ae7bc40e0331b78a73992be44079a3ec)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix whitespace
Mitch Williams [Fri, 6 Nov 2015 23:26:10 +0000 (15:26 -0800)]
i40e: fix whitespace

Orabug: 22342532

Operators should have spaces around them.

Change-ID: I64735e9aa8618b9a5059a87ace1c999d6d3bfcfb
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 b82bc49ede1f012d37ba8777e8232cd7c01365cd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove separate functions gathering XOFF Rx stats
Neerav Parikh [Fri, 6 Nov 2015 23:26:09 +0000 (15:26 -0800)]
i40e: Remove separate functions gathering XOFF Rx stats

Orabug: 22342532

The separate functions to gather Flow control Rx XOFF stats was to
determine if the Tx for a queue was paused due to Link Flow Control(LFC)
or Priority Flow Control(PFC).

But, with recent change in the i40e driver the logic for checking th Tx
hang has been removed and these functions don't do anything meaningful.
Hence, there is no need to keep these separate functions to gather Rx
XOFF stats for LFC or PFC.

This patch removes these functions and moves the stat collection for
XOFF Rx to the i40e_update_pf_stats() that collects all the PF stats.

Change-ID: Iec1452dac3a6766f0d968e754cb407530d7c60cd
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 95db239f4fc664d9ce4ba9a6a3e87d2a3d856a23)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove CONFIG_I40E_VXLAN
Jesse Brandeburg [Fri, 6 Nov 2015 23:26:08 +0000 (15:26 -0800)]
i40e: remove CONFIG_I40E_VXLAN

Orabug: 22342532

Instead of having our own custom symbol, we can just rely
on whether or not the kernel has the feature enabled.

In this case use IS_ENABLED(CONFIG_VXLAN) in order to handle
built-in or module in the current BKM way.

Change-ID: I5890fbb518ff8ed6bb07c3362fb0a8a829f9b241
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 8fe269991aece394a7ed274f525d96c73f94109a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: use priv flags to control packet split
Jesse Brandeburg [Fri, 6 Nov 2015 23:26:07 +0000 (15:26 -0800)]
i40e: use priv flags to control packet split

Orabug: 22342532

Ethtool priv flags implementation to enable or disable packet split, which
is a hardware feature that inspects headers and will put headers in a
separate DMA buffer from the payload data.  The driver was automatically
choosing to enable packet split in some cases and this gives the user the
ability to turn it off/on explicitly.

to query state:
ethtool --show-priv-flags ethx

to enable:
ethtool --set-priv-flags ethx packet-split on
to disable:
ethtool --set-priv-flags ethx packet-split off

Why would anyone want this?
Because some environments benefit from header/data split in the receive
buffer, and the driver defaults to one or the other depending on
environment/kernel parameters.

Why didn't you implement a generic ethtool control for this feature?
Because Intel hardware is the only hardware that supports header/data
split.

Change-ID: I803121e1eecc9ccb2884031fd85dd1110b3af66d
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 827de39212298048e75309377c8262c4d7f2cb41)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: use correct types
Mitch Williams [Fri, 6 Nov 2015 23:26:06 +0000 (15:26 -0800)]
i40evf: use correct types

Orabug: 22342532

Don't use uint32_t type the kernel. Use u32 instead. No functional
change.

Change-ID: I77bbf3b6464edaef747c7104b43534032a4dba63
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 d82acb353246d3989377761ca26f5489264a4793)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: propagate properly
Mitch Williams [Mon, 9 Nov 2015 23:35:50 +0000 (15:35 -0800)]
i40e: propagate properly

Orabug: 22342532

i40e_sync_vsi_filters() is the surly teenager of this driver. It says
it's going to report errors, but it doesn't actually do that most of the
time. And when it does, it leaves a mess.

Change this function to have a common exit point so it will properly
release the busy lock on the VSI. Propagate errors to the callers.
Finally, adjust a few callers to check for and deal with errors from
this function.

Change-ID: Ic6af4956491e72402ebb3c538a3c31a0ad7f8667
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 ea02e90b4b49782462d06a425e05c776909fbae4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoi40evf: don't use atomic allocation
Mitch Williams [Fri, 6 Nov 2015 23:26:04 +0000 (15:26 -0800)]
i40evf: don't use atomic allocation

Orabug: 22342532

These allocations don't need to be at atomic level. GFP_KERNEL is fine
and they'll reduce stress on the allocator when the system is starved
for memory.

Change-ID: I3561d0399a681de0ad25291b6c848b224c1fde12
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 a85088d813a3ac44afa237113539585257127cfa)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix memory leaks, sideband filter programming
Kiran Patil [Fri, 6 Nov 2015 23:26:03 +0000 (15:26 -0800)]
i40e: Fix memory leaks, sideband filter programming

Orabug: 22342532

This patch fixes the memory leak which would be seen otherwise when user
programs flow-director filter using ethtool (sideband filter programming).

When ethtool is used to program flow directory filter, 'raw_buf' gets
allocated and it is supposed to be freed as part of queue cleanup. But
check of 'tx_buffer->skb' was preventing it from being freed.

Change-ID: Ief4f0a1a32a653180498bf6e987c1b4342ab8923
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 a42e7a369ea2b73a554a85dea7d6243af51cd4f0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Detection and recovery of TX queue hung logic moved to service_task from tx_timeout
Kiran Patil [Fri, 6 Nov 2015 23:26:02 +0000 (15:26 -0800)]
i40e: Detection and recovery of TX queue hung logic moved to service_task from tx_timeout

Orabug: 22342532

This patch contains following changes:
   - detection and recovery logic (issue SW interrupt) has been moved to
     service_task from timeout function.
   - added some more debug info from tx_timeout.

Logic to detect and recover TX queue hung is now two step process:
  - service_task detects TX queue hung and sets a bit(hung_detected) if
    it was not set.
  - if bit was set (means this is back-back hung condition detected),
    issue SW interrupt and clear the bit.
  - napi_poll clears the bit unconditionally since it cleans TX/RX queues.

Change-ID: Ieed03a48927c845a988b3ff375090bf37caeb903
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 9c6c12595b73e580f103b0812837f015034d460e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: remove duplicate string
Mitch Williams [Fri, 6 Nov 2015 23:26:01 +0000 (15:26 -0800)]
i40evf: remove duplicate string

Orabug: 22342532

We already print the driver info string in probe, so don't print
it again in init. No need to repeat. No need to repeat.

Change-ID: Ief597997f580a8c54d5950e3a84c29f2075be66b
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 05281eb8e1754688ecf07a63844c56c9f76b38ad)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: set real num queues
Mitch Williams [Fri, 6 Nov 2015 23:26:00 +0000 (15:26 -0800)]
i40evf: set real num queues

Orabug: 22342532

Use the helper function to set the real number of RX queues, and also
set the real number of TX queues.

Change-ID: I67982799de3f248fb4158ccdc9b1a74385f42ddd
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 e6c4cf6fb9323c0f65b8fef1c0c8c9e15b51007e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: increase max number of queues
Mitch Williams [Fri, 6 Nov 2015 23:25:59 +0000 (15:25 -0800)]
i40evf: increase max number of queues

Orabug: 22342532

Future devices will allow for more queue pairs, so allocate a netdev
that can handle them. While we're at it, get rid of the separate
MAX_TX/MAX_RX defines. Since we always get matched queue pairs, having
these makes no sense.

Change-ID: I0e3556cd9a962506e509eb7c0afa36b329e8cb51
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 1255b7a12ec4b6174a1c84f4aae4370b8ba1b1cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix i40e_print_features() VEB mode output
Joe Perches [Thu, 3 Dec 2015 12:20:57 +0000 (04:20 -0800)]
i40e: Fix i40e_print_features() VEB mode output

Orabug: 22342532

Commit 7fd89545f337 ("i40e: remove BUG_ON from feature string building")
added defective output when I40E_FLAG_VEB_MODE_ENABLED was set in
function i40e_print_features.

Fix it.

Miscellanea:

- Remove unnecessary string variable
- Add space before not after fixed strings
- Use kmalloc not kzalloc
- Don't initialize i to 0, use result of first snprintf

Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3b195843f59b8aefdc15c689615745bf6758756c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove unused argument
Jesse Brandeburg [Fri, 6 Nov 2015 01:01:02 +0000 (17:01 -0800)]
i40e: remove unused argument

Orabug: 22342532

With the final edition of the patches to remove sleeps from
the driver's entry points, the grab_rtnl argument is no
longer needed, so partially revert the commit that added it.

Change-ID: Ib9778476242586cc9e58b670f5f48d415cb59003
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 17652c6336fdca0f48906f0a1d9b5ac77b29e5a7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix: do not sleep in netdev_ops
Jesse Brandeburg [Fri, 6 Nov 2015 01:01:01 +0000 (17:01 -0800)]
i40e: fix: do not sleep in netdev_ops

Orabug: 22342532

The driver was being called by VLAN, bonding, teaming operations
that expected to be able to hold locks like rcu_read_lock().

This causes the driver to be held to the requirement to not sleep,
and was found by the kernel debug options for checking sleep
inside critical section, and the locking validator.

Change-ID: Ibc68c835f5ffa8ffe0638ffe910a66fc5649a7f7
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 0e4425ed641f3eef67c892bc541949cd745a9ba9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoi40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1
Catherine Sullivan [Mon, 26 Oct 2015 23:44:41 +0000 (19:44 -0400)]
i40e/i40evf: Bump i40e version to 1.4.4 and i40evf to 1.4.1

Orabug: 22342532

Bump.

Change-ID: I00ebbb2e5e5572f947502b8f6db4d94f666d6b14
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 e1c227919548fb9d8ee771e715d2764f1d41e8e0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: allocate ring structs dynamically
Mitch Williams [Mon, 26 Oct 2015 23:44:40 +0000 (19:44 -0400)]
i40evf: allocate ring structs dynamically

Orabug: 22342532

Instead of awkwardly keeping a fixed array of pointers in the adapter
struct and then allocating ring structs individually, just keep a single
pointer and allocate a single blob for the arrays. This simplifies code,
shrinks the adapter structure, and future-proofs the driver by not
limiting the number of rings we can handle.

Change-ID: I31334ff911a6474954232cfe4bc98ccca3c769ff
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 0dd438d8ad5db85c1a805ce2244252e37d5586a0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: allocate queue vectors dynamically
Mitch Williams [Mon, 26 Oct 2015 23:44:39 +0000 (19:44 -0400)]
i40evf: allocate queue vectors dynamically

Orabug: 22342532

Change the queue_vector array from a statically-sized member of the
adapter structure to a dynamically-allocated and -sized array.

This reduces the size of the adapter structure, and allows us to support
any number of queue vectors in the future without changing the code.

Change-ID: I08dc622cb2f2ad01e832e51c1ad9b86524730693
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 7d96ba1a8b7c36d1f4a04dc40e031b6f8c677496)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: quoth the VF driver, Nevermore
Mitch Williams [Mon, 26 Oct 2015 23:44:38 +0000 (19:44 -0400)]
i40evf: quoth the VF driver, Nevermore

Orabug: 22342532

If, upon a midnight dreary, the PF returns ERR_PARAM when the VF is
requesting resources, that's fatal. Either the firmware or NVM is badly,
badly misconfigured, or this VF has been disabled due to a previous VF
driver sending a bunch of bogus messages.

Either way, there is no recovery from this. Don't ponder weak and weary,
just quit.

Change-ID: I09d9f16cc4ee7fec3b57646a289d33838c1c5bf5
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 e743072fd16e6e772d5b5e4aef38873946f9a3e0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: make error message more useful
Mitch Williams [Mon, 26 Oct 2015 23:44:37 +0000 (19:44 -0400)]
i40e: make error message more useful

Orabug: 22342532

If we get an invalid message from a VF, we should tell the user which VF
is being naughty, rather than making them guess.

Change-ID: I9252cef7baea3d8584043ed6ff12619a94e2f99c
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 e7ffb72d65c784ba445ac849bd46d2533365fae7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix confusing message
Helin Zhang [Mon, 26 Oct 2015 23:44:36 +0000 (19:44 -0400)]
i40e: fix confusing message

Orabug: 22342532

This patch fixes the confusing kernel message of enabled RSS size,
by reporting it together with the hardware maximum RSS size.

Change-ID: I64864dbfbc13beccc180a7871680def1f3d5a339
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e36b0b111bcc651ce030e88e042f83b015dd04b8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Update error messaging
Carolyn Wyborny [Mon, 26 Oct 2015 23:44:35 +0000 (19:44 -0400)]
i40e: Update error messaging

Orabug: 22342532

This patch fixes an issue where adminq init failures always provided
a message that NVM was newer than expected.  This is not always the
case for init_adminq failures. Without this patch, if adminq init
fails for any reason, newer NVM message would be given.  This
problem is fixed by adding  a check for that specific error
condition and a different hopefully helpful message otherwise.

Change-ID: Iaeaebee4e398989eae40bb70f943ab66a3a521a5
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 2b2426a760764017cb53ffae128c87b7808dcf11)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: add new fields to store user configuration of RSS
Helin Zhang [Mon, 26 Oct 2015 23:44:34 +0000 (19:44 -0400)]
i40evf: add new fields to store user configuration of RSS

Orabug: 22342532

This patch adds new fields to i40e_vsi to store user configured
RSS config data and code to use it.

Change-ID: Ic5d3db8d9df52182b560248f8cdca9c5c7546879
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 66f9af855a4df146713866f6076207edea44a4f5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: create a generic get RSS function
Helin Zhang [Mon, 26 Oct 2015 23:44:33 +0000 (19:44 -0400)]
i40evf: create a generic get RSS function

Orabug: 22342532

There are two ways to get RSS, this patch implements two functions
with the same input parameters, and creates a more generic function
for getting RSS configuration.

Change-ID: I12d3b712c21455d47dd0a5aae58fc9b7c680db59
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 90b02b4392eb9778265ec6b4fef034010a937910)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: create a generic config RSS function
Helin Zhang [Tue, 27 Oct 2015 20:15:06 +0000 (16:15 -0400)]
i40evf: create a generic config RSS function

Orabug: 22342532

There are two ways to configure RSS, this patch adjusts those two
functions with the same input parameters, and creates a more
generic function for configuring RSS.

Change-ID: Iace73bdeba4831909979bef221011060ab327f71
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2c86ac3c70794f0ecc3684b0ae0fd75b0cf0c1f6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: rename VF adapter specific RSS function
Helin Zhang [Mon, 26 Oct 2015 23:44:31 +0000 (19:44 -0400)]
i40evf: rename VF adapter specific RSS function

Orabug: 22342532

This patch renames old VF adapter specific RSS function to clarify
its scope.

Change-ID: Ie5253083a44c677ebb7709a8a3a18402ad2dc6a6
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 96a8198652e5b80a2cfc87397a3512bf8e45cd63)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: prefetch skb data on transmit
Jesse Brandeburg [Mon, 26 Oct 2015 23:44:30 +0000 (19:44 -0400)]
i40e/i40evf: prefetch skb data on transmit

Orabug: 22342532

Issue a prefetch for data early in the transmit path.
This should not be generally needed for Tx traffic, but
it helps immensely for pktgen workloads and should help
for forwarding workloads as well.

Change-ID: Iefee870c20599e0c4240e1d8637e4f16b625f83a
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 b74118f08356fd8ab6cb5d1a15705a2760c9afdd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround
Anjali Singhai Jain [Mon, 26 Oct 2015 23:44:29 +0000 (19:44 -0400)]
i40e/i40evf: Fix RS bit update in Tx path and disable force WB workaround

Orabug: 22342532

This patch fixes the issue of forcing WB too often causing us to not
benefit from NAPI.

Without this patch we were forcing WB/arming interrupt too often taking
away the benefits of NAPI and causing a performance impact.

With this patch we disable force WB in the clean routine for X710
and XL710 adapters. X722 adapters do not enable interrupt to force
a WB and benefit from WB_ON_ITR and hence force WB is left enabled
for those adapters.
For XL710 and X710 adapters if we have less than 4 packets pending
a software Interrupt triggered from service task will force a WB.

This patch also changes the conditions for setting RS bit as described
in code comments. This optimizes when the HW does a tail bump amd when
it does a WB. It also optimizes when we do a wmb.

Change-ID: Id831e1ae7d3e2ec3f52cd0917b41ce1d22d75d9d
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 6a7fded776a778f728b13d83a2c9fc893580c080)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: rename rss_size to alloc_rss_size in i40e_pf
Helin Zhang [Mon, 26 Oct 2015 23:44:28 +0000 (19:44 -0400)]
i40e: rename rss_size to alloc_rss_size in i40e_pf

Orabug: 22342532

This patch renames rss_size to alloc_rss_size in i40e_pf, which is
clearer and avoids confusion. It also adds comments to the other
related structure members to help clarify usage.

Change-ID: Ia90090609d006ab589cb639975bb8a0af795d16f
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit acd65448f2e6b3407b8bb28b57d711ca417ea679)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add new fields to store user configuration
Helin Zhang [Mon, 26 Oct 2015 23:44:27 +0000 (19:44 -0400)]
i40e: add new fields to store user configuration

Orabug: 22342532

This patch adds new fields to i40e_vsi to store user configured
RSS config data and code to use it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Change-ID: I73886469dca9e9f6b16d842182a87f3f4009f95d
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 28c5869f2bc4e319027bc22a66a1aa9eefc69a16)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Bump version to 1.4.2
Catherine Sullivan [Wed, 21 Oct 2015 23:56:24 +0000 (19:56 -0400)]
i40e: Bump version to 1.4.2

Orabug: 22342532

Bump.

Change-ID: I2d1ce93b2ce74e4eef2394c932aef52cba99713f
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 1c2df9e5a763d6d88f9aea8ca76d0ca75753fbd5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: create a generic configure rss function
Helin Zhang [Wed, 21 Oct 2015 23:56:23 +0000 (19:56 -0400)]
i40e: create a generic configure rss function

Orabug: 22342532

This patch renames the old pf-specific function in order to clarify
its scope. This patch also creates a more generic configure RSS
function with the old name.

This patch also creates a new more generic function to get RSS
configuration, using the appropriate method.

Change-ID: Ieddca2707b708ef19f1ebccdfd03a0a0cd63d3af
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 043dd650efde3dfc65a6461e1cdc51cc87cb76f7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: rework the functions to configure RSS with similar parameters
Helin Zhang [Wed, 21 Oct 2015 23:56:22 +0000 (19:56 -0400)]
i40e: rework the functions to configure RSS with similar parameters

Orabug: 22342532

Adjust the RSS configure functions so that there is a generic way to
hook to ethtool hooks.

Change-ID: If446e34fcfaf1bc3320d9d319829a095b5976e67
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e69ff813af354ae445518d44e299eeb85d5037e2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: return the number of enabled queues for ETHTOOL_GRXRINGS
Helin Zhang [Wed, 21 Oct 2015 23:47:13 +0000 (19:47 -0400)]
i40e: return the number of enabled queues for ETHTOOL_GRXRINGS

Orabug: 22342532

This patch fixes a problem where using ethtool rxnfc command could
let RX flow hash be set on disabled queues. This patch fixes the
problem by returning the number of enabled queues before setting
rxnfc.

Change-ID: Idbac86b0b47ddacc8deee7cd257e41de01cbe5c0
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3e3aa21fe9265bdc45ff795dbcc90bcdd2f1017c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: handle many MAC filters correctly
Mitch Williams [Wed, 21 Oct 2015 23:47:12 +0000 (19:47 -0400)]
i40evf: handle many MAC filters correctly

Orabug: 22342532

When a lot (many hundreds) of MAC or VLAN filters are added at one time,
we can overflow the Admin Queue buffer size with all the requests.
Unfortunately, the driver would then calculate the message size
incorrectly, causing it to be rejected by the PF. Furthermore, there was
no mechanism to trigger another request to allow for configuring the
rest of the filters that didn't fit into the first request.

To fix this, recalculate the correct buffer size when we detect the
overflow condition instead of just assuming the max buffer size. Also,
don't clear the request bit in adapter->aq_required when we have an
overflow, so that the rest of the filters can be processed later.

Change-ID: Idd7cbbc5af31315e0dcb1b10e6a02ad9817ce65c
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 1418c3458118c6969d08e23aa377da7e2a7be36c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: clean up error messages
Mitch Williams [Wed, 21 Oct 2015 23:47:11 +0000 (19:47 -0400)]
i40e/i40evf: clean up error messages

Orabug: 22342532

Clean up and enhance error messages related to VF MAC/VLAN filters.
Indicate which VF is having issues, and if possible indicate the MAC
address or VLAN involved.

Also, when an error is returned from the PF driver, print useful
information about what went wrong, for the most likely cases.

Change-ID: Ib3d15eef9e3369a78fd142948671e5fa26d921b8
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 8d8f2295d0752230e0a697af33e5af96561b64a0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add comment to #endif
Helin Zhang [Wed, 21 Oct 2015 23:47:10 +0000 (19:47 -0400)]
i40e/i40evf: Add comment to #endif

Orabug: 22342532

Add a comment to the #endif to more easily match it with its #if.

Change-ID: I47eb0a60a17dc6d2f01a930e45006d2dc82e044f
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2f175f552ddb2498742c925332ce01b602fa029a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move the saving of old link info from handle_link_event to link_event
Catherine Sullivan [Wed, 21 Oct 2015 23:47:09 +0000 (19:47 -0400)]
i40e: Move the saving of old link info from handle_link_event to link_event

Orabug: 22342532

The watchdog only calls link_event not handle_link_event which means
that we need to save the old information in link_event.

Previously when polling we were comparing current data to the old data
saved the last time we actually received a link event. This means that
the polling would only fix link status changes in one direction
depending on what the last old data saved off was.

Change-ID: Ie590f30fdbcb133d0ddad4e07e3eb1aad58255b3
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 1f9610e4777c391e1e749ffc646b29dbff920834)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add a stat to track how many times we have to do a force WB
Anjali Singhai Jain [Wed, 21 Oct 2015 23:47:08 +0000 (19:47 -0400)]
i40e/i40evf: Add a stat to track how many times we have to do a force WB

Orabug: 22342532

When in NAPI with interrupts disabled, the HW needs to be forced to do a
write back on TX if the number of descriptors pending are less than a
cache line.

This stat helps keep track of how many times we get into this situation.

Change-ID: I76c1bcc7ebccd6bffcc5aa33bfe05f2fa1c9a984
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 164c9f54631beca4d174f306acdcaec2bdeef52e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove BUG_ON from FCoE setup
Shannon Nelson [Wed, 21 Oct 2015 23:47:05 +0000 (19:47 -0400)]
i40e: remove BUG_ON from FCoE setup

Orabug: 22342532

There's no need to kill the kernel thread here. If this condition was
true, the probe() would have died long before we got here. In any case,
we'll get the same result when this code tries to use the VSI pointer
being checked.

Prompted by a recent Linus diatribe.

Change-ID: I62f531cac34d4fc28ff9657d5b2d9523ae5e33a4
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 f9b26ebb6e46f2231adc22d69f4150dc53f19b74)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove BUG_ON from feature string building
Shannon Nelson [Wed, 21 Oct 2015 23:47:04 +0000 (19:47 -0400)]
i40e: remove BUG_ON from feature string building

Orabug: 22342532

There's really no reason to kill the kernel thread just because of a
little info string. This reworks the code to use snprintf's limiting to
assure that the string is never too long, and WARN_ON to still put out
a warning that we might want to look at the feature list length.

Prompted by a recent Linus diatribe.

Change-ID: If52ba5ca1c2344d8bf454a31bbb805eb5d2c5802
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 7fd89545f3374a061669a279ae0e084b0ddbb53d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change BUG_ON to WARN_ON in service event complete
Shannon Nelson [Wed, 21 Oct 2015 23:47:03 +0000 (19:47 -0400)]
i40e: Change BUG_ON to WARN_ON in service event complete

Orabug: 22342532

There's no need to kill the thread and eventually the kernel in this
case.  In fact, the remainder of the code won't hurt anything anyway,
so just complain that we're here and move along.

Prompted by a recent Linus diatribe.

Change-ID: Iec020d8bcfedffc1cd2553cc6905fd915bb3e670
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 b875f99b4cb454e0aa1e68d2d8792112a1e07050)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: remove unused tunnel parameter
Shannon Nelson [Wed, 21 Oct 2015 23:47:02 +0000 (19:47 -0400)]
i40e/i40evf: remove unused tunnel parameter

Orabug: 22342532

Code was moved into a separate function some time ago.

Change-ID: Icabbe71ce05cf5d716d3e1152cdd9cd41d11bcb5
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 9c883bd3ebd127785ef0538b04e2d4b4c64c4c2d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agointel: i40e: fix confused code
Rasmus Villemoes [Sat, 17 Oct 2015 20:58:19 +0000 (22:58 +0200)]
intel: i40e: fix confused code

Orabug: 22342532

This code is pretty confused. The variable name 'bytes_not_copied'
clearly indicates that the programmer knew the semantics of
copy_{to,from}_user, but then the return value is checked for being
negative and used as a -Exxx return value.

I'm not sure this is the proper fix, but at least we get rid of the
dead code which pretended to check for access faults.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0286c67e710cc82260b8c826e5a7b75143fedbd6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>