]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agoi40e: re-use %*ph specifier to hexdump a data
Andy Shevchenko [Fri, 2 Oct 2015 09:18:16 +0000 (12:18 +0300)]
i40e: re-use %*ph specifier to hexdump a data

Orabug: 22342532

Instead of using a custom approach change the code to use %*ph format
specifier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a3524e95ac5339e9b65dba2228f3f7efd27648cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump i40e to 1.3.46 and i40evf to 1.3.33
Catherine Sullivan [Thu, 1 Oct 2015 18:37:41 +0000 (14:37 -0400)]
i40e/i40evf: Bump i40e to 1.3.46 and i40evf to 1.3.33

Orabug: 22342532

Bump up the version...

Change-ID: Ib8d501021671ba20250115ed54330e2c182255b7
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 0e320516b280a8cf7258d9d41e7140563dd7c027)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Disable VEB bridge mode with SR-IOV failure
Akeem G Abodunrin [Thu, 1 Oct 2015 18:37:40 +0000 (14:37 -0400)]
i40e: Disable VEB bridge mode with SR-IOV failure

Orabug: 22342532

If a call to enable SR-IOV in the kernel failed, we need to disable
I40E_FLAG_VEB_MODE_ENABLED, so that bridge mode could fall back to
VEPA, which is a default.

Change-ID: I12b6f776769506db85b29bea94b9c88d0b5ee65e
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 de445b3dc29835ae840f202bc62fd3ae42da12ad)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix an incorrect OEM version string
Carolyn Wyborny [Thu, 1 Oct 2015 18:37:39 +0000 (14:37 -0400)]
i40e: Fix an incorrect OEM version string

Orabug: 22342532

This patch fixes a problem where the driver output of the OEM
version string varied from the other tools.  The mask value
and the order of operations were incorrect, per the original
change request.  Without this patch, the version string will
appear incorrect from the driver.

Change-ID: Ie1ca6485284b4ce3b57e5a99b18b7641617c7ef7
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 2efaad86b5cdd0f6d70436fa304a567df8a3cf6c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix inconsistent statuses after a PF reset
Helin Zhang [Thu, 1 Oct 2015 18:37:38 +0000 (14:37 -0400)]
i40e: fix inconsistent statuses after a PF reset

Orabug: 22342532

This patch fixes a problem of possibly getting inconsistent flow control
statuses after a PF reset. Requested_mode was being set with a default
value during probing, but the initial HW state could be different from
this mode.

Change-ID: I772bf07b78616e87086418d4bd87954b66fa17cd
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 58fc3267f151f6facfc94c6982bef09a53bb5219)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: use correct struct for list manipulation
Mitch Williams [Thu, 1 Oct 2015 18:37:37 +0000 (14:37 -0400)]
i40evf: use correct struct for list manipulation

Orabug: 22342532

Not sure how this compiles at all. Use the correct struct for
manipulating the VLAN filter list. Without this, the VLAN filter
list doesn't get processed correctly, and VLAN filters will not
be re-enabled after any kind of reset.

Change-ID: Iceff2dc089f303058fb71ecb08419eed471e0e90
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 40d01366e6dd5ef1cb3505f11b2d208cfa3632f3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix VEB/VEPA bridge mode mismatch issue
Akeem G Abodunrin [Thu, 1 Oct 2015 18:37:36 +0000 (14:37 -0400)]
i40e: Fix VEB/VEPA bridge mode mismatch issue

Orabug: 22342532

Fix i40e_is_vsi_uplink_mode_veb to check if bridge is actually
in VEB mode before allowing LB in the add VSI routine, instead of
unconditionally returning VEB bridge mode.

Change-ID: I162397b1bdd02367735fe9baaeb51465be2a3ce9
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 09603eaa5ca91dd9a318d8722ff5de8feb1e36ab)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix a bug in debugfs with add/del macaddr
Anjali Singhai Jain [Thu, 1 Oct 2015 18:37:35 +0000 (14:37 -0400)]
i40e: fix a bug in debugfs with add/del macaddr

Orabug: 22342532

The new code flow requires us to grab the filter list lock before
adding/deleting the filter.

Change-ID: I4eaef508ab4da2d1b2e23f20f2a78d931d5b6aeb
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 10dc0358e802ea60f95432f89c8dd051767fc06f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add a workaround to drop all flow control frames
Anjali Singhai Jain [Thu, 1 Oct 2015 18:37:34 +0000 (14:37 -0400)]
i40e/i40evf: Add a workaround to drop all flow control frames

Orabug: 22342532

This patch adds a workaround to drop any flow control frames from being
transmitted from any VSI. FW can still send flow control frames if flow
control is enabled.

With this patch in place a malicious VF cannot send flow control or PFC
packets out on the wire.

Change-ID: I4303b24e98b93066d2767fec24dfe78be591c277
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 e7358f54a3954df16d4f87e3cad35063f1c17de5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump i40e to 1.3.38 and i40evf to 1.3.25
Catherine Sullivan [Mon, 28 Sep 2015 18:17:00 +0000 (14:17 -0400)]
i40e/i40evf: Bump i40e to 1.3.38 and i40evf to 1.3.25

Orabug: 22342532

Bump.

Change-ID: Id0a7ecaa491f88ce94c9eba4901e592a56044ee0
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 a1f192cf70b187ab01b8b03cdeea82b8820c927a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: declare rather than initialize int object
Jean Sacren [Sat, 19 Sep 2015 11:08:45 +0000 (05:08 -0600)]
i40e: declare rather than initialize int object

Orabug: 22342532

'err' would be overwritten immediately, so we should declare it only
rather than initialize it to zero.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6f66a484f1ff644b4600368fe3091e31b65d3c50)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix kernel-doc argument name
Jean Sacren [Sat, 19 Sep 2015 11:08:43 +0000 (05:08 -0600)]
i40e: fix kernel-doc argument name

Orabug: 22342532

The second argument name in the kernel-doc argument list for
i40e_features_check() was slightly off. Fix it for the kernel doc.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2bc11c634eaebb936345b136a196f555045a47ea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move error message to debug level
Catherine Sullivan [Mon, 28 Sep 2015 18:16:59 +0000 (14:16 -0400)]
i40e: Move error message to debug level

Orabug: 22342532

There is an error coming back from get_phy_capabilities that does not
seem to have any functional implications. We will continue looking into
why this error message is occurring, but in the meantime, we will move it
to debug to avoid confusion.

Change-ID: I9091754bf62c066ddedeb249923d85606e2d68ed
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 52e9689e4ef070eff1e0f9e6e84a8451b86813b5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix order of checks when enabling/disabling autoneg in ethtool
Catherine Sullivan [Mon, 28 Sep 2015 18:16:58 +0000 (14:16 -0400)]
i40e: Fix order of checks when enabling/disabling autoneg in ethtool

Orabug: 22342532

We were previously checking if autoneg was allowed to change before
checking if autoneg was changing. We need to do this in the other order
or else we will erroneously return EINVAL when autoneg is not changing.

Change-ID: Iff9f7d1c9bddc1ad1e5d227d4f42754f90155410
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 3ce12ee9d8f9ae245f38e6acbd32625d8e002c5b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix an accidental error with BIT_ULL replacement
Anjali Singhai Jain [Mon, 28 Sep 2015 18:16:57 +0000 (14:16 -0400)]
i40e/i40evf: Fix an accidental error with BIT_ULL replacement

