]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
8 years agoaacraid: Fix character device re-initialization
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:07 +0000 (15:06 -0800)]
aacraid: Fix character device re-initialization

During EEH PCI hotplug activity kernel unloads and loads the driver,
causing character device to be unregistered(aac_remove_one).When the
driver is loaded back using aac_probe_one the character device needs
to be registered again for the AIF management tools to work.

Fixed by adding code to register character device in aac_probe_one if
it is unregistered in aac_remove_one.

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b9fb54b425e14658959bbc753452aaaf4d11d6fa)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix AIF triggered IOP_RESET
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:06 +0000 (15:06 -0800)]
aacraid: Fix AIF triggered IOP_RESET

while driver removal is in progress or PCI shutdown is invoked, driver
kills AIF aacraid thread, but IOCTL requests from the management tools
re-start AIF thread leading to IOP_RESET.

Fixed by setting adapter_shutdown flag when PCI shutdown is invoked.

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit fbd185986ebafaeac900a1af1829fed2bf03242e)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Created new mutex for ioctl path
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:05 +0000 (15:06 -0800)]
aacraid: Created new mutex for ioctl path

aac_mutex was used to create protect the ioctl path for only the compat
path, it would be make more sense to place mutex in aac_do_ioctl, which
is the main ioctl function call that handles all ioctl commands.

Created new mutex ioctl_mutex in struct aac_dev to protect switch case
in aac_do_ioctl and removed aac_mutex from aac_cfg_ioctl and
aac_compat_do_ioctl

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 222a9fb376df0f4aec32493a3fb5d18fa56979f2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fundamental reset support for Series 7
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:04 +0000 (15:06 -0800)]
aacraid: Fundamental reset support for Series 7

Series 7 does not support PCI hot reset used by EEH.

Enabled fundamental reset only for Series 7

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b93b7dd85dc0788eedc6ad30ff0b01ad9d4c657)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Set correct msix count for EEH recovery
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:03 +0000 (15:06 -0800)]
aacraid: Set correct msix count for EEH recovery

During EEH recovery number of online CPU's might change thereby changing
the number of MSIx vectors. Since each fib is allocated to a vector,
changes in the number of vectors causes fib to be sent thru invalid
vectors.In addition the correct number of MSIx vectors is not updated in
the INIT struct sent to the controller, when it is reinitialized.

Fixed by reassigning vectors to fibs based on the updated number of MSIx
vectors and updating the INIT structure before sending to controller.

Fixes: MSI-X vector calculation for suspend/resume
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthushirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ecc479e00db8eb110b200afe1effcb3df20ca7ae)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Added EEH support
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:01 +0000 (15:06 -0800)]
aacraid: Added EEH support

Added support for PCI EEH (extended error handling).

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5c63f7f710bdde6454d304a84146a5338962a509)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: aac_release_resources() can be static
Fengguang Wu [Tue, 10 Nov 2015 05:59:06 +0000 (13:59 +0800)]
aacraid: aac_release_resources() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit fe0798c5e150be8f06959250076d3864477e74c2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Update driver version
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:41 +0000 (06:38 -0400)]
aacraid: Update driver version

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit ead1cbf92745b2b52846da56c9b3dd83ea4e718b)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Use pci_enable_msix_range()
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:40 +0000 (06:38 -0400)]
aacraid: Use pci_enable_msix_range()

As pci_enable_msix() deprecated, replaced with pci_enable_msix_range()

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 84859c926b0828b07b2c3dd66a440ef4120a8668)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: IOCTL fix
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:39 +0000 (06:38 -0400)]
aacraid: IOCTL fix

Driver blocks ioctls once it received shutdown/suspend request during
suspend/hybernation. This patch unblocks ioctls on resume path.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e728f8e39ffd8f7054e0718b4fb308c32235a5c2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Reset irq affinity hints
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:38 +0000 (06:38 -0400)]
aacraid: Reset irq affinity hints

Reset irq affinity hints before releasing IRQ.
Removed duplicate code of IRQ acquire/release.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 8b1462e0ebb677ee07da6c18f7047539ea6e449e)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Tune response path if IsFastPath bit set
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:37 +0000 (06:38 -0400)]
aacraid: Tune response path if IsFastPath bit set

