Re: [RFC PATCH 0/3] lpfc: nodelist pointer cleanup

2019-10-18 Thread James Smart
On 10/18/2019 12:50 AM, Hannes Reinecke wrote: Hi James, trying to figure this annoying lpfc_set_rrq_active() bug I've found the nodelist pointer handling in the lpfc io buffers a bit strange; there's a 'ndlp' pointer, but for scsi the nodelist is primarily accessed via the 'rdata' pointer (alth

[PATCH 07/16] lpfc: fix coverity error of dereference after null check

2019-10-18 Thread James Smart
ck Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index da90c7bf2287..2235a45999a8 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers

[PATCH 02/16] lpfc: Fix reporting of read-only fw error errors

2019-10-18 Thread James Smart
the field. Parse the adapter return codes for Write_Object and write an appropriate message to the system console. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw4.h | 1 + drivers/scsi/lpfc/lpfc_init.c | 69 ++

[PATCH 16/16] lpfc: Update lpfc version to 12.6.0.0

2019-10-18 Thread James Smart
Update lpfc version to 12.6.0.0 Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index d8839d95f7fe..ed1b10b0161e

[PATCH 12/16] lpfc: Add log macros to allow print by serverity or verbocity setting

2019-10-18 Thread James Smart
-by: James Smart --- drivers/scsi/lpfc/lpfc_logmsg.h | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_logmsg.h b/drivers/scsi/lpfc/lpfc_logmsg.h index ea10f03437f5..148d02a27b58 100644 --- a/drivers/scsi/lpfc/lpfc_logmsg.h +++ b/drivers/scsi/lpfc

[PATCH 10/16] lpfc: Revise interrupt coalescing for missing scenarios

2019-10-18 Thread James Smart
escing value is then applied to the EQs that had interrupted on the cpu. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw4.h | 1 - drivers/scsi/lpfc/lpfc_init.c | 51 ++- drivers/scsi/lpfc/lpfc_sli.c | 3 ++

[PATCH 15/16] lpfc: Add additional discovery log messages

2019-10-18 Thread James Smart
-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 22 +++--- drivers/scsi/lpfc/lpfc_els.c | 10 -- drivers/scsi/lpfc/lpfc_hbadisc.c | 39 +++ 3 files changed, 62 insertions(+), 9 deletions(-) diff

[PATCH 08/16] lpfc: Slight fast-path Performance optimizations

2019-10-18 Thread James Smart
Slightly rework some error check code paths for better streamlining. Added compiler unlikely hints to allow slightly better optimization of the fast-path. Removed a few pointer checks that were obviously already valid. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi

[PATCH 09/16] lpfc: Remove lock contention target write path

2019-10-18 Thread James Smart
ed by the adapter to generate the IU. Remove the allocations and the associated buffer pool. Rather than leaving NULLs in buffer pointer locations, set command and sgl to indicate skipped SGLE indexes. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h

[PATCH 11/16] lpfc: Make FW logging dynamically configurable

2019-10-18 Thread James Smart
that it can be enabled dynamically via an attribute. Additionally, the size of the buffer can be configured dynamically. - Add locks around states that now may be changing. - Tie the feature into debugfs so that the logs can be read at any time. Signed-off-by: Dick Kennedy Signed-off-by:

[PATCH 13/16] lpfc: Add FA-WWN Async Event reporting

2019-10-18 Thread James Smart
Add decode support for adapter Async Events which report FA-WWN configuration errors. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- Note: Requires the prior patch: lpfc: Add log macros to allow print by serverity or verbocity setting --- drivers/scsi/lpfc/lpfc_hw4.h | 1

[PATCH 06/16] lpfc: Fix hardlockup in lpfc_abort_handler

2019-10-18 Thread James Smart
cpu. Fix the unlock order by fully releasing the hbalocks as well. CC: Zhangguanghui Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- Original patch sent by Zhangguanghui Modified slightly as merged and tested at Emulex. --- drivers/scsi/lpfc/lpfc_scsi.c | 5 +++-- 1 file changed, 3

[PATCH 03/16] lpfc: Fix lockdep errors in sli_ringtx_put

2019-10-18 Thread James Smart
: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 379c37451645..3a6520187ee5 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c

[PATCH 05/16] lpfc: Fix bad ndlp ptr in xri aborted handling

2019-10-18 Thread James Smart
ing") Cc: # v5.1+ Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_scsi.c | 11 +++ drivers/scsi/lpfc/lpfc_sli.c | 5 - drivers/scsi/lpfc/lpfc_sli.h | 3 +-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scs

[PATCH 14/16] lpfc: Add FC-AL support to lpe32000 models

2019-10-18 Thread James Smart
topology should be fixed and the topology types to be configured. - adds a pt attribute to report the persistent topology if present. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 1 + drivers/scsi/lpfc/lpfc_attr.c | 38 +- drivers

[PATCH 04/16] lpfc: Fix SLI3 hba in loop mode not discovering devices

2019-10-18 Thread James Smart
when private loop and letting the state machine play out. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nportdisc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c

[PATCH 01/16] lpfc: fix lpfc_nvmet_mrq to be bound by hdw queue count

2019-10-18 Thread James Smart
o use hardware queue count rather than interrupt vector count. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 6 +++--- drivers/scsi/lpfc/lpfc_init.c | 6 ++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_att

[PATCH 00/16] lpfc: Update lpfc to revision 12.6.0.0

2019-10-18 Thread James Smart
Update lpfc to revision 12.6.0.0 This patch contains a set fixes, optimizations, and a handful of new additions. The patches were cut against Martin's 5.5/scsi-queue tree James Smart (16): lpfc: fix lpfc_nvmet_mrq to be bound by hdw queue count lpfc: Fix reporting of read-only fw

Re: [PATCH] lpfc: remove left-over BUILD_NVME defines

2019-10-18 Thread James Smart
On 10/17/2019 7:01 PM, Martin K. Petersen wrote: Hannes, The BUILD_NVME define never got defined anywhere, causing NVMe commands to be treated as SCSI commands when freeing the buffers. This was causing a stuck discovery and a horrible crash in lpfc_set_rrq_active() later on. Applied to 5.4/sc

Re: [PATCH] lpfc: remove left-over BUILD_NVME defines

2019-10-17 Thread James Smart
;scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair") Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_init.c | 2 -- drivers/scsi/lpfc/lpfc_scsi.c | 2 -- 2 files changed, 4 deletions(-) Yep. Thanks. Reviewed-by: James Smart -- james

Re: scsi: lpfc: Fix hardlockup in lpfc_abort_handler

2019-10-10 Thread James Smart
On 10/10/2019 1:59 AM, Zhangguanghui wrote: Hi everyone Please refer to the latest patch. There is a race deadlock in the function lpfc_abort_handler potential deadlocks arising from lock ordering problems. It’s the correct order spin_unlock(&lpfc_cmd->buf_lock) spin_unlock_irqrestore(&phba

Re: [PATCH] scsi: lpfc: Make function lpfc_defer_pt2pt_acc static

2019-10-04 Thread James Smart
Should it be static? Reported-by: Hulk Robot mailto:hul...@huawei.com>> Signed-off-by: zhengbin mailto:zhengbi...@huawei.com>> ---  drivers/scsi/lpfc/lpfc_nportdisc.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Dick Kennedy Reviewed-by: James Smart Thanks! -- james

[PATCH 14/20] lpfc: Fix spinlock_irq issues in lpfc_els_flush_cmd()

2019-09-21 Thread James Smart
While reviewing the CT behavior, issues with spinlock_irq were seen. The driver should be using spinlock_irqsave/irqrestore in the els flush routine. Changed to spinlock_irqsave/irqrestore. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 16

[PATCH 11/20] lpfc: Fix coverity errors on NULL pointer checks

2019-09-21 Thread James Smart
Coverity flagged several scenarios where checking of null pointer values wasn't consistent. Fix the code to that be consistent on checking. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 5 + drivers/scsi/lpfc/lpfc_nvmet.c

[PATCH 09/20] lpfc: Fix discovery failures when target device connectivity bounces

2019-09-21 Thread James Smart
back to STE_NPR_NODE when GID_FT completes, thereby restarting the discovery process for the node. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hbadisc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc

[PATCH 15/20] lpfc: Fix hdwq sgl locks and irq handling

2019-09-21 Thread James Smart
rt dynamic unbounded SGL lists on G7 hardware.") Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/

[PATCH 13/20] lpfc: Fix list corruption in lpfc_sli_get_iocbq

2019-09-21 Thread James Smart
t the abort completions aren't ignored. - Updated the fdmi path to recognize a CT request that fails due to the port being unusable. This stops FDMI retries. FDMI will be restarted on next link up. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 6

[PATCH 19/20] lpfc: cleanup: remove unused fcp_txcmlpq_cnt

2019-09-21 Thread James Smart
Local variable fcp_txcmplq_cnt is initialized to 0 and then displayed in lpfc driver message 0387. Presumed residual (or unused) code from previous commit. Removed fcp_txcmplq_cnt. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 4 +--- 1 file

[PATCH 10/20] lpfc: Fix NVMe ABTS in response to receiving an ABTS

2019-09-21 Thread James Smart
the code such that there is a single routine being used for nvme or nvmet ABORT requests, and IA is an argument. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_hw4.h | 1 + drivers/scsi/lpfc/lpfc_nvme.c | 73

[PATCH 12/20] lpfc: Fix host hang at boot or slow boot

2019-09-21 Thread James Smart
wait long command timeouts. Fix by having the early flush routine also process the related CQ and rearm the CQ. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 42 -- 1 file changed, 36 insertions(+), 6 deletions

[PATCH 20/20] lpfc: Update lpfc version to 12.4.0.1

2019-09-21 Thread James Smart
Update lpfc version to 12.4.0.1 Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index b8aae31ffda3..d8839d95f7fe

[PATCH 16/20] lpfc: Fix list corruption detected in lpfc_put_sgl_per_hdwq

2019-09-21 Thread James Smart
y: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 6d89dd3dd532..09e275e3bcd8 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++

[PATCH 18/20] lpfc: Complete removal of FCoE T10diff support on SLI-4 adapters

2019-09-21 Thread James Smart
g the device list that identifies FCoE devices. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 79a1924

[PATCH 17/20] lpfc: Update async event logging

2019-09-21 Thread James Smart
Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw4.h | 1 + drivers/scsi/lpfc/lpfc_init.c | 17 +++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index f70fb7629c82..6095e3cfddd3 100644 --- a/drivers

[PATCH 00/20] lpfc: Update lpfc to revision 12.4.0.1

2019-09-21 Thread James Smart
Update lpfc to revision 12.4.0.1 This patch set contains fixes as well as a few cleanups. The patches were cut against Martin's 5.4/scsi-queue tree James Smart (20): lpfc: Fix pt2pt discovery on SLI3 HBAs lpfc: Fix premature re-enabling of interrupts in lpfc_sli_host_down lpfc: Fix

[PATCH 02/20] lpfc: Fix premature re-enabling of interrupts in lpfc_sli_host_down

2019-09-21 Thread James Smart
Use of spin_lock_irq may re-enable interrupts prematurely. Convert to spin_lock. Note: code is under the phba->hba_lock which has been locked with irqsave. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 4 ++-- 1 file changed, 2 insertions(+)

[PATCH 03/20] lpfc: Fix miss of register read failure check

2019-09-21 Thread James Smart
Coverity flagged missing status check on register read that flags a poisoned data return value. Add checking of register read status. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[PATCH 08/20] lpfc: Fix GPF on scsi command completion

2019-09-21 Thread James Smart
off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_scsi.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index fe1097666de4..c2773c07657d 100644 --- a/drivers/scsi/lpfc/lpfc_scs

[PATCH 06/20] lpfc: Fix device recovery errors after PLOGI failures

2019-09-21 Thread James Smart
Error state marking is always done prior to release back to the internal rpi free list, which the driver wasn't doing in cases prior. Also enhanced some of the logging to help in the next case of problem troubleshooting. Signed-off-by: Dick Kennedy Signed-off-by: James Smar

[PATCH 01/20] lpfc: Fix pt2pt discovery on SLI3 HBAs

2019-09-21 Thread James Smart
e the mailbox command completed. Thus the PRLI response used the old n_port_id. Defer the PRLI response until CONFIG_LINK completes. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nportdisc.c | 141 ++--- 1 file changed, 115 inser

[PATCH 04/20] lpfc: Fix NVME io abort failures causing hangs

2019-09-21 Thread James Smart
d by the FC port - 1 resource for the original command and 1 resource for the abort request. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 1 - drivers/scsi/lpfc/lpfc_attr.c | 5 - drivers/scsi/lpfc/lpfc_init.c | 9 +++-- drivers/scsi/l

[PATCH 07/20] lpfc: Fix locking on mailbox command completion

2019-09-21 Thread James Smart
the parallel path. Fix by making the calls that clear mbox state/port pointer while under lock. Also slightly cleaned up the error path. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[PATCH 05/20] lpfc: Fix rpi release when deleting vport

2019-09-21 Thread James Smart
avoids the indentation issues. Fixes: 9b1640686470 ("scsi: lpfc: Fix use-after-free mailbox cmd completion") Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hbadisc.c | 88 +++- drivers/scsi/lpfc/lpfc_sli.c | 2 +

[PATCH] lpfc: Fix reset recovery paths that are not recovering

2019-09-03 Thread James Smart
ned-off-by: James Smart --- Indicated commit that is fixed is only in 5.4/scsi-queue --- drivers/scsi/lpfc/lpfc_sli.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index bb5705267c39..75bb75800642 100644 ---

[PATCH] lpfc: fix 12.4.0.0 GPF at boot

2019-08-28 Thread James Smart
value that when used eventually faulted the system Convert offending code to use local variable. Fixes: c00f62e6c546 ("scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair") Signed-off-by: Dick Kennedy Signed-off-by: James Smart Tested-by: Abdul Haleem --- Offending

Re: [PATCH 00/42] lpfc: Update lpfc to revision 12.4.0.0

2019-08-27 Thread James Smart
On 8/27/2019 6:31 AM, Hannes Reinecke wrote: On 8/20/19 5:06 AM, Martin K. Petersen wrote: James, Update lpfc to revision 12.4.0.0 Applied to 5.4/scsi-queue, thanks! This update is crashing on my server: [ 33.178690] general protection fault: [#1] SMP PTI [ 33.226638] CPU: 0 PI

[PATCH] lpfc: Remove bg debugfs buffers

2019-08-27 Thread James Smart
Capturing and downloading dif command data and dif data was done a dozen years ago and no longer being used. Also creates a potential security hole. Remove the debugfs buffer for dif debugging. Signed-off-by: Dick Kennedy Signed-off-by: James Smart CC: KyleMahlkuch CC: Hannes Reinecke

[PATCH] lpfc: Raise config max for lpfc_fcp_mq_threshold variable

2019-08-27 Thread James Smart
Raise the config max for lpfc_fcp_mq_threshold variable to 256. Signed-off-by: Dick Kennedy Signed-off-by: James Smart CC: Hannes Reinecke --- Martin, this fix applies 5.3/scsi-fixes patch: scsi: lpfc: Mitigate high memory pre-allocation by SCSI-MQ --- drivers/scsi/lpfc/lpfc_attr.c | 2

[PATCH] lpfc: Resolve checker warning for lpfc_new_io_buf()

2019-08-27 Thread James Smart
as no need to compare sizes nor to allocate size based on a define. Change allocation to use actual structure length Signed-off-by: Dick Kennedy Signed-off-by: James Smart CC: Dan Carpenter --- drivers/scsi/lpfc/lpfc_init.c | 11 +-- drivers/scsi/lpfc/lpfc_sli4.h | 3 --- 2 files

Fwd: Re: [PATCH] lpfc: Fix Buffer Overflow Error

2019-08-26 Thread James Smart
On 7/16/2019 7:48 AM, KyleMahlkuch wrote: Power and x86 have different page sizes so rather than allocate the buffer based on number of pages we should allocate space by using max_sectors. There is also code in lpfc_scsi.c to be sure we don't write past the end of this buffer. Signed-off-by: K

Re: [bug report] scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware.

2019-08-26 Thread James Smart
On 8/26/2019 6:40 AM, Dan Carpenter wrote: Hello James Smart, The patch d79c9e9d4b3d: "scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware." from Aug 14, 2019, leads to the following static checker warning: drivers/scsi/lpfc/lpfc_init.c:4107 lpfc_new_io_buf()

Re: [PATCH v3] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-08-26 Thread James Smart
On 8/26/2019 12:18 AM, Hannes Reinecke wrote: On 8/16/19 4:36 AM, James Smart wrote: When SCSI-MQ is enabled, the SCSI-MQ layers will do pre-allocation of MQ resources based on shost values set by the driver. In newer cases of the driver, which attempts to set nr_hw_queues to the cpu count, the

[PATCH v3] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-08-15 Thread James Smart
for SCSI-MQ, performance levels remained near maximum with the within-driver affiinitization. A module parameter was created to allow the value set for the nr_hw_queues to be tunable. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Ming Lei --- v3: add Ming's reviewe

[PATCH 41/42] lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair

2019-08-14 Thread James Smart
s. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 3 +- drivers/scsi/lpfc/lpfc_crtn.h| 2 +- drivers/scsi/lpfc/lpfc_debugfs.c | 92 ++-- drivers/scsi/lpfc/lpfc_debugfs.h | 61 +++- drivers/scsi/lpfc/lpfc_init.

[PATCH 32/42] lpfc: Fix BlockGuard enablement on FCoE adapters

2019-08-14 Thread James Smart
-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 7ac6508b7ed8..63e631f116e4 100644 --- a/drivers/scsi

[PATCH 27/42] lpfc: Fix nvme sg_seg_cnt display if HBA does not support NVME

2019-08-14 Thread James Smart
The driver is currently reporting a non-zero nvme sg_seg_cnt value of 256 when nvme is disabled. It should be zero. Fix by ensuring the value is cleared. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 29/42] lpfc: Fix upcall to bsg done in non-success cases

2019-08-14 Thread James Smart
call to lpfc_bsg_request() will return success. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_bsg.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index

[PATCH 36/42] lpfc: Migrate to %px and %pf in kernel print calls

2019-08-14 Thread James Smart
In order to see real addresses, convert %p with %px for kernel addresses and replace %p with %pf for functions. While converting, standardize on "x%px" throughout (not %px or 0x%px). Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_bsg.c | 2 +

[PATCH 08/42] lpfc: Fix discovery when target has no GID_FT information

2019-08-14 Thread James Smart
to re-login if the nport_id is still present. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c| 16 +++- drivers/scsi/lpfc/lpfc_nportdisc.c | 6 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_c

[PATCH 37/42] lpfc: Add first and second level hardware revisions to sysfs reporting

2019-08-14 Thread James Smart
To aid better hardware detection when there are issues, report the first and second level hardware revisions from the READ_REV command. Add the elements to the existing hardware id string. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 3 ++- 1 file

[PATCH 26/42] lpfc: Fix nvme target mode ABTSing a received ABTS

2019-08-14 Thread James Smart
apter command-based routine to let the adapter manage the ABTS. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nvmet.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c

[PATCH 28/42] lpfc: Fix sli4 adapter initialization with MSI

2019-08-14 Thread James Smart
When forcing the use of MSI (vs MSI-X) the driver is crashing in pci_irq_get_affinity. The driver was not using the new pci_alloc_irq_vectors interface in the MSI path. Fix by using pci_alloc_irq_vectors() with PCI_RQ_MSI in the MSI path. Signed-off-by: Dick Kennedy Signed-off-by: James Smart

[PATCH 07/42] lpfc: Fix port relogin failure due to GID_FT interaction

2019-08-14 Thread James Smart
g the outstanding GFT_ID if the related remote port is logged out. Ensure a PRLI transmit attempt only occurs if the remote port is logging in. This avoids the incorrect attempt while logged out. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c

[PATCH 33/42] lpfc: Fix nvme first burst module parameter description

2019-08-14 Thread James Smart
modinfo for lpfc_nvme_enable_fb is incorrect. FirstBurst on lpfc target is not fully supported. Update the attribute description Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git

[PATCH 05/42] lpfc: Fix failure to clear non-zero eq_delay after io rate reduction

2019-08-14 Thread James Smart
onger applicable. Fix by always clearing the percpu counters for each time period and always run the eq_delay calculations if an eq has a non-zero coalescing value. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 32 +--- 1

[PATCH 31/42] lpfc: Fix reported physical link speed on a disabled trunked link

2019-08-14 Thread James Smart
Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hbadisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 44e779e4c885..95db23adc96d 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c

[PATCH 30/42] lpfc: Fix Max Frame Size value shown in fdmishow output

2019-08-14 Thread James Smart
off the upper nibble. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index c52d5edf4d44..1717f3403a97 100644 --- a/drivers/scsi

[PATCH 12/42] lpfc: Fix irq raising in lpfc_sli_hba_down

2019-08-14 Thread James Smart
The adapter reset path (lpfc_sli_hba_down) is taking/releasing a lock with irq. But, the path is already under the hbalock which raised irq so it's unnecessary. Convert to simple lock/unlock. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 4 ++

[PATCH 38/42] lpfc: Add MDS driver loopback diagnostics support

2019-08-14 Thread James Smart
ensure that enable_mds_diags is a RW parameter. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 2 +- drivers/scsi/lpfc/lpfc_els.c | 11 ++- drivers/scsi/lpfc/lpfc_hw4.h | 6 ++ drivers/scsi/lpfc/lpfc_sli.c | 30

[PATCH 35/42] lpfc: Add simple unlikely optimizations to reduce NVME latency

2019-08-14 Thread James Smart
While performing code review, several relatively simple optimizations can be done in the fast path. Add these optimizations (unlikely designators). Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nvme.c | 8 1 file changed, 4 insertions(+), 4

[PATCH 02/42] lpfc: Fix PLOGI failure with high remoteport count

2019-08-14 Thread James Smart
the RPI to be reused before it was actually available. Fix by clearing RPI bitmask only after UNREG_RPI mailbox completion. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_disc.h| 1 + drivers/scsi/lpfc/lpfc_hbadisc.c | 8 ++-- drivers/scsi/lpfc

[PATCH 34/42] lpfc: Fix coverity warnings

2019-08-14 Thread James Smart
Running on Coverity produced the following errors: - coding style (indentation) - memset size mismatch errors note: comment cases where it is purposely a mismatch Fix the errors Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 10

[PATCH 22/42] lpfc: Fix deadlock on host_lock during cable pulls

2019-08-14 Thread James Smart
ath is will unconditionally re-enable interrupts in cases where irq state should be preserved. The re-enablement allowed the other paths to execute which then causes the deadlock. Fix by converting the lock/unlock to irqsave/irqrestore. Signed-off-by: Dick Kennedy Signed-off-by: James Sm

[PATCH 25/42] lpfc: Fix hang when downloading fw on port enabled for nvme

2019-08-14 Thread James Smart
ll generate the completions for the scsi and nvme outstanding io. The abort ios, if waiting, will be caught and flushed as well. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_init.c | 4 drivers/scsi/lpfc/l

[PATCH 18/42] lpfc: Fix propagation of devloss_tmo setting to nvme transport

2019-08-14 Thread James Smart
the lldd set routine. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 33c8bae49821..90181afe0e28 100644 --- a

[PATCH 24/42] lpfc: Fix too many sg segments spamming in kernel log

2019-08-14 Thread James Smart
parameters set by the driver should have avoided this. The dm1 multipath maintainer has been notified of the issue. Fix by changing the return code for the dma mapping routines to indicate cases that are not retryable and return DID_ERROR on those cases. Signed-off-by: Dick Kennedy Signed-off-by: James

[PATCH 10/42] lpfc: Fix issuing init_vpi mbox on SLI-3 card

2019-08-14 Thread James Smart
. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_vport.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 343bc71d4615..b76646357980 100644 --- a/drivers/scsi/lpfc

[PATCH 21/42] lpfc: Fix error in remote port address change

2019-08-14 Thread James Smart
nnedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nvme.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index e8924e90c4eb..103708503592 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/dr

[PATCH 09/42] lpfc: Fix ADISC reception terminating login state if a NVME target

2019-08-14 Thread James Smart
processing. Enhance logging to recognize condition better. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nportdisc.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc

[PATCH 42/42] lpfc: Update lpfc version to 12.4.0.0

2019-08-14 Thread James Smart
Update lpfc version to 12.4.0.0 Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index f7e93aaf1e00..b8aae31ffda3

[PATCH 39/42] lpfc: Support dynamic unbounded SGL lists on G7 hardware.

2019-08-14 Thread James Smart
CPUs may be handling the put routines. This can put a strain on the lpfc_put_cmd_rsp_buf_per_cpu routine because all the resources are being put on a limited subset of CPUs. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 5 + drivers/scsi/lpfc/lpfc_hw

[PATCH 13/42] lpfc: Fix oops when fewer hdwqs than cpus

2019-08-14 Thread James Smart
T_IRQ flag is set. Also contains a few small cleanup fixes and a little better logging. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 144 ++ 1 file changed, 89 insertions(+), 55 deletions(-) diff --git a/drivers

[PATCH 00/42] lpfc: Update lpfc to revision 12.4.0.0

2019-08-14 Thread James Smart
Update lpfc to revision 12.4.0.0 This patch set contains a laundry list of fixes for lpfc. Most are small. There are a couple of cleanup patches and several functional additions at the tail of the patch set. The patches were cut against Martin's 5.4/scsi-queue tree James Smart (42):

[PATCH 15/42] lpfc: Fix null ptr oops updating lpfc_devloss_tmo via sysfs attribute

2019-08-14 Thread James Smart
k the logic to validate and prevent any reference to the null ptr. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c

[PATCH 40/42] lpfc: Add NVMe sequence level error recovery support

2019-08-14 Thread James Smart
retransmission. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 1 + drivers/scsi/lpfc/lpfc_disc.h | 2 ++ drivers/scsi/lpfc/lpfc_els.c | 4 drivers/scsi/lpfc/lpfc_hw4.h | 8 drivers/scsi/lpfc/lpfc_init.c | 8

[PATCH 23/42] lpfc: Fix crash due to port reset racing vs adapter error handling

2019-08-14 Thread James Smart
ned-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 7 +++ drivers/scsi/lpfc/lpfc_scsi.c | 16 +--- drivers/scsi/lpfc/lpfc_sli.c | 6 -- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 84

[PATCH 19/42] lpfc: Fix sg_seg_cnt for HBAs that don't support NVME

2019-08-14 Thread James Smart
ct by changing the location of where the NVME sgl information is being applied, which will avoid any SLI-3-based adapter. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 10 -- drivers/scsi/lpfc/lpfc_init.c | 9 + 2 files changed, 9 inser

[PATCH 01/42] lpfc: Limit xri count for kdump environment

2019-08-14 Thread James Smart
to a more reasonable value. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 1ac98becb5ba..02231370428a 100644 --- a/drivers/scsi

[PATCH 17/42] lpfc: Fix loss of remote port after devloss due to lack of RPIs

2019-08-14 Thread James Smart
: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 7 --- drivers/scsi/lpfc/lpfc_hbadisc.c | 41 +++- drivers/scsi/lpfc/lpfc_sli.c | 34 +++-- 3 files changed, 56 insertions(+), 26 deletions

[PATCH 14/42] lpfc: Fix FLOGI handling across multiple link up/down conditions

2019-08-14 Thread James Smart
efore the driver sees the link transition. Fix by having the link down handler in the driver run through any outstanding ELS's and change the completion handler of the ELS so that it will be no-op'd and released. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/

[PATCH 16/42] lpfc: Fix devices that don't return after devloss followed by rediscovery

2019-08-14 Thread James Smart
NPR_2B_DISC and UNUSED and transition the node back to NPR state to allow the re-login to take place. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH 11/42] lpfc: Fix Oops in nvme_register with target logout/login

2019-08-14 Thread James Smart
ck is held. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nvme.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 946642cee3df..9746808cf94f 100644 --- a/drivers

[PATCH 04/42] lpfc: Fix crash on driver unload in wq free

2019-08-14 Thread James Smart
If a timer routine uses workqueues, it could fire before the workqueue is allocated. Fix by allocating the workqueue before the timer routines are setup Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 11 +-- 1 file changed, 5 insertions

[PATCH 20/42] lpfc: Fix driver nvme rescan logging

2019-08-14 Thread James Smart
ntation of lpfc_nvme_rescan_port. remoteport pointer will always be NULL if a NVMe initiator only. But, grabbing of remoteport pointer should be done under lock to coincide with the registering of the remote port with the fc transport. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- dr

[PATCH 03/42] lpfc: Fix ELS field alignments

2019-08-14 Thread James Smart
to do is rather intrusive so this course of action was deferred. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 5b439a6

[PATCH 06/42] lpfc: Fix leak of ELS completions on adapter reset

2019-08-14 Thread James Smart
failed to reinit. Fix by having the ELS completion handler identify the driver-generated completion status and release the abort context. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers

Re: [PATCH v2] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-08-06 Thread James Smart
On 8/5/2019 6:09 PM, Ming Lei wrote: I am wondering why you use 2 * num_possible_nodes() as the limit instead of num_possible_nodes(), could you explain it a bit? The number comes from most systems being dual socket systems, thus a numa node count of 2. Some of these dual socket systems can b

[PATCH] lpfc: Fix crash when cpu count is 1 and null irq affinity mask

2019-08-02 Thread James Smart
queues incomplete and crashes the system. Fix by recognizing the null mask and assigning the vector to the first cpu in the system. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 23 +-- 1 file changed, 21 insertions(+), 2 deletions

[PATCH v2] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-08-01 Thread James Smart
for SCSI-MQ, performance levels remained near maximum with the within-driver affiinitization. A module parameter was created to allow the value set for the nr_hw_queues to be tunable. Signed-off-by: Dick Kennedy Signed-off-by: James Smart CC: Ming Lei --- v2: revised to set nr_hw_queues to mini

Re: [PATCH] lpfc: Mitigate high memory pre-allocation by SCSI-MQ

2019-07-31 Thread James Smart
On 7/30/2019 7:31 PM, Ming Lei wrote: Hi James, Could the default hw queue count be set as numa node number? This way should work fine most of times. Thanks, Ming Lei Well... I could. But I have 2 reservations: - I assume most systems will be 2 sockets thus 2 numa nodes - there's something

  1   2   3   4   5   6   7   8   9   10   >