]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
8 years agoixgbe: Correct X550 phy ID
Don Skidmore [Fri, 4 Nov 2016 20:46:16 +0000 (16:46 -0400)]
ixgbe: Correct X550 phy ID

Orabug: 24568240

We were using an old Alpha version of the X550 phy ID.  This was leading
to unnecessary queries of the PHY.  I removed the old ID (which shouldn't
be on any HW) and add the two that are.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5f1c3589b0f0feb2c99b985d3a3bbda0dd790626)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add X553 FW ALEF support
Don Skidmore [Fri, 4 Nov 2016 01:01:37 +0000 (21:01 -0400)]
ixgbe: Add X553 FW ALEF support

Orabug: 24568240

This patch add X553 FW ALEF support for B0.  ALEF is the new unified
FW.  This contains updated register defines for ALEF speed
configuration.  Likewise it also removes the AN_CNTL_8 usage from
the native SFI flow as it is no longer supported by FW.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 470739b56386dd59df046e84e54a075d8f965b84)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: set device if before calling get_invariants
Emil Tantilov [Wed, 12 Oct 2016 19:34:25 +0000 (12:34 -0700)]
ixgbe: set device if before calling get_invariants

Orabug: 24568240

Fix an issue where set_phy_power was NULL for X550 copper devices
because get_invariants was called before hw->device_id was set.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 55570b6f5e2caa37a5bbd634cbe5ed126d3656f9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: use link instead of I2C combined abstraction
Emil Tantilov [Mon, 10 Oct 2016 21:54:03 +0000 (14:54 -0700)]
ixgbe: use link instead of I2C combined abstraction

Orabug: 24568240

Introduce ixgbe_link_operations struct with the following changes:

read_i2c_combined => read_link
read_i2c_combined_unlocked => read_link_unlocked
write_i2c_combined => write_link
write_i2c_combined_unlocked => write_link_unlocked

This will allow X550EM_a to override these methods for MDIO access
while X550EM_x provides methods to use I2C combined access. This
also adds a new structure, ixgbe_link_info, to hold information
about the link. Initially this is just method pointers and a bus
address.

The functions involved in combined I2C accesses were moved from
ixgbe_phy.c to ixgbe_x550.c. The underlying functions that carry
out the combined I2C accesses were left in ixgbe_phy.c because
they share some functions with other I2C methods.

v2 - set hw->link.ops in probe.
v3 - check ii->link_ops before setting it since we don't have it
for all devices.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b71f6c40bb36f9691420f66283f3c3acca11016b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: remove SFP ixfi support
Emil Tantilov [Tue, 4 Oct 2016 00:09:58 +0000 (17:09 -0700)]
ixgbe: remove SFP ixfi support

Orabug: 24568240

Remove SFP ixfi code since there is no HW that currently supports it.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 812d7dff107fa272caf9aa4f8e2420d1d1eaa429)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Handle previously-freed msix_entries
Mark Rustad [Wed, 28 Sep 2016 22:36:38 +0000 (15:36 -0700)]
ixgbe: Handle previously-freed msix_entries

Orabug: 24568240

The msix_entries memory can be freed by a previous suspend or
remove, so don't crash on close when it isn't there.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1fa71252778d6fe151438b009416e4ce7bc1c802)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add X553 PHY FC autoneg support
Don Skidmore [Tue, 27 Sep 2016 18:31:12 +0000 (14:31 -0400)]
ixgbe: Add X553 PHY FC autoneg support

Orabug: 24568240

This patch adds X553 flow control auto negotiation for fiber and
backplain.  To enable this new function pointers were added as well
as creating a function to dynamically set function pointer we can't
define only on MAC type.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2916500db3075cf2dd7968fe0f140ef4df7c6d31)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: fix link status check for copper X550em
Emil Tantilov [Mon, 26 Sep 2016 21:08:18 +0000 (14:08 -0700)]
ixgbe: fix link status check for copper X550em

Orabug: 24568240

Read the PHY register twice in order to get the correct value for
autoneg_status.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 21d882eb3a7e8d706247f32c0352390791751e8f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: do not use ixgbe specific mdio defines
Emil Tantilov [Mon, 26 Sep 2016 21:08:13 +0000 (14:08 -0700)]
ixgbe: do not use ixgbe specific mdio defines

Orabug: 24568240

Replace some ixgbe specific MDIO defines with their equivalent
from the kernel.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4dc4000b35119fb83266f978475f5881e263358e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Update setup PHY link to unset all speeds
Don Skidmore [Sat, 22 Oct 2016 01:10:54 +0000 (21:10 -0400)]
ixgbe: Update setup PHY link to unset all speeds

Orabug: 24568240

This patch updates ixgbe_setup_phy_link_generic to set/unset
auto-negotiation for all speeds. This ensures that unsupported
speeds are unset. This is necessary since the PHY NVM may
advertise unsupported speeds.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d2e455a8884dcf5549ef67fcc2714ac0a64b9dc8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add support to retrieve and store LED link active
Don Skidmore [Fri, 21 Oct 2016 01:42:00 +0000 (21:42 -0400)]
ixgbe: Add support to retrieve and store LED link active

Orabug: 24568240

This patch adds support to get the LED link active via the LEDCTL
register.  If the LEDCTL register does not have LED link active
(LED mode field = 0x0100) set then default LED link active returned.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 805cedd663549bfc74dbbc5dca73810df0589396)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add X552 iXFI configuration helper function
Don Skidmore [Thu, 22 Sep 2016 00:21:52 +0000 (20:21 -0400)]
ixgbe: Add X552 iXFI configuration helper function

Orabug: 24568240

X553 doesn't need all the initialization that X552 did for iXFI. This
patch will allow native SPI SFP+ to work with X553 devices.  Future
patches will add additional configuration as needed.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0c1b7de4f33f64665c45a15980a02582740034ff)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: fix panic when using macvlan with l2-fwd-offload enabled
Emil Tantilov [Thu, 22 Sep 2016 22:06:52 +0000 (15:06 -0700)]
ixgbe: fix panic when using macvlan with l2-fwd-offload enabled

Orabug: 24568240

Fix NULL pointer dereference in the case where a macvlan interface is
brought up while the PF is still down:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
IP: [<ffffffffa0170fb2>] ixgbe_alloc_rx_buffers+0x42/0x1a0 [ixgbe]

Call Trace:
[<ffffffffa017336b>] ixgbe_configure_rx_ring+0x2eb/0x3d0 [ixgbe]
[<ffffffffa0173811>] ixgbe_fwd_ring_up+0xd1/0x380 [ixgbe]
[<ffffffffa0179709>] ixgbe_fwd_add+0x149/0x230 [ixgbe]
[<ffffffffa0113480>] macvlan_open+0x260/0x2b0 [macvlan]