If 'IsFastPath' bit is set, then response path assumes no error and skips
error check.

Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 55b8760847a6e593ab67448ca79f83c4b1a9f012)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Enable 64bit write to controller register
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:36 +0000 (06:38 -0400)]
aacraid: Enable 64bit write to controller register

If writeq() not supported, then do atomic two 32bit write

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit c6992781d9e8086d592f95870092a59042d111a2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Change interrupt mode to MSI for Series 6
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:35 +0000 (06:38 -0400)]
aacraid: Change interrupt mode to MSI for Series 6

This change always sets MSI interrupt mode for series-6 controller.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 9022d375bd22869ba3e5ad3635f00427cfb934fc)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Add Power Management support
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:34 +0000 (06:38 -0400)]
aacraid: Add Power Management support

* .suspend() and .resume() routines implemented in the driver
* aac_release_resources() initiates firmware shutdown
* aac_acquire_resources re-initializes the host interface

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit de665f28f788ad72ff6a0ce6ac2721d77248b7cf)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix for LD name and UID not exposed to OS
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:33 +0000 (06:38 -0400)]
aacraid: Fix for LD name and UID not exposed to OS

Driver sends the right size of the response buffer.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit fb5d40d4fca272286695c67da0a2d0a9d0954615)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: aac_src_intr_message() can be static
kbuild test robot [Fri, 10 Apr 2015 08:53:38 +0000 (16:53 +0800)]
aacraid: aac_src_intr_message() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 305974fe011d9c2061b8da668c7da63ef0a4346d)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoLPFC driver update for UEK4 11.2.0.5
rkennedy [Thu, 9 Feb 2017 18:29:12 +0000 (10:29 -0800)]
LPFC driver update for UEK4 11.2.0.5

Orabug: 25486030

Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Update copyrights
rkennedy [Thu, 9 Feb 2017 18:25:29 +0000 (10:25 -0800)]
lpfc: Update copyrights

Orabug: 25486030

Update copyrights to 2017 for all files touched in this patch set

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct WQ creation for pagesize
rkennedy [Thu, 9 Feb 2017 18:15:07 +0000 (10:15 -0800)]
lpfc: Correct WQ creation for pagesize

Orabug: 25486030

Correct WQ creation for pagesize

The driver was calculating the adapter command pagesize indicator from
the system pagesize. However, the buffers the driver allocates are only
one size (SLI4_PAGE_SIZE), so no calculation was necessary.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix few small typos in lpfc_scsi.c
Milan P. Gandhi [Thu, 13 Oct 2016 22:06:02 +0000 (15:06 -0700)]
scsi: lpfc: Fix few small typos in lpfc_scsi.c

Orabug: 25486030

This patch does a cleanup and fixes few small typos in lpfc_scsi.c

Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4b160ae8a34983f11635981168760412ed3c2cfa)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix sg_reset on SCSI device causing kernel crash
James Smart [Thu, 13 Oct 2016 22:06:04 +0000 (15:06 -0700)]
scsi: lpfc: Fix sg_reset on SCSI device causing kernel crash

Orabug: 25486030

Fix sg_reset on SCSI device causing kernel crash

Driver could reference stale node pointers in task mgmt call.
Changed to use resetting cmd and look up node pointer in task mgmt
function.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit eed695d70e7eff55595f222b55b96f105d4a27ca)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct issue leading to oops during link reset
James Smart [Mon, 19 Dec 2016 23:07:23 +0000 (15:07 -0800)]
scsi: lpfc: Correct issue leading to oops during link reset

Orabug: 25486030

Correct issue leading to oops during link reset. Missing vport pointer.

[mkp: fixed typo]

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e6c6acc0e0223ddaf867628d420ee196349c6fae)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct error in setting OS Driver Version with FW
James Smart [Mon, 19 Dec 2016 23:07:21 +0000 (15:07 -0800)]
scsi: lpfc: Correct error in setting OS Driver Version with FW

Orabug: 25486030

Correct error in setting OS Driver Version with FW.  Prior length was
too short.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@Suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b2fd103b05feabbc86db726ae121da94639892d7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload
James Smart [Mon, 19 Dec 2016 23:07:20 +0000 (15:07 -0800)]
scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload

Orabug: 25486030

Clear the VendorVersion in the PLOGI/PLOGI ACC payload

