]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
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>
9 years agoi40e: stop VF rings
Mitch Williams [Wed, 26 Aug 2015 19:14:09 +0000 (15:14 -0400)]
i40e: stop VF rings

Orabug: 22342532

Explicitly stop the rings belonging to each VF when disabling SR-IOV.
Even though the VFs were gone, and the associated VSIs were removed, the
rings were not stopped, and in some circumstances the hardware would
continue to access the memory formerly used by the rings, causing memory
corruption or DMAR errors, both of which would lead to general malaise
of the kernel.

To relieve this condition, explicitly stop all the rings associated with
each VF before releasing its resources.

Change-ID: I78c05d562c66e7b594b7e48d67860f49b3e5b6ec
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 0325fca7577c5157da2cdf064fc3e8d38242e47c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: enable WoL operation if config bit show WoL capable
Shannon Nelson [Wed, 26 Aug 2015 19:14:08 +0000 (15:14 -0400)]
i40e: enable WoL operation if config bit show WoL capable

Orabug: 22342532

The driver was disabling Wake-on-LAN by default and waiting for the user
to expressly turn it on.  This patch has the driver turning on WoL from
the start if enabled in the hardware config, which matches the behavior
of our other drivers.

Change-ID: I43faedb907f8ba4d1a61b72a7c86072b97af12b1
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 1d5109d18757d8d6450905275bf362819781368c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Increase the amount of time we wait for reset to be done
Paul M Stillwell Jr [Wed, 26 Aug 2015 19:14:07 +0000 (15:14 -0400)]
i40e: Increase the amount of time we wait for reset to be done

Orabug: 22342532

In some rare cases the reset can take longer to complete so increase the
amount of time we wait.

Change-ID: Ib5628ec54b526a811ee33d1214fe763226406671
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 22e05bd6f7949d3e638c9f4697a2198a19fff312)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: don't blow away MAC address
Mitch Williams [Mon, 31 Aug 2015 23:54:51 +0000 (19:54 -0400)]
i40evf: don't blow away MAC address

Orabug: 22342532

Under certain circumstances, we can get an extra VF_RESOURCES message
from the PF driver at runtime. When this happens, we need to parse it
because our VSI may have changed out from underneath us, and that will
affect our relationship with the PF driver.

However, parsing the resources message also blows away our current MAC
address in the hardware struct, usually with all zeros. When this
happens, the next time the interface is opened, it will have no MAC
address and will a) not work and b) complain.

Fix this issue by restoring the current MAC address from the netdev
struct after we parse the resource message.

Change-ID: I6cd1b624fc20432f81dc901166c8de195b8e0e65
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 8552d85442dd814d733f67592627ea55f7cbfb01)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: grab the AQ spinlocks before clearing registers
Shannon Nelson [Mon, 28 Sep 2015 18:12:38 +0000 (14:12 -0400)]
i40e/i40evf: grab the AQ spinlocks before clearing registers

Orabug: 22342532

Make sure we have the spinlocks before we clear the ARQ and ASQ management
registers.  Also, widen the locked portion and make a sanity check earlier
in the send function to be sure we're working with safe register values.

Change-ID: I34b56044b33461ed780f3d2de8d62826cdf933f9
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 24408e7ae677cea4e44ce6869a1b803820839471)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix a memory leak in X722 rss config path
Anjali Singhai [Mon, 24 Aug 2015 20:26:53 +0000 (13:26 -0700)]
i40e: Fix a memory leak in X722 rss config path

Orabug: 22342532

In any case free the memory allocated before exiting.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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 126b63d9d3aa99a90381ed168a885989dd33cf15)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Use numa_mem_id() to better support memoryless node
Jiang Liu [Mon, 17 Aug 2015 03:19:03 +0000 (11:19 +0800)]
i40evf: Use numa_mem_id() to better support memoryless node

Orabug: 22342532