Reported-by: Matthew Garrett <mjg59@coreos.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a3b8cb1f84a0de95323902c76bab245675d6d218)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Flip to the new dev walk API
David Ahern [Tue, 18 Oct 2016 02:15:48 +0000 (19:15 -0700)]
ixgbe: Flip to the new dev walk API

Orabug: 24568240

Convert ixgbe users to new dev walk API. This is just a code conversion;
no functional change is intended.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1cd127fc7d3a6d6a0fc9f9cca47ca3a16ee79679)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

8 years agoixgbe: reset before SRIOV init to avoid mailbox issues
Emil Tantilov [Fri, 9 Sep 2016 19:59:10 +0000 (12:59 -0700)]
ixgbe: reset before SRIOV init to avoid mailbox issues

Orabug: 24568240

Enabling SRIOV while the ixgbevf driver is loaded will result in all
mailbox requests from ixgbevf_open() being rejected by ixgbe because
adapter->clear_to_send is set to false on reset.

Call ixgbe_sriov_reinit() before pci_enable_sriov() to make sure that
mailbox requests are handled from the time ixgbevf is loaded.

Reported-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0c339bf9ac2eed861d34a9dd40aee2a2d490ec36)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF
Alexander Duyck [Thu, 8 Sep 2016 03:28:24 +0000 (20:28 -0700)]
ixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF

Orabug: 24568240

Instead of limiting the VFs if we don't use 4 queues for RSS in the PF we
can instead just limit the RSS queues used to a power of 2.  By doing this
we can support use cases where VFs are using more queues than the PF is
currently using and can support RSS if so desired.

The only limitation on this is that we cannot support 3 queues of RSS in
the PF or VF.  In either of these cases we should fall back to 2 queues in
order to be able to use the power of 2 masking provided by the psrtype
register.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e24fcf28959298e07cae9ee19eb9a4b2b399b4fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Limit reporting of redirection table if SR-IOV is enabled
Alexander Duyck [Thu, 8 Sep 2016 03:28:17 +0000 (20:28 -0700)]
ixgbe: Limit reporting of redirection table if SR-IOV is enabled

Orabug: 24568240

The hardware redirection table can support more queues then the PF
currently has when SR-IOV is enabled.  In order to account for this use the
RSS mask to trim of the bits that are not used.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fa81da7e5b261cf8010f65253661522d3ff71714)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Allow setting multiple queues when SR-IOV is enabled
Alexander Duyck [Thu, 8 Sep 2016 03:28:11 +0000 (20:28 -0700)]
ixgbe: Allow setting multiple queues when SR-IOV is enabled

Orabug: 24568240

The maximum queue count reported was 1, however support for multiple queues
with SR-IOV was added some time ago so we should report support for it to
the user so that they can select multiple queues if they so desire.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3b00da03ae303a3bdfa3bdfbb078e0eadb749375)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Use MDIO_PRTAD_NONE consistently
Mark Rustad [Thu, 1 Sep 2016 20:58:51 +0000 (13:58 -0700)]
ixgbe: Use MDIO_PRTAD_NONE consistently

Orabug: 24568240

The value MDIO_PRTAD_NONE should be used to indicate no PHY address.
Not 0, not 0xFFFF. Use the MDIO_PRTAD_NONE value consistently.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7564a8880a3cf831078a67bffb05c51f34d133eb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: add spinlocks for MTU change calls
Emil Tantilov [Mon, 29 Aug 2016 23:39:28 +0000 (16:39 -0700)]
ixgbevf: add spinlocks for MTU change calls

Orabug: 24568240

Protect set_rlpml with mailbox lock to make sure the MTU configuration
is handled properly.

This change resolves an issue where set_rlpml can fail when the VF
interface is brought up:
ixgbevf 0000:03:1d.6: Failed to set MTU at 1500

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 14b22cd9827ad6765a00ca0b267c3cb0353d9c10)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Indicate support for pause frames in all cases
Mark Rustad [Fri, 26 Aug 2016 21:48:33 +0000 (14:48 -0700)]
ixgbe: Indicate support for pause frames in all cases

Orabug: 24568240

All the MACs supported by ixgbe support pause frames, so indicate
that support in ethtool. Also set advertising according to requested
mode.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ade3ccf9dc75c94c1557108572d445f0300adead)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Resolve NULL reference by setting {read, write}_reg_mdi
Mark Rustad [Fri, 26 Aug 2016 21:48:28 +0000 (14:48 -0700)]
ixgbe: Resolve NULL reference by setting {read, write}_reg_mdi

Orabug: 24568240

Set the read_reg_mdi and write_reg_mdi method pointers for
X550EM_A_10G_T devices to resolve jumping to NULL.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8fe293aaaa7abd192633cf612065b355a66ed6ad)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: make ixgbe_led_on/off_t_x550em static
Emil Tantilov [Mon, 22 Aug 2016 23:28:34 +0000 (16:28 -0700)]
ixgbe: make ixgbe_led_on/off_t_x550em static

Orabug: 24568240

These functions are only used in ixgbe_x550.c.

Fixes a warning when compiling with -Wmissing-prototypes

Reported-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d2d43e5b9fce2c30182dd9b6c63f436ea923a4d9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: simplify the logic for setting VLAN filtering
Emil Tantilov [Mon, 22 Aug 2016 23:17:46 +0000 (16:17 -0700)]
ixgbe: simplify the logic for setting VLAN filtering

Orabug: 24568240

Simplify the logic for setting VLNCTRL.VFE by checking the  VMDQ flag
and 82598 MAC instead of having to maintain a list of MAC types.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 691e412132f07bd566934b7cbc430e87c5656de1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:39 +0000 (10:03 -0400)]
ixgbe: use IS_ENABLED() instead of checking for built-in or module

Orabug: 24568240

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ee58c1149e2bba6043e31f736f6f6136562758ac)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Eliminate useless message and improve logic
Mark Rustad [Tue, 30 Aug 2016 18:33:43 +0000 (11:33 -0700)]
ixgbe: Eliminate useless message and improve logic

Orabug: 24568240

Remove a useless log message and improve the logic for setting
a PHY address from the contents of the MNG_IF_SEL register.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ae3cb8cb20c87c0833a54360344ad4ee77bdb184)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add support for new X557 device
Don Skidmore [Thu, 18 Aug 2016 00:34:40 +0000 (20:34 -0400)]
ixgbe: Add support for new X557 device

Orabug: 24568240

This patch adds support for the new copper device X557.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 92ed84300718de43fd7a92ebbd3dc1189c6dd091)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: add device to MDIO speed setting
Don Skidmore [Wed, 17 Aug 2016 21:34:07 +0000 (17:34 -0400)]
ixgbe: add device to MDIO speed setting

Orabug: 24568240

This shouldn't matter as nothing should be attached still to be
consisted control MDIO speed for these devices as well.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a83c27e79068cbaa2ce08d696b2150ebd49e8ffd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Fix led interface for X557 devices
Don Skidmore [Wed, 17 Aug 2016 18:11:57 +0000 (14:11 -0400)]
ixgbe: Fix led interface for X557 devices