Vendor version info may have been set on fabric login. Before sending
PLOGI payloads, ensure that it's cleared.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e0165f20447c8ca1d367725ee94d8ec9f38ca275)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct host name in symbolic_name field
James Smart [Mon, 19 Dec 2016 23:07:24 +0000 (15:07 -0800)]
scsi: lpfc: Correct host name in symbolic_name field

Orabug: 25486030

Correct host name in symbolic_name field of nameserver registrations

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6c9231f604c2575be24c96d38deb70f145172f92)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: FCoE VPort enable-disable does not bring up the VPort
James Smart [Mon, 19 Dec 2016 23:07:25 +0000 (15:07 -0800)]
scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort

Orabug: 25486030

FCoE VPort enable-disable does not bring up the VPort.
VPI structure needed to be initialized before being re-registered.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 104450eb08ca662e6b1d02da11aca9598e978f3e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix Xlane dynamic LUN set for LUN priority.
James Smart [Mon, 19 Dec 2016 23:07:26 +0000 (15:07 -0800)]
scsi: lpfc: Fix Xlane dynamic LUN set for LUN priority.

Orabug: 25486030

Fix Xlane dynamic LUN set for LUN priority. Dynamic changing of the
priority was not getting reflected on the LUN.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b5749fe182a0fa1c39ea1b33c0691d436f269195)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Deprecate lpfc_prot_sg_seg_cnt parameter
James Smart [Mon, 19 Dec 2016 23:07:27 +0000 (15:07 -0800)]
scsi: lpfc: Deprecate lpfc_prot_sg_seg_cnt parameter

Orabug: 25486030

Deprecate lpfc_prot_sg_seg_cnt parameter. Eliminates driver from
unnecessarily limiting DIF s/g list length.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f2bf460cf5ef989f0a593d05932460326376d5f6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct oops on vport port resets
James Smart [Mon, 19 Dec 2016 23:07:29 +0000 (15:07 -0800)]
scsi: lpfc: Correct oops on vport port resets

Orabug: 25486030

Correct oops on vport port resets. Incorrect WQE type, thus the clearing
code actually overstepped the WQE.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2f07784f05c23b322863274e801c31aa64e46c71)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Add missing memory barrier
James Smart [Mon, 19 Dec 2016 23:07:30 +0000 (15:07 -0800)]
scsi: lpfc: Add missing memory barrier

Orabug: 25486030

On loosely ordered memory systems (PPC for example), the WQE elements
were being updated in memory, but not necessarily flushed before the
separate doorbell was written to hw which would cause hw to dma the
WQE element. Thus, the hardware occasionally received partially
updated WQE data.

Add the memory barrier after updating the WQE memory.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b3b3bdb83b4ad51252d21bb13596db879e51850)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: fix oops/BUG in lpfc_sli_ringtxcmpl_put()
Mauricio Faria de Oliveira [Wed, 23 Nov 2016 12:33:19 +0000 (10:33 -0200)]
scsi: lpfc: fix oops/BUG in lpfc_sli_ringtxcmpl_put()

Orabug: 25486030

The BUG_ON() recently introduced in lpfc_sli_ringtxcmpl_put() is hit in
the lpfc_els_abort() > lpfc_sli_issue_abort_iotag() >
lpfc_sli_abort_iotag_issue() function path [similar names], due to
'piocb->vport == NULL':

BUG_ON(!piocb || !piocb->vport);

This happens because lpfc_sli_abort_iotag_issue() doesn't set the
'abtsiocbp->vport' pointer -- but this is not the problem.