Orabug: 22342532

A mask value of 0x1FF was accidentally replaced with a bit mask
causing flow director sideband to be broken.

Change-ID: Id3387f67dd1b567b41692b570b383c58671e1eae
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 a03dc368547a7a4e9fcedc6f64dd64a9ff5e0593)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix for PHY NVM interaction problem
Carolyn Wyborny [Mon, 28 Sep 2015 18:16:56 +0000 (14:16 -0400)]
i40e: fix for PHY NVM interaction problem

Orabug: 22342532

This patch fixes a problem where the NVMUpdate Tool, when using the PHY
NVM feature, gets bad data from the PHY because of contention on the
MDIO interface from get PHY capability calls from the driver during
regular operations.  The problem is fixed by adding a check if media
is available before calling get PHY capability function because that
bit is not set when device is in PHY interaction mode.

Change-ID: Ib89991b0f841808dd92410f5e8683d6ee3301cd0
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 8589af70d0879a68c93ef77505a6234d22b1b1a7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix for Tools loopback test failing after driver load
Carolyn Wyborny [Mon, 28 Sep 2015 18:16:55 +0000 (14:16 -0400)]
i40e: Fix for Tools loopback test failing after driver load

Orabug: 22342532

This patch fixes a problem where our Tools MAC Loopback test, after
driver unbind would fail.  This was because the hw was configured
for multiqueue and unbind operation did not clear this configuration.
The problem is fixed by resetting this configuration in i40e_remove.

Change-ID: I130c05138319182ed1476d3a0b5222d6a6320af9
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 bcab2db97d2423b97b248ba35eb2277168e71fcc)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: adjust interrupt throttle less frequently
Jesse Brandeburg [Mon, 28 Sep 2015 18:16:54 +0000 (14:16 -0400)]
i40e/i40evf: adjust interrupt throttle less frequently

Orabug: 22342532

The adaptive ITR (interrupt throttle rate) algorithm was adjusting
the hardware's interrupt rate too frequently.  This caused a lot
of variation in the interrupt rate for fairly constant workloads.

Change the code to have a counter and adjust only once every N
number of interrupts.

Change-ID: I0460f1f86571037484eca5aca36ac4d889cb8389
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 ee2319cf17ee64bbd0096f2f8f3f8390c93b1e39)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: change dynamic interrupt thresholds
Jesse Brandeburg [Mon, 28 Sep 2015 18:16:53 +0000 (14:16 -0400)]
i40e/i40evf: change dynamic interrupt thresholds

Orabug: 22342532

The dynamic algorithm, while now working, doesn't have good
performance in 40G mode.

One part of this patch addresses the high CPU utilization of some small
streaming workloads that the driver should reduce CPU in.

It also changes the minimum ITR that the dynamic algorithm
will settle on, causing our minimum latency to go from 12us
to about 14us, when using adaptive mode.

It also changes the BULK interrupt rate to allow maximum throughput
on a 40Gb connection with a single thread of transmit, clamping
interrupt rate to 8000 for TX makes single thread traffic go too
slow.

The new ULTRA bulk setting is introduced and is used
when the Rx packet rate on this queue exceeds 40000 packets per
second.  This value of 40000 was chosen because the automatic tuning
of minimum ITR=20us means that a single queue can't quite achieve
that many packets per second from a round-robin test.

Change-ID: Icce8faa128688ca5fd2c4229bdd9726877a92ea2
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 c56625d59726ee2dc4dfd91c8b6c22098abe1ac4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix bug in throttle rate math
Jesse Brandeburg [Mon, 28 Sep 2015 18:16:52 +0000 (14:16 -0400)]
i40e/i40evf: fix bug in throttle rate math

Orabug: 22342532

The driver was using a value expressed in 2us increments
for the divisor to figure out our bytes/usec values.

Fix the usecs variable to contain a value in microseconds.

Change-ID: I5c20493103c295d6f201947bb908add7040b7c41
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 51cc6d9fccde27310b7dfba2be268ff5b8dcf52d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: refactor IRQ enable function
Jesse Brandeburg [Mon, 28 Sep 2015 18:16:51 +0000 (14:16 -0400)]
i40e/i40evf: refactor IRQ enable function

Orabug: 22342532

This change moves a multi-line register setting into a function
which simplifies reading the flow of the enable function.

This also fixes a bug where the enable function was enabling
the interrupt twice while trying to update the two interrupt
throttle rate thresholds for Rx and Tx.

Change-ID: Ie308f9d0d48540204590cb9d7a5a7b1196f959bb
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 8f5e39ce9214888464d34ef7949e56bdc999b46c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: don't give up
Mitch Williams [Mon, 28 Sep 2015 18:16:50 +0000 (14:16 -0400)]
i40evf: don't give up

Orabug: 22342532

When the VF driver is unable to communicate with the PF, it just gives
up and never tries again. Aside from the obvious character flaw that
this shows, it's also a lousy user experience.

When PF communications fail, wait five seconds, and try again. And
again. Don't give up, little VF driver! Your prince will come!

Change-ID: Ia1378a39879883563b8faffce819f375821f9585
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 b9029e941dd66d2bc2ab529807a1eef4444f62f0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: use napi_schedule_irqoff()
Alexander Duyck [Tue, 29 Sep 2015 22:19:50 +0000 (15:19 -0700)]
i40e/i40evf: use napi_schedule_irqoff()

Orabug: 22342532

The i40e_intr and i40e/i40evf_msix_clean_rings functions run from hard
interrupt context or with interrupts already disabled in netpoll.

They can use napi_schedule_irqoff() instead of napi_schedule()

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 5d3465a1e4c01be455ef00834ec365e578942d67)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix basic support for X722 devices
Anjali Singhai [Thu, 24 Sep 2015 22:26:32 +0000 (15:26 -0700)]
i40e: Fix basic support for X722 devices

Orabug: 22342532

Acquire NVM, before issuing an AQ read nvm command for X722.
We need to acquire the NVM before issuing an AQ read to the NVM
otherwise we will get EBUSY from the FW. Also release when done.

This fixes the two X722 issues with respect to eeprom checksum verify
and reading NVM version info.

With this patch in place, i40e driver will provide basic support
for X722 devices.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@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 07f89be81fa51ec85456559d7db9bc71379a20c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: fix overlong BIT defines
Jesse Brandeburg [Thu, 17 Sep 2015 02:01:08 +0000 (19:01 -0700)]
i40evf: fix overlong BIT defines

Orabug: 22342532

The defines from the RSS enabling call were mistakenly
missed in the patches to the i40e which should have been
to i40evf as well.

This is a follow up to (commit ed921559886dd40528) "fix
32 bit build warnings".

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 d08f55585f22c38db5fcbed509a71d925e0509c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Lock for VSI's MAC filter list
Kiran Patil [Wed, 30 Sep 2015 18:09:03 +0000 (14:09 -0400)]
i40e: Lock for VSI's MAC filter list

Orabug: 22342532

This patch introduces a spinlock which is to be used for synchronizing
access to VSI's MAC filter list.

This patch also synchronizes execution of other codepaths which are
accessing VSI's MAC filter list with execution of
service_task:sync_vsi_filters.

In function i40e_add_vsi, copied out LAA MAC address instead of cloning
MAC filter entry because only MAC address is needed to remove MAC VLAN
filter from FW/HW.