Orabug: 24568240

The X557 devices use a different interface to the LED for the port.
This patch reflect that change.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a0ad55a36e33905c7a79627f1f3448db1105210f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: fix incorrect MAC address on load
Emil Tantilov [Wed, 27 Jul 2016 17:55:08 +0000 (10:55 -0700)]
ixgbevf: fix incorrect MAC address on load

Orabug: 24568240

The PF driver was only receiving the first 4 bytes of the MAC due
to an incorrect size parameter for ixgbevf_write_msg_read_ack()
in ixgbevf_set_rar_vf().

Correct the size by calculating it on a fly for all instances where
we call ixgbevf_write_msg_read_ack()

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c64269710ef28eb0dea03098853e425851214496)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: report correct media type for KR, KX and KX4 interfaces
Veola Nazareth [Sun, 21 Aug 2016 02:35:37 +0000 (19:35 -0700)]
ixgbe: report correct media type for KR, KX and KX4 interfaces

Orabug: 24568240

ethtool reports backplane type interfaces as 1000/10000baseT link modes.
This has been corrected to report the media as KR, KX or KX4 based on the backplane interface present.

Signed-off-by: Veola Nazareth <veola.nazareth@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 27b23f96f3cf6ffd680e28bf569d8ddd71842590)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Do not clear RAR entry when clearing VMDq for SAN MAC
Alexander Duyck [Sat, 20 Aug 2016 03:58:26 +0000 (20:58 -0700)]
ixgbe: Do not clear RAR entry when clearing VMDq for SAN MAC

Orabug: 24568240

The RAR entry for the SAN MAC address was being cleared when we were
clearing the VMDq pool bits.  In order to prevent this we need to add
an extra check to protect the SAN MAC from being cleared.

Fixes: 6e982aeae ("ixgbe: Clear stale pool mappings")
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c10ac75aeed2d8486a73a316ac3a08f85d140894)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: use atomic bitwise operations when handling reset requests
Emil Tantilov [Fri, 29 Jul 2016 21:46:31 +0000 (14:46 -0700)]
ixgbe: use atomic bitwise operations when handling reset requests

Orabug: 24568240

Use atomic bitwise operations when setting and checking reset
requests. This should help with possible races in the service task.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 57ca2a4fed520ee85a8fe809ff1947ec7c25aec9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: only check Tx queue enablement when debugging
Emil Tantilov [Fri, 29 Jul 2016 17:30:16 +0000 (10:30 -0700)]
ixgbevf: only check Tx queue enablement when debugging

Orabug: 24568240

Following a write the VFTXDCTL.ENABLE bit is set only when the Tx queue
is actually enabled, which may not happen during the configure phase even
if we waited for it. Make this check debug only since this is causing
confusion with users who notice the warning in dmesg.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ee95053f78ee6883a6aeb75e346346adc0f4aded)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: change hw_dbg to use netdev_dbg
Emil Tantilov [Fri, 29 Jul 2016 17:30:11 +0000 (10:30 -0700)]
ixgbevf: change hw_dbg to use netdev_dbg

Orabug: 24568240

Instead of the home brewed macro make use of netdev_dbg same as
the ixgbe driver.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4ad6af0237fd3a2ab8e8ef8a43f7fe4bb3787718)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: only check Tx queue enablement when debugging
Emil Tantilov [Fri, 29 Jul 2016 17:30:06 +0000 (10:30 -0700)]
ixgbe: only check Tx queue enablement when debugging

Orabug: 24568240

Following a write the TXDCTL.ENABLE bit is set only when the Tx queue
is actually enabled, which may not happen during the configure phase even
if we waited for it. Make this check debug only since this is causing
confusion with users who notice the warning in dmesg.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a55defd897cb2b4d96fedd81e2d5513d83ff339e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
Alexander Duyck [Thu, 11 Aug 2016 21:51:56 +0000 (14:51 -0700)]
ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths

Orabug: 24568240

When I was adding the code for enabling VLAN promiscuous mode with SR-IOV
enabled I had inadvertently left the VLNCTRL.VFE bit unchanged as I has
assumed there was code in another path that was setting it when we enabled
SR-IOV.  This wasn't the case and as a result we were just disabling VLAN
filtering for all the VFs apparently.

Also the previous patches were always clearing CFIEN which was always set
to 0 by the hardware anyway so I am dropping the redundant bit clearing.

Fixes: 16369564915a ("ixgbe: Add support for VLAN promiscuous with SR-IOV")
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f60439bc21e3337429838e477903214f5bd8277f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: cleanup crosstalk fix
Don Skidmore [Tue, 19 Jul 2016 23:43:28 +0000 (19:43 -0400)]
ixgbe: cleanup crosstalk fix

Orabug: 24568240

This patch address a few issues with the initial crosstalk fix.  Most
important of which is the SDP that indicates the presents of a SFP+
module changes between HW types.  With this change that is taken in
to consideration

It also moves the check closer to the base code that checks link.  This
makes it so we only need to do the check in one spot.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit aac9e053f1044bf21ac068eeb0e8518d080f4a66)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

8 years agoixgbe: remove redundant check on ret_val
Colin Ian King [Thu, 14 Jul 2016 11:47:09 +0000 (12:47 +0100)]
ixgbe: remove redundant check on ret_val

Orabug: 24568240

The last check on ret_val is redundant since ret_val has not changed
since the previous check, so remove it as it is extraneous.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fdb359ee445f83400bad762d54b2964b39d42d10)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Commonize mailbox write/read
Tony Nguyen [Wed, 13 Jul 2016 17:33:34 +0000 (10:33 -0700)]
ixgbevf: Commonize mailbox write/read

Orabug: 24568240

With changes to ixgbevf_write_msg_read_ack(), other functions are
performing the same operations done here; change those functions to
utilize ixgbevf_write_msg_read_ack().

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 221c556acbd76154c34015b7cbbb3621ae7dbc7c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Add range checking for setting MTU
Tony Nguyen [Wed, 13 Jul 2016 17:33:16 +0000 (10:33 -0700)]
ixgbevf: Add range checking for setting MTU

Orabug: 24568240

Currently when setting the VF's MTU, the PF can return a NACK but this
isn't passed on to the VF.  Propagate the results from the PF to the VF
so errors can be reported.

In ixgbevf_change_mtu, return an error and reject the change.

For ixgbevf_configure_rx, log the error for debugging purposes since
the function is buried in a series of Rx config routines that are void.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6a11e52b6995b07a83a7d50e6301025ca35501be)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Protect ixgbevf_reset_subtask from remove event
Don Skidmore [Tue, 12 Jul 2016 22:47:38 +0000 (18:47 -0400)]
ixgbevf: Protect ixgbevf_reset_subtask from remove event

Orabug: 24568240