Previously, lpfc_sli_ringtxcmpl_put() accessed 'piocb->vport' only if
'piocb->iocb.ulpCommand' is neither CMD_ABORT_XRI_CN nor
CMD_CLOSE_XRI_CN, which are the only possible values for
lpfc_sli_abort_iotag_issue():

    lpfc_sli_ringtxcmpl_put():

        if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
           (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
           (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
            (!(piocb->vport->load_flag & FC_UNLOADING)))

    lpfc_sli_abort_iotag_issue():

        if (phba->link_state >= LPFC_LINK_UP)
                iabt->ulpCommand = CMD_ABORT_XRI_CN;
        else
                iabt->ulpCommand = CMD_CLOSE_XRI_CN;

So, this function path would not have hit this possible NULL pointer
dereference before.

In order to fix this regression, move the second part of the BUG_ON()
check prior to the pointer dereference that it does check for.

For reference, this is the stack trace observed. The problem happened
because an unsolicited event was received - a PLOGI was received after
our PLOGI was issued but not yet complete, so the discovery state
machine goes on to sw-abort our PLOGI.

    kernel BUG at drivers/scsi/lpfc/lpfc_sli.c:1326!
    Oops: Exception in kernel mode, sig: 5 [#1]
    <...>
    NIP [...] lpfc_sli_ringtxcmpl_put+0x1c/0xf0 [lpfc]
    LR  [...] __lpfc_sli_issue_iocb_s4+0x188/0x200 [lpfc]
    Call Trace:
    [...] [...] __lpfc_sli_issue_iocb_s4+0xb0/0x200 [lpfc] (unreliable)
    [...] [...] lpfc_sli_issue_abort_iotag+0x2b4/0x350 [lpfc]
    [...] [...] lpfc_els_abort+0x1a8/0x4a0 [lpfc]
    [...] [...] lpfc_rcv_plogi+0x6d4/0x700 [lpfc]
    [...] [...] lpfc_rcv_plogi_plogi_issue+0xd8/0x1d0 [lpfc]
    [...] [...] lpfc_disc_state_machine+0xc0/0x2b0 [lpfc]
    [...] [...] lpfc_els_unsol_buffer+0xcc0/0x26c0 [lpfc]
    [...] [...] lpfc_els_unsol_event+0xa8/0x220 [lpfc]
    [...] [...] lpfc_complete_unsol_iocb+0xb8/0x138 [lpfc]
    [...] [...] lpfc_sli4_handle_received_buffer+0x6a0/0xec0 [lpfc]
    [...] [...] lpfc_sli_handle_slow_ring_event_s4+0x1c4/0x240 [lpfc]
    [...] [...] lpfc_sli_handle_slow_ring_event+0x24/0x40 [lpfc]
    [...] [...] lpfc_do_work+0xd88/0x1970 [lpfc]
    [...] [...] kthread+0x108/0x130
    [...] [...] ret_from_kernel_thread+0x5c/0xbc
    <...>

Cc: stable@vger.kernel.org # v4.8
Fixes: 22466da5b4b7 ("lpfc: Fix possible NULL pointer dereference")
Reported-by: Harsha Thyagaraja <hathyaga@in.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2319f847a8910cff1d46c9b66aa1dd7cc3e836a9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Fix possible NULL pointer dereference
Johannes Thumshirn [Fri, 29 Jul 2016 13:30:56 +0000 (15:30 +0200)]
lpfc: Fix possible NULL pointer dereference

Orabug: 25486030

Check for the existence of piocb->vport before accessing it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 22466da5b4b7a82d3e5a9c21c752cae91a21dc91)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Use %zd format string for size_t
Arnd Bergmann [Mon, 17 Oct 2016 12:35:46 +0000 (14:35 +0200)]
scsi: lpfc: Use %zd format string for size_t

Orabug: 25486030

A recent bugfix introduced a harmless warning in the lpfc driver:

drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_write_firmware':
drivers/scsi/lpfc/lpfc_logmsg.h:56:45: error: format '%ld' expects argument of type 'long int', but argument 9 has type 'size_t {aka const unsigned int}' [-Werror=format=]

'size_t' is always the same width as 'long' in the kernel, but the
compiler doesn't know that. The %z modifier is what the standard expects
to be used here, and this shuts up the warning.

Fixes: 679053c651fb ("scsi: lpfc: Fix fw download on SLI-4 FC adapters")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit efe583c6d3cdafbeb0c039cd5d0f88fd26637065)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix fw download on SLI-4 FC adapters
James Smart [Thu, 13 Oct 2016 22:06:17 +0000 (15:06 -0700)]
scsi: lpfc: Fix fw download on SLI-4 FC adapters

Orabug: 25486030

Fix fw download on SLI-4 FC adapters

Driver performs a quick validation of magic numbers in the fw
download image. Driver needed to be updated for more recent
magic numbers.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b6ef5db2590f0f6b99ba25fb018b60653ea66fe)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Synchronize link speed with boot driver
James Smart [Thu, 13 Oct 2016 22:06:16 +0000 (15:06 -0700)]
scsi: lpfc: Synchronize link speed with boot driver

Orabug: 25486030

Synchronize link speed with boot driver