Function i40e_clean_rx_irq() tries to reuse memory pages allocated
from the nearest node. To better support memoryless node, use
numa_mem_id() instead of numa_node_id() to get the nearest node with
memory.

This change should only affect performance.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 27ca2753500537b8f3f3aba43558d68e2e8439a1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Use numa_mem_id() to better support memoryless node
Jiang Liu [Mon, 17 Aug 2015 03:19:02 +0000 (11:19 +0800)]
i40e: Use numa_mem_id() to better support memoryless node

Orabug: 22342532

Function i40e_clean_rx_irq() tries to reuse memory pages allocated
from the nearest node. To better support memoryless node, use
numa_mem_id() instead of numa_node_id() to get the nearest node with
memory.

This change should only affect performance.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8dc5562e4e2b8255d2ea5d472a7fa25d5aa20da4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix 32 bit build warnings
Jesse Brandeburg [Fri, 14 Aug 2015 01:54:31 +0000 (18:54 -0700)]
i40e: fix 32 bit build warnings

Orabug: 22342532

Sparse found some issues with 32 bit compilation, which probably should
at least work without warning.  Not only that, but the code was wrong.
Thanks sparse!!

And thanks to the kbuild robot zero day testing for finding this issue.

$ make ARCH=i386 M=drivers/net/ethernet/intel/i40e C=2 CF="-D__CHECK_ENDIAN__"
  CHECK   drivers/net/ethernet/intel/i40e/i40e_main.c
  include/linux/etherdevice.h:79:32: warning: restricted __be16 degrades to integer
  drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (32) for type unsigned long
  drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (42) for type unsigned long
  drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (39) for type unsigned long
  drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (40) for type unsigned long

CC: kbuild-all@01.org
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reported-by: kbuild test robot <fengguang.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 9c70d7cebfec558e07a2ab0f2d5f5a80a821ecf5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix kbuild warnings
Jesse Brandeburg [Fri, 14 Aug 2015 01:54:26 +0000 (18:54 -0700)]
i40e: fix kbuild warnings

Orabug: 22342532

The 0day build infrastructure found some issues in i40e, this
removes the warnings by adding a harmless cast to a dev_info.

CC: kbuild-all@01.org
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reported-by: kbuild test robot <fengguang.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 e88ae667ecccf104311ec1a34536bd1e8a0fe6f7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: tweak init timing
Mitch Williams [Thu, 13 Aug 2015 22:11:32 +0000 (15:11 -0700)]
i40evf: tweak init timing

Orabug: 22342532

This patch tweaks the init timing of the driver just a little bit to
increase stability on load/unload and SR-IOV enable/disable cycles.

First, run the init_task loop a little quicker in order to reduce
overall init time.

Second, stagger the start of the init task based on the device's
PCIe function ID. This lessens the impact on the firmware when a
whole bunch of VFs are initialized simultaneously, e.g. enabling
SR-IOV without the VF driver blacklisted. For single VFs assigned
to VMs this will have no effect as the function ID will always be 0.

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 9b32b0b5dded7382c00595180bd5ce4f2f8c3d9b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: warn on double free
Jesse Brandeburg [Thu, 23 Jul 2015 20:54:42 +0000 (16:54 -0400)]
i40e: warn on double free

Orabug: 22342532

Down was requesting queue disables, but then exited immediately without
waiting for the queues to actually disable. This could allow any
function called after i40evf_down to run immediately, including
i40evf_up, and causes a memory leak.

This issue has been fixed in a recent refactor of the reset code, but
add a couple WARN_ONs in the slow path to help us recognize if we
reintroduce this issue or if we missed any cases.

Change-ID: I27b6b5c9a79c1892f0ba453129f116bc32647dd0
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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 e908f81562b1367ac3ab3d156db3dcbbe07479f6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: refactor interrupt enable
Jesse Brandeburg [Thu, 23 Jul 2015 20:54:41 +0000 (16:54 -0400)]
i40e: refactor interrupt enable