In ixgbevf_reset_subtask We weren't verifying that the port haven't
been removed, we are with this patch.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6e469ed03ed9b21b0c2dd46f77113a85f3e2bea6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add missing destroy_workqueue() on error in ixgbe_init_module()
Wei Yongjun [Tue, 12 Jul 2016 15:17:02 +0000 (15:17 +0000)]
ixgbe: Add missing destroy_workqueue() on error in ixgbe_init_module()

Orabug: 24568240

Add the missing destroy_workqueue() before return from
ixgbe_init_module() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6b8368798772a4fabfec690be3b5f390c4bda600)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Add lock around ixgbevf_reinit_locked call
Don Skidmore [Tue, 12 Jul 2016 01:29:56 +0000 (21:29 -0400)]
ixgbevf: Add lock around ixgbevf_reinit_locked call

Orabug: 24568240

The function ixgbevf_reinit_locked() assumes you have the rtnl lock
however we didn't when calling from the service task.  This patch
corrects that.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8e8247ab98315e096b812a68381ca812f0b0b5e3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: fix setup_fc for x550em
Emil Tantilov [Fri, 8 Jul 2016 00:18:38 +0000 (17:18 -0700)]
ixgbe: fix setup_fc for x550em

Orabug: 24568240

mac->ops.setup_fc can be null for backplanes which can cause the driver
to crash on load.

Reported-by: Patrick McLean <patrickm@gaikai.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit abf76d76c5e716a0129180b8f464b1b293823adf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: add VF support for new hardware
Don Skidmore [Wed, 29 Jun 2016 23:32:24 +0000 (19:32 -0400)]
ixgbevf: add VF support for new hardware

Orabug: 24568240

This patch add VF support for the new X553 hardware.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1d94f987f53cb53798dbcc7e7f1dfb00f9269efb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Fix minor typo while freeing irq
Babu Moger [Sun, 19 Jun 2016 00:40:47 +0000 (17:40 -0700)]
ixgbe: Fix minor typo while freeing irq

Orabug: 24568240

The array subscript increments after the execution of the statement.
So there is no issue here. However it helps to read the code better.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 90c6f87786e65e12cab06e637db8c7ef2f22de95)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Change register variable to unsigned
Don Skidmore [Tue, 14 Jun 2016 18:26:28 +0000 (14:26 -0400)]
ixgbe: Change register variable to unsigned

Orabug: 24568240

I noticed this variable used for register reads wasn't an unsigned
so this patch corrects that.  I don't believe this was causing any
issue as is but this is more consistent with the rest of the driver.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 310ea1236c2a8492d3c0f1453e5995e08b24c70e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: bump version number
Don Skidmore [Tue, 7 Jun 2016 00:23:24 +0000 (20:23 -0400)]
ixgbevf: bump version number

Orabug: 24568240

Bump the version number to more closely match the function included
in the driver.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 9f8fe731b8e810ef0324ebd8fc5973deecb6fb0b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Correct parameter sent to LED function
Don Skidmore [Fri, 17 Jun 2016 21:10:13 +0000 (17:10 -0400)]
ixgbevf: Correct parameter sent to LED function

Orabug: 24568240

The second parameter of these functions is the index to the led we
are interested in affecting.  However we were mistakenly passing
the offset in the register.  This patch corrects that and adds some
bonds checking which would hopefully make bugs like this more noticeable
in the future.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 003287e0f0875d0ba5f4ee3d7741ec9992766d71)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: fix NACK check in ixgbevf_set_uc_addr_vf()
Emil Tantilov [Thu, 9 Jun 2016 17:45:34 +0000 (10:45 -0700)]
ixgbevf: fix NACK check in ixgbevf_set_uc_addr_vf()

Orabug: 24568240

Fix the NACK check in ixgbevf_set_uc_addr_vf() for instances where
index != 0.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fc355e078a830c40f6245a55ecfff6481a4bcf57)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: napi_poll must return the work done
Paolo Abeni [Wed, 15 Jun 2016 13:37:59 +0000 (15:37 +0200)]
ixgbe: napi_poll must return the work done

Orabug: 24568240

Currently the function ixgbe_poll() returns 0 when it clean completely
the rx rings, but this foul budget accounting in core code.
Fix this returning the actual work done, capped to weight - 1, since
the core doesn't allow to return the full budget when the driver modifies
the napi status

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Venkatesh Srinivas <venkateshs@google.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4b732cd4bb6006ad7fd4d5cdba27fcb751cdf4b7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe/ixgbevf: use napi_complete_done()
Jesse Brandeburg [Thu, 24 Sep 2015 23:35:47 +0000 (16:35 -0700)]
ixgbe/ixgbevf: use napi_complete_done()

Orabug: 24568240

As per Eric Dumazet's previous patches:
(see commit (24d2e4a50737) - tg3: use napi_complete_done())

Quoting verbatim:
Using napi_complete_done() instead of napi_complete() allows
us to use /sys/class/net/ethX/gro_flush_timeout

GRO layer can aggregate more packets if the flush is delayed a bit,
without having to set too big coalescing parameters that impact
latencies.
</end quote>

Tested
configuration: low latency via ethtool -C ethx adaptive-rx off
rx-usecs 10 adaptive-tx off tx-usecs 15
workload: streaming rx using netperf TCP_MAERTS

igb:
MIGRATED TCP MAERTS TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.0.0.1 () port 0 AF_INET : demo
...
Interim result:  941.48 10^6bits/s over 1.000 seconds ending at 1440193171.589

Alignment      Offset         Bytes    Bytes       Recvs   Bytes    Sends
Local  Remote  Local  Remote  Xfered   Per                 Per
Recv   Send    Recv   Send             Recv (avg)          Send (avg)
    8       8      0       0 1176930056  1475.36    797726   16384.00  71905

MIGRATED TCP MAERTS TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.0.0.1 () port 0 AF_INET : demo
...
Interim result:  941.49 10^6bits/s over 0.997 seconds ending at 1440193142.763

Alignment      Offset         Bytes    Bytes       Recvs   Bytes    Sends
Local  Remote  Local  Remote  Xfered   Per                 Per
Recv   Send    Recv   Send             Recv (avg)          Send (avg)
    8       8      0       0 1175182320  50476.00     23282   16384.00  71816

i40e:
Hard to test because the traffic is incoming so fast (24Gb/s) that GRO
always receives 87kB, even at the highest interrupt rate.

Other drivers were only compile tested.

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>
(partial backport of commit 32b3e08fff60494cd1d281a39b51583edfd2b18f for ixgbe/ixgbevf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: fix spoofed packets with macvlans
Emil Tantilov [Thu, 2 Jun 2016 01:59:44 +0000 (18:59 -0700)]
ixgbe: fix spoofed packets with macvlans

Orabug: 24568240

When setting spoofing, both VLAN and MAC need to be set together.
This change resolves an issue where MAC-VLANs on the VF fail to pass
traffic due to spoofed packets.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 581e0c7df90b1a7f92e7ac3e69000b414319f161)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Correct reporting of timestamping for x550
Tony Nguyen [Wed, 1 Jun 2016 16:50:43 +0000 (09:50 -0700)]
ixgbe: Correct reporting of timestamping for x550