Link speed settings set by the boot driver are reported by the hw.
Driver will attempt to read them, and if set, will respect their
values.
The driver can override the settings with its own if instructed by
user space (via bsg), with the new values being picked up by the
boot driver.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c691816e00d0b4da376f005ffc06eec8a9711dcf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct panics with eh_timeout and eh_deadline
James Smart [Thu, 13 Oct 2016 22:06:15 +0000 (15:06 -0700)]
scsi: lpfc: Correct panics with eh_timeout and eh_deadline

Orabug: 25486030

Correct panics with eh_timeout and eh_deadline

We were having double completions on our SLI-3 version of adapters.
Solved by clearing our command pointer before calling scsi_done.

The eh paths potentially ran simulatenously and would see the non-null
value and invoke scsi_done again.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 89533e9be08aeda5cdc4600d46c1540c7b440299)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix lost target in pt-to-pt connect
James Smart [Thu, 13 Oct 2016 22:06:14 +0000 (15:06 -0700)]
scsi: lpfc: Fix lost target in pt-to-pt connect

Orabug: 25486030

Fix lost target in pt-to-pt connect

Change reject code to something that allows a retry

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 401304cc0d508de2e366e693fedbe52b18aef0a8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Revise strings with full lpfc parameter name
James Smart [Thu, 13 Oct 2016 22:06:13 +0000 (15:06 -0700)]
scsi: lpfc: Revise strings with full lpfc parameter name

Orabug: 25486030

Revise strings with full lpfc parameter name

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6c86068dd235b61af9bfdcb8d3ec0d98ccbcf5a6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_sriov_nr_virtfn parameter
James Smart [Thu, 13 Oct 2016 22:06:12 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_sriov_nr_virtfn parameter

Orabug: 25486030

Code cleanup for lpfc_sriov_nr_virtfn parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0cfbbf2f9672c07637427f24768647a7fe19bd75)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_max_scsicmpl_time parameter
James Smart [Thu, 13 Oct 2016 22:06:11 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_max_scsicmpl_time parameter

Orabug: 25486030

Code cleanup for lpfc_max_scsicmpl_time parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ed5b152913971aeac12751f313655358ca2ab6e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_topology parameter
James Smart [Thu, 13 Oct 2016 22:06:10 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_topology parameter

Orabug: 25486030

Code cleanup for lpfc_topology parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0a0354398cf8775c40973bcfa60ec8d5a72ee58d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_aer_support parameter
James Smart [Thu, 13 Oct 2016 22:06:09 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_aer_support parameter

Orabug: 25486030

Code cleanup for lpfc_aer_support parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 506139a23eff91c365098fe9cc418e0fdcc5b660)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_enable_rrq parameter
James Smart [Thu, 13 Oct 2016 22:06:08 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_enable_rrq parameter

Orabug: 25486030

Code cleanup for lpfc_enable_rrq parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 31202b0e3c8dded6623a13ea0033a7bf03121c0a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code clean up for lpfc_iocb_cnt parameter
James Smart [Thu, 13 Oct 2016 22:06:07 +0000 (15:06 -0700)]
scsi: lpfc: Code clean up for lpfc_iocb_cnt parameter

Orabug: 25486030

Code clean up for lpfc_iocb_cnt parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0d8c8ba3fa5e21eebf36ef7ab7e370622309ac1c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Set driver environment data on adapter
James Smart [Thu, 13 Oct 2016 22:06:05 +0000 (15:06 -0700)]
scsi: lpfc: Set driver environment data on adapter

Orabug: 25486030

Set driver environment data on adapter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 61bda8f7c3ce46ce5de7c91a3383f7fe963643b9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct embedded io wq element size
James Smart [Thu, 13 Oct 2016 22:06:03 +0000 (15:06 -0700)]
scsi: lpfc: Correct embedded io wq element size

Orabug: 25486030

Correct embedded io wq element size. Embedded element sizes are
128 byte elements

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit dc58f44c2140748d96e33a533cd9e80692f58518)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Mark symbols static where possible
Baoyou Xie [Sun, 25 Sep 2016 05:44:55 +0000 (13:44 +0800)]
scsi: lpfc: Mark symbols static where possible

Orabug: 25486030

We get a few warnings when building kernel with W=1:
drivers/scsi/lpfc/lpfc_sli.c:5693:1: warning: no previous prototype for 'lpfc_set_features' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_sli.c:8972:1: warning: no previous prototype for 'lpfc_sli_calc_ring' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4621:1: warning: no previous prototype for 'lpfc_rdp_res_link_service' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4633:1: warning: no previous prototype for 'lpfc_rdp_res_sfp_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4698:1: warning: no previous prototype for 'lpfc_rdp_res_link_error' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4727:1: warning: no previous prototype for 'lpfc_rdp_res_bbc_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4752:1: warning: no previous prototype for 'lpfc_rdp_res_oed_temp_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4780:1: warning: no previous prototype for 'lpfc_rdp_res_oed_voltage_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4809:1: warning: no previous prototype for 'lpfc_rdp_res_oed_txbias_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4838:1: warning: no previous prototype for 'lpfc_rdp_res_oed_txpower_desc' [-Wmissing-prototypes]
....

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.  So this
patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bd4b3e5c8adf2b9f601b46b917afac555be05688)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: avoid harmless comparison warning
Arnd Bergmann [Wed, 15 Jun 2016 20:42:17 +0000 (22:42 +0200)]
scsi: lpfc: avoid harmless comparison warning

Orabug: 25486030

When building with -Wextra, we get a lot of warnings for the lpfc driver
concerning expressions that are always true, starting with:

drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_npiv_init':
drivers/scsi/lpfc/lpfc_attr.c:2786:77: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_rrq_init':
drivers/scsi/lpfc/lpfc_attr.c:2802:76: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_suppress_link_up_init':
drivers/scsi/lpfc/lpfc_attr.c:2812:2050: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_log_verbose_init':
drivers/scsi/lpfc/lpfc_attr.c:3064:1930: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]