Orabug: 22342532

The interrupt enable function was always making the caller add
the base_vector from the VSI struct which is already passed to
the function. Just collapse the math into the helper function.

Change-ID: I54ef33aa7ceebc3231c3cc48f7b39fd0c3ff5806
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 7845548de7e4b49451f0eed77f690e579c428417)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Strip VEB stats if they are disabled in HW
Anjali Singhai Jain [Thu, 23 Jul 2015 20:54:40 +0000 (16:54 -0400)]
i40e: Strip VEB stats if they are disabled in HW

Orabug: 22342532

Due to performance reasons, VEB stats have been disabled in the hw. This
patch adds code to check for that condition before accumulating these
stats.

Change-ID: I7d805669476fedabb073790403703798ae5d878e
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 d1a8d275340470b89fa3a3f7c47433caf1286336)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: add new device id 1588
Shannon Nelson [Thu, 23 Jul 2015 20:54:39 +0000 (16:54 -0400)]
i40e/i40evf: add new device id 1588

Orabug: 22342532

Add new device id and support for another 20Gb device.

Change-ID: Ib1b61e5bb6201d84953f97cade39a6e3369c2cf2
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 48a3b512e8c0703884dd1b3afd85a295ecd36b5f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove useless message
Greg Rose [Thu, 23 Jul 2015 20:54:38 +0000 (16:54 -0400)]
i40e: Remove useless message

Orabug: 22342532

Remove a useless message that blathers on whenever a vxlan port is deleted.

Change-ID: If63fb8cf38e56cf433b68e498f11389de51919ba
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 201991004da2c88e780ec58c93c960d0223c3687)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: limit debugfs io ops
Shannon Nelson [Thu, 23 Jul 2015 20:54:37 +0000 (16:54 -0400)]
i40e: limit debugfs io ops

Orabug: 22342532

Don't let the debugfs register read and write commands try to access
outside of the ioremapped space.  While we're at it, remove the use of
a misleading constant.

Change-ID: Ifce2893e232c65c7a76c23532c658f298218a81b
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 2ac8b675d9466b397f94aa1ead575d39b71b5055)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: use QOS field consistently
Mitch Williams [Thu, 23 Jul 2015 20:54:36 +0000 (16:54 -0400)]
i40e: use QOS field consistently

Orabug: 22342532

In i40e_ndo_set_vf_port_vlan, we were using the QOS value
inconsistently, sometimes shifting it, sometimes not. Do the shift-and-
or operation correctly, once, and use the result consistently everywhere
in the function.

Change-ID: I46f062f3edc90a8a017ecec9137f4d1ab0ab9e41
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 f7fc2f2eb11fe808df330df42a9429aa5b804388)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: count drops in netstat interface
Jesse Brandeburg [Thu, 23 Jul 2015 20:54:35 +0000 (16:54 -0400)]
i40e: count drops in netstat interface

Orabug: 22342532

The i40e rx_dropped counter was not showing up in netstat -i.
Add the right counter to be updated with the stats.

Change-ID: I4dd552e9995836099184f9d9a08e90edb591155f
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 d8201e200a7474d391fd24ca811b0375e6694387)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix Tx hang workaround code
Jesse Brandeburg [Thu, 23 Jul 2015 20:54:34 +0000 (16:54 -0400)]
i40e/i40evf: fix Tx hang workaround code

Orabug: 22342532

The arm writeback (arm_wb) code is used for kicking the Tx ring to
make sure any pending work is completed even if interrupts are
disabled. It was running when it didn't need to, and not clearing
the ring->arm_wb state after it was set.  This caused Tx hangs
to still occur occasionally when there really was no hang.
Fix this by resetting the variable right after it was used.