Orabug: 24568240

Update ixgbe_ethtool_get_ts_info() to show that x550 supports hardware
timestamping of all packets.

Reported-by: Guy Harris <guy@alum.mit.edu>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 918b89e77fa554e185a5cc09d10655397aacdfa2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: ixgbevf_write/read_posted_mbx should use IXGBE_ERR_MBX to initialize ret_val
Xin Long [Thu, 12 May 2016 17:51:55 +0000 (01:51 +0800)]
ixgbevf: ixgbevf_write/read_posted_mbx should use IXGBE_ERR_MBX to initialize ret_val

Orabug: 24568240

Now ixgbevf_write/read_posted_mbx use -IXGBE_ERR_MBX as the initiative
return value, but it's incorrect, cause in ixgbevf_vlan_rx_add_vid(),
it use err == IXGBE_ERR_MBX, the err returned from mac.ops.set_vfta,
and in ixgbevf_set_vfta_vf, it return from write/read_posted. so we
should initialize err with IXGBE_ERR_MBX, instead of -IXGBE_ERR_MBX.

With this fix, the other functions that called it also can work well,
cause they only care about if err is 0 or not.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b3a3c5176c146ec7de653a3062237620464175fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: use correct mask when enabling sriov
Emil Tantilov [Wed, 4 May 2016 22:01:27 +0000 (15:01 -0700)]
ixgbe: use correct mask when enabling sriov

Orabug: 24568240

Swap the parameters in GENMASK in order to generate the correct mask.

This change fixes Tx hangs when enabling SRIOV.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 11f2b494bc07f3d054687159ad6b1f3ec12a9040)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Remove unused parameter
Tony Nguyen [Wed, 27 Apr 2016 21:14:14 +0000 (14:14 -0700)]
ixgbevf: Remove unused parameter

Orabug: 24568240

ixgbevf_update_xcast_mode() is not using the netdev parameter;
removing it since it's unnecessary.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8b44a8a09de335a2fa7e39bb27e9fb50ff6d52ba)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Disable DCB and FCoE for X550EM_x and x550em_a
Usha Ketineni [Tue, 26 Apr 2016 12:00:26 +0000 (05:00 -0700)]
ixgbe: Disable DCB and FCoE for X550EM_x and x550em_a

Orabug: 24568240

This patch adds IXGBE_FLAG_DCB_CAPABLE flag that is set
for all MACs other than X550EM_x and x550em_a. DCB and
FCoE is disabled for these MACS. DCB initialization
code is moved to a separate function.

Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com>
Tested-by: Ronald Bynoe <ronald.j.bynoe@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8829009d2fd5683ed29418420b4883cf4782c85c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

8 years agoixgbevf: Use mac_ops instead of trying to identify NIC type
Alexander Duyck [Fri, 22 Apr 2016 17:18:26 +0000 (13:18 -0400)]
ixgbevf: Use mac_ops instead of trying to identify NIC type

Orabug: 24568240

This change makes it so that we can just use function pointers instead of
having to identify if a given VF is running on a Linux or Windows PF.  By
doing this we can avoid having to pull too much information out of the
lower layers and can instead just make use of the mac_ops pointers since
they should differ between the two types of VFs anyway.

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 2f8214fe6811a246265629d81af2313695c63f4d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Revise populating few registers and macro definitions
Preethi Banala [Thu, 21 Apr 2016 18:40:35 +0000 (11:40 -0700)]
ixgbe: Revise populating few registers and macro definitions

Orabug: 24568240

Revise populating few registers in ixgbe_get_regs() and macro
definitions.
Before applying patch:
$ du -k objs/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
8572    objs/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
After applying patch:
$ du -k objs/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
8568    objs/drivers/net/ethernet/intel/ixgbe/ixgbe.ko

Signed-off-by: Preethi Banala <preethi.banala@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 45a88dfcd806ca8774180026891b136ef10fd844)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Return 64 bit stats values
Preethi Banala [Thu, 21 Apr 2016 18:40:24 +0000 (11:40 -0700)]
ixgbe: Return 64 bit stats values

Orabug: 24568240

The code was ignoring higher 32 bits of stats registers. This patch
correctly fills out 64 bit value in two 32 bit words.

Signed-off-by: Preethi Banala <preethi.banala@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4c4f8023be8c8f900e79a622b92bfc778db1f2ec)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Remove duplicate and unused device ID definitions
Preethi Banala [Thu, 21 Apr 2016 18:39:29 +0000 (11:39 -0700)]
ixgbe: Remove duplicate and unused device ID definitions

Orabug: 24568240

Remove duplicate and unused device ID definitions.

Signed-off-by: Preethi Banala <preethi.banala@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 61ff59d81c3cf9c346a008032ad974d6e79ae1d9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: check EEPROM for WOL support for X540 and above
Emil Tantilov [Thu, 21 Apr 2016 18:37:12 +0000 (11:37 -0700)]
ixgbe: check EEPROM for WOL support for X540 and above

Orabug: 24568240

This change aims to simplify the logic we use to determine WOL
support by reading the EEPROM bits for MACs X540 and newer.

Also some cleanups in ixgbe_wol_supported() - changed return type to
bool and removed redundant return variable by simply using return after
the checks.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 740234f070eadd010f7b129c6592767db68f16ba)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: add WoL support for some 82599 subdevice IDs
Emil Tantilov [Thu, 21 Apr 2016 18:37:06 +0000 (11:37 -0700)]
ixgbe: add WoL support for some 82599 subdevice IDs

Orabug: 24568240

We had some 82599 subdevice IDs missing from the list of parts that
support WoL.

Reported-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 00103a6ce31624cb91cba9d1f991409f67453d73)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Support Windows hosts (Hyper-V)
KY Srinivasan [Wed, 20 Apr 2016 02:17:57 +0000 (19:17 -0700)]
ixgbevf: Support Windows hosts (Hyper-V)

Orabug: 24568240

On Hyper-V, the VF/PF communication is a via software mediated path
as opposed to the hardware mailbox. Make the necessary
adjustments to support Hyper-V.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c6d45171d706c2b5efa3d5ee7a8260c14b6367c0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Add the device ID's presented while running on Hyper-V
KY Srinivasan [Wed, 20 Apr 2016 02:17:56 +0000 (19:17 -0700)]
ixgbevf: Add the device ID's presented while running on Hyper-V

Orabug: 24568240

Intel SR-IOV cards present different ID when running on Hyper-V.
Add the device IDs presented while running on Hyper-V.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b4363fbd8df2be23439e15a53b4040897228c481)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: use msleep for long delays
Arnd Bergmann [Sat, 16 Apr 2016 20:35:08 +0000 (22:35 +0200)]
ixgbe: use msleep for long delays

Orabug: 24568240