The code works as intended, but it would be nice to shut up the warning
so we don't clutter up build logs with this. Using a separate inline
function for it makes it clear to the compiler that the comparison is
necessary in the caller but still lets it do the constant-folding.

[mkp: fix typo]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit de8c36bba33380fcc8564e69c039a4b84166e66d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held
Johannes Thumshirn [Mon, 18 Jul 2016 14:06:03 +0000 (16:06 +0200)]
lpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held

Orabug: 25486030

Call lpfc_sli_validate_fcp_iocb() with the hbalock held, as the pointer
to iocbq is not guaranteed to still be valid after looking it up.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 31979008fdae72d7441643f3a5b1bdaedf481335)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Copyright updates
James Smart [Wed, 6 Jul 2016 19:36:13 +0000 (12:36 -0700)]
lpfc: Copyright updates

Orabug: 25486030

Copyright updates

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 51f4ca3c93b2eaf80a182e9fcfa4f9e5706cca12)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct issue with ioremap() call on 32bit kernel
James Smart [Wed, 6 Jul 2016 19:36:11 +0000 (12:36 -0700)]
lpfc: Correct issue with ioremap() call on 32bit kernel

Orabug: 25486030

Correct issue with ioremap() call on 32bit kernel

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 115a4124bae6697b375e150deaed3a4ffc6580e1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Re-organize source for easier driver attribute management
James Smart [Wed, 6 Jul 2016 19:36:10 +0000 (12:36 -0700)]
lpfc: Re-organize source for easier driver attribute management

Orabug: 25486030

Re-organize source for easier driver attribute management

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 93dd1911cf4913321d91aa9c525f5f8149f90fee)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Remove global lpfc_sli_mode attribute in leiu of per-hba lpfc_sli_mode
James Smart [Wed, 6 Jul 2016 19:36:09 +0000 (12:36 -0700)]
lpfc: Remove global lpfc_sli_mode attribute in leiu of per-hba lpfc_sli_mode

Orabug: 25486030

Remove global lpfc_sli_mode attribute in leiu of per-hba lpfc_sli_mode

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 12247e8101eacfda790a14944c34bdccb6e90d6b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Remove global lpfc_delay_discovery attribute in leiu of per-hba lpfc_delay_disc...
James Smart [Wed, 6 Jul 2016 19:36:08 +0000 (12:36 -0700)]
lpfc: Remove global lpfc_delay_discovery attribute in leiu of per-hba lpfc_delay_discovery

Orabug: 25486030

Remove global lpfc_delay_discovery attribute in leiu of per-hba
lpfc_delay_discovery

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 8eb8b960fd0593baaddd1c01cbff6b85c5056ccf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Remove global lpfc_enable_npiv attribute in leiu of per-hba lpfc_enable_npiv
James Smart [Wed, 6 Jul 2016 19:36:07 +0000 (12:36 -0700)]
lpfc: Remove global lpfc_enable_npiv attribute in leiu of per-hba lpfc_enable_npiv