Change-ID: I0e10ac7c715d44aa994239642aa4d57c998573a2
Signed-off-by: Kiran Patil <kiran.patil@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 216590355cb0e79fa36c7220176ce850f0e3d276)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump i40e to 1.3.34 and i40evf to 1.3.21
Catherine Sullivan [Mon, 28 Sep 2015 18:12:44 +0000 (14:12 -0400)]
i40e/i40evf: Bump i40e to 1.3.34 and i40evf to 1.3.21

Orabug: 22342532

Bump.

Change-ID: I7ec818a507554648675b9b245ced9e6b6bd9ed4e
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 d1d39516e41d7ad107e807ebeee1519c412bb0e3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: increase AQ work limit
Mitch Williams [Mon, 28 Sep 2015 18:12:43 +0000 (14:12 -0400)]
i40e: increase AQ work limit

Orabug: 22342532

With 64 VFs, we can easily overwhelm the AQ on the PF if we have too low
a limit on the number of AQ requests. This leads to ARQ overflow errors,
and occasionally VFs that fail to initialize.

Since we really only hit this condition on initial VF driver load, the
requests that we process are lightweight, so this extra work doesn't
cause problems for the PF driver.

Change-ID: I620221520d8af987df6ace9ba938ffaf22107681
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 628f096d8d244f54c3595a478b6e672cdb6c04ed)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: relax and stagger init timing a bit
Mitch Williams [Mon, 28 Sep 2015 18:12:42 +0000 (14:12 -0400)]
i40evf: relax and stagger init timing a bit

Orabug: 22342532

On some devices, in some systems, in some configurations, the VFs would
fail to initialize the first time you loaded the driver.

To correct this, increase the delay time for the init task slightly, and
wait longer before giving up.

If we enable VFs and load the VF driver in the same kernel as the PF
driver, we can totally overwhelm the PF driver with AQ requests because
all of the instances try to initialize at the same time.

To help alleviate this, stagger the initial scheduling of the init task
using the PCIe function as a multiplier. We mask off the function to
only three bits so no instance has to wait too long.

With these two changes, initializing 128 VFs on a single device goes
from four minutes to just a few seconds.

Change-ID: If3d8720c1c4e838ab36d8781d9ec295a62380936
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 3f7e5c330e19da2ac822ea1d02b744a24497e61b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Recognize 1000Base_T_Optical phy type when link is up
Catherine Sullivan [Mon, 28 Sep 2015 18:12:41 +0000 (14:12 -0400)]
i40e: Recognize 1000Base_T_Optical phy type when link is up

Orabug: 22342532

1000Base_T_Optical got added to the function that figures out what
is supported when link is down but not when link is up. Add it in there
too so that we display the correct information.

Change-ID: I85ebcdfa7c02d898c44c673b1500552a53c8042e
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 48becae60f7e461b4b204e6608dc6beebe6c8aff)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: correctly populate vlan_features
Mitch Williams [Mon, 28 Sep 2015 18:12:40 +0000 (14:12 -0400)]
i40evf: correctly populate vlan_features

Orabug: 22342532

The vlan_features field was correctly being set to the same value as the
netdev features field. However, this was being done before the features
were actually being set up, leaving the vlan_features empty.

Also, after a reset, vlan_features will be incorrectly assigned the
previous netdev feature flags, which can contain VLAN feature bits. This
makes the VLAN code angry and will cause a stack dump.

To fix these issues, set up the netdev features first, then mask out the
VLAN feature bits when assigning vlan_features.

Change-ID: Ib0548869dc83cf6a841cb8697dd94c12359ba4d2
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 cc7e406cb967ccc84cd2141398bba24b07d68788)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: reset the invalid msg counter in vf when a valid msg is received
Jingjing Wu [Mon, 28 Sep 2015 18:12:39 +0000 (14:12 -0400)]
i40e: reset the invalid msg counter in vf when a valid msg is received

Orabug: 22342532

When the number of invalid messages from a VF is exceeded, the VF
will be disabled, due to the invalid messages.  This happens if
other VF drivers (like DPDK) send a message through the driver's
mailbox (aka virtchannel) interface, but the message is not
supported by the i40e pf driver, such as CONFIG_PROMISCUOUS_MODE.

This patch changes the num_invalid_msgs in struct i40e_vf to record
the continuous invalid msgs, and it will be reset when a valid msg
is received.

Change-ID: Iaec42fd3dcdd281476b3518be23261dd46fc3718
Signed-off-by: Jingjing Wu <jingjing.wu@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 5d38c93e7111a68fc7b9f771bf420d9e026a21de)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: moderate interrupts differently
Jesse Brandeburg [Mon, 28 Sep 2015 18:12:37 +0000 (14:12 -0400)]
i40e/i40evf: moderate interrupts differently

Orabug: 22342532

The XL710 hardware has a different interrupt moderation design
that can support a limit of total interrupts per second per
vector, in addition to the "number of interrupts per second"
controls already established in the driver.  This combination
of hardware features allows us to set very low default latency
settings but minimize the total CPU utilization by not
making too many interrupts, should the user desire.

The current driver implementation is still enabling the dynamic
moderation in the driver, and only using the rx/tx-usecs
limit in ethtool to limit the interrupt rate per second, by default.

The new code implemented in this patch
2) adds init/use of the new "Interrupt Limit" register
3) adds ethtool knob to control/report the limits above

Usage is ethtool -C ethx rx-usecs-high <value> Where <value> is number
of microseconds to create a rate of 1/N interrupts per second,
regardless of rx-usecs or tx-usecs values. Since there is a credit based
scheme in the hardware, the rx-usecs and tx-usecs can be configured for
very low latency for short bursts, but once the credit runs out the
refill rate on the credits is limited by rx-usecs-high.

Change-ID: I3a1075d3296123b0f4f50623c779b027af5b188d
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 ac26fc136c24edee53f1719e490d896fb07cd79b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for non-willing Apps
Greg Bowers [Mon, 28 Sep 2015 18:12:35 +0000 (14:12 -0400)]
i40e: Add support for non-willing Apps

Orabug: 22342532

Adds support for setting a new bit in the Set Local LLDP MIB AQ command
Type field.  When set to 1, the bit indicates to FW that Apps should be
treated as non-willing.  When 0, FW behaves as before.

Change-ID: I0d2101c1606c59c7188d3e6a0c7810e0f205233a
Signed-off-by: Greg Bowers <gregory.j.bowers@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 947570e800e2ae3cbf827918a999aa88ee1600b0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: priv flag for controlling VEB stats
Shannon Nelson [Mon, 28 Sep 2015 18:12:34 +0000 (14:12 -0400)]
i40e: priv flag for controlling VEB stats

Orabug: 22342532

Add an ethtool priv flag to enable and disable printing
the VEB statistics.

Change-ID: I7654054a3a73b08aa8310d94ee8fce6219107dd8
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 1cdfd88f2de89cbfffb5813dc92b7e711920c731)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Removed unused defines
Greg Rose [Mon, 28 Sep 2015 18:12:33 +0000 (14:12 -0400)]
i40e: Removed unused defines

Orabug: 22342532

Two defines that are not used are causing customer confusion - remove
them.

