rkennedy [Tue, 13 Oct 2015 20:15:31 +0000 (13:15 -0700)]
lpfc: Fix for discovery failure in PT2PT when FLOGI's ELS ACC response gets aborted
Submitted by james.smart () james.smart.()@emulex.com
Fix for discovery failure in PT2PT when FLOGI's ELS ACC response gets aborted
Change login state machine to:
- Restart FLOGI if prior is ABTS'd
- Reject incoming FLOGIs if we have one pending
The above ensures that we always finish FLOGI processing, regardless
of who initated FLOGI, before processing PLOGI's.
Signed-off-by: Dick Kennedy dick.kennedy@avagotech.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105413003759&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:26 +0000 (13:15 -0700)]
lpfc: Add support for Lancer G6 and 32G FC links
Submitted by james.smart () james.smart.()@emulex.com
Add support for Lancer G6 and 32G FC links
Signed-off-by: Dick Kennedy dick.kennedy@avagotech.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105411903746&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Ales Novak Ales.Novak@emulex.com
From: Ales Novak alnovak@suse.cz
lpfc_send_rscn_event() allocates data for sizeof(struct
lpfc_rscn_event_header) + payload_len, but claims that the data has size
of sizeof(struct lpfc_els_event_header) + payload_len. That leads to
buffer overruns.
Signed-off-by: Ales Novak alnovak@suse.cz Signed-off-by: James Smart james.smart@avagotech.com Reviewed-by: Hannes Reinecke hare@suse.de
http://marc.info/?l=linux-scsi&m=144105411603743&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:17 +0000 (13:15 -0700)]
lpfc: Fix possible use-after-free and double free in lpfc_mbx_cmpl_rdp_page_a2()
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Johannes Thumshirn Johannes.Thumshirn@emulex.com
From: Johannes Thumshirn jthumshirn@suse.de
If the bf_get() call in lpfc_mbx_cmpl_rdp_page_a2() does succeeds, execution
continues normally and mp gets kfree()d.
If the subsequent call to lpfc_sli_issue_mbox() fails execution jumps to the
error label where lpfc_mbuf_free() is called with mp-virt and mp-phys as
function arguments. This is the use after free. Following the use after free mp
gets kfree()d again which is a double free.
Signed-off-by: Johannes Thumshirn jthumshirn@suse.de Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105412703755&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:12 +0000 (13:15 -0700)]
lpfc: remove set but not used variables
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Sebastian Herbszt Sebastian.Herbszt@emulex.com
From: Sebastian Herbszt herbszt@gmx.de
Remove set but not used variables.
Signed-off-by: Sebastian Herbszt herbszt@gmx.de Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105412703757&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:07 +0000 (13:15 -0700)]
lpfc:Make the function lpfc_sli4_mbox_completions_pending static in order to comply wi
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Nicholas Krause Nicholas.Krause@emulex.com
From: Nicholas Krause xerofoify@gmail.com
This makes the function lpfc_sli4_mbox_completion's definition
static now in order to comply with its prototype being also
declared as static too.
Signed-off-by: Nicholas Krause xerofoify@gmail.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105411503741&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:13:30 +0000 (13:13 -0700)]
Fix kmalloc overflow in LPFC driver at large core count
Submitted by james.smart james.smart.@avagotech.com
From: james.smart@avagotech.com (James Smart)
Note: original patch modified by me to resolve unused variable warning
From: ian mitchell <imitchell@sgi.com>
This patch allows the LPFC to start up without a fatal kernel bug based
on an exceeded KMALLOC_MAX_SIZE and a too large NR_CPU-based maskbits
field. The bug was based on the number of CPU cores in a system.
Using the get_cpu_mask() function declared in kernel/cpu.c allows the
driver to load on the community kernel 4.2 RC1.
Signed-off-by: Ian Mitchell <imitchell@sgi.com> Signed-off-by: Alex Thorlton <athorlton@sgi.com> Suggested-by: Robert Elliot <elliott@hp.com>
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 19:48:28 +0000 (12:48 -0700)]
lpfc: Destroy lpfc_hba_index IDR on module exit
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Johannes Thumshirn Johannes.Thumshirn@emulex.com
From: Johannes Thumshirn jthumshirn@suse.de
Destroy lpfc_hba_index IDR on module exit, reclaiming the allocated memory.
This was detected by the following semantic patch (written by Luis Rodriguez
mcgrof@suse.com)
SmPL
@ defines_module_init @
declarer name module_init, module_exit;
declarer name DEFINE_IDR;
identifier init;
@@
Signed-off-by: Johannes Thumshirn jthumshirn@suse.de Signed-off-by: James Smart james.smart@avagotech.com Reviewed-by: Hannes Reinecke hare@suse.de
http://marc.info/?l=linux-scsi&m=144105411403740&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 19:48:24 +0000 (12:48 -0700)]
lpfc: in sli3 use configured sg_seg_cnt for sg_tablesize
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Bodo Stroesser Bodo.Stroesser@emulex.com
From: Bodo Stroesser bstroesser@ts.fujitsu.com
Hi James,
We had some performance problems with RAID systems connected to LPe12k.
AFAICS, the reason is a small bug in lpfc.ko, causing the IO-size to
be smaller than expected.
rkennedy [Tue, 13 Oct 2015 19:48:15 +0000 (12:48 -0700)]
lpfc: fix model description
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Sebastian Herbszt Sebastian.Herbszt@emulex.com
From: Sebastian Herbszt herbszt@gmx.de
Remove trailing space from model description.
Signed-off-by: Sebastian Herbszt herbszt@gmx.de Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105410703733&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:35 +0000 (10:42 -0400)]
lpfc: Check for active portpeerbeacon.
LCB requests to set Beacon would fail if the beacon was already enabled
internally as the mailbox command used to query the state failes with
an already-set status.
Correct by enhancing the check so we don't fail if if the already set
status comes back.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 481ad967991e1ff00d627d365de398b7a77e4d7f)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:36 +0000 (10:42 -0400)]
lpfc: Fix vport deletion failure.
If a vport was deleted while in the middle of discovery, we weren't
clearing the nport discovery flag. Correct by clearing the flag and
cancelling our discovery timeout timer.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 73dc0dbed3f9f65c6f80fab429dd9771de794714)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:37 +0000 (10:42 -0400)]
lpfc: Devices are not discovered during takeaway/giveback testing
When a remote nport changes it's DID, a new ndlp is used.
However, we left the old ndlp state unchanged and still in
a discovery state. The may stall discovery resulting in some
devices not being discovered. Correct by swapping the state
of the 2 ndlp's when a DID swap is detected.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 953ceeda97ddfed2c6e0bea3706257d57197f269)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:38 +0000 (10:42 -0400)]
lpfc: Add support for using block multi-queue
With blk-mq support in the mid-layer, lpfc can do IO steering based
on the information in the request tag. This patch allows lpfc to use
blk-mq if enabled. If not enabled, we fall back into the emulex-internal
affinity mappings.
This feature can be turned on via CONFIG_SCSI_MQ_DEFAULT or passing
scsi_mod.use_blk_mq=Y as a parameter to the kernel.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 8b0dff14164d3f43eba8365950b506d898e0e1e6)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:39 +0000 (10:42 -0400)]
lpfc: Fix scsi prep dma buf error.
Didn't check for less-than-or-equal zero. Means we may later call
scsi_dma_unmap() even though we don't have valid mappings.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 5116fbf136ea21b8678a85eee5c03508736ada9f)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:40 +0000 (10:42 -0400)]
lpfc: Fix cq_id masking problem.
The driver inadvertainly constrained the id space to 8 bits, when its
a full 16 bits from hw. This resulted in bad id's being written to the
hardware. Resulted in symptoms such as incomplete initialization, no
detection of link events, etc.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 16f3b48d26ac069abc020826f0c429c4ddcfb20c)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:41 +0000 (10:42 -0400)]
lpfc: Fix scsi task management error message.
TMF's were getting error messages on FCP_RSP errors (underrun). Underruns
aren't meaningful in the scenario. Change the error message to filter out
these response check errors, and don't unconditionally mark the cmd as
in error.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit ae374a308cbfeab3cf72ef7c57695d2145defeab)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:43 +0000 (10:42 -0400)]
lpfc: Fix to drop PLOGIs from fabric node till LOGO processing completes
The domain controller PLOGI's concurrent with prior LOGO's/unreg_rpi's
completing created a race condition where driver rpi ref count can
inadvertantly hit 0 and the rpi attempted to be freed. This error
sometimes resulted in Warning messages indicating kref.h via
lfpc_nlp_get+0x128.
Correct by dropping any new PLOGI until the prior nport state has settled.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:16 +0000 (13:55 -0400)]
lpfc: The lpfc driver does not issue RFF_ID and RFT_ID in the correct sequence
The order (it's a shall, but hard to dictate after the fact) is given in
FC-SCM - kind of. SCM indicates what shall be implemented, lists it as (a),
(b), (c), but actually doesn't say it has to be in that order. The only hard
requirement, called out in FCP-4, is that you must register your FC-4 Type
(via RFT_ID) before registering FC-4 Type Features (via RFF_ID), which makes
sense. We obviously violated this and there were some switches (or newer fw in
them) that enforced it. The other rule of thumbs are: register your data with
the switch first, then register for SCRs, then do queries about the fabric,
with the SCRs telling you of changes post the queries.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e26422fe91e533cb0a51f5f5bf80856d40592e0d)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:17 +0000 (13:55 -0400)]
lpfc: Correct loss of target discovery after cable swap.
Fix incorrect reference counting
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 0290217ad830f2813bb9ed5f51af686c0c591f28)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:18 +0000 (13:55 -0400)]
lpfc: Add support for ELS LCB.
Also has a little whitespace fixing.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:19 +0000 (13:55 -0400)]
lpfc: Correct reference counting of rport
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 7aafb6e75e0212b5aa5b1f79737e6e8de40b1132)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:20 +0000 (13:55 -0400)]
lpfc: Fix ABORTs WQ selection in terminate_rport_io
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit a1efe163102fed8a3b5990a67cadb1193e630820)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:21 +0000 (13:55 -0400)]
lpfc: Add support for RDP ELS command.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:22 +0000 (13:55 -0400)]
lpfc: Correct reporting of vport state on fdisc command failure.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit c84163d179e561613472a4ee479eb67ba2771177)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:23 +0000 (13:55 -0400)]
lpfc: Fix discovery issue when changing from Pt2Pt to Fabric.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 6b337e032c398aa9d92222f0709f4e06932acf72)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:25 +0000 (13:55 -0400)]
lpfc: Fix to remove IRQF_SHARED flag for MSI/MSI-X vectors.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit ed243d37be56be3dff4bf51a6f870d36843ed12f)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:26 +0000 (13:55 -0400)]
lpfc: Fix crash in vport_delete.
We inadvertantly took the path to recreate the vport while in a
driver teardown path
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit cc82355a6e6cb606125b849db7f9e9a10408d407)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:27 +0000 (13:55 -0400)]
lpfc: Correct loss of RSCNs during array takeaway/giveback testing.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e5abba4c6aa7f094d32c0115193516697da60df8)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:29 +0000 (13:55 -0400)]
lpfc: Fix incorrect log message reported for empty FCF record.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit f818ea7ad46222526bcaa3b04208775f371dc03c)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Thu, 21 May 2015 17:55:30 +0000 (13:55 -0400)]
lpfc: Change buffer pool empty message to miscellaneous category
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit f911462fc4aad8885de4844bf0e8e561e77df6a6)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
In mpt2sas driver due to lack of synchronization between ioctl,
BRM status access through sysfs, pci resource removal kernel oops
happen as ioctl path and BRM status sysfs access path still tries
to access the removed resources
Two locks added to provide syncrhonization
1. pci_access_mutex: Mutex to synchronize ioctl,sysfs show path and
pci resource handling. PCI resource freeing will lead to free
vital hardware/memory resource, which might be in use by cli/sysfs
path functions resulting in Null pointer reference followed by kernel
crash. To avoid the above race condition we use mutex syncrhonization
which ensures the syncrhonization between cli/sysfs_show path
Note: pci_access_mutex is used only if nytro warpdrive cards
(ioc->is_warpdrive based on device id) are used
as we could not test this case with other SAS2 HBA cards
We can remove this check if this behaviour confirmed from other
cards.
2. spinlock on list operations over IOCs
Case: when multiple warpdrive cards(IOCs) are in use
Each IOC will added to the ioc list stucture on initialization.
Watchdog threads run at regular intervals to check IOC for any
fault conditions which will trigger the dead_ioc thread to
deallocate pci resource, resulting deleting the IOC netry from list,
this deletion need to protected by spinlock to enusre that
ioc removal is syncrhonized, if not synchronized it might lead to
list_del corruption as the ioc list is traversed in cli path
Signed-off-by: Nagarajkumar Narayanan <nagarajkumar.narayanan@seagate.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 6229b414b3adb3aac0b54e67d72d6462fc230c0d)
With the addition of X550em_x SFP+ support, the driver is now
functionally equivalent to what will be the 4.2.1 driver when
released, so change the version to match.
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 21dd560162d4bbf98cc81b303bfa19740ae5b964) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The X540 thermal interrupt (IXGBE_EIMS_TS) is not an SDP, so it
doesn't need to be enabled in ixgbe_setup_gpie(). In fact the
value is simply not for the GPIE register at all.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c5846ba44500293d290eb2a31bd344565f237ad3) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The 82599 and X540 datasheets require that FCRTH be "set" for Tx
switching (VM-to-VM loopback) but it did not previously specify what
the value should be set to. It has now been determined that
the correct value is RXPBSIZE - (24*1024).
This setting is also required for later devices.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bc1fc64fd2d9093496e5b04c6d94d26bfa629c9c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
A logic error here results in the adapter_stopped flag only being
cleared when ixgbe_setup_fc returns an error. Correct the logic.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3507a9b8c9d1684b5095c97f587ee46184e590da) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This change does two things. First, it makes it so that we always
set the relaxed ordering bits related to the DCA registers even if
DCA is not enabled. Second, it moves the configuration out of the
ixgbe_down function and into the ixgbe_configure function before
enabling the Rx and Tx rings. This ensures that DCA is configured
correctly before starting to process packets.
Thanks to Alex Duyck for this fix.
CC: Alex Duyck <aduyck@mirantis.com> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 9de7605ea2389d5ab86d6fbb3f1a11b87665a35c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 018d7146eee1942f27675bdabf9b43586bfaef72) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch skips the PCI transactions pending check in
ixgbe_disable_pcie_master. This is done to addresses a known HW
issue where the PCI transactions pending bit sticks high when there
are pending transactions. HW engineering instructed to workaround
this issue by wait and then continue with our reset flow.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7fc151035487916b266257c2e7b8b6cb2a5cd04f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch sets RDRXCTL.PSP when the driver is in SRIOV mode which
enables padding of small packets.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f961ddae164a5288a62146aae191da7bc1ecedb4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Setting the X550* RDRXCTL register should fall through into X540
and 82599, not 82598.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 052a1a724338bbf4721f8b4d7de8486701fc37cb) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The timeout path is supposed to release the semaphore, so do that.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5967fe225686bcae17352de172573964a15b17d5) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Take control of an I2C mux that selects which SFP is attached to
the I2C bus. The control of the mux is captured in the taking and
releasing of the related semaphore. Because only port 1 can control
the mux, port 1 always leaves the mux set to select port 0.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 449e21a92411ba35bfa68b4464aa7dbd1f705d28) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reduce the frequency of polling for SFP modules. Because the
service task sometimes runs at high rates, we can poll for
SFPs too often. When an SFP is not present, the I2C timeouts
that result are very costly. So, prevent SFP polling from
being done more than once every two seconds. To reduce latency,
the poll time is cleared in a couple of cases to permit the
next service task execution to poll the SFP module.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 58e7cd24d474c87763387f606e403012f562760b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Since SFP+ can be used with some X550 devices, permit them to be
detected.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 69eec0c2fa8781a6abae96af1f11069e1965cbfe) Signed-off-by: Brian Maly <brian.maly@oracle.com>
On some hardware platforms, the CS4227 does not initialize properly.
Detect those cases and reset it appropriately.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 542b6eecf4c3640f15a84ff89525131d421e7c8c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Configures the CS4227 correctly for both 1G and 10G operation,
by moving the code to ixgbe_setup_mac_link_sfp_x550em(). It
needs to be in this function because we need both the module
type and the speed, and this is the only function in the init
flow that knows the speed. In contrast,
ixgbe_setup_sfp_modules_X550em() does not know the speed, so we
can't do anything useful here. This is a fundamental difference
from the previous flow, and is due to the way the CS4227 is
implemented.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e23f33367882450c66f7de8805b98ce7665a7ba9) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch adds X550EM_x SFP+ dual-speed support. 82599 fiber link
code was moved from ixgbe_82599.c to ixgbe_common.c for use by
X550EM. SFP MAC link code is added to x550EM.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6d373a1bbb99bdfb9ce820aec9ae5f2e02c8891f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reduce the number of retries during PHY detection. This reduces
pauses when no SFP is present. Once an SFP is detected, the normal
retry count will be used.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 56f6ed1ce13b0cb85ae9537f839df7c4ba1f5369) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Clear the destination location for I2C data initially so that
the received data will not be affected by previous attempts.
This could have returned wrong data in certain retry sequences.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6ee8c9a70d65ee37251465348501a067138050d7) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Set the bit banging mode in the hardware when performing bit banging
I2C operations on X550. Also control the output enable on both the
clock and data lines.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 25b1029789f98f945a03a2d04662a94b357aacb9) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The lan_id is being set after a previous I2C eeprom access which
makes no sense because it needs to be set before any access. Move
the setting to before the access.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit da4ea4baf77c9e45c53671e465043ffaf26fd45d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Most I2C accesses take and release semaphores for each access. Now
there is a reason to perform multiple I2C operations under the same
holding of the semaphore, so provide unlocked I2C methods for that
purpose.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bb5ce9a5cb6e915a2b284a8785686716823679d1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Provide I2C combined operations on X550EM, not X550 devices.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4f9e3a3de0e2fbc49c036322cb2ee656ea8b93fc) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Add support for the SFP insertion interrupt on X550EM devices with
SFPs.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit cbd45ec7aae9a20835d1a64c7a1910eb5dcec57b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When an SFP not present error is returned by the reset_hw method,
accept it and go on, since an SFP can still be inserted. Previously
it was only accepted for 82598 devices.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 29a8dca1997f880563e53e9ba0fcb50b03bd23af) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Setting ndo_features_check to passthru_features_check allows the driver
to skip the check for multiple tagged TSO packets and enables stacked
VLAN TSO.
Tested with 82599ES.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0f90300f4fd30968a4d40fe47a9043be9912cb31) Signed-off-by: Brian Maly <brian.maly@oracle.com>
X550 has HW support for SCTP flow director filters SCTP mask. This
patch adds it like we do for UDP and TCP.
Signed-off-by: Donald C 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 5532408b48834bd762ed53c22aabed5dae0748d6) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch is part of the future enablement of X550 SFP+ support. This
HW uses different SDP so the interrupts need to be set up accordingly.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a023bbd0b1a3716397d8d54ba5b95e09b8e27699) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch updates the lowest limit for adaptive interrupt interrupt
moderation to roughly 12K interrupts per second.
The way I came about reaching 12K as the desired interrupt rate is by
testing with UDP flows. Specifically I had a simple test that ran a
netperf UDP_STREAM test at varying sizes. What I found was as the packet
sizes increased the performance fell steadily behind until we were only
able to receive at ~4Gb/s with a message size of 65507. A bit of digging
found that we were dropping packets for the socket in the network stack,
and looking at things further what I found was I could solve it by increasing
the interrupt rate, or increasing the rmem_default/rmem_max. What I found was
that when the interrupt coalescing resulted in more data being processed
per interrupt than could be stored in the socket buffer we started losing
packets and the performance dropped. So I reached 12K based on the
following math.
rmem_default = 212992
skb->truesize = 2994
212992 / 2994 = 71.14 packets to fill the buffer
packet rate at 1514 packet size is 812744pps
71.14 / 812744 = 87.9us to fill socket buffer
From there it was just a matter of choosing the interrupt rate and
providing a bit of wiggle room which is why I decided to go with 12K
interrupts per second as that uses a value of 84us.
The data below is based on VM to VM over a direct assigned ixgbe interface.
The test run was:
netperf -H <ip> -t UDP_STREAM"
Socket Message Elapsed Messages CPU Service
Size Size Time Okay Errors Throughput Util Demand
bytes bytes secs # # 10^6bits/sec % SS us/KB
Before:
212992 65507 60.00 1100662 0 9613.4 10.89 0.557
212992 60.00 473474 4135.4 11.27 0.576
Using bare metal the data is similar but not as dramatic as the throughput
increases from about 8.5Gb/s to 9.5Gb/s.
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8ac34f10a5ea4c7b6f57dfd52b0693a2b67d9ac4) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When the .remove() callback for a PF is called, SR-IOV support for the
device is disabled, which requires unbinding and removing the VFs.
The VFs may be in-use either by the host kernel or userspace, such as
assigned to a VM through vfio-pci. In this latter case, the VFs may
be removed either by shutting down the VM or hot-unplugging the
devices from the VM. Unfortunately in the case of a Windows 2012 R2
guest, hot-unplug is broken due to the ordering of the PF driver
teardown. Disabling SR-IOV prior to unregister_netdev() avoids this
issue.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Mitch Williams <mitch.a.williams@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 6b010e9b1f0a406d1d35202a694fa724a559bf77) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Add checks for systems that don't have SFP's to avoid incorrectly
acting on interrupts that are falsely interpreted as SFP events.
This also includes a modified check generating the EICR mask to be
more forward-looking.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4ccc650cc845476885f73660b2e6335852f0f75c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Resolve warnings resulting from redundant initialization of the
get_bus_info field in the mac_ops_X550* structures.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 990a2d6ed543bd18b864b8a11f7be3368c67ccea) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When unbinding an SR-IOV device with VFs configured from ixgbe, the
driver behaves in one of two ways. If max_vfs was specified, the
SR-IOV state is disabled, removing the VFs. The occurs regardless of
whether the VF count was later modified through sysfs. If however
max_vfs is zero, such as by not specifying the module parameter, the
VFs persist after the PF is unbound from ixgbe. If the PF is then
bound to vfio-pci to be assigned to a VM, the PF is non-functional.
>From the comment, commit da36b64736cf ("ixgbe: Implement PCI SR-IOV
sysfs callback operation") clearly intended this alternate behavior,
but probably didn't realize the PF doesn't work in this mode.
This bimodal behavior is confusing to users and results in a state
where the PF is broken for other uses unless the user sets
sriov_numvfs to zero prior to unbinding the device. Remove this
behavior so that VFs are removed and the PF is functional for other
uses after unbind, regardless of the way VFs are enabled.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7837e2867f56ec4435e75af54236732885303694) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Now that we can do 2.5G link speed, we need to be able to report it.
Also change the nested triadic involved in creating the log message
to instead use a simpler switch statement to set a string pointer.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 454adb008d78e4ecdfec3f2e5e9eb08ee5a60f1a) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch resolves an issue where users were not able to dynamically
set number of queues for 82598 via ethtool -L
Reported-by: Tal Abudi <talabudi@gmail.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 7e3f5c8881ba45eba1c74344b00558920008e6e6) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Allows to change the rxfh indirection table and/or key using
ethtool interface.
Signed-off-by: Tom Barbette <tom.barbette@ulg.ac.be> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1c7cf0784e4d448ed8a07c5fc1e3aac1528272f1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Avoid a needless PHY access on copper phys to save the 10ms wait
time for each PHY access. A helper function is introduced to
actually do the register access and process the contents.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ae8140aa6bf5c7aafc0d9c2f612c5b59bea1ce9f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
We already cache this FW/SW semaphore mask so might as well use it
for consistency.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 897b9349f056d1c1cf5141ded4ec26766d845f8b) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch removes the redundant lan_id in the phy struct and uses
the bus version. Both variables exist and intend to represent the
STATUS register LAN_ID field. However, phy.lan_id is not bit shifted
so the phy.lan_id = 0x0 for LAN Id 0 and phy.lan_id = 0x4 for LAN Id 1.
Where bus.lan_id is bit shifted so bus.lan_id = 0x0 for LAN Id 0 and
bus.lan_id = 0x1 for LAN Id 1. There seems no need for the additional
lan_id variable and this should make the code less confusing.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d5702dea43fc517c389f2d9825213dabbfdaed5e) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The ixgbe never has as very doubtfully ever will support either
PCI or PCI-X devices. So remove the unused types from the
ixgbe_bus_type. Thanks to Alex Duyck for suggesting this.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fa888b891384ccbf18e70af2e02f5173e55e5e7f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
With this patch we add support for a new bus type ixgbe_bus_type_internal.
X550em devices use IOSF and not PCIe bus so this new type is to accommodate
them.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f9328bc6a7edc0fbaea836007b4261ca6233d96f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Added ixgbe_get_bus_info_X550em to X550 code. ixgbe_get_bus_info_X550em
sets bus.width to ixgbe_bus_width_unknown and bus.speed to
ixgbe_bus_speed_unknown, because IOSF does not report a PCIe bus
width or speed.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 454c65dd1a1e7fdaa5bbd3a34e14ab5560fbfad7) Signed-off-by: Brian Maly <brian.maly@oracle.com>
When the device is closing or suspending, call ixgbe_enter_lplu to
enter low power link up state on devices that support it. When this
is done, prevent the phy from being reset in the ixgbe_down path
so that link is present when calling ixgbe_enter_lplu.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6ac7439459606a57265800e60b14d58365ab19eb) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Add support for VXLAN RX offloads for the X55x devices that support
them.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 67359c3c9fc8e9fbed991bbe0cfeda55c7e0a64c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
By using GSO for UDP-encapsulated packets, all ixgbe devices can
be directed to generate checksums for the inner headers because
the outer UDP checksum can be zero. So point the machinery at the
inner headers and have the hardware generate the checksum.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f467bc06022d4d37de459f9498ff4fbc7e9b0fca) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Wait up to about 100 us for FDIRCMD writes to complete and return
failure indications.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d490d15877b2e6fc2d800ea232a0eca54cf4592c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
There are various reasons why this method may or may not need to be
defined and some of these we don't know until runtime. So we will
set the value in get_invariants.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b5529ef5be1f0a0089988ec51541aa9573e94476) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch adds a support function that will indicate for the
existence of management FW.
Signed-off-by: Donald C Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bd8069ace513dd2741bc7177eeebc9a392451db1) Signed-off-by: Brian Maly <brian.maly@oracle.com>
The following commit added the capability of entering low power mode:
ixgbe: Add a PHY power state method
This works fine with newer drivers that support this capability,
however older drivers that dont support this encounter a regression
as they are not able to restore power mode at boot when the driver
loads. This regression is encountered when booting a newer kernel/driver
that supports low power mode, then doing a warm reboot to an older
kernel or other OS like FreeBSD that do not know how to restore the
power mode. In this case a cold reboot is required to restore power
mode.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6fb469023cd995d7be5ab3bf12b79387710382ff) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Use the ARRAY_SIZE macro rather than calculating sizeof(a)/sizeof(a[0]).
Also directly replace the code rather than using an unnecessary define.
Reported-by: Maninder Singh <maninder1.s@samsung.com> Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 9fa0452b645efdff439948a5cf448b8e497340e9) Signed-off-by: Brian Maly <brian.maly@oracle.com>
There are many settings possible using ethtool -C/--coalesce, but not
all of them are supported in igb. Report failure when an unsupported
option is set.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0c5bbeb8839172990e3b8aa82ae3c166e85a09bc) Signed-off-by: Brian Maly <brian.maly@oracle.com>
e1000_check_for_link_media_swap() checks PHY page 0 for copper and PHY
page 1 for "other" (fiber) link. The switch back from page 1 to page 0
happened too soon, before e1000_check_for_link_82575() is executed, and
link on fiber (other) was never detected. Check for link while still on
the proper PHY page.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2ba6c0797c8b5a9f945345ef2b9193bd47e5f18e) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This change makes it so that we pull the timestamp from the fragment before
we add it to the skb. By doing this we can avoid a possible issue in which
the fragment can possibly be less than IGB_RX_HDR_LEN due to the timestamp
being pulled after the copybreak check.
While making this change I realized we could also pull the rest of the
igb_pull_tail function into igb_add_rx_frag since in the case of igb,
unlike ixgbe, we are able to unmap the entire buffer before calling
add_rx_frag so merging the two allows for sharing of code between the two
merged functions.
Reported-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f56e7bba22fad16c0d4fac996623ce1c13244f8f) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 97aebc1b3cdfd445a0a051090f0dcc6018b6df2c) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 73cd63598dcbc95f51d5becf548e0643aa7a49fa) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Disable IPv6 extension header processing as per hardware errata.
Also fix copyright date.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8d0a88a959f0768d6b46436ea2517926fb682e53) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This change updates igb so that it will correctly perform the descriptor
count calculation. Previously it was taking NETDEV_FRAG_PAGE_MAX_SIZE
into account with isn't really correct since a different value is used to
determine the size of the pages used for TCP. That is actually determined
by SKB_FRAG_PAGE_ORDER.
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2ee52ad4962b32797bac33fa29ec8159e64c4ee3) Signed-off-by: Brian Maly <brian.maly@oracle.com>
igb_enable_mas() should only be called for the 82575 and has no clear
return so changing it to void. Also simplify the odd conditional
expression.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8cfb879d1b118e190bf9aea1b50da62c0d8a4a77) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Merge branch 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek:
IB/rds_rdma: unloading of ofed stack causes page fault panic
RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns.
RDS-TCP: Make RDS-TCP work correctly when it is set up in a netns other than init_net
net: sk_clone_lock() should only do get_net() if the parent is not a kernel socket
net: Modify sk_alloc to not reference count the netns of kernel sockets.
net: Pass kern from net_proto_family.create to sk_alloc
net: Add a struct net parameter to sock_create_kern
Signed-off-by: Raanan Avargil <raanan.avargil@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d2d7d4e4a60f1aeefb38d7a0bede3742ddb76a68) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Change the algorithm. Read systimel twice and check for overflow.
If there was no overflow, use the first value.
If there was an overflow, read systimeh again and use the second
systimel value.
Signed-off-by: Raanan Avargil <raanan.avargil@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 37b12910dd11d9ab969f2c310dc9160b7f3e3405) Signed-off-by: Brian Maly <brian.maly@oracle.com>
This patch fixes wrong locking usage.
In the context of slot reset, we should use lock.
And during resume, there is no need of lock.
Reported-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Raanan Avargil <raanan.avargil@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2758f9edb7bd5a06a2ecee83cc2ebaf8822a0cb5) Signed-off-by: Brian Maly <brian.maly@oracle.com>