Orabug: 25486030

Remove global lpfc_enable_npiv attribute in leiu of per-hba lpfc_enable_npiv

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 458c083e83ed2f8e446cf1a38dd21996cebe6da0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct Port reset resulting in FC port going offline
James Smart [Wed, 6 Jul 2016 19:36:06 +0000 (12:36 -0700)]
lpfc: Correct Port reset resulting in FC port going offline

Orabug: 25486030

Correct Port reset resulting in FC port going offline

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0e916ee71d2f0453dbfe402cd8ca24f9668518ad)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add support for XLane LUN priority
James Smart [Wed, 6 Jul 2016 19:36:05 +0000 (12:36 -0700)]
lpfc: Add support for XLane LUN priority

Orabug: 25486030

Add support for XLane LUN priority

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c92c841cc72ae7eb665fb9ea2a1c991e214c3807)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct RDP response Revision location
James Smart [Wed, 6 Jul 2016 19:36:04 +0000 (12:36 -0700)]
lpfc: Correct RDP response Revision location

Orabug: 25486030

Correct RDP response Revision location

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5b1993dedfdc131ff095c0c079ef106aed3fe9ac)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Re-organize source for easier device-id management
James Smart [Wed, 6 Jul 2016 19:36:03 +0000 (12:36 -0700)]
lpfc: Re-organize source for easier device-id management

Orabug: 25486030

Re-organize source for easier device-id management

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 12f4445733c516648ab0b013314a83467876ac2f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct FCOE discovery to avoid loss of storage devices after system reboot
James Smart [Wed, 6 Jul 2016 19:36:02 +0000 (12:36 -0700)]
lpfc: Correct FCOE discovery to avoid loss of storage devices after system reboot

Orabug: 25486030

Correct FCOE discovery to avoid loss of storage devices after system reboot

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a1cadfeffac70a1ed77b45a8f93b92b9cb501d94)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Fix SLI mode 2 config failure
James Smart [Wed, 6 Jul 2016 19:36:01 +0000 (12:36 -0700)]
lpfc: Fix SLI mode 2 config failure

Orabug: 25486030

Fix SLI mode 2 config failure

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4597663fabf16645e2af8f02b9d7ba66110588b6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add MDS Diagnostics Support
James Smart [Wed, 6 Jul 2016 19:36:00 +0000 (12:36 -0700)]
lpfc: Add MDS Diagnostics Support

Orabug: 25486030

Add MDS Diagnostics Support

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7bdedb34a0ac1a4b30224c6945eaaebc6fae779a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add recovery from adapter parity errors on some SLI4 adapters
James Smart [Wed, 6 Jul 2016 19:35:56 +0000 (12:35 -0700)]
lpfc: Add recovery from adapter parity errors on some SLI4 adapters

Orabug: 25486030

Add recovery from adapter parity errors on some SLI4 adapters

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 65791f1f90aade6a02877f9bb7c63f67b35f138c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Utilize embedded CDB logic to minimize IO latency
James Smart [Thu, 31 Mar 2016 21:12:30 +0000 (14:12 -0700)]
lpfc: Utilize embedded CDB logic to minimize IO latency

Orabug: 25486030

Pass cmd iu payloads inline to adapter job structure rather than as
separate dma buffers.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b5c539583988b70bddea73f333c640fc93a62e88)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add sysfs proc_name support
James Smart [Wed, 6 Jul 2016 19:35:59 +0000 (12:35 -0700)]
lpfc: Add sysfs proc_name support

Orabug: 25486030

Add sysfs proc_name support

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 08dcd4cf3be26024ade20ff7c9f436a2cff83792)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Disable FDMI probing if not connected to a fabric
James Smart [Wed, 6 Jul 2016 19:36:12 +0000 (12:36 -0700)]
lpfc: Disable FDMI probing if not connected to a fabric

Orabug: 25486030

Disable FDMI probing if not connected to a fabric

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a03a4219a4e0b3e53078a2f97fee0b5a4cab2a20)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Reject RDP ELS if port has no login
James Smart [Wed, 6 Jul 2016 19:35:58 +0000 (12:35 -0700)]
lpfc: Reject RDP ELS if port has no login