The newly added x550em_a support causes a link failure on ARM because of
an overly long time passed into udelay():

ERROR: "__bad_udelay" [drivers/net/ethernet/intel/ixgbe/ixgbe.ko] undefined!

There are multiple variants of the ixgbe_acquire_swfw_sync_*() function,
and the other ones all use msleep(), so we can safely assume that all
callers are allowed to sleep, which makes msleep() a better replacement
than mdelay().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 49425dfc7451 ("ixgbe: Add support for x550em_a 10G MAC type")
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d4f90d9dca26efef7a1112a8f4258c90b73bb37f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: Move API negotiation function into mac_ops
Alexander Duyck [Fri, 15 Apr 2016 00:37:15 +0000 (20:37 -0400)]
ixgbevf: Move API negotiation function into mac_ops

Orabug: 24568240

This patch moves API negotiation into mac_ops.  The general idea here is
that with HyperV on the way we need to make certain that anything that will
have different versions between HyperV and a standard VF needs to be
abstracted enough so that we can have a separate function between the two
so we can avoid changes in one breaking something in the other.

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 7921f4dc4c36e736d7a5b45dfa7b6a755a4fc012)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: make use of BIT() macro to avoid shift of signed values
Jacob Keller [Wed, 13 Apr 2016 23:08:24 +0000 (16:08 -0700)]
ixgbevf: make use of BIT() macro to avoid shift of signed values

Orabug: 24568240

Also cleanup a case where we're bit shifting a value into place, and use
an unsigned constant. Make use of the unsigned postfix in places where
BIT() macro is not appropriate.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8d055cc0c8be92cd6a77193460117f0ab0a05286)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: resolve shift of negative value warning
Jacob Keller [Wed, 13 Apr 2016 23:08:23 +0000 (16:08 -0700)]
ixgbe: resolve shift of negative value warning

Orabug: 24568240

Make use of GENMASK instead of open coding the equivalent operation
incorrectly.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: use BIT() macro
Jacob Keller [Wed, 13 Apr 2016 23:08:22 +0000 (16:08 -0700)]
ixgbe: use BIT() macro

Orabug: 24568240

Several areas of ixgbe were written before widespread usage of the
BIT(n) macro. With the impending release of GCC 6 and its associated new
warnings, some usages such as (1 << 31) have been noted within the ixgbe
driver source. Fix these wholesale and prevent future issues by simply
using BIT macro instead of hand coded bit shifts.

Also fix a few shifts that are shifting values into place by using the
'u' prefix to indicate unsigned. It doesn't strictly matter in these
cases because we're not shifting by too large a value, but these are all
unsigned values and should be indicated as such.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b4f47a483045a6e6b31be8ade76cdfef7091f18b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add work around for empty SFP+ cage crosstalk
Don Skidmore [Tue, 12 Apr 2016 23:25:10 +0000 (19:25 -0400)]
ixgbe: Add work around for empty SFP+ cage crosstalk

Orabug: 24568240

It is possible on some systems that crosstalk could lead to link flap
on empty SFP+ cages.  A new NVM bit was defined to let SW know it
needs to implement the work around which consists of verifying that
there is a module in the cage before acting on the LSC.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4319a7976722f6925b5bbbdac417d87a0cbde859)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Use correct FC setup function for x550em_a
Mark Rustad [Fri, 8 Apr 2016 23:19:29 +0000 (16:19 -0700)]
ixgbe: Use correct FC setup function for x550em_a

Orabug: 24568240

Somehow the wrong fc_setup function was used for x550em_a, so
correct that. Also set setup_link to NULL as its value is
determined later, just like it is with X550EM_x.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a0254a70b4f91396ad04b1225dd7c10a680d38ff)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: add support for per-queue ethtool stats
Emil Tantilov [Thu, 7 Apr 2016 22:58:44 +0000 (15:58 -0700)]
ixgbevf: add support for per-queue ethtool stats

Orabug: 24568240

Implement per-queue statistics for packets, bytes and busy poll
specific counters.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a02a5a53418a6039893f5d5a9373cf18080fded2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbevf: refactor ethtool stats handling
Emil Tantilov [Thu, 7 Apr 2016 22:58:39 +0000 (15:58 -0700)]
ixgbevf: refactor ethtool stats handling

Orabug: 24568240

This brings the logic closer to how we handle the stats in ixgbe and it
sets us up for introducing per-queue stats.

Use IXGBEVF_STAT and IXGBEVF_NETDEV_STAT for accessing the driver and
netdev stats respectively. This way we don't have to calculate the
stats based on register values which could lead to the counters not
being initialized properly when the interface is down.

IXGBEVF_QUEUE_STATS_LEN is set to include the number of queues.

Also some defines were renamed to use the IXGBEVF prefix.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d72d6c19b583afc09ace22baf80b29b11139a8f3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: Add register wait for slow links
Mark Rustad [Thu, 7 Apr 2016 17:43:50 +0000 (10:43 -0700)]
ixgbe: Add register wait for slow links

Orabug: 24568240

Use a new register to wait for previous register writes to complete
before issuing a register read. This is needed when slower links
are in use.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2f2219bea21118511c23d24dba5f2145f870a7db)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: make 'action' field in struct ixgbe_fdir_filter a u64 value
Sridhar Samudrala [Fri, 1 Apr 2016 17:34:38 +0000 (10:34 -0700)]
ixgbe: make 'action' field in struct ixgbe_fdir_filter a u64 value

Orabug: 24568240

This field is used to record the RX queue index for a redirect action
passed via ring_cookie field in struct ethtool_rx_flow_spec which is
a u64 value.

For ex: after adding a filter rule to redirect to a VF using ethtool
  # echo 4 > /sys/class/net/p4p1/device/sriov_numvfs
  # ethtool -N p4p1 flow-type ip4 src-ip 192.168.0.1 action 0x100000000

querying for the rule shows the Action as 'Direct to queue 0'

  # ethtool -n p4p1
  4 RX rings available
  Total 1 rules

  Filter: 2045
  Rule Type: Raw IPv4
Src IP addr: 192.168.0.1 mask: 0.0.0.0
Dest IP addr: 0.0.0.0 mask: 255.255.255.255
TOS: 0x0 mask: 0xff
Protocol: 0 mask: 0xff
L4 bytes: 0x0 mask: 0xffffffff
VLAN EtherType: 0x0 mask: 0xffff
VLAN: 0x0 mask: 0xffff
User-defined: 0x0 mask: 0xffffffffffffffff
Action: Direct to queue 0

With this fix, ethtool will report the right queue index even for VFs.
Action: Direct to queue 4294967296

Here 4294967296 corresponds to 0x100000000.
We need to update 'ethtool' to report the queue index as a Hex value so
that it is more  user friendly and matches with the 'action' value that
is passed when adding the rule.

Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2a9ed5d1fc5e7e88a22da2d85bbaf6fc5b4c2fb8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: fix default mac->ops.setup_link for X550EM
Emil Tantilov [Thu, 24 Mar 2016 16:58:40 +0000 (09:58 -0700)]
ixgbe: fix default mac->ops.setup_link for X550EM