Change-ID: Icef0325aca8e0f4fcdfc519e026bdd375e791200
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 d9d17cf74aed93add76c9cf648ce2f73b68ce410)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove read/write failed messages from nvmupdate
Shannon Nelson [Mon, 28 Sep 2015 18:12:32 +0000 (14:12 -0400)]
i40e: remove read/write failed messages from nvmupdate

Orabug: 22342532

Allow the nvmupdate application to decide when a read or write error
should be exposed to the user.  Since the application needs to use
write probes to find the ReadOnly sections on a potentially unknown NVM
version in the HW and read probes to check the status of the last write,
some error messages are expected, but need not be shown to the users.
The driver doesn't know which are ignorable from real errors, so needs
to let the application make the decision.

Change-ID: I78fca8ab672bede11c10c820b83c26adfd536d03
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 3c5c420535ab7e25a639db16f7b2b16a70e147ec)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix compile issue related to const string
Jingjing Wu [Mon, 28 Sep 2015 18:12:31 +0000 (14:12 -0400)]
i40e/i40evf: Fix compile issue related to const string

Orabug: 22342532

Add const to functions that return strings that aren't going to be
modified. This addresses some reported compile complaints.

Change-ID: Ic56b1e814ab4d23a50480e7fdec652445f776ee8
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4e68adfeb91d684e5c7a0c6305af872120c71f23)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: generate fewer startup messages
Shannon Nelson [Mon, 28 Sep 2015 18:12:30 +0000 (14:12 -0400)]
i40e: generate fewer startup messages

Orabug: 22342532

Cut down on the number of startup log entries by putting a couple behind
debug flags and combining a couple others into a single line.

Change-ID: I708089f086308f84d43f8b6f0e8a634a02d058fb
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 6dec101765e442fc7f46205acdb2cf3b88879f16)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add support for netpoll
Alexander Duyck [Thu, 24 Sep 2015 16:04:38 +0000 (09:04 -0700)]
i40evf: Add support for netpoll

Orabug: 22342532

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 7709b4c1fff39972b6a1b6183b593c43f1a555fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Drop useless "IN_NETPOLL" flag
Alexander Duyck [Thu, 24 Sep 2015 16:04:32 +0000 (09:04 -0700)]
i40e/i40evf: Drop useless "IN_NETPOLL" flag

Orabug: 22342532

The code in i40e and i40evf is using an "IN_NETPOLL" flag that has never
added any value due to the fact that the Rx clean-up is handled in NAPI.
As such the flag was set, the queue was scheduled via NAPI, and then polled
from the netpoll controller and if any Rx packets were processed the were
processed in the wrong context.

In addition the flag itself just added an unneeded conditional to the
hot-path so it can safely be dropped and save us a few instructions.

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 8b6503590510fd7a8b303feeaf8a45a192e2b8df)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Fix handling of napi budget
Alexander Duyck [Thu, 24 Sep 2015 16:04:26 +0000 (09:04 -0700)]
i40e/i40evf: Fix handling of napi budget

Orabug: 22342532

The polling routine for i40e was rounding up the budget for Rx cleanup to
1.  This is incorrect as the netpoll poll call is expecting no Rx to be
processed as the budget passed was 0.

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 c67caceb864cf15731532ab25162166c228fa270)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump i40e version to 1.3.28 and i40evf to 1.3.19
Catherine Sullivan [Thu, 3 Sep 2015 21:19:02 +0000 (17:19 -0400)]
i40e/i40evf: Bump i40e version to 1.3.28 and i40evf to 1.3.19

Orabug: 22342532

Bump.

Change-ID: I8d9a99f320af43960deba8718eee2d6de50eaf46
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 164f739361c962ac63aa6f7cbd48309d1bff15fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: speed up init
Mitch Williams [Thu, 3 Sep 2015 21:19:01 +0000 (17:19 -0400)]
i40evf: speed up init

Orabug: 22342532

Shorten up the delays in the init task, allowing the VF driver to
initialize faster. This aids performance in load/unload tests and
mitigates DMAR errors in VF enable/disable tests with absurdly short
delays. In the real world, the VF driver will come up more quickly.

The original values were set conservatively based on what we expected
from the firmware in terms of performance. Now that the driver is in use
and we know how well firmware responds to our requests, we can shorten
these delays.

Change-ID: Ibead77d34b19e8170e667c3f58bc14748bbc5bc9
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 5be8308b1614947f056802cb5775307f0ad54ad2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove unnecessary string copy operations
Shannon Nelson [Thu, 3 Sep 2015 21:19:00 +0000 (17:19 -0400)]
i40e: remove unnecessary string copy operations

Orabug: 22342532

Save a little stack space and remove unnecessary strncpy() with a little
string pointer.

Change-ID: Id2719d34710bfc273d3bb445fec085cd04276e88
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 a916549029848f1356bf2d797e83218de53f17b2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: X722 is on the IOSF bus and does not report the PCI bus info
Anjali Singhai Jain [Thu, 3 Sep 2015 21:18:59 +0000 (17:18 -0400)]
i40e: X722 is on the IOSF bus and does not report the PCI bus info

Orabug: 22342532

X722 will report Gen 1x1 in the PCI config space as it is on
IOSF bus, so skip the PCI bus link/speed check.

Change-ID: Icd5f5751dc7fb00dccf0d5dc5a0a644948e7062e
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 3fced535079a6aaff2d85bd5c52ad50df0558e3d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Store off PHY capabilities
Kevin Scott [Thu, 3 Sep 2015 21:18:58 +0000 (17:18 -0400)]
i40e: Store off PHY capabilities

Orabug: 22342532

Store off reported PHY capabilities in link_info structure.

Change-ID: Ife0f037c26983ca985dbf79abf33f8f8791369e8
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 3ac67d7bfa2f35cc8a52bdff39e3bbadb6e639a9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: remove redundant declarations of a variable and a function
Shannon Nelson [Thu, 3 Sep 2015 21:18:57 +0000 (17:18 -0400)]
i40e/i40evf: remove redundant declarations of a variable and a function

Orabug: 22342532

Remove a variable declaration inside an if block hiding an existing
declaration at the start of the function.

Also remove a forward function declaration that is no longer needed due
to code re-organization.

Change-ID: I12954668b722718074949c93d74cd20eaacd93e4
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 874d1a10eb1ab466f48627cdd268335a635dde52)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove FD atr control from debugfs
Shannon Nelson [Thu, 3 Sep 2015 21:18:56 +0000 (17:18 -0400)]
i40e: remove FD atr control from debugfs

Orabug: 22342532

Since the flow-director-atr priv flag was added to our ethtool interface,
we don't need the on/off control in debugfs.

Change-ID: Ib3b599916434ab30ccd40074e71d7a81609b5bb5
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 106b1941ff304ad6b6b9828b24c8545814a7a4e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: allow FD SB if MFP mode only has 1 partition
Shannon Nelson [Thu, 3 Sep 2015 21:18:55 +0000 (17:18 -0400)]
i40e: allow FD SB if MFP mode only has 1 partition

Orabug: 22342532

Even though the device might be in MFP mode, if there's only one partition
enabled, then we still have plenty of interrupts for managing the Flow
Directory Sideband activity.  This patch enables FD SB in this case.
This patch also reverses the sense of the conditional in order to remove
the negative logic.

Change-ID: I9edf211a6219fc8d159b4be9964f9fd7f4e00bc0
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 6eae9c6a3536f3a676b54ebf82244c23d3b1019f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove obsolete version check
Mitch Williams [Thu, 3 Sep 2015 21:18:54 +0000 (17:18 -0400)]
i40e: remove obsolete version check