Orabug: 25486030

Reject RDP ELS if port has no login

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7d9333139ec0dd7fd1ffa69ad4ab4bf701481ac9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct Buffer credit descriptor values in RDP response
James Smart [Wed, 6 Jul 2016 19:35:57 +0000 (12:35 -0700)]
lpfc: Correct Buffer credit descriptor values in RDP response

Orabug: 25486030

Correct Buffer credit descriptor values in RDP response

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3aaaa3141796d646052457aaff2a1be7c81aab3a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct RDP response sizing issue
James Smart [Wed, 6 Jul 2016 19:35:55 +0000 (12:35 -0700)]
lpfc: Correct RDP response sizing issue

Orabug: 25486030

Correct RDP response sizing issue

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6c92d1d0ce4efffc67ba6f4ce0c7f970c15af390)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Fix Transgression Flag of Optical Element descriptor for RDP on Linux
James Smart [Wed, 6 Jul 2016 19:35:54 +0000 (12:35 -0700)]
lpfc: Fix Transgression Flag of Optical Element descriptor for RDP on Linux

Orabug: 25486030

Fix Transgression Flag of Optical Element descriptor for RDP on Linux

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 310429ef11e828e26c5ef222b6793bef1fc8cd6e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agobnx2x: avoid two atomic ops per page on x86
Eric Dumazet [Fri, 20 Jan 2017 16:25:34 +0000 (08:25 -0800)]
bnx2x: avoid two atomic ops per page on x86

Orabug: 25477835

Commit 4cace675d687 ("bnx2x: Alloc 4k fragment for each rx ring buffer
element") added extra put_page() and get_page() calls on arches where
PAGE_SIZE=4K like x86

Reorder things to avoid this overhead.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
Cc: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b9032741e4f86844d8c4a7c18001ee328dae2f7a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agobnx2x: Prevent tunnel config for 577xx
Mintz, Yuval [Sun, 4 Dec 2016 13:30:18 +0000 (15:30 +0200)]
bnx2x: Prevent tunnel config for 577xx

Orabug: 25477835

Only the 578xx adapters are capable of configuring UDP ports for
the purpose of tunnelling - doing the same on 577xx might lead to
a firmware assertion.
We're already not claiming support for any related feature for such
devices, but we also need to prevent the configuration of the UDP
ports to the device in this case.

Fixes: f34fa14cc033 ("bnx2x: Add vxlan RSS support")
Reported-by: Anikina Anna <anikina@gmail.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 360d9df2acd9f0b89aabaf16fca08954f113bd4e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

8 years agoixgbevf: Handle previously-freed msix_entries
Mark Rustad [Fri, 28 Oct 2016 17:46:39 +0000 (10:46 -0700)]
ixgbevf: 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. Also only
clear the interrupts when the interface is up, because there
aren't any when it is not up.

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 eeffceee421b17a1d484679d738f278fbaa01384)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: ixgbe_atr() compute l4_proto only if non-paged data has network/transport...
Sowmini Varadhan [Mon, 24 Oct 2016 22:36:39 +0000 (15:36 -0700)]
ixgbe: ixgbe_atr() compute l4_proto only if non-paged data has network/transport headers

Orabug: 24568240

For some Tx paths (e.g., tpacket_snd()), ixgbe_atr may be
passed down an sk_buff that has the network and transport
header in the paged data, so it needs to make sure these
headers are available in the headlen bytes to calculate the
l4_proto.

This patch expect that network and transport headers are
already available in the non-paged header dat.  The assumption
is that the caller has set this up if l4_proto based Tx
steering is desired.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@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 9f3c7504fa005e2aab5ba9e1f2d8b4f4fcc6c077)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

8 years agoixgbe: ixgbe_atr() should access udp_hdr(skb) only for UDP packets
Sowmini Varadhan [Mon, 24 Oct 2016 22:36:38 +0000 (15:36 -0700)]
ixgbe: ixgbe_atr() should access udp_hdr(skb) only for UDP packets

Orabug: 24568240

Commit 9f12df906cd8 ("ixgbe: Store VXLAN port number in network order")
incorrectly checks for hdr.ipv4->protocol != IPPROTO_UDP
in ixgbe_atr(). This check should be for "==" instead.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@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 520288218cf233f442aa815496a95622c2672c62)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
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>