Change-ID: I7bf75d552ba9c4bd203d40615213861a24bb5594
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 0deda86836e489fe43a33e8d899319bd0ed985a4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fixup padding issue in get_cee_dcb_cfg_v1_resp
Shannon Nelson [Thu, 23 Jul 2015 20:54:32 +0000 (16:54 -0400)]
i40e: fixup padding issue in get_cee_dcb_cfg_v1_resp

Orabug: 22342532

The struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
word boundary layout issues, which most compilers deal with by silently
adding padding, making the actual struct larger than designed.
This patch adds an extra byte in fields reserved3 and reserved4 to directly
acknowledge that padding.

Because the struct doesn't actually change in size or layout, this doesn't
constitute a change in the API.

Change-ID: I53fa4741b73fa255621232a85fba000b0e223015
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 17351401fec6df1e6032054cd3c2ea03ad917a92)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix a port VLAN configuration bug
Greg Rose [Thu, 23 Jul 2015 20:54:31 +0000 (16:54 -0400)]
i40e: Fix a port VLAN configuration bug

Orabug: 22342532

If a port VLAN is set for a given virtual function (VF) before the VF
driver is loaded then a configuration error results in which the port
VLAN is ignored when the VF driver is subsequently loaded.  This causes
the VF's MAC/VLAN filters to not use the correct VLAN filter.  This
patch ensures that the port VLAN filter is considered at the right time
during configuration of the VF's MAC/VLAN filters.

Change-ID: I28f404cbc21a4c6d70a7980b87c77f13f06685a4
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 d9b68f8aba0ae3f9ab6c5dec4ae1052b7e26c53c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix up type clash in i40e_aq_rc_to_posix conversion
Shannon Nelson [Thu, 23 Jul 2015 20:54:30 +0000 (16:54 -0400)]
i40e/i40evf: fix up type clash in i40e_aq_rc_to_posix conversion

Orabug: 22342532

The error code sent into i40e_aq_rc_to_posix() are signed values, so we
really need to treat them as such.

Change-ID: I3d1ae0ee9ae0b1b6f5fc424f8b8cc58b0ea93203
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 1fa89a4b3b0b646ee9cb04eb890a3398eae0dc85)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: rtnl_lock called twice in i40e_pci_error_resume()
Vasily Averin [Wed, 8 Jul 2015 12:04:26 +0000 (15:04 +0300)]
i40e: rtnl_lock called twice in i40e_pci_error_resume()

Orabug: 22342532

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4c4935a964e29da61390122f0a5c9f36e8ae081d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: missing rtnl_unlock in i40evf_resume()
Vasily Averin [Tue, 7 Jul 2015 15:53:38 +0000 (18:53 +0300)]
i40evf: missing rtnl_unlock in i40evf_resume()

Orabug: 22342532

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Tested-by: Andrews Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f2a1c3680c1d9e2a1f9e68ce13f1130e587d28cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix RS bit update in Tx path and disable force WB workaround
Anjali Singhai [Sat, 26 Sep 2015 01:26:13 +0000 (18:26 -0700)]
i40e: 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 and when
it does a WB. It also optimizes when we do a wmb.

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 5804474311912c1b80601a1afee052e8df962cd4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add GRE tunnel type to csum encoding
Shannon Nelson [Fri, 25 Sep 2015 19:26:04 +0000 (19:26 +0000)]
i40e: add GRE tunnel type to csum encoding

Orabug: 22342532

Make sure the Tx checksum encoder knows about GRE protocol and sets the
descriptor flag appropriately.

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 c1d1791dc8b2a13c316a4e163552804361a786a4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: refactor tx timeout logic
Kiran Patil [Thu, 24 Sep 2015 22:13:15 +0000 (18:13 -0400)]
i40e/i40evf: refactor tx timeout logic

Orabug: 22342532

This patch modifies the driver timeout logic by issuing a writeback
request via a software interrupt to the hardware the first time the
driver detects a hang. The driver was too aggressive in resetting a hung
queue, so back that off by removing logic to down the netdevice after
too many hangs, and move the function to the service task.