Orabug: 22342532

This version check only applies to very, very old firmware,
that only ran on A0 hardware, which we never shipped and don't
support in this driver anyway. Remove it, before somebody
gets hurt.

Change-ID: I3752d090ff488acf98ee76b075af961e9c968ee4
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 9b28ef01003f815d9bbdb50c4208586c9246ad08)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add WB_ON_ITR offload support
Anjali Singhai Jain [Thu, 3 Sep 2015 21:18:53 +0000 (17:18 -0400)]
i40e/i40evf: Add WB_ON_ITR offload support

Orabug: 22342532

X722 has a way to work around the descriptor WB issue,
this offload helps turn that feature on.

Change-ID: I7ffa67622426bfca5a651417b63e3afcfeb60412
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 1f012279163af2f1bec30de42960f0312be3a52e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove 100M SGMII unless hw is X722
Catherine Sullivan [Thu, 3 Sep 2015 21:18:52 +0000 (17:18 -0400)]
i40e: Remove 100M SGMII unless hw is X722

Orabug: 22342532

Only the X722 device now supports 100M SGMII, and nothing supports
100M on 1000Base_T.

Change-ID: I6f44dcd818944edd40041410e6de380f4a359a0c
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
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 3b6c2179eebf4536d08cf966c9f585dd95c72367)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change some messages from info to debug only
Neerav Parikh [Thu, 3 Sep 2015 21:18:50 +0000 (17:18 -0400)]
i40e: Change some messages from info to debug only

Orabug: 22342532

There are several error messages that have been printing when there is
no functional issue. These messages should be available at debug message
level only.

Change-ID: Id91e47bf942c483563995f30d8705fa53acd5aa3
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
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 8279e49531f427ae7e8db894072d91bc42d3eeb5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: use priv flags to control flow director
Jesse Brandeburg [Thu, 3 Sep 2015 21:18:49 +0000 (17:18 -0400)]
i40e: use priv flags to control flow director

Orabug: 22342532

Some customers wish to be able to control our hardware specific
feature called flow director, at runtime.  This patch enables
ethtool priv flags to control this driver/hardware specific feature.

ethtool --set-priv-flags ethX flow-director-atr off

NOTE: the ethtool ntuple interface controls the flow-director
      sideband rules.

Change-ID: Iba156350b07fa2ce66f53ded51739f9a3781fe0e
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 ef17178cf5abe304b2098a50f580e8c19e5084d2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add missing parameter comment to ndo_bridge_setlink
Jesse Brandeburg [Thu, 3 Sep 2015 21:18:48 +0000 (17:18 -0400)]
i40e: Add missing parameter comment to ndo_bridge_setlink

Orabug: 22342532

Add nlflags to the function comment for ndo_bridge_setlink.

Change-ID: I34c704f307f2a3f7bac3ca4b44e2a094d3d082d6
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 d4b2f9fe608320604748c3cb90c99b2255782935)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump i40e version to 1.3.25 and i40evf to 1.3.17
Catherine Sullivan [Mon, 31 Aug 2015 23:54:55 +0000 (19:54 -0400)]
i40e/i40evf: Bump i40e version to 1.3.25 and i40evf to 1.3.17

Orabug: 22342532

Bump.

Change-ID: If3cd42f6c1b9546beed60faf9c79faab35216f58
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 06a24dd6c29a814a81595861c2cc681329c56bfc)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Refactor PHY structure and add phy_capabilities enum
Catherine Sullivan [Tue, 1 Sep 2015 15:36:30 +0000 (11:36 -0400)]
i40e/i40evf: Refactor PHY structure and add phy_capabilities enum

Orabug: 22342532

Remove unused members in the PHY structure and add a new member to store
all the capabilities the PHY has as reported by the FW. This information
will help us determine what speeds the device is capable of when link is
down.

Also add an enum to decode the PHY types the NVM is capable of.
Use the phy_types variable to determine what phy types are possible
when link is down instead of device id as it will be more accurate.

When on a backplane device, we do not support changing any settings,
however we should display all the phy_types we are capable of so if we
see a backplane dev ID set supported and advertised purely based on
the phy_types variable.

Change-ID: Ia75d560f1fcd30c54cbfb7458690c5867559a930
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 fc72dbce09989b268b20342473ddc8d77c8da350)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add module_types and update_link_info
Catherine Sullivan [Mon, 31 Aug 2015 23:54:53 +0000 (19:54 -0400)]
i40e/i40evf: Add module_types and update_link_info

Orabug: 22342532

Add a module_types variable to the link_info struct to save the module
information from get_phy_capabilities. This information can be used to
determine which speeds the module supports.

Also add a new function update_link_info which updates the module_types
parameter and then calls get_link_info. This function should be called
in place of get_link_info so that the module_types variable stays
up-to-date with the rest of the link information.

The EAS table does not reflect the values that are actually returned,
so instead, basing these values on the Ethernet compliance codes
specified in table 33 of SFF-8436 as these have been accurate.

Use the new variable in ethtool to differentiate between a 10G/1G dual
speed fiber module and a 10G only module.

Change-ID: Ib7585cce321319c10ce15180054c41a6cbd41389
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 0a862b43acc6c5d38fd462baa9c76f9197907d73)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: split device ids into a separate file
Shannon Nelson [Mon, 31 Aug 2015 23:54:50 +0000 (19:54 -0400)]
i40e/i40evf: split device ids into a separate file

Orabug: 22342532

Due to desires to write userland drivers, and other requests, without
needing the rest of the include files, the device ids are pulled out
into a standalone file.

Change-ID: Ic0b047dbf9d4b0891892309c1f2079f56d9b60e8
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 d72c95ea422ab63c832a13c075cb73bc87a1276e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: update fw version text string per previous product formats
Carolyn Wyborny [Mon, 31 Aug 2015 23:54:49 +0000 (19:54 -0400)]
i40e: update fw version text string per previous product formats

Orabug: 22342532

This patch moves the internal fw version and fw api version info to be
output in probe.  The nvm version, etrack and oem version info are now
configured for output via ethtool -i.

Change-ID: I05d490093a7137dbefcdef263d014d1e5c9e83d0
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 f0b44440148c257bb5b1872e8ff5d6591afc8f4f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: don't panic on VSI allocation failure
Mitch Williams [Mon, 31 Aug 2015 23:54:48 +0000 (19:54 -0400)]
i40e: don't panic on VSI allocation failure

Orabug: 22342532

In some circumstances, the firmware may fail to allocate a VSI for a VF.
When this happens, the driver does not react well to the bad news and
has a panic attack.

To fix this problem, check the return value from i40e_alloc_vf_res and
don't try to configure the device further if it failed. Additionally,
explicitly clear the INIT bit when we free VF resources, so that this
bit will be in the proper state in the failure case, and won't blow up
elsewhere.

Change-ID: I6a20ce2b59c3458fd832032e88fa28cd42500189
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 21be99ec4ed366e24d4735d230aa3086ff2bc6ed)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: remove redundant call
Mitch Williams [Mon, 31 Aug 2015 23:54:47 +0000 (19:54 -0400)]
i40e: remove redundant call

Orabug: 22342532

This function call isn't needed here; the same function is already
called by i40e_reset_vf.

