]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
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>
9 years agoi40evf: fix compiler warning of unused variable
Jesse Brandeburg [Sun, 4 Oct 2015 08:09:49 +0000 (01:09 -0700)]
i40evf: fix compiler warning of unused variable

Orabug: 22342532

Compiler complained of an unused variable, which the driver was just
using to store the result of a rd32 which is used to clear a register
unconditionally.  Just drop the unused variable and re-use one.

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 cfbe4dba0d5891faa11bd4e7c1fcdc512aff2f5f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix unconditional execution of cpu_to_le16()
Jean Sacren [Tue, 13 Oct 2015 07:06:32 +0000 (01:06 -0600)]
i40e: fix unconditional execution of cpu_to_le16()

Orabug: 22342532

The commit 3092e5e4cc79 ("i40e: add little endian conversion for
checksum") fixed the checksum bug on big-endian architecture.

But we should not execute cpu_to_le16() unconditionally. Thus, put
cpu_to_le16() under certain condition.

Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
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 2fc4cd52fa7ed86e9d1df94e459b6a2435bfa9c7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: clean up local variable initialization
Jean Sacren [Tue, 13 Oct 2015 07:06:31 +0000 (01:06 -0600)]
i40e: clean up local variable initialization

Orabug: 22342532

In both i40e_calc_nvm_checksum() and i40e_update_nvm_checksum(), the
local variables designated by 'ret_code' are overwritten immediately. As
such, they should merely be declared.

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 0e5229c6c576969bf8f89f8ca74fa7ea355b434e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: clean up local variable initialization
Jean Sacren [Tue, 13 Oct 2015 07:06:30 +0000 (01:06 -0600)]
i40evf: clean up local variable initialization

Orabug: 22342532

In i40evf_msix_aq(), the first two lines of rd32() are mainly to clear
the registers. If we initialize 'val' at this point, it will be
overwritten immediately. We shall simply discard the return value here.

When we initialize 'val', we might as well include the mask in one step.

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 ed17f7e5d7918adb487debe49fadf57fd2b98d1c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add missing kernel-doc argument
Jean Sacren [Tue, 13 Oct 2015 07:06:28 +0000 (01:06 -0600)]
i40e: add missing kernel-doc argument

Orabug: 22342532

The following kernel-doc arguments for their respective functions are
missing:

1) @cd_type_cmd_tso_mss for i40e_tso();
2) @cd_type_cmd_tso_mss for i40e_tsyn();
3) @tx_ring for i40e_tx_enable_csum().

Add them all for the kernel-doc requirement.

Signed-off-by: Jean Sacren <sakiwit@gmail.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 554f4544afa541b25882cd0ca5fd6b01b4e2ce07)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: add missing kernel-doc argument
Jean Sacren [Tue, 13 Oct 2015 07:06:27 +0000 (01:06 -0600)]
i40evf: add missing kernel-doc argument

Orabug: 22342532

@flush has been missing since the inception of i40evf_irq_enable(). Add
it for the kernel doc.

Signed-off-by: Jean Sacren <sakiwit@gmail.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 69c1d70ab6b5b53ec21919f4f8de84041d3f6cdd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
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>