Change-ID: Ife100b9d124cd08cbdb81ab659008c1b9abbedea
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@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 b03a8c1f4c0c6f95f5addaf4a13dd3aa118c3c1a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move i40e_get_head into header file
Kiran Patil [Thu, 24 Sep 2015 19:43:02 +0000 (15:43 -0400)]
i40e: Move i40e_get_head into header file

Orabug: 22342532

i40e_get_head needs to be called in multiple files in a further patch,
prepare by moving the function into a header file.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1e6d6f8c1b07a5874444c3a403eb24427e8b39d3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agologging errors that get masked to EIO inside drivers/block/loop.c
Manjunath Patil [Thu, 10 Dec 2015 00:05:54 +0000 (19:05 -0500)]
logging errors that get masked to EIO inside drivers/block/loop.c

Currently, some loop driver functions mask all errors to EIO.
This patch is intended to log actual error prior to returning
EIO to guest.

ENOSPC and EDQUOT are handled specially as they are common in
dom0

Orabug: 22505557
Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
Acked-by: Srinivas Eeda <srinivas.eeda@oracle.com>
9 years agobe2iscsi: Update the driver version
Jitendra Bhivare [Wed, 24 Feb 2016 06:48:45 +0000 (12:18 +0530)]
be2iscsi: Update the driver version

Orabug: 22725588

Driver version: 10.6.0.2

Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix memory leak in beiscsi_alloc_mem()
Maurizio Lombardi [Thu, 1 Oct 2015 08:56:25 +0000 (10:56 +0200)]
be2iscsi: Fix memory leak in beiscsi_alloc_mem()

Orabug: 22725588

In case of error, the memory allocated for phwi_ctrlr was not freed.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Add lock to protect WRB alloc and free
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:20 +0000 (15:49 +0530)]
be2iscsi: Add lock to protect WRB alloc and free

Orabug: 22725588

FW got into UE after running IO stress test

With kernel change to split session lock in frwd_lock and back_lock for
tx and rx path correspondingly, in the IO path, common resource used in
driver such as WRB was left unprotected.

Add wrb_lock spinlock to protect allocation and freeing of WRB.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: _bh for io_sgl_lock and mgmt_sgl_lock
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:19 +0000 (15:49 +0530)]
be2iscsi: _bh for io_sgl_lock and mgmt_sgl_lock

Orabug: 22725588

Processing of mgmt and IO tasks are done in process context and
softirqs.

Allocation and freeing of sgl_handles needs to be done under
spin_lock_bh/spin_unlock_bh and move the locks to the routines.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix ExpStatSn in management tasks
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:18 +0000 (15:49 +0530)]
be2iscsi: Fix ExpStatSn in management tasks

Orabug: 22725588

Connection resets observed from some targets when NOP-Out with wrong
ExpStatSn is sent.

FW keeps track of StatSn and fills up ExpStatSn accordingly.  The header
filled up by the stack needs to be modified by driver to clear
ExpStatSn. If the field is not cleared, FW recalculates ExpStatSn and
wrong offset'ed ExpStatSn is seen in the wire trace.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Couple MCC tag and WRB alloc and free
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:17 +0000 (15:49 +0530)]
be2iscsi: Couple MCC tag and WRB alloc and free

Orabug: 22725588

WARN_ON(atomic_read(&mccq->used) >= mccq->len) seen when FW gets into
UE.

MCCQ overflow is happening because driver discards any new request and
frees up the tag. The tag allocation controls the number of MCC WRB
posted.  It is being replenished but WRBs are not hence the WARN_ON.

Allocation and freeing of WRB and tags for MCC is now done in one place.
This helps to achieve proper accounting of WRB indices and MCC tags.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix MCC WRB leak in open_connection
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:16 +0000 (15:49 +0530)]
be2iscsi: Fix MCC WRB leak in open_connection