Change-ID: I96ccbf91b752965c9e28fe895d4c7d4c46e3ba44
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 e7e6cfce16e9184497716e004fc9e714a7411ad0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Convert CEE App TLV selector to IEEE selector
Greg Bowers [Mon, 31 Aug 2015 23:54:46 +0000 (19:54 -0400)]
i40e: Convert CEE App TLV selector to IEEE selector

Orabug: 22342532

Changes the parsing of CEE App TLVs to fill in the App selector in struct
i40e_dcbx_config with the IEEE App selector so the caller doesn't have to
consider whether the App came from a CEE or IEEE DCBX negotiation.

Change-ID: Ia7d9d664cde04d2ebcc9822fd22e4929c6edab3a
Signed-off-by: Greg Bowers <gregory.j.bowers@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 41c3ae8b726e07e366fdb63e0e40a33528f1c3e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add info to nvm info struct for OEM version data
Carolyn Wyborny [Mon, 31 Aug 2015 23:54:45 +0000 (19:54 -0400)]
i40e/i40evf: Add info to nvm info struct for OEM version data

Orabug: 22342532

This patch adds a member to the nvm_info struct for oem_ver info to be
output either by OID or ethtool.

Change-ID: I1e5d513ae67622e2af17042924fdb4b5d6d85366
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 ac24382d41cc72541d5f8810336acf98a5e6d260)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: properly handle ndo_set_mac_address calls
Mitch Williams [Mon, 31 Aug 2015 23:54:44 +0000 (19:54 -0400)]
i40evf: properly handle ndo_set_mac_address calls

Orabug: 22342532

The driver was not correctly handling calls to its ndo_set_mac_address
method. It did not properly check to see if the override would be
allowed by the PF driver, and never removed the old address from its
filter list.

Add a new flag to the adapter struct which is set if the MAC address is
assigned by the PF. Check this flag and don't allow the MAC address to
be changed if it is set. Search for and properly remove the filter
for the old MAC address when the new one is set.

Change-ID: I817bf620c869c5a80e6a7eab65c9cbad1dc89799
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 14e52ee26bdfd6ad00075b66089b4b63fe36fff0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Use BIT() macro for priority map parsing
Neerav Parikh [Mon, 31 Aug 2015 23:54:43 +0000 (19:54 -0400)]
i40e: Use BIT() macro for priority map parsing

Orabug: 22342532

Replace one left over (1 << up) in the i40e_dcb.c file with the BIT()
macro.

Change-ID: I39492a400a2cee5ac566143a5b436cc478bea0db
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 ab252253e08c16de28ec0f6da0a7ff684a8fce98)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Make it clear a parameter is never used
Carolyn Wyborny [Mon, 31 Aug 2015 23:54:42 +0000 (19:54 -0400)]
i40e: Make it clear a parameter is never used

Orabug: 22342532

Flag the filter_mask parameter as __always_unused in the
ndo_bridge_getlink function.

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

9 years agoi40e/i40evf: Add new link status defines
Shannon Nelson [Mon, 31 Aug 2015 23:54:41 +0000 (19:54 -0400)]
i40e/i40evf: Add new link status defines

Orabug: 22342532

Add the new Port link status bit and rename the link status to function
link status.

Change-ID: I71289327ae62638ce967b6ad40114caf998b6dab
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 1d55aa9c350b02a0c79d901518026e3af5d5b006)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: print neato new features
Jesse Brandeburg [Fri, 28 Aug 2015 21:55:59 +0000 (17:55 -0400)]
i40e: print neato new features

Orabug: 22342532

To help users and developers know what compile options
and hardware features are enabled at compile time, print
VxLAN is available.

Change-ID: I3162f3b7678dc725a597f964217920eb218b480b
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 ce6fcb3f2467902b48e59d1c866c5b4c9f6136eb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: pass QOS handle to VF
Mitch Williams [Fri, 28 Aug 2015 21:55:58 +0000 (17:55 -0400)]
i40e/i40evf: pass QOS handle to VF

Orabug: 22342532

The VF really doesn't care about the QOS handle but it will in the
future. Since the VF only uses TC0, send it that handle. On the VF
side, save the handle and use it to populate the QOS params when we call
into the client interface.

Change-ID: I76f41b070baeaa09b19383e9168bc677837e0761
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 f578f5f453abf09e8cb4c3aaf1e0c3bdf8125493)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: use capabilities flags properly
Mitch Williams [Fri, 28 Aug 2015 21:55:57 +0000 (17:55 -0400)]
i40evf: use capabilities flags properly

Orabug: 22342532

Use the capabilities passed to us by the PF driver to control VF driver
behavior. In the process, clean up the VLAN add/remove code so it's not
a horrible morass of ifdefs.

Change-ID: I1050eaf12b658a26fea6813047c9964163c70a73
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 8ed995ff6bb9c5436db64b3653a0c62a0cd18f08)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: refactor code to remove indent
Jesse Brandeburg [Fri, 28 Aug 2015 21:55:56 +0000 (17:55 -0400)]
i40e: refactor code to remove indent

Orabug: 22342532

I found a code indent that was avoidable because a whole function is inside
an if block, reverse the if and move the code back a tab.

Change-ID: I9989c8750ee61678fbf96a3b0fd7bf7cc7ef300a
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 a5fdaf342aa2fa6679dcb87dad2f78f1309de29e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: clean up some code
Jesse Brandeburg [Fri, 28 Aug 2015 21:55:54 +0000 (17:55 -0400)]
i40e/i40evf: clean up some code

Orabug: 22342532

Add missings spaces after declarations, remove another __func__ use,
remove uncessary braces, remove unneeded breaks, and useless returns,
and generally fix up some code.

Change-ID: Ie715d6b64976c50e1c21531685fe0a2bd38c4244
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
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 6995b36c0fc3dd97c1d641f9630d19db2cadf44f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: detect reset more reliably
Mitch Williams [Fri, 28 Aug 2015 21:55:53 +0000 (17:55 -0400)]
i40evf: detect reset more reliably

Orabug: 22342532

Using VFGEN_RSTAT to detect a VF reset is an endeavor that is fraught
with peril. It's entirely too easy to miss a reset because none of the
bits are sticky. By the time the VF driver reads the register, the reset
may have been processed and cleaned up by the PF driver, leaving the
register in the same state that it was before the reset.

Instead, detect a reset with the VF_ARQLEN register. When the VF is
reset, the enable bit in this register is cleared, and it stays cleared
until the VF driver processes the reset and re-enables the admin queue.

Because we now deal with multiple registers in the reset and watchdog
tasks, rename the rstat_val variable to reg_val.

Change-ID: Id1df17045c0992e607da0162d31807f7fc20d199
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 ee5c1e92dd01d372b8e054b5a7e1cc19a1d32815)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Support FW CEE DCB UP to TC map nibble swap
Greg Bowers [Fri, 28 Aug 2015 21:55:52 +0000 (17:55 -0400)]
i40e: Support FW CEE DCB UP to TC map nibble swap

Orabug: 22342532

Changes parsing of AQ command Get CEE DCBX OPER CFG (0x0A07). Change is
required because FW creates the oper_prio_tc nibbles reversed from those
in the CEE Priority Group sub-TLV.