Orabug: 24568240

X550EM_a/x did not have a default value for mac->ops.setup_link which
was causing link issues for backplane devices.

This patch sets mac->ops.setup_link to ixgbe_setup_mac_link_X540 for
X550EM_a/x which is also default for X550. This will result in
mac->ops.setup_link calling the link setup function for the respective
PHY type in case we do not need a special function to deal with it.

Reported-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4695886c644e48a02ca9d4c146a7ec4de8f2d2d8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: set VLAN spoof checking unconditionally
Emil Tantilov [Fri, 18 Mar 2016 23:11:19 +0000 (16:11 -0700)]
ixgbe: set VLAN spoof checking unconditionally

Orabug: 24568240

Previously the PF driver would only set VLAN spoof checking if
the VF had created VLANs. This was done by setting and checking
a counter (vlan_count) whenever a VLAN was created by the VF.
However it is possible for the vlan_count to be !=0 while there are
no VLANs assigned to the VF due to the count incrementing every
time a VLAN 0 is added on ifdown/up, which resulted in VLAN spoofing
always being set for those VFs.

This patch cleans up the logic by unconditionally setting VLAN based on
how the VF is configured (via ip link set ethX vf Y spoofchk on/off).
This change also resolves an issue where the VLAN spoofing can remain
set even after being disabled by the user due to the driver enabling
VLAN spoof checking every time a VLAN is added to the VF, but would
only allow changes in the setting if vlan_count != 0.

Also default_vf_vlan_id and vlans_enabled were removed from the
vf_data_storage structure since they are not being used in the driver.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d3dec7c7c03351ae006f698501b523e7b1a38b3d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: consolidate the configuration of spoof checking
Emil Tantilov [Fri, 18 Mar 2016 23:11:14 +0000 (16:11 -0700)]
ixgbe: consolidate the configuration of spoof checking

Orabug: 24568240

Consolidate the logic behind configuring spoof checking:

Move the setting of the MAC, VLAN and Ethertype spoof checking into
ixgbe_ndo_set_vf_spoofchk().

Change ixgbe_set_mac_anti_spoofing() to set MAC spoofing per VF similar
to the VLAN and Ethertype functions - this allows us to call the helper
functions in ixgbe_ndo_set_vf_spoofchk() for all spoof check types and
only disable MAC spoof checking when creating MACVLAN.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 77f192af721440a9d91365438be6ecb98edd0310)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: protect vxlan_get_rx_port in ixgbe_service_task with rtnl_lock
Hannes Frederic Sowa [Mon, 18 Apr 2016 19:19:45 +0000 (21:19 +0200)]
ixgbe: protect vxlan_get_rx_port in ixgbe_service_task with rtnl_lock

Orabug: 24568240

vxlan_get_rx_port requires rtnl_lock to be held.

Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Shannon Nelson <shannon.nelson@intel.com>
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
Cc: Don Skidmore <donald.c.skidmore@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
Cc: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b1f99a787e8239da3ea859709f5fb60b3fd02c13)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoib_uverbs: Allocate pd in a lazy manner to conserve resources
Mukesh Kacker [Wed, 23 Dec 2015 03:49:49 +0000 (19:49 -0800)]
ib_uverbs: Allocate pd in a lazy manner to conserve resources

For usnic devices devices where the maximum number of pd
resources are limited (usnic devices), its a waste to
allocate this resource on device initialization.

We delay the allocation to first use.

Orabug: 22378991

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
8 years agoib/mlx4: add msi-x allocation kernel msg logging
Qing Huang [Fri, 16 Dec 2016 00:03:58 +0000 (16:03 -0800)]
ib/mlx4: add msi-x allocation kernel msg logging

Kernel msg prints are added in the mlx4 driver when enabling msi-x
vectors during device initialization. This would help us to debug
issues when we encounter errors in this area on both bare metal and
VM.

Orabug: 25307234

Related Orabug: 2347901820597484

Signed-off-by: Qing Huang <qing.huang@oracle.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoNVMe: reduce admin queue depth as workaround for Samsung EPIC SQ errata
Ashok Vairavan [Thu, 8 Dec 2016 00:10:38 +0000 (16:10 -0800)]
NVMe: reduce admin queue depth as workaround for Samsung EPIC SQ errata

Orabug: 25186219

PCIe analyzer tracing by Oracle and Samsung revealed an errata in Samsung's
firmware for EPIC SSDs where the invalid completion entries in admin queue
and IO queue can occur  when the queues straddle an 8MB DMA address boundary.

This patch limits admin queue depth to 64 for EPIC SSDs.

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonvme: Limit command retries
Keith Busch [Wed, 14 Dec 2016 22:38:35 +0000 (14:38 -0800)]
nvme: Limit command retries

Many controller implementations will return errors to commands that will
not succeed, but without the DNR bit set. The driver previously retried
these commands an unlimited number of times until the command timeout
has exceeded, which takes an unnecessarilly long period of time.

This patch limits the number of retries a command can have, defaulting
to 5, but is user tunable at load or runtime.

The struct request's 'retries' field is used to track the number of
retries attempted. This is in contrast with scsi's use of this field,
which indicates how many retries are allowed.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Orabug: 25256529
Conflicts:
Patched the commits manually due to the lack of core.c file
drivers/nvme/host/pci.c
drivers/nvme/host/nvme.h

Signed-off-by: Ashok Vairavan <ashok.vairavan@intel.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonvme: avoid cqe corruption when update at the same time as read
Marta Rybczynska [Sun, 18 Dec 2016 18:21:19 +0000 (10:21 -0800)]
nvme: avoid cqe corruption when update at the same time as read

Make sure the CQE phase (validity) is read before the rest of the
structure. The phase bit is the highest address and the CQE
read will happen on most platforms from lower to upper addresses
and will be done by multiple non-atomic loads. If the structure
is updated by PCI during the reads from the processor, the
processor may get a corrupted copy.

The addition of the new nvme_cqe_valid function that verifies
the validity bit also allows refactoring of the other CQE read
sequences.

Signed-off-by: Marta Rybczynska <marta.rybczynska@kalray.eu>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit d783e0bd02e700e7a893ef4fa71c69438ac1c276)

Orabug: 24960824
Conflicts:
    nvme_poll() function is not available in UEK4QU2. Resolved
the conflicts around nvme poll function.

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoNVMe: Don't unmap controller registers on reset
Keith Busch [Sun, 18 Dec 2016 18:18:59 +0000 (10:18 -0800)]
NVMe: Don't unmap controller registers on reset

Unmapping the registers on reset or shutdown is not necessary. Keeping
the mapping simplifies reset handling.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit b00a726a9fd82ddd4c10344e46f0d371e1674303)