Orabug: 22725588

In open with IP of unknown address family, only tag is freed and error
returned. MCC WRB allocated for the operation is not freed.

Added check for supported family of IP in the beginning before
allocating the tag and WRB.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Cleanup processing of BMBX completion
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:15 +0000 (15:49 +0530)]
be2iscsi: Cleanup processing of BMBX completion

Orabug: 22725588

Remove confusingly named be_mcc_compl_is_new and be_mcc_compl_use
functions in processing of BMBX. Rearrange beiscsi_process_mbox_compl
function.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix be_mcc_compl_poll to use tag_state
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:14 +0000 (15:49 +0530)]
be2iscsi: Fix be_mcc_compl_poll to use tag_state

Orabug: 22725588

be_mcc_compl_poll waits till 'used' count of MCC WRBQ is zero. This is
to determine the completion of an MCC sent.

Change function to poll for the tag of MCC sent, instead, and wait till
its tag_state is cleared.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Remove be_mbox_notify_wait function
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:13 +0000 (15:49 +0530)]
be2iscsi: Remove be_mbox_notify_wait function

Orabug: 22725588

be_mbox_notify_wait does exactly same thing as be_mbox_notify.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Rename MCC and BMBX processing functions
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:12 +0000 (15:49 +0530)]
be2iscsi: Rename MCC and BMBX processing functions

Orabug: 22725588

beiscsi_mccq_compl -> beiscsi_mccq_compl_wait - indicate blocking call.
be_mcc_wait_compl -> be_mcc_compl_poll - indicate polling for completion.
be_mbox_db_ready_wait -> be_mbox_db_ready_poll - indicate polling for RDY.
be_mcc_compl_process -> beiscsi_process_mbox_compl - indicate BMBX compl.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Remove redundant MCC processing code
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:11 +0000 (15:49 +0530)]
be2iscsi: Remove redundant MCC processing code

Orabug: 22725588

be_mcc_compl_process_isr is removed. MCC CQ processing is done only in
beiscsi_process_mcc_cq and MCC CQE processing is done only in
beiscsi_process_mcc_compl.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Use macros for MCC WRB and CQE fields
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:10 +0000 (15:49 +0530)]
be2iscsi: Use macros for MCC WRB and CQE fields

Orabug: 22725588

Rename mcc_numtag to mcc_tag_status.  MCC CQE status is processed using
macros already defined in be_cmds.h.

Add MCC_Q_WRB_ and MCC_Q_CMD_TAG_MASK macros to map to already defined
CQE_STATUS_ macros to be consistent when posting MCC.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Remove unused mcc_cq_lock
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:09 +0000 (15:49 +0530)]
be2iscsi: Remove unused mcc_cq_lock

Orabug: 22725588

mcc_cq_lock spin_lock is used only in beiscsi_process_mcc which is
called only when all interrupts are disabled from mgmt_epfw_cleanup
during unloading of driver. There is no other context where there can be
contention for the processing of CQ.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: add checks for dma mapping errors
Alexey Khoroshilov [Fri, 15 Jan 2016 21:45:34 +0000 (00:45 +0300)]
be2iscsi: add checks for dma mapping errors

Orabug: 22725588

hwi_write_buffer() does not check if mapping dma memory succeed. The
patch adds the check and failure handling.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Acked-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix WRB leak in login/logout path
Jitendra Bhivare [Wed, 20 Jan 2016 08:41:00 +0000 (14:11 +0530)]
be2iscsi: Fix WRB leak in login/logout path

Orabug: 22725588

Login/Logout loop was hanging after few hours. /var/log/message showed
that alloc_wrb_handle() function was not able to allocate any new WRB.