Change-ID: I7d9d8641bb430d30e286fc3fac909866ef8a0de8
Signed-off-by: Greg Bowers <gregory.j.bowers@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 95e5613f75ac93d0547b7d2077030a5fe11af21e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Explicitly assign enum index for VSI type
Serey Kong [Thu, 27 Aug 2015 15:42:41 +0000 (11:42 -0400)]
i40e/i40evf: Explicitly assign enum index for VSI type

Orabug: 22342532

Ran into an issue where PF's VSI type list was different from VF's,
which was resulted in different enum index. The VSI type list can
be different depending on what build flag is used for PF and VF.

The change is to explicitly assign enum index for each VSI type
so that PF and VF always reference to the same VSI type event if the
enum lists are different.

Change-ID: I8c0e5fdb515f324f7964df863a458073cf467e57
Signed-off-by: Serey Kong <serey.kong@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 66486cd71723b2b41b36759159b551230ab8763d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add switch for link polling
Shannon Nelson [Thu, 27 Aug 2015 15:42:40 +0000 (11:42 -0400)]
i40e: add switch for link polling

Orabug: 22342532

There's been some need for controlling the periodic link polling for
debugging link issues.  This patch enables switching it off and on
through an ethtool private flag.  The link poll remains on by default,
but can be turned off with
ethtool --set-priv-flags p261p1 LinkPolling off
and later turned back on with
ethtool --set-priv-flags p261p1 LinkPolling on

To check the current status, use
ethtool --show-priv-flags p261p1

Change-ID: I32e4ab654ff3eec90a06cf144899971b82d71c40
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 9ac77266379d070c6d140ad44f86a99936497eeb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix multiple link up messages
Matt Jared [Thu, 27 Aug 2015 15:42:39 +0000 (11:42 -0400)]
i40e: Fix multiple link up messages

Orabug: 22342532

This patch addresses an issue where multiple link up messages can be logged
resulting from aq link status timing when link properties are changed (fc,
speed, etc.); solved by using a single function to handle status printing
and adding a mechanism to track whether link state (up or down) has
actually changed.

Change-ID: Ied6ed6e49dc397c77d992adc0bc9ed3767152b9d
Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c156f856ad8ba4f71bcdb2c92ba1a9effaa29ac1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix for extra Flow Director filter in table after error
Carolyn Wyborny [Thu, 27 Aug 2015 15:42:38 +0000 (11:42 -0400)]
i40e: Fix for extra Flow Director filter in table after error

Orabug: 22342532

This patch fixes a problem where the PF's fdir filter table would have an
entry that the hw was unable to add. This notification happens in the hot
path, so instead of trying to fix it then, we note the location in the
failure case and delete it during regular fdir subtask callback. Without
this patch, a case can occur where an invalid entry gets replayed and a
valid one is not.

Change-ID: I67831c183b5d0309876de807cc434809b74c9cb7
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
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 3487b6c30c0dd2204dc31e14330097dff02d9a58)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Store CEE DCBX DesiredCfg and RemoteCfg
Neerav Parikh [Thu, 27 Aug 2015 15:42:37 +0000 (11:42 -0400)]
i40e/i40evf: Store CEE DCBX DesiredCfg and RemoteCfg

Orabug: 22342532

This patch adds capability to query and store the CEE DCBX DesiredCfg
and RemoteCfg data from the LLDP MIB.
Added new member "desired_dcbx_config" in the i40e_hw data structure
to hold CEE only DesiredCfg data.

Change-ID: I19c550369594384eaff4cc63e690ca740231195d
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 1a9375eb7f987e9338c17504dd2b358b688b32d8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add parsing for CEE DCBX TLVs
Neerav Parikh [Thu, 27 Aug 2015 15:42:36 +0000 (11:42 -0400)]
i40e: Add parsing for CEE DCBX TLVs

Orabug: 22342532

This patch adds parsing for CEE DCBX TLVs from the LLDP MIB.

While the driver gets the DCB CEE operational configuration from Firmware
using the "Get CEE DCBX Oper Config" AQ command there is a need to get
the CEE DesiredCfg Tx by firmware and DCB configuration Rx from peer; for
debug and other application purposes.

Change-ID: I9140edf1a25a2852c7eff805d81e5eff6266178d
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 909b2d16c41f3a56ff67342073ae5f2569d58084)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add more verbose error messages
Mitch Williams [Thu, 27 Aug 2015 15:42:35 +0000 (11:42 -0400)]
i40e: add more verbose error messages

Orabug: 22342532

Under certain circumstances, the device may not have enough resources to
enable all of the VFs that it advertises in config space. Although the
number of supported VFs is reported upon driver init, it is not obvious
when this is different from the number reported in config space. To
eliminate this confusion, add an error message explaining the problem.
Additionally, move the 'Allocating VFs' message down below the error
checks so as to prevent further confusion.

Change-ID: I45b7efca53a7aebf7777be33a8bc9d615ae48ea1
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 96c8d0738aff3ecf3e8b3253fb286685e35d93e6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: inline interrupt enable
Jesse Brandeburg [Thu, 27 Aug 2015 15:42:34 +0000 (11:42 -0400)]
i40e: inline interrupt enable

Orabug: 22342532

The interrupt enable function can be inlined by moving it to the header
file, which decreases the function call overhead for a frequently called
function.

Change-ID: I3214cc99593725768642680e7b8ce7e9bba7e44d
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 02d109be3ddc9768c1c38709218648d0c48a4ea9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix erroneous WARN_ON
Jesse Brandeburg [Thu, 27 Aug 2015 15:42:33 +0000 (11:42 -0400)]
i40e: fix erroneous WARN_ON

Orabug: 22342532

The driver was issuing a WARN_ON during ring size changes
because the code was cloning the rx_ring struct but
not zeroing out the pointers before allocating new memory.

Zero out the pointers in the cloned copy before allocating
new memory for them.  In this case the code was correctly
avoiding memory leaks but still triggering the warning.

Change-ID: I186dd493948e9b7254ab0593d4aad8b68808918d
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 1e8efb42cf32982d68c1ceab3e3dc15a05157632)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: remove unused opcode
Mitch Williams [Thu, 27 Aug 2015 15:42:32 +0000 (11:42 -0400)]
i40e/i40evf: remove unused opcode

Orabug: 22342532

This opcode is not required. VFs that program RSS through the firmware
do it by interacting directly with the firmware, and do not need to use
the virtual channel for this functionality.

Change-ID: Iaf17d2600e28ff1b6be8653f2fe9df1facd23b0e
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 7fd0ac66c2de5767e234fea6436d28dce210da80)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: propagate interrupt allocation failure
Mitch Williams [Thu, 27 Aug 2015 15:42:31 +0000 (11:42 -0400)]
i40evf: propagate interrupt allocation failure

Orabug: 22342532

Lower level functions are properly reporting errors, and higher-level
functions are correctly responding to errors, but the errors aren't
actually getting through. Typically, the middle-manager function seems
to want to shield its boss from any bad news.

This change fixes a panic if the driver is unable to enable MSI-X or is
unable to acquire enough vectors.

Change-ID: Ifd5787ce92519a5d97e4b465902db930d97b71a1
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 313ed2d52052ad8dab9a6182cde55a832873cbea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Additional checks for CEE APP priority validity
Neerav Parikh [Thu, 27 Aug 2015 15:42:30 +0000 (11:42 -0400)]
i40e: Additional checks for CEE APP priority validity

Orabug: 22342532