Orabug: 24758839
Conflicts:
The changes are merged manually as the nvme upstream is not in sync with
UEK4 QU2
    drivers/nvme/host/pci.c

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonet: ena: change the return type of ena_set_push_mode() to be void.
Rami Rosen [Tue, 23 Aug 2016 17:20:17 +0000 (20:20 +0300)]
net: ena: change the return type of ena_set_push_mode() to be void.

Orabug: 25307221

This patch changes the return type of ena_set_push_mode() to be void,
as it always returns 0.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 184b49c89f39f5c5ad262a6456248284e10984c6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonet: ena: Fix error return code in ena_device_init()
Wei Yongjun [Mon, 15 Aug 2016 22:51:04 +0000 (22:51 +0000)]
net: ena: Fix error return code in ena_device_init()

Orabug: 25307221

Fix to return a negative error code from the invalid dma width
error handling case instead of 0.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6e22066fd02b675260b980b3e42b7d616a9839c5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonet: ena: Remove unnecessary pci_set_drvdata()
Wei Yongjun [Mon, 15 Aug 2016 22:50:34 +0000 (22:50 +0000)]
net: ena: Remove unnecessary pci_set_drvdata()

Orabug: 25307221

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 557bc7d44d52d52374bc72e9cc3b0beb41026886)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agonet: ena: Add a driver for Amazon Elastic Network Adapters
Netanel Belgazal [Thu, 22 Dec 2016 02:40:46 +0000 (21:40 -0500)]
net: ena: Add a driver for Amazon Elastic Network Adapters
 (ENA)

Orabug: 25307221

This is a driver for the ENA family of networking devices.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1738cd3ed342294360d6a74d4e58800004bff854)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Add interface to support RDMA driver.
Michael Chan [Wed, 7 Dec 2016 05:26:21 +0000 (00:26 -0500)]
bnxt_en: Add interface to support RDMA driver.

Orabug: 24567991

Since the network driver and RDMA driver operate on the same PCI function,
we need to create an interface to allow the RDMA driver to share resources
with the network driver.

1. Create a new bnxt_en_dev struct which will be returned by
bnxt_ulp_probe() upon success.  After that, all calls from the RDMA driver
to bnxt_en will pass a pointer to this struct.

2. This struct contains additional function pointers to register, request
msix, send fw messages, register for async events.

3. If the RDMA driver wants to enable RDMA on the function, it needs to
call the function pointer bnxt_register_device().  A ulp_ops structure
is passed for RCU protected upcalls from bnxt_en to the RDMA driver.

4. The RDMA driver can call firmware APIs using the bnxt_send_fw_msg()
function pointer.

5. 1 stats context is reserved when the RDMA driver registers.  MSIX
and completion rings are reserved when the RDMA driver calls
bnxt_request_msix() function pointer.

6. When the RDMA driver calls bnxt_unregister_device(), all RDMA resources
will be cleaned up.

v2: Fixed 2 uninitialized variable warnings.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a588e4580a7ecb715dab8bf09725b97aa0e0e3a0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Refactor the driver registration function with firmware.
Michael Chan [Wed, 7 Dec 2016 05:26:20 +0000 (00:26 -0500)]
bnxt_en: Refactor the driver registration function with firmware.

Orabug: 24567991

The driver register function with firmware consists of passing version
information and registering for async events.  To support the RDMA driver,
the async events that we need to register may change.  Separate the
driver register function into 2 parts so that we can just update the
async events for the RDMA driver.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a1653b13f14c714f9bfd5e10c603a37c3bcba7b6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Reserve RDMA resources by default.
Michael Chan [Wed, 7 Dec 2016 05:26:19 +0000 (00:26 -0500)]
bnxt_en: Reserve RDMA resources by default.

Orabug: 24567991

If the device supports RDMA, we'll setup network default rings so that
there are enough minimum resources for RDMA, if possible.  However, the
user can still increase network rings to the max if he wants.  The actual
RDMA resources won't be reserved until the RDMA driver registers.

v2: Fix compile warning when BNXT_CONFIG_SRIOV is not set.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e4060d306b5196966d74e05dee48e6c3a52aaad4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Improve completion ring allocation for VFs.
Michael Chan [Wed, 7 Dec 2016 05:26:18 +0000 (00:26 -0500)]
bnxt_en: Improve completion ring allocation for VFs.

Orabug: 24567991

All available remaining completion rings not used by the PF should be
made available for the VFs so that there are enough rings in the VF to
support RDMA.  The earlier workaround code of capping the rings by the
statistics context is removed.

When SRIOV is disabled, call a new function bnxt_restore_pf_fw_resources()
to restore FW resources.  Later on we need to add some logic to account
for RDMA resources.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7b08f661ab80e87dcdba7ab9a460fe2c9d08bf5b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Move function reset to bnxt_init_one().
Michael Chan [Wed, 7 Dec 2016 05:26:17 +0000 (00:26 -0500)]
bnxt_en: Move function reset to bnxt_init_one().

Orabug: 24567991

Now that MSIX is enabled in bnxt_init_one(), resources may be allocated by
the RDMA driver before the network device is opened.  So we cannot do
function reset in bnxt_open() which will clear all the resources.

The proper place to do function reset now is in bnxt_init_one().
If we get AER, we'll do function reset as well.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aa8ed021ab515a93f2a052e9cc80320882889698)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Enable MSIX early in bnxt_init_one().
Michael Chan [Wed, 7 Dec 2016 05:26:16 +0000 (00:26 -0500)]
bnxt_en: Enable MSIX early in bnxt_init_one().

Orabug: 24567991

To better support the new RDMA driver, we need to move pci_enable_msix()
from bnxt_open() to bnxt_init_one().  This way, MSIX vectors are available
to the RDMA driver whether the network device is up or down.

Part of the existing bnxt_setup_int_mode() function is now refactored into
a new bnxt_init_int_mode().  bnxt_init_int_mode() is called during
bnxt_init_one() to enable MSIX.  The remaining logic in
bnxt_setup_int_mode() to map the IRQs to the completion rings is called
during bnxt_open().

v2: Fixed compile warning when CONFIG_BNXT_SRIOV is not set.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7809592d3e2ec79cd1feab0cc96169d22f6ffee1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Add bnxt_set_max_func_irqs().
Michael Chan [Wed, 7 Dec 2016 05:26:15 +0000 (00:26 -0500)]
bnxt_en: Add bnxt_set_max_func_irqs().

Orabug: 24567991

By refactoring existing code into this new function.  The new function
will be used in subsequent patches.

v2: Fixed compile warning when CONFIG_BNXT_SRIOV is not set.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 33c2657eb688a063ab9cbe11fd4d18c93c7945e1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agobnxt_en: Add PFC statistics.
Michael Chan [Sat, 3 Dec 2016 02:17:18 +0000 (21:17 -0500)]
bnxt_en: Add PFC statistics.

Orabug: 24567991

Report PFC statistics to ethtool -S and DCBNL.

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