Sep 11 11:25:22 Jhelum10 kernel: connection32513:0: Could not send nopout
Sep 11 11:25:22 Jhelum10 kernel: scsi host10: BM_4989 : Alloc of WRB_HANDLE
Failed for the CID : 384
Sep 11 11:25:22 Jhelum10 kernel: connection32513:0: Could not allocate pdu for
mgmt task.

Driver allocates WRB to pass login negotiated parameters information to FW
in beiscsi_offload_connection(). This allocated WRB was not freed so there
was WRB_Leak happening.

Put WRB used for posting the login-negotiated parameters back in pool.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix async link event processing
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:59 +0000 (14:10 +0530)]
be2iscsi: Fix async link event processing

Orabug: 22725588

Use only port_link_status only to determine link state change.  Only bit
0 is used to get the state.  Remove code for processing port_fault.

Fixed get_nic_conf structure definition. Removed rsvd[23] field in
be_cmd_get_nic_conf_resp.

Moved definitions of struct field values below the field.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix to process 25G link speed info from FW
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:58 +0000 (14:10 +0530)]
be2iscsi: Fix to process 25G link speed info from FW

Orabug: 22725588

Async link event provides port_speed info. Cache the port_speed info
and use the same to report in ISCSI_HOST_PARAM_PORT_SPEED query.

Removed link status query IOCTL used to do the same.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix IOPOLL implementation
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:56 +0000 (14:10 +0530)]
be2iscsi: Fix IOPOLL implementation

Orabug: 22725588

OS not responding when running 2 port traffic on 72 CPUs system.

be2iscsi IRQs gets affined to CPU0 when irqbalancer is disabled.
be_iopoll processing completions in BLOCK_IOPOLL_SOFTIRQ hogged CPU0.

1. Use budget to exit the polling loop. beiscsi_process_cq didn't honour
   it.
2. Rearming of EQ is done only after iopoll completes.

[mkp: Fixed up blk_iopoll -> irq_poll transition]

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix return value for MCC completion
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:55 +0000 (14:10 +0530)]
be2iscsi: Fix return value for MCC completion

Orabug: 22725588

Change return value of completed MCC EBUSY to EINVAL.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Add FW config validation
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:54 +0000 (14:10 +0530)]
be2iscsi: Add FW config validation

Orabug: 22725588

System crash in I+T card personality.

Fix to add validation for ULP in initiator mode, physical port number,
and supported queue, icd, cid counts.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix to handle misconfigured optics events
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:53 +0000 (14:10 +0530)]
be2iscsi: Fix to handle misconfigured optics events

Orabug: 22725588

Log messages for misconfigured transceivers reported by FW.

Register async events that driver handles using MCC_CREATE_EXT ioctl.
Errors messages for faulted/uncertified/unqualified optics are logged.
Added IOCTL to get port_name to be displayed in error message.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix VLAN support for IPv6 network
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:52 +0000 (14:10 +0530)]
be2iscsi: Fix VLAN support for IPv6 network

Orabug: 22725588

Configuring VLAN parameters through IPv6 interface was not supported in
driver.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Fix to remove shutdown entry point
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:51 +0000 (14:10 +0530)]
be2iscsi: Fix to remove shutdown entry point

Orabug: 22725588

Null pointer dereference in shutdown path after taking dump.

Shutdown path is not needed as FW comes up clean every time during probe
after issuing FUNCTION reset MBOX command.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Added return value check for mgmt_get_all_if_id
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:50 +0000 (14:10 +0530)]
be2iscsi: Added return value check for mgmt_get_all_if_id

Orabug: 22725588

Use of mutex_lock_interruptible can return -EINTR, handle and log the
error.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agobe2iscsi: Set mbox timeout to 30s
Jitendra Bhivare [Wed, 20 Jan 2016 08:40:49 +0000 (14:10 +0530)]
be2iscsi: Set mbox timeout to 30s

Orabug: 22725588

FW recommended timeout for all mbox command is 30s.  Use msleep instead
mdelay to relinquish CPU when polling for mbox completion.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>