The firmware has added additional status information to allow software
to determine if the APP priority for FCoE/iSCSI/FIP is valid or not in
CEE DCBX mode.

This patch adds to support those additional checks and will only add
applications to the software table that have oper and sync bits set
without any error.

Change-ID: I0a76c52427dadf97d4dba4538a3068d05e4eb56b
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 2642f02528b6e9c1e904f6e3ec902d8a2deb7af5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add a stat to keep track of linearization count
Anjali Singhai Jain [Thu, 27 Aug 2015 15:42:29 +0000 (11:42 -0400)]
i40e/i40evf: Add a stat to keep track of linearization count

Orabug: 22342532

Keep track of how many times we ask the stack to linearize the
skb because the HW cannot handle skbs with more than 8 frags per
segment/single packet.

Change-ID: If455452060963a769bbe6112cba952e79e944b52
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 2fc3d7152ae9562c15c30ed4a766ba05a3db8200)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix unicast mac address add
Shannon Nelson [Wed, 26 Aug 2015 19:14:20 +0000 (15:14 -0400)]
i40e/i40evf: fix unicast mac address add

Orabug: 22342532

When using something like "ip maddr add ..." to add another unicast mac
address to the netdev, the mac address comes into the set_rx_mode handler
in the multicast list whether it is a unicast or multicast address.
This was confusing the code when it was trying to search for addresses
that needed to be deleted from the VSI, because it was looking for the
VSI unicast address in the netdev unicast list.  The result was that a
new unicast address would get added to the VSI list and then immediately
removed, and would never actually make it down into the hardware.

This patch removes the separation from unicast and multicast in the search
for filters to be deleted.  It also simplifies the logic a little with a
jump to the bottom of the loop when an address is found.  Now it doesn't
matter which netdev list the address is hiding in, we'll check them all.

Change-ID: Ie3685a92427ae7d2212bf948919ce295bc7a874c
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 2f41f3358672dfda67c1e254f1e823d98e6a3099)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix bug in return from get_link_status and avoid spurious link messages
Jesse Brandeburg [Wed, 26 Aug 2015 19:14:19 +0000 (15:14 -0400)]
i40e: fix bug in return from get_link_status and avoid spurious link messages

Orabug: 22342532

Previously, the driver could call this function and have only true/false
returned, but false could mean multiple things like failure to read
or link was down. This change allows the caller to get all return values
in the call chain bubbled back to the source, which keeps information about
failures from being lost.

Also, in some unlikely scenarios, the firmware can become slow to respond
to admin queue (AQ) queries for link state.  Should the AQ time out,
the driver can detect the state and avoid a link change when there
may have been none.

Change-ID: Ib2ac38407b7880750fb891b392fa77457fe6c21c
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 a72a5abcb37beac163704efba6a3d33ebca4d90a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add little endian conversion for checksum
Jesse Brandeburg [Wed, 26 Aug 2015 19:14:18 +0000 (15:14 -0400)]
i40e: add little endian conversion for checksum

Orabug: 22342532

The checksum is not correct on big endian machines so add code to swap it
correctly.

Change-ID: Ic92b886d172a2cbe49f5d7eee1bc78e447023c7b
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit dd38c583aea07c508caeaf979c64e267584ee067)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: give up the __func__
Shannon Nelson [Wed, 26 Aug 2015 19:14:17 +0000 (15:14 -0400)]
i40e/i40evf: give up the __func__

Orabug: 22342532

During early development, we added the function name to all of the error
strings to make debugging simpler. Now that we've released the driver,
our users should have more comprehensible error messages. So tear the
roof off and give up the __func__. Ow.

Change-ID: I7e1766252c7a032b9af6520da6aff536bdfd533c
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
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 fb43201f150300fa2c0215f00418eda9143cdab1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Never let speed get set to 0 in get_settings
Catherine Sullivan [Wed, 26 Aug 2015 19:14:16 +0000 (15:14 -0400)]
i40e: Never let speed get set to 0 in get_settings

Orabug: 22342532

In ethtool, there is a possibility of speed getting set to 0
if advertise is set to 0 (which it is when autoneg is disabled).
We never want this to happen as the firmware will actually attempt
to set the speed to 0 sending link down, so add an extra check
to make sure this doesn't happen.

Change-ID: I62e0eeee2cbf043d8e6f5c9c9f0b92794e877f01
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 0002e1189b594d462c7a93417f5ac8bbc22bd768)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix for truncated interrupt name
Carolyn Wyborny [Wed, 26 Aug 2015 19:14:15 +0000 (15:14 -0400)]
i40e: Fix for truncated interrupt name

Orabug: 22342532

This patch extends the size of the text available for the interrupt names.
Without this patch, all the descriptive data available for the Flow
Director interrupts is truncated.

Change-ID: I2ac458f23ac3b4ea8f1edf73edc283b1d3704c7f
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 fba52e21e5cad1347255d0d3600f7e4df6e69435)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: assure clean asq status report
Shannon Nelson [Wed, 26 Aug 2015 19:14:14 +0000 (15:14 -0400)]
i40e/i40evf: assure clean asq status report

Orabug: 22342532

There was a possibility where the asq_last_status could get through without
update and thus report a previous error.  I don't think we've actually seen
this happen, but this patch will help make sure it doesn't.

Change-ID: I9e33927052a5ee6ea21f80b66d4c4b76c2760b17
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Christopher Pau <christopher.pau@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 9e1c26e35030aa56057a69514acb17da5e81eb16)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: make i40e_init_pf_fcoe to void
Shannon Nelson [Wed, 26 Aug 2015 19:14:13 +0000 (15:14 -0400)]
i40e: make i40e_init_pf_fcoe to void

Orabug: 22342532

i40e_init_pf_fcoe() didn't return anything except 0, it prints enough
error info already, and no driver logic depends on the return value,
so this can be void.

Change-ID: Ie6afad849857d87a7064c42c3cce14c74c2f29d8
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 21364bcfc7810894114ab18f5335745e374cc2ea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix bad CEE status shift value
Shannon Nelson [Wed, 26 Aug 2015 19:14:12 +0000 (15:14 -0400)]
i40e: fix bad CEE status shift value

Orabug: 22342532

Fix a shift value that was wrong, ending up with a bad bitmask.  Also add
a blank line between two sets of #defines for better readability.

Change-ID: I3e41fa2a2ab904d3a4e6cbf13972ab0036a10601
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 725821f340184fcdd35dbd369c5058eec8a30fcb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix a potential type compare issue
Shannon Nelson [Wed, 26 Aug 2015 19:14:11 +0000 (15:14 -0400)]
i40e/i40evf: fix a potential type compare issue

Orabug: 22342532

Rework an if expression to assure there is no type compare problem between
a size and a possible negative number.

Change-ID: I4921fcc96abfcf69490efce020a9e4007f251c99
Reported-by: Helin Zhang <helin.zhang@intel.com>
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 df08fd4dbcc95cbc5a35745b6a77a9df0dc5776f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: add driver support for new device ids
Shannon Nelson [Wed, 26 Aug 2015 19:14:10 +0000 (15:14 -0400)]
i40e/i40evf: add driver support for new device ids

Orabug: 22342532

Early addition of new a device id.

Change-ID: I61a8c8556fdf4f5714be4e4089689e374f30293c
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 bc5166b908aaa126d524b84c767323b75c17bdee)
Signed-off-by: Brian Maly <brian.maly@oracle.com>