Re: [PATCH 3.10 141/319] scsi: mpt3sas: Fix secure erase premature termination
Hi James, On Mon, Feb 06, 2017 at 10:38:48PM -0800, James Bottomley wrote: > On Mon, 2017-02-06 at 23:26 +0100, Willy Tarreau wrote: (...) > > We don't have the referenced commit above in 3.10 so we should be > > safe. Additionally I checked that neither 4.4 nor 3.12 have them > > either, so that makes me feel confident that we can skip it in 3.10 > > as well. > > The original was also racy with respect to multiple commands, so the > above fixed the race as well. OK so I tried to backport it to 3.10. I dropped a few parts which were addressing this one marked for stable 4.4+ : 7ff723a ("scsi: mpt3sas: Unblock device after controller reset") And I got the attached patch. All I know is that it builds. I'd appreciate it if someone could confirm its validity, in which case I'll add it. Thanks, Willy --- diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index 994656c..997e13f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -219,6 +219,7 @@ struct MPT3SAS_TARGET { * @eedp_enable: eedp support enable bit * @eedp_type: 0(type_1), 1(type_2), 2(type_3) * @eedp_block_length: block size + * @ata_command_pending: SATL passthrough outstanding for device */ struct MPT3SAS_DEVICE { struct MPT3SAS_TARGET *sas_target; @@ -227,6 +228,17 @@ struct MPT3SAS_DEVICE { u8 configured_lun; u8 block; u8 tlr_snoop_check; + /* +* Bug workaround for SATL handling: the mpt2/3sas firmware +* doesn't return BUSY or TASK_SET_FULL for subsequent +* commands while a SATL pass through is in operation as the +* spec requires, it simply does nothing with them until the +* pass through completes, causing them possibly to timeout if +* the passthrough is a long executing command (like format or +* secure erase). This variable allows us to do the right +* thing while a SATL command is pending. +*/ + unsigned long ata_command_pending; }; #define MPT3_CMD_NOT_USED 0x8000 /* free */ diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index e414b71..db38f70 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -3515,9 +3515,18 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) SAM_STAT_CHECK_CONDITION; } -static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd) +static int _scsih_set_satl_pending(struct scsi_cmnd *scmd, bool pending) { - return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16); + struct MPT3SAS_DEVICE *priv = scmd->device->hostdata; + + if (scmd->cmnd[0] != ATA_12 && scmd->cmnd[0] != ATA_16) + return 0; + + if (pending) + return test_and_set_bit(0, >ata_command_pending); + + clear_bit(0, >ata_command_pending); + return 0; } /** @@ -3547,13 +3556,6 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) scsi_print_command(scmd); #endif - /* -* Lock the device for any subsequent command until command is -* done. -*/ - if (ata_12_16_cmd(scmd)) - scsi_internal_device_block(scmd->device); - scmd->scsi_done = done; sas_device_priv_data = scmd->device->hostdata; if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { @@ -3568,6 +3570,19 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) return 0; } + /* +* Bug work around for firmware SATL handling. The loop +* is based on atomic operations and ensures consistency +* since we're lockless at this point +*/ + do { + if (test_bit(0, _device_priv_data->ata_command_pending)) { + scmd->result = SAM_STAT_BUSY; + scmd->scsi_done(scmd); + return 0; + } + } while (_scsih_set_satl_pending(scmd, true)); + sas_target_priv_data = sas_device_priv_data->sas_target; /* invalid device handle */ @@ -4057,8 +4072,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) if (scmd == NULL) return 1; - if (ata_12_16_cmd(scmd)) - scsi_internal_device_unblock(scmd->device, SDEV_RUNNING); + _scsih_set_satl_pending(scmd, false); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
Re: [PATCH 3.10 141/319] scsi: mpt3sas: Fix secure erase premature termination
On Mon, 2017-02-06 at 23:26 +0100, Willy Tarreau wrote: > Hi Sathya, > > On Mon, Feb 06, 2017 at 09:21:44AM -0700, Sathya Prakash Veerichetty > wrote: > > Willy, > > I think this patch had a problem and later modified to a different > > blocking mechanism. Could you please pull in the latest change for > > this? > > Much appreciated, thanks. I've checked and found the patch you're > talking about : > > commit ffb58456589443ca572221fabbdef3db8483a779 > Author: James Bottomley> Date: Sun Jan 1 09:39:24 2017 -0800 > > scsi: mpt3sas: fix hang on ata passthrough commands > > mpt3sas has a firmware failure where it can only handle one pass > through > ATA command at a time. If another comes in, contrary to the SAT > standard, it will hang until the first one completes (causing > long > commands like secure erase to timeout). The original fix was to > block > the device when an ATA command came in, but this caused a > regression > with > > commit 669f044170d8933c3d66d231b69ea97cb8447338 > Author: Bart Van Assche > Date: Tue Nov 22 16:17:13 2016 -0800 > > scsi: srp_transport: Move queuecommand() wait code to SCSI > core > > So fix the original fix of the secure erase timeout by properly > returning SAM_STAT_BUSY like the SAT recommends. The original > patch > also had a concurrency problem since scsih_qcmd is lockless at > that > point (this is fixed by using atomic bitops to set and test the > flag). > > [mkp: addressed feedback wrt. test_bit and fixed whitespace] > > Fixes: 18f6084a989ba1b (mpt3sas: Fix secure erase premature > termination) > Signed-off-by: James Bottomley < > james.bottom...@hansenpartnership.com> > Acked-by: Sreekanth Reddy > Reviewed-by: Christoph Hellwig > Reported-by: Ingo Molnar > Tested-by: Ingo Molnar > Signed-off-by: Martin K. Petersen > > We don't have the referenced commit above in 3.10 so we should be > safe. Additionally I checked that neither 4.4 nor 3.12 have them > either, so that makes me feel confident that we can skip it in 3.10 > as well. The original was also racy with respect to multiple commands, so the above fixed the race as well. James
[Bug 194341] New: drivers/scsi/mpt3sas/mpt3sas_scsih.c _scsih_ir_fastpath ambiguous path structures
https://bugzilla.kernel.org/show_bug.cgi?id=194341 Bug ID: 194341 Summary: drivers/scsi/mpt3sas/mpt3sas_scsih.c _scsih_ir_fastpath ambiguous path structures Product: SCSI Drivers Version: 2.5 Kernel Version: 4.10 Hardware: All OS: Linux Tree: Mainline Status: NEW Severity: enhancement Priority: P1 Component: Other Assignee: scsi_drivers-ot...@kernel-bugs.osdl.org Reporter: michael_allen_b...@hotmail.com Regression: No Given the number of error checks and intermittent conditional branches all ending with the same error code, it may be worth restructuring this path to optimistically execute the fast path and then have a single set of error checks at the end, since all of the errors immediately exit the function with a error code anyways. -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 194321] New: drivers/scsi/mpt3sas/mpt3sas_base.c mpt3sas_base_put_smid_fast_path structure descriptor.Default.DescriptorTypeDependent is not used in fast path
https://bugzilla.kernel.org/show_bug.cgi?id=194321 Bug ID: 194321 Summary: drivers/scsi/mpt3sas/mpt3sas_base.c mpt3sas_base_put_smid_fast_path structure descriptor.Default.DescriptorTypeDependent is not used in fast path Product: SCSI Drivers Version: 2.5 Kernel Version: 4.10 Hardware: All OS: Linux Tree: Mainline Status: NEW Severity: enhancement Priority: P1 Component: Other Assignee: scsi_drivers-ot...@kernel-bugs.osdl.org Reporter: michael_allen_b...@hotmail.com Regression: No Our tool gave us a warning regarding this field being unused, I'm not sure if it bears fixing or changing -- You are receiving this mail because: You are watching the assignee of the bug.
Re: [lkp-robot] [scsi, block] 0dba1314d4: WARNING:at_fs/sysfs/dir.c:#sysfs_warn_dup
On Mon, Feb 6, 2017 at 8:09 PM, Jens Axboewrote: > On 02/06/2017 05:14 PM, James Bottomley wrote: >> On Sun, 2017-02-05 at 21:13 -0800, Dan Williams wrote: >>> On Sun, Feb 5, 2017 at 1:13 AM, Christoph Hellwig wrote: Dan, can you please quote your emails? I can't find any content inbetween all these quotes. >>> >>> Sorry, I'm using gmail, but I'll switch to attaching the logs. >>> >>> So with help from Xiaolong I was able to reproduce this, and it does >>> not appear to be a regression. We simply change the failure output of >>> an existing bug. Attached is a log of the same test on v4.10-rc7 >>> (i.e. without the recent block/scsi fixes), and it shows sda being >>> registered twice. >>> >>> "[6.647077] kobject (d5078ca4): tried to init an initialized >>> object, something is seriously wrong." >>> >>> The change that "scsi, block: fix duplicate bdi name registration >>> crashes" makes is to properly try to register sdb since the sda devt >>> is still alive. However that's not a fix because we've managed to >>> call blk_register_queue() twice on the same queue. >> >> OK, time to involve others: linux-scsi and linux-block cc'd and I've >> inserted the log below. >> >> James >> >> --- >> >> [5.969672] scsi host0: scsi_debug: version 1.86 [20160430] >> [5.969672] dev_size_mb=8, opts=0x0, submit_queues=1, statistics=0 >> [5.971895] scsi 0:0:0:0: Direct-Access Linuxscsi_debug >> 0186 PQ: 0 ANSI: 7 >> [6.006983] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 >> MB/8.00 MiB) >> [6.026965] sd 0:0:0:0: [sda] Write Protect is off >> [6.027870] sd 0:0:0:0: [sda] Mode Sense: 73 00 10 08 >> [6.066962] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, >> supports DPO and FUA >> [6.486962] sd 0:0:0:0: [sda] Attached SCSI disk >> [6.488377] sd 0:0:0:0: [sda] Synchronizing SCSI cache >> [6.489455] sd 0:0:0:0: Attached scsi generic sg0 type 0 >> [6.526982] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 >> MB/8.00 MiB) >> [6.546964] sd 0:0:0:0: [sda] Write Protect is off >> [6.547873] sd 0:0:0:0: [sda] Mode Sense: 73 00 10 08 >> [6.586963] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, >> supports DPO and FUA >> [6.647077] kobject (d5078ca4): tried to init an initialized object, >> something is seriously wrong. > > So sda is probed twice, and hilarity ensues when we try to register it > twice. I can't reproduce this, using scsi_debug and with scsi_async > enabled. > > This is running linux-next? What's your .config? > The original failure report is here: http://marc.info/?l=linux-kernel=148619222300774=2 ...but it reproduces on current mainline with the same config. I haven't spotted what makes scsi_debug behave like this.
Re: [lkp-robot] [scsi, block] 0dba1314d4: WARNING:at_fs/sysfs/dir.c:#sysfs_warn_dup
On 02/06/2017 05:14 PM, James Bottomley wrote: > On Sun, 2017-02-05 at 21:13 -0800, Dan Williams wrote: >> On Sun, Feb 5, 2017 at 1:13 AM, Christoph Hellwigwrote: >>> Dan, >>> >>> can you please quote your emails? I can't find any content >>> inbetween all these quotes. >> >> Sorry, I'm using gmail, but I'll switch to attaching the logs. >> >> So with help from Xiaolong I was able to reproduce this, and it does >> not appear to be a regression. We simply change the failure output of >> an existing bug. Attached is a log of the same test on v4.10-rc7 >> (i.e. without the recent block/scsi fixes), and it shows sda being >> registered twice. >> >> "[6.647077] kobject (d5078ca4): tried to init an initialized >> object, something is seriously wrong." >> >> The change that "scsi, block: fix duplicate bdi name registration >> crashes" makes is to properly try to register sdb since the sda devt >> is still alive. However that's not a fix because we've managed to >> call blk_register_queue() twice on the same queue. > > OK, time to involve others: linux-scsi and linux-block cc'd and I've > inserted the log below. > > James > > --- > > [5.969672] scsi host0: scsi_debug: version 1.86 [20160430] > [5.969672] dev_size_mb=8, opts=0x0, submit_queues=1, statistics=0 > [5.971895] scsi 0:0:0:0: Direct-Access Linuxscsi_debug 0186 > PQ: 0 ANSI: 7 > [6.006983] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 MB/8.00 > MiB) > [6.026965] sd 0:0:0:0: [sda] Write Protect is off > [6.027870] sd 0:0:0:0: [sda] Mode Sense: 73 00 10 08 > [6.066962] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, > supports DPO and FUA > [6.486962] sd 0:0:0:0: [sda] Attached SCSI disk > [6.488377] sd 0:0:0:0: [sda] Synchronizing SCSI cache > [6.489455] sd 0:0:0:0: Attached scsi generic sg0 type 0 > [6.526982] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 MB/8.00 > MiB) > [6.546964] sd 0:0:0:0: [sda] Write Protect is off > [6.547873] sd 0:0:0:0: [sda] Mode Sense: 73 00 10 08 > [6.586963] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, > supports DPO and FUA > [6.647077] kobject (d5078ca4): tried to init an initialized object, > something is seriously wrong. So sda is probed twice, and hilarity ensues when we try to register it twice. I can't reproduce this, using scsi_debug and with scsi_async enabled. This is running linux-next? What's your .config? -- Jens Axboe
Re: [PATCH 1/2] qla2xxx: Fix a recently introduced memory leak
> "Bart" == Bart Van Asschewrites: Hi Bart, Bart> Since there is now a resolution for patch 2: have you already Bart> decided when to submit these patches upstream? I queued it in scsi-fixes last week: commit 2780f3c8f0233de90b6b47a23fc422b7780c5436 Author: Mauricio Faria de Oliveira AuthorDate: Wed Jan 25 22:07:06 2017 -0200 Commit: Martin K. Petersen CommitDate: Tue Jan 31 22:25:32 2017 -0500 scsi: qla2xxx: Avoid that issuing a LIP triggers a kernel crash [...] -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH V4 00/24] aacraid: Patchset for Smart Family Support
> "Raghava" == Raghava Aditya Renukunta >writes: Raghava> This patchset adds support to the HBA1000 and SMARTIOC2000 Raghava> family of cards. The driver version is now updated to 50740 Applied to 4.11/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH] snic: switch to pci_irq_alloc_vectors
> "Christoph" == Christoph Hellwigwrites: Narsimhulu, Please test and review! https://patchwork.kernel.org/patch/9549801/ -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH] fnic: switch to pci_alloc_irq_vectors
> "Christoph" == Christoph Hellwigwrites: Christoph> Not a full cleanup for the IRQ code, for that we'd need to Christoph> know if the max number of the various CQ types is going to Christoph> stay 1 forever. Satish: Please test and review! -- Martin K. Petersen Oracle Linux Engineering
Re: [lkp-robot] [scsi, block] 0dba1314d4: WARNING:at_fs/sysfs/dir.c:#sysfs_warn_dup
On Sun, 2017-02-05 at 21:13 -0800, Dan Williams wrote: > On Sun, Feb 5, 2017 at 1:13 AM, Christoph Hellwigwrote: > > Dan, > > > > can you please quote your emails? I can't find any content > > inbetween all these quotes. > > Sorry, I'm using gmail, but I'll switch to attaching the logs. > > So with help from Xiaolong I was able to reproduce this, and it does > not appear to be a regression. We simply change the failure output of > an existing bug. Attached is a log of the same test on v4.10-rc7 > (i.e. without the recent block/scsi fixes), and it shows sda being > registered twice. > > "[6.647077] kobject (d5078ca4): tried to init an initialized > object, something is seriously wrong." > > The change that "scsi, block: fix duplicate bdi name registration > crashes" makes is to properly try to register sdb since the sda devt > is still alive. However that's not a fix because we've managed to > call blk_register_queue() twice on the same queue. OK, time to involve others: linux-scsi and linux-block cc'd and I've inserted the log below. James --- [5.969672] scsi host0: scsi_debug: version 1.86 [20160430] [5.969672] dev_size_mb=8, opts=0x0, submit_queues=1, statistics=0 [5.971895] scsi 0:0:0:0: Direct-Access Linuxscsi_debug 0186 PQ: 0 ANSI: 7 [6.006983] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 MB/8.00 MiB) [6.026965] sd 0:0:0:0: [sda] Write Protect is off [6.027870] sd 0:0:0:0: [sda] Mode Sense: 73 00 10 08 [6.066962] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA [6.486962] sd 0:0:0:0: [sda] Attached SCSI disk [6.488377] sd 0:0:0:0: [sda] Synchronizing SCSI cache [6.489455] sd 0:0:0:0: Attached scsi generic sg0 type 0 [6.526982] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 MB/8.00 MiB) [6.546964] sd 0:0:0:0: [sda] Write Protect is off [6.547873] sd 0:0:0:0: [sda] Mode Sense: 73 00 10 08 [6.586963] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA [6.647077] kobject (d5078ca4): tried to init an initialized object, something is seriously wrong. [6.648723] CPU: 0 PID: 99 Comm: kworker/u2:1 Not tainted 4.10.0-rc7 #932 [6.649811] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014 [6.651418] Workqueue: events_unbound async_run_entry_fn [6.652347] Call Trace: [6.652987] dump_stack+0x79/0xa4 [6.653716] kobject_init+0x75/0x90 [6.654452] blk_mq_register_dev+0x2a/0x110 [6.655269] blk_register_queue+0x7b/0x130 [6.656080] device_add_disk+0x1c6/0x460 [6.656866] sd_probe_async+0xf1/0x1c0 [6.657634] ? __lock_acquire.isra.14+0x43b/0x940 [6.658501] async_run_entry_fn+0x30/0x190 [6.659311] ? process_one_work+0x12f/0x430 [6.660113] process_one_work+0x1aa/0x430 [6.660901] ? process_one_work+0x12f/0x430 [6.661716] worker_thread+0x1dd/0x470 [6.662479] kthread+0xd4/0x100 [6.663175] ? process_one_work+0x430/0x430 [6.663984] ? __kthread_create_on_node+0x180/0x180 [6.664869] ret_from_fork+0x21/0x2c [6.665638] kobject (ffab51ec): tried to init an initialized object, something is seriously wrong. [6.667290] CPU: 0 PID: 99 Comm: kworker/u2:1 Not tainted 4.10.0-rc7 #932 [6.668372] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014 [6.669984] Workqueue: events_unbound async_run_entry_fn [6.670909] Call Trace: [6.671540] dump_stack+0x79/0xa4 [6.672266] kobject_init+0x75/0x90 [6.673011] blk_mq_register_dev+0x4c/0x110 [6.673832] blk_register_queue+0x7b/0x130 [6.674633] device_add_disk+0x1c6/0x460 [6.675413] sd_probe_async+0xf1/0x1c0 [6.676191] ? __lock_acquire.isra.14+0x43b/0x940 [6.677057] async_run_entry_fn+0x30/0x190 [6.677860] ? process_one_work+0x12f/0x430 [6.678667] process_one_work+0x1aa/0x430 [6.679455] ? process_one_work+0x12f/0x430 [6.680269] worker_thread+0x1dd/0x470 [6.681036] kthread+0xd4/0x100 [6.681737] ? process_one_work+0x430/0x430 [6.682540] ? __kthread_create_on_node+0x180/0x180 [6.683420] ret_from_fork+0x21/0x2c [6.684207] [ cut here ] [6.685067] WARNING: CPU: 0 PID: 99 at ./include/linux/kref.h:46 kobject_get+0x7f/0x90 [6.686592] CPU: 0 PID: 99 Comm: kworker/u2:1 Not tainted 4.10.0-rc7 #932 [6.687680] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014 [6.689280] Workqueue: events_unbound async_run_entry_fn [6.690208] Call Trace: [6.690843] dump_stack+0x79/0xa4 [6.691563] __warn+0xd2/0xf0 [6.692246] ? kobject_get+0x7f/0x90 [6.692992] warn_slowpath_null+0x25/0x30 [6.693787] kobject_get+0x7f/0x90 [6.694505] kobject_add_internal+0x2e/0x360 [6.695322] ? kfree_const+0x18/0x20 [6.696071] ? kobject_set_name_vargs+0x62/0x80 [6.696914]
Re: [PATCH] pm8001: switch to pci_irq_alloc_vectors
> "Christoph" == Christoph Hellwigwrites: Applied to 4.11/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering
Re: sort out the ->eh_timed_out mess
> "Christoph" == Christoph Hellwigwrites: Christoph> We originally only supported the methods in the Christoph> transport_template, which led to problems with drivers Christoph> needing it and having to fake up a template. Then we added Christoph> it to the host to avoid that issue, but because the transport Christoph> template takes precedence we still have various placed that Christoph> need to hack around it. Christoph> This series removes the transport_template instance and Christoph> switches everyone to use the host method, similar to how we Christoph> supply generic helpers elsewhere. Christoph> In addition it removes a bit of cruft in the same area. Applied to 4.11/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 08/39] megaraid_sas: megasas_get_request_descriptor always return valid desc
> "Martin" == Martin K Petersenwrites: Martin> Also, please remove all the "This patch depends on ..." stuff Martin> from the patch descriptions. The dependencies are inherent in Martin> the ordering of the patches and we don't want that in the commit Martin> messages. And please make sure to apply the review tags you got from Hannes and Tomas to those patches that remain unchanged... -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 08/39] megaraid_sas: megasas_get_request_descriptor always return valid desc
> "Shivasharan" == Shivasharan Srikanteshwara >writes: Shivasharan, Shivasharan> Are you OK if I re-send only above impacted patch or like Shivasharan> to see complete series with v2 tag and updated patch Shivasharan> numbers? Please send a complete v2 with all the little issues fixed up. Also, please remove all the "This patch depends on ..." stuff from the patch descriptions. The dependencies are inherent in the ordering of the patches and we don't want that in the commit messages. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 13/39] megaraid_sas : set residual bytes count during IO compeltion
> "Shivasharan" == Shivasharan S> writes: Shivasharan> Fixing issue of not setting residual bytes correctly. @@ -1464,6 +1465,15 @@ map_cmd_status(struct fusion_context *fusion, SCSI_SENSE_BUFFERSIZE); scmd->result |= DRIVER_SENSE << 24; } + + /* +* If the IO request is partially completed, then MR FW will +* update "io_request->DataLength" field with actual number of +* bytes transferred.Driver will set residual bytes count in +* SCSI command structure. +*/ + resid = (scsi_bufflen(scmd) - data_length); + scsi_set_resid(scmd, resid); Is data_length guaranteed to be a multiple of the logical block size? Otherwise you need to tweak the residual like we just did for mpt3sas. -- Martin K. Petersen Oracle Linux Engineering
[PATCH v2 07/18] lpfc: NVME Initiator: Base modifications Part E
NVME Initiator: Base modifications This is part E of parts A..F. Part E is limited to lpfc_sli.c. This is the location of most of changes for the following: - sli3 ring vs sli4 wq splits - io abort interfaces - actual queuing routines and use of dma and sgl pools - service routines to create/delete queues This patch by itself will not result in a compilable driver. All parts A..F must be applied to create a compilable driver. * Refer to Part A for a description of base modifications Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Note: this was patch 6 in the V1 patches Address review items: Reverted lpfc_sli_hbq_count() spurious change. Thus more files than just lpfc_sli.c Created helper function for assigning the pring pointer Sync with max_hw_queues/io_channel/io_channel_irqs change Flipped a few do_while loops to for loops Some additional checkpatch cleanups drivers/scsi/lpfc/lpfc_crtn.h |2 +- drivers/scsi/lpfc/lpfc_hw.h |2 +- drivers/scsi/lpfc/lpfc_init.c |2 +- drivers/scsi/lpfc/lpfc_mbox.c |2 +- drivers/scsi/lpfc/lpfc_sli.c | 1470 + 5 files changed, 1063 insertions(+), 415 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index 8dfa4e4..db56b73 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -322,7 +322,7 @@ uint32_t lpfc_sli_get_buffer_tag(struct lpfc_hba *); struct lpfc_dmabuf * lpfc_sli_ring_taggedbuf_get(struct lpfc_hba *, struct lpfc_sli_ring *, uint32_t ); -int lpfc_sli_hbq_count(struct lpfc_hba *phba); +int lpfc_sli_hbq_count(void); int lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *, uint32_t); void lpfc_sli_hbqbuf_free_all(struct lpfc_hba *); int lpfc_sli_hbq_size(struct lpfc_hba *phba); diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 5d7416c..28247c9 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h @@ -4162,7 +4162,7 @@ typedef struct _IOCB {/* IOCB structure */ /* HBQ entries are 4 words each = 4k */ #define LPFC_TOTAL_HBQ_SIZE (sizeof(struct lpfc_hbq_entry) * \ -lpfc_sli_hbq_count(phba)) +lpfc_sli_hbq_count()) struct lpfc_sli2_slim { MAILBOX_t mbx; diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index ea720bc..6fd5135 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -6697,7 +6697,7 @@ lpfc_sli_pci_mem_setup(struct lpfc_hba *phba) if (!phba->hbqslimp.virt) goto out_free_slim; - hbq_count = lpfc_sli_hbq_count(phba); + hbq_count = lpfc_sli_hbq_count(); ptr = phba->hbqslimp.virt; for (i = 0; i < hbq_count; ++i) { phba->hbqs[i].hbq_virt = ptr; diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index 8dd5a77..dc1b9a1 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -1291,7 +1291,7 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) mb->un.varCfgPort.cdss = 1; /* Configure Security */ mb->un.varCfgPort.cerbm = 1; /* Request HBQs */ mb->un.varCfgPort.ccrp = 1; /* Command Ring Polling */ - mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count(phba); + mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count(); if (phba->max_vpi && phba->cfg_enable_npiv && phba->vpd.sli3Feat.cmv) { mb->un.varCfgPort.max_vpi = LPFC_MAX_VPI; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index dbe9cb1..d114543 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -34,14 +34,17 @@ #include #include +#include + #include "lpfc_hw4.h" #include "lpfc_hw.h" #include "lpfc_sli.h" #include "lpfc_sli4.h" #include "lpfc_nl.h" #include "lpfc_disc.h" -#include "lpfc_scsi.h" #include "lpfc.h" +#include "lpfc_scsi.h" +#include "lpfc_nvme.h" #include "lpfc_crtn.h" #include "lpfc_logmsg.h" #include "lpfc_compat.h" @@ -67,14 +70,17 @@ static struct lpfc_iocbq *lpfc_sli4_els_wcqe_to_rspiocbq(struct lpfc_hba *, struct lpfc_iocbq *); static void lpfc_sli4_send_seq_to_ulp(struct lpfc_vport *, struct hbq_dmabuf *); -static int lpfc_sli4_fp_handle_wcqe(struct lpfc_hba *, struct lpfc_queue *, +static int lpfc_sli4_fp_handle_cqe(struct lpfc_hba *, struct lpfc_queue *, struct lpfc_cqe *); -static int lpfc_sli4_post_els_sgl_list(struct lpfc_hba *, struct list_head *, +static int lpfc_sli4_post_sgl_list(struct lpfc_hba *, struct list_head *, int); static void
[PATCH v2 10/18] lpfc: NVME Initiator: bind to nvme_fc api
NVME Initiator: Tie in to NVME Fabrics nvme_fc LLDD initiator api Adds the routines to: - register and deregister the FC port as a nvme-fc initiator localport - register and deregister remote FC ports as a nvme-fc remoteport. - binding of nvme queues to adapter WQs - send/perform NVME LS's - send/perform NVME FCP initiator io operations Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Minor tweaks drivers/scsi/lpfc/Makefile |7 +- drivers/scsi/lpfc/lpfc.h |5 + drivers/scsi/lpfc/lpfc_crtn.h |9 + drivers/scsi/lpfc/lpfc_ct.c|2 +- drivers/scsi/lpfc/lpfc_els.c |4 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 15 +- drivers/scsi/lpfc/lpfc_init.c | 39 +- drivers/scsi/lpfc/lpfc_nportdisc.c |4 +- drivers/scsi/lpfc/lpfc_nvme.c | 2257 drivers/scsi/lpfc/lpfc_nvme.h |6 + drivers/scsi/lpfc/lpfc_sli.c | 21 +- drivers/scsi/lpfc/lpfc_sli4.h |1 + drivers/scsi/lpfc/lpfc_vport.c | 16 +- 13 files changed, 2348 insertions(+), 38 deletions(-) create mode 100644 drivers/scsi/lpfc/lpfc_nvme.c diff --git a/drivers/scsi/lpfc/Makefile b/drivers/scsi/lpfc/Makefile index e2516ba..cd7e1fc 100644 --- a/drivers/scsi/lpfc/Makefile +++ b/drivers/scsi/lpfc/Makefile @@ -28,6 +28,7 @@ endif obj-$(CONFIG_SCSI_LPFC) := lpfc.o -lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o lpfc_hbadisc.o \ - lpfc_init.o lpfc_mbox.o lpfc_nportdisc.o lpfc_scsi.o lpfc_attr.o \ - lpfc_vport.o lpfc_debugfs.o lpfc_bsg.o +lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o \ + lpfc_hbadisc.o lpfc_init.o lpfc_mbox.o lpfc_nportdisc.o \ + lpfc_scsi.o lpfc_attr.o lpfc_vport.o lpfc_debugfs.o lpfc_bsg.o \ + lpfc_nvme.o diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 14a6bc6..cd1042c 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -123,6 +123,11 @@ struct perf_prof { uint16_t wqidx[40]; }; +/* + * Provide for FC4 TYPE x28 - NVME. The + * bit mask for FCP and NVME is 0x8 identically + * because they are 32 bit positions distance. + */ #define LPFC_FC4_TYPE_BITMASK 0x0100 /* Provide DMA memory definitions the driver uses per port instance. */ diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index db56b73..2750f28 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -529,4 +529,13 @@ struct lpfc_scsi_buf *lpfc_get_scsi_buf(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp); /* NVME interfaces. */ +void lpfc_nvme_unregister_port(struct lpfc_nodelist *ndlp); +int lpfc_nvme_register_port(struct lpfc_vport *vport, + struct lpfc_nodelist *ndlp); +int lpfc_nvme_create_localport(struct lpfc_vport *vport); +void lpfc_nvme_destroy_localport(struct lpfc_vport *vport); +void lpfc_nvme_update_localport(struct lpfc_vport *vport); void lpfc_nvme_mod_param_dep(struct lpfc_hba *phba); +void lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba, + struct lpfc_iocbq *cmdiocb, + struct lpfc_wcqe_complete *abts_cmpl); diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index afb2536..8cfeffe 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1412,7 +1412,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, if (((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) && (context == FC_TYPE_NVME)) { - /* todo: init: revise localport nvme attributes */ + lpfc_nvme_update_localport(vport); CtReq->un.rff.type_code = context; } else if (((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 76a71c9..1155f01 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2622,7 +2622,9 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, !(vport->fc_flag & FC_PT2PT_PLOGI)) { phba->pport->fc_myDID = 0; - /* todo: init: revise localport nvme attributes */ + if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || + (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) + lpfc_nvme_update_localport(phba->pport); mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (mbox) { diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 5209ea2..8c000e4 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -909,7 +909,9 @@ lpfc_linkdown(struct
[PATCH v2 08/18] lpfc: NVME Initiator: Base modifications Part F
NVME Initiator: Base modifications This is part F of parts A..F. Part F is limited to lpfc_debugfs.[ch]. It contains the modifications in the existing debugfs snippets to work with the base modifications. This patch by itself will not result in a compilable driver. All parts A..F must be applied to create a compilable driver. * Refer to Part A for a description of base modifications Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Note: this was patch 7 in the V1 patches Address review items: Reverted lpfc_sli_hbq_count() spurious change. Refactoring of queue print functions Sync with max_hw_queues/io_channel/io_channel_irqs change Some printk(KERN_ERR) flips to pr_err() Enlarge protective space for buffer overrun checks Couple more checkpatch cleanups drivers/scsi/lpfc/lpfc_debugfs.c | 778 ++- drivers/scsi/lpfc/lpfc_debugfs.h | 266 ++--- 2 files changed, 504 insertions(+), 540 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index a63542b..e19a3fa 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -484,20 +484,23 @@ lpfc_debugfs_dumpHostSlim_data(struct lpfc_hba *phba, char *buf, int size) off += (8 * sizeof(uint32_t)); } - for (i = 0; i < 4; i++) { - pgpp = >port_gp[i]; - pring = >ring[i]; - len += snprintf(buf+len, size-len, -"Ring %d: CMD GetInx:%d (Max:%d Next:%d " -"Local:%d flg:x%x) RSP PutInx:%d Max:%d\n", -i, pgpp->cmdGetInx, pring->sli.sli3.numCiocb, -pring->sli.sli3.next_cmdidx, -pring->sli.sli3.local_getidx, -pring->flag, pgpp->rspPutInx, -pring->sli.sli3.numRiocb); - } - if (phba->sli_rev <= LPFC_SLI_REV3) { + for (i = 0; i < 4; i++) { + pgpp = >port_gp[i]; + pring = >sli3_ring[i]; + len += snprintf(buf+len, size-len, +"Ring %d: CMD GetInx:%d " +"(Max:%d Next:%d " +"Local:%d flg:x%x) " +"RSP PutInx:%d Max:%d\n", +i, pgpp->cmdGetInx, +pring->sli.sli3.numCiocb, +pring->sli.sli3.next_cmdidx, +pring->sli.sli3.local_getidx, +pring->flag, pgpp->rspPutInx, +pring->sli.sli3.numRiocb); + } + word0 = readl(phba->HAregaddr); word1 = readl(phba->CAregaddr); word2 = readl(phba->HSregaddr); @@ -531,10 +534,11 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) int cnt; struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_nodelist *ndlp; - unsigned char *statep, *name; + unsigned char *statep; cnt = (LPFC_NODELIST_SIZE / LPFC_NODELIST_ENTRY_SIZE); + len += snprintf(buf+len, size-len, "\nFCP Nodelist Entries ...\n"); spin_lock_irq(shost->host_lock); list_for_each_entry(ndlp, >fc_nodes, nlp_listp) { if (!cnt) { @@ -574,36 +578,32 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) default: statep = "UNKNOWN"; } - len += snprintf(buf+len, size-len, "%s DID:x%06x ", - statep, ndlp->nlp_DID); - name = (unsigned char *)>nlp_portname; - len += snprintf(buf+len, size-len, - "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ", - *name, *(name+1), *(name+2), *(name+3), - *(name+4), *(name+5), *(name+6), *(name+7)); - name = (unsigned char *)>nlp_nodename; - len += snprintf(buf+len, size-len, - "WWNN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ", - *name, *(name+1), *(name+2), *(name+3), - *(name+4), *(name+5), *(name+6), *(name+7)); + len += snprintf(buf+len, size-len, "%s DID:x%06x ", + statep, ndlp->nlp_DID); + len += snprintf(buf+len, size-len, + "WWPN x%llx ", + wwn_to_u64(ndlp->nlp_portname.u.wwn)); + len += snprintf(buf+len, size-len, + "WWNN x%llx ", +
[PATCH v2 15/18] lpfc: NVME Target: bind to nvmet_fc api
NVME Target: Tie in to NVME Fabrics nvmet_fc LLDD target api Adds the routines to: - register and deregister the FC port as a nvmet-fc targetport - binding of nvme queues to adapter WQs - receipt and passing of NVME LS's to transport, sending transport response - receipt of NVME FCP CMD IUs, processing FCP target io data transmission commands; transmission of FCP io response. - Abort operations for tgt io exchanges. Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Sync with max_hw_queues/io_channel/io_channel_irqs change Teardown bugfixes drivers/scsi/lpfc/Makefile |2 +- drivers/scsi/lpfc/lpfc_crtn.h| 10 + drivers/scsi/lpfc/lpfc_ct.c |2 +- drivers/scsi/lpfc/lpfc_els.c |5 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 10 +- drivers/scsi/lpfc/lpfc_init.c| 14 +- drivers/scsi/lpfc/lpfc_mem.c | 45 + drivers/scsi/lpfc/lpfc_nvmet.c | 1672 ++ drivers/scsi/lpfc/lpfc_sli.c |8 +- 9 files changed, 1753 insertions(+), 15 deletions(-) create mode 100644 drivers/scsi/lpfc/lpfc_nvmet.c diff --git a/drivers/scsi/lpfc/Makefile b/drivers/scsi/lpfc/Makefile index cd7e1fc..30a6a35 100644 --- a/drivers/scsi/lpfc/Makefile +++ b/drivers/scsi/lpfc/Makefile @@ -31,4 +31,4 @@ obj-$(CONFIG_SCSI_LPFC) := lpfc.o lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o \ lpfc_hbadisc.o lpfc_init.o lpfc_mbox.o lpfc_nportdisc.o \ lpfc_scsi.o lpfc_attr.o lpfc_vport.o lpfc_debugfs.o lpfc_bsg.o \ - lpfc_nvme.o + lpfc_nvme.o lpfc_nvmet.o diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index 675b5bb..18a8d6e 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -365,6 +365,8 @@ void *lpfc_nvmet_buf_alloc(struct lpfc_hba *phba, int flags, void lpfc_nvmet_buf_free(struct lpfc_hba *phba, void *virtp, dma_addr_t dma); void lpfc_in_buf_free(struct lpfc_hba *, struct lpfc_dmabuf *); +void lpfc_rq_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp); + /* Function prototypes. */ const char* lpfc_info(struct Scsi_Host *); int lpfc_scan_finished(struct Scsi_Host *, unsigned long); @@ -544,6 +546,14 @@ int lpfc_nvme_register_port(struct lpfc_vport *vport, int lpfc_nvme_create_localport(struct lpfc_vport *vport); void lpfc_nvme_destroy_localport(struct lpfc_vport *vport); void lpfc_nvme_update_localport(struct lpfc_vport *vport); +int lpfc_nvmet_create_targetport(struct lpfc_hba *phba); +int lpfc_nvmet_update_targetport(struct lpfc_hba *phba); +void lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba); +void lpfc_nvmet_unsol_ls_event(struct lpfc_hba *phba, + struct lpfc_sli_ring *pring, struct lpfc_iocbq *piocb); +void lpfc_nvmet_unsol_fcp_event(struct lpfc_hba *phba, + struct lpfc_sli_ring *pring, + struct rqb_dmabuf *nvmebuf, uint64_t isr_ts); void lpfc_nvme_mod_param_dep(struct lpfc_hba *phba); void lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index d576da4..53bdfe4 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1436,7 +1436,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, if ((vport == phba->pport) && phba->nvmet_support) { CtReq->un.rff.fbits = (FC4_FEATURE_TARGET | FC4_FEATURE_NVME_DISC); - /* todo: update targetport attributes */ + lpfc_nvmet_update_targetport(phba); } else { lpfc_nvme_update_localport(vport); } diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index b7927c2..4ce62a0 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2630,9 +2630,10 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { - if (!phba->nvmet_support) + if (phba->nvmet_support) + lpfc_nvmet_update_targetport(phba); + else lpfc_nvme_update_localport(phba->pport); - /* todo: tgt: update targetport attributes */ } mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index f8e0c0e..8737ad9 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -911,9 +911,10 @@ lpfc_linkdown(struct lpfc_hba *phba)
[PATCH v2 18/18] lpfc: Update lpfc version to 11.2.0.7
Update lpfc version to 11.2.0.7 Signed-off-by: Dick KennedySigned-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 0d93535..86c6c9b 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * ***/ -#define LPFC_DRIVER_VERSION "11.2.0.4" +#define LPFC_DRIVER_VERSION "11.2.0.7" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ -- 2.5.0
[PATCH v2 17/18] lpfc: Update copyrights
Update copyrights to 2017 for all files touched in this patch set Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Corporate changed our copyright update to add the official Broadcom copyright drivers/scsi/lpfc/Makefile | 4 +++- drivers/scsi/lpfc/lpfc.h | 4 +++- drivers/scsi/lpfc/lpfc_attr.c | 4 +++- drivers/scsi/lpfc/lpfc_attr.h | 4 +++- drivers/scsi/lpfc/lpfc_bsg.c | 4 +++- drivers/scsi/lpfc/lpfc_bsg.h | 6 -- drivers/scsi/lpfc/lpfc_compat.h| 4 +++- drivers/scsi/lpfc/lpfc_crtn.h | 4 +++- drivers/scsi/lpfc/lpfc_ct.c| 4 +++- drivers/scsi/lpfc/lpfc_debugfs.c | 4 +++- drivers/scsi/lpfc/lpfc_debugfs.h | 4 +++- drivers/scsi/lpfc/lpfc_disc.h | 4 +++- drivers/scsi/lpfc/lpfc_els.c | 4 +++- drivers/scsi/lpfc/lpfc_hbadisc.c | 4 +++- drivers/scsi/lpfc/lpfc_hw.h| 4 +++- drivers/scsi/lpfc/lpfc_hw4.h | 6 -- drivers/scsi/lpfc/lpfc_ids.h | 4 +++- drivers/scsi/lpfc/lpfc_init.c | 6 -- drivers/scsi/lpfc/lpfc_logmsg.h| 4 +++- drivers/scsi/lpfc/lpfc_mbox.c | 4 +++- drivers/scsi/lpfc/lpfc_mem.c | 4 +++- drivers/scsi/lpfc/lpfc_nl.h| 4 +++- drivers/scsi/lpfc/lpfc_nportdisc.c | 4 +++- drivers/scsi/lpfc/lpfc_nvme.c | 4 +++- drivers/scsi/lpfc/lpfc_nvme.h | 4 +++- drivers/scsi/lpfc/lpfc_nvmet.c | 6 -- drivers/scsi/lpfc/lpfc_nvmet.h | 4 +++- drivers/scsi/lpfc/lpfc_scsi.c | 4 +++- drivers/scsi/lpfc/lpfc_scsi.h | 4 +++- drivers/scsi/lpfc/lpfc_sli.c | 4 +++- drivers/scsi/lpfc/lpfc_sli.h | 4 +++- drivers/scsi/lpfc/lpfc_sli4.h | 4 +++- drivers/scsi/lpfc/lpfc_version.h | 8 ++-- drivers/scsi/lpfc/lpfc_vport.c | 4 +++- drivers/scsi/lpfc/lpfc_vport.h | 4 +++- 35 files changed, 112 insertions(+), 40 deletions(-) diff --git a/drivers/scsi/lpfc/Makefile b/drivers/scsi/lpfc/Makefile index 30a6a35..cb6aa80 100644 --- a/drivers/scsi/lpfc/Makefile +++ b/drivers/scsi/lpfc/Makefile @@ -1,9 +1,11 @@ #/*** # * This file is part of the Emulex Linux Device Driver for * # * Fibre Channel Host Bus Adapters.* +# * Copyright (C) 2017 Broadcom. All Rights Reserved. The term * +# * “Broadcom” refers to Broadcom Limited and/or its subsidiaries. * # * Copyright (C) 2004-2012 Emulex. All rights reserved. * # * EMULEX and SLI are trademarks of Emulex.* -# * www.emulex.com * +# * www.broadcom.com* # * * # * This program is free software; you can redistribute it and/or * # * modify it under the terms of version 2 of the GNU General * diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 2d4c3e6..f7988ed 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1,9 +1,11 @@ /*** * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters.* + * Copyright (C) 2017 Broadcom. All Rights Reserved. The term * + * “Broadcom” refers to Broadcom Limited and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex.* - * www.emulex.com * + * www.broadcom.com* * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 2731bf8..53a1ee8 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -1,9 +1,11 @@ /*** * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters.* + * Copyright (C) 2017 Broadcom. All Rights Reserved. The term * + * “Broadcom” refers to Broadcom Limited and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex.* - * www.emulex.com * + * www.broadcom.com* * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it
[PATCH v2 16/18] lpfc: NVME Target: Add debugfs support
NVME Target: Add debugfs support Adds debugfs snippets to cover the new NVME target functionality Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Sync with max_hw_queues/io_channel/io_channel_irqs change Sync with refactoring drivers/scsi/lpfc/lpfc_debugfs.c | 331 ++- drivers/scsi/lpfc/lpfc_nvmet.c | 276 +++- drivers/scsi/lpfc/lpfc_nvmet.h | 13 ++ 3 files changed, 613 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index f2525b3..5b820ec 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -47,6 +47,7 @@ #include "lpfc.h" #include "lpfc_scsi.h" #include "lpfc_nvme.h" +#include "lpfc_nvmet.h" #include "lpfc_logmsg.h" #include "lpfc_crtn.h" #include "lpfc_vport.h" @@ -537,11 +538,13 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) int len = 0; int cnt; struct Scsi_Host *shost = lpfc_shost_from_vport(vport); + struct lpfc_hba *phba = vport->phba; struct lpfc_nodelist *ndlp; unsigned char *statep; struct nvme_fc_local_port *localport; struct lpfc_nvme_lport *lport; struct lpfc_nvme_rport *rport; + struct lpfc_nvmet_tgtport *tgtp; struct nvme_fc_remote_port *nrport; cnt = (LPFC_NODELIST_SIZE / LPFC_NODELIST_ENTRY_SIZE); @@ -620,6 +623,26 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) } spin_unlock_irq(shost->host_lock); + if (phba->nvmet_support && phba->targetport && (vport == phba->pport)) { + tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; + len += snprintf(buf+len, size-len, + "\nNVME Targetport Entry ...\n"); + + /* Port state is only one of two values for now. */ + if (phba->targetport->port_id) + statep = "REGISTERED"; + else + statep = "INIT"; + len += snprintf(buf+len, size-len, + "TGT WWNN x%llx WWPN x%llx State %s\n", + wwn_to_u64(vport->fc_nodename.u.wwn), + wwn_to_u64(vport->fc_portname.u.wwn), + statep); + len += snprintf(buf+len, size-len, + "Targetport DID x%06x\n", + phba->targetport->port_id); + goto out_exit; + } len += snprintf(buf+len, size-len, "\nNVME Lport/Rport Entries ...\n"); localport = vport->localport; @@ -711,9 +734,75 @@ static int lpfc_debugfs_nvmestat_data(struct lpfc_vport *vport, char *buf, int size) { struct lpfc_hba *phba = vport->phba; + struct lpfc_nvmet_tgtport *tgtp; int len = 0; - if (phba->nvmet_support == 0) { + if (phba->nvmet_support) { + if (!phba->targetport) + return len; + tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; + len += snprintf(buf+len, size-len, + "\nNVME Targetport Statistics\n"); + + len += snprintf(buf+len, size-len, + "LS: Rcv %08x Drop %08x Abort %08x\n", + atomic_read(>rcv_ls_req_in), + atomic_read(>rcv_ls_req_drop), + atomic_read(>xmt_ls_abort)); + if (atomic_read(>rcv_ls_req_in) != + atomic_read(>rcv_ls_req_out)) { + len += snprintf(buf+len, size-len, + "Rcv LS: in %08x != out %08x\n", + atomic_read(>rcv_ls_req_in), + atomic_read(>rcv_ls_req_out)); + } + + len += snprintf(buf+len, size-len, + "LS: Xmt %08x Drop %08x Cmpl %08x Err %08x\n", + atomic_read(>xmt_ls_rsp), + atomic_read(>xmt_ls_drop), + atomic_read(>xmt_ls_rsp_cmpl), + atomic_read(>xmt_ls_rsp_error)); + + len += snprintf(buf+len, size-len, + "FCP: Rcv %08x Drop %08x\n", + atomic_read(>rcv_fcp_cmd_in), + atomic_read(>rcv_fcp_cmd_drop)); + + if (atomic_read(>rcv_fcp_cmd_in) != + atomic_read(>rcv_fcp_cmd_out)) { + len += snprintf(buf+len, size-len, + "Rcv FCP: in %08x != out %08x\n", +
[PATCH v2 14/18] lpfc: NVME Target: Merge into FC discovery
NVME Target: Merge into FC discovery Adds NVME PRLI handling and Nameserver registrations for NVME Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Bug fix in reglogin drivers/scsi/lpfc/lpfc_ct.c| 8 +++- drivers/scsi/lpfc/lpfc_els.c | 34 ++ drivers/scsi/lpfc/lpfc_hbadisc.c | 27 +++ drivers/scsi/lpfc/lpfc_nportdisc.c | 35 --- 4 files changed, 92 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 2c051369..d576da4 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1433,7 +1433,13 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, if (((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) && (context == FC_TYPE_NVME)) { - lpfc_nvme_update_localport(vport); + if ((vport == phba->pport) && phba->nvmet_support) { + CtReq->un.rff.fbits = (FC4_FEATURE_TARGET | + FC4_FEATURE_NVME_DISC); + /* todo: update targetport attributes */ + } else { + lpfc_nvme_update_localport(vport); + } CtReq->un.rff.type_code = context; } else if (((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 1155f01..b7927c2 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2211,7 +2211,13 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, !phba->nvmet_support) bf_set(prli_fba, npr_nvme, 1); - bf_set(prli_init, npr_nvme, 1); + if (phba->nvmet_support) { + bf_set(prli_tgt, npr_nvme, 1); + bf_set(prli_disc, npr_nvme, 1); + + } else { + bf_set(prli_init, npr_nvme, 1); + } npr_nvme->word1 = cpu_to_be32(npr_nvme->word1); npr_nvme->word4 = cpu_to_be32(npr_nvme->word4); elsiocb->iocb_flag |= LPFC_PRLI_NVME_REQ; @@ -2623,8 +2629,11 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, phba->pport->fc_myDID = 0; if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) - lpfc_nvme_update_localport(phba->pport); + (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { + if (!phba->nvmet_support) + lpfc_nvme_update_localport(phba->pport); + /* todo: tgt: update targetport attributes */ + } mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (mbox) { @@ -4405,7 +4414,22 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb, bf_set(prli_type_code, npr_nvme, PRLI_NVME_TYPE); bf_set(prli_estabImagePair, npr_nvme, 0); /* Should be 0 */ bf_set(prli_acc_rsp_code, npr_nvme, PRLI_REQ_EXECUTED); - bf_set(prli_init, npr_nvme, 1); + if (phba->nvmet_support) { + bf_set(prli_tgt, npr_nvme, 1); + bf_set(prli_disc, npr_nvme, 1); + if (phba->cfg_nvme_enable_fb) { + bf_set(prli_fba, npr_nvme, 1); + + /* TBD. Target mode needs to post buffers +* that support the configured first burst +* byte size. +*/ + bf_set(prli_fb_sz, npr_nvme, + phba->cfg_nvmet_fb_size); + } + } else { + bf_set(prli_init, npr_nvme, 1); + } lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, "6015 NVME issue PRLI ACC word1 x%08x " @@ -5823,6 +5847,8 @@ lpfc_rscn_recovery_check(struct lpfc_vport *vport) (ndlp->nlp_state == NLP_STE_UNUSED_NODE) || !lpfc_rscn_payload_check(vport, ndlp->nlp_DID)) continue; + if (vport->phba->nvmet_support) + continue; lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RECOVERY); lpfc_cancel_retry_delay_tmo(vport, ndlp); diff
[PATCH v2 13/18] lpfc: NVME Target: Receive buffer updates
NVME Target: Receive buffer updates Allocates buffer pools and configures adapter interfaces to handle receive buffer (asynchronous FCP CMD ius, first burst data) from the adapter. Splits by protocol, etc. Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Sync with max_hw_queues/io_channel/io_channel_irqs change Sync with refactoring drivers/scsi/lpfc/lpfc.h | 3 + drivers/scsi/lpfc/lpfc_attr.c | 81 +- drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_hw4.h | 274 +++ drivers/scsi/lpfc/lpfc_init.c | 233 +++- drivers/scsi/lpfc/lpfc_mbox.c | 87 ++ drivers/scsi/lpfc/lpfc_sli.c | 608 +- drivers/scsi/lpfc/lpfc_sli4.h | 11 + 8 files changed, 1282 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index c5208e2..2d4c3e6 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -770,9 +770,12 @@ struct lpfc_hba { uint32_t cfg_suppress_rsp; uint32_t cfg_nvme_oas; uint32_t cfg_nvme_io_channel; + uint32_t cfg_nvmet_mrq; + uint32_t cfg_nvmet_mrq_post; uint32_t cfg_enable_nvmet; uint32_t cfg_nvme_posted_buf; uint32_t cfg_nvme_enable_fb; + uint32_t cfg_nvmet_fb_size; uint32_t cfg_total_seg_cnt; uint32_t cfg_sg_seg_cnt; uint32_t cfg_sg_dma_buf_size; diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 8058484..2731bf8 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -58,6 +58,10 @@ #define LPFC_MIN_DEVLOSS_TMO 1 #define LPFC_MAX_DEVLOSS_TMO 255 +#define LPFC_DEF_MRQ_POST 128 +#define LPFC_MIN_MRQ_POST 32 +#define LPFC_MAX_MRQ_POST 512 + /* * Write key size should be multiple of 4. If write key is changed * make sure that library write key is also changed. @@ -3282,6 +3286,24 @@ LPFC_ATTR_R(suppress_rsp, 1, 0, 1, "Enable suppress rsp feature is firmware supports it"); /* + * lpfc_nvmet_mrq: Specify number of RQ pairs for processing NVMET cmds + * lpfc_nvmet_mrq = 1 use a single RQ pair + * lpfc_nvmet_mrq >= 2 use specified RQ pairs for MRQ + * + */ +LPFC_ATTR_R(nvmet_mrq, + 1, 1, 16, + "Specify number of RQ pairs for processing NVMET cmds"); + +/* + * lpfc_nvmet_mrq_post: Specify number buffers to post on every MRQ + * + */ +LPFC_ATTR_R(nvmet_mrq_post, LPFC_DEF_MRQ_POST, + LPFC_MIN_MRQ_POST, LPFC_MAX_MRQ_POST, + "Specify number of buffers to post on every MRQ"); + +/* * lpfc_enable_fc4_type: Defines what FC4 types are supported. * Supported Values: 1 - register just FCP *2 - register just NVME @@ -4658,13 +4680,28 @@ LPFC_VPORT_ATTR_RW(first_burst_size, 0, 0, 65536, "First burst size for Targets that support first burst"); /* -* lpfc_nvme_enable_fb: Enable NVME first burst on I and T functions. -* For the Initiator (I), enabling this parameter means that an NVME -* PRLI response with FBA enabled and an FB_SIZE set to a nonzero value -* will be processed by the initiator for subsequent NVME FCP IO. +* lpfc_nvmet_fb_size: NVME Target mode supported first burst size. +* When the driver is configured as an NVME target, this value is +* communicated to the NVME initiator in the PRLI response. It is +* used only when the lpfc_nvme_enable_fb and lpfc_nvmet_support +* parameters are set and the target is sending the PRLI RSP. * Parameter supported on physical port only - no NPIV support. -* Value range is [0,1]. Default value is 0 (disabled). +* Value range is [0,65536]. Default value is 0. */ +LPFC_ATTR_RW(nvmet_fb_size, 0, 0, 65536, +"NVME Target mode first burst size in 512B increments."); + +/* + * lpfc_nvme_enable_fb: Enable NVME first burst on I and T functions. + * For the Initiator (I), enabling this parameter means that an NVMET + * PRLI response with FBA enabled and an FB_SIZE set to a nonzero value will be + * processed by the initiator for subsequent NVME FCP IO. For the target + * function (T), enabling this parameter qualifies the lpfc_nvmet_fb_size + * driver parameter as the target function's first burst size returned to the + * initiator in the target's NVME PRLI response. Parameter supported on physical + * port only - no NPIV support. + * Value range is [0,1]. Default value is 0 (disabled). + */ LPFC_ATTR_RW(nvme_enable_fb, 0, 0, 1, "Enable First Burst feature on I and T functions."); @@ -5100,7 +5137,10 @@ struct device_attribute *lpfc_hba_attrs[] = { _attr_lpfc_fcp_io_channel, _attr_lpfc_suppress_rsp, _attr_lpfc_nvme_io_channel, + _attr_lpfc_nvmet_mrq, + _attr_lpfc_nvmet_mrq_post, _attr_lpfc_nvme_enable_fb, + _attr_lpfc_nvmet_fb_size, _attr_lpfc_enable_bg, _attr_lpfc_soft_wwnn,
[PATCH v2 11/18] lpfc: NVME Initiator: Add debugfs support
NVME Initiator: Add debugfs support Adds debugfs snippets to cover the new NVME initiator functionality Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Sync with io_channel/max_hw_queues change Some additional checkpatch cleanups drivers/scsi/lpfc/lpfc.h | 48 +++ drivers/scsi/lpfc/lpfc_ct.c | 27 +- drivers/scsi/lpfc/lpfc_debugfs.c | 837 +-- drivers/scsi/lpfc/lpfc_debugfs.h | 5 + drivers/scsi/lpfc/lpfc_nvme.c| 125 ++ drivers/scsi/lpfc/lpfc_nvme.h| 7 + drivers/scsi/lpfc/lpfc_sli.c | 5 + 7 files changed, 932 insertions(+), 122 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index cd1042c..03e2703 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -458,6 +458,9 @@ struct lpfc_vport { #ifdef CONFIG_SCSI_LPFC_DEBUG_FS struct dentry *debug_disc_trc; struct dentry *debug_nodelist; + struct dentry *debug_nvmestat; + struct dentry *debug_nvmektime; + struct dentry *debug_cpucheck; struct dentry *vport_debugfs_root; struct lpfc_debugfs_trc *disc_trc; atomic_t disc_trc_cnt; @@ -1084,6 +1087,51 @@ struct lpfc_hba { #define LPFC_TRANSGRESSION_LOW_RXPOWER 0x4000 uint16_t sfp_alarm; uint16_t sfp_warning; + +#ifdef CONFIG_SCSI_LPFC_DEBUG_FS +#define LPFC_CHECK_CPU_CNT32 + uint32_t cpucheck_rcv_io[LPFC_CHECK_CPU_CNT]; + uint32_t cpucheck_xmt_io[LPFC_CHECK_CPU_CNT]; + uint32_t cpucheck_cmpl_io[LPFC_CHECK_CPU_CNT]; + uint32_t cpucheck_ccmpl_io[LPFC_CHECK_CPU_CNT]; + uint16_t cpucheck_on; +#define LPFC_CHECK_OFF 0 +#define LPFC_CHECK_NVME_IO 1 + uint16_t ktime_on; + uint64_t ktime_data_samples; + uint64_t ktime_status_samples; + uint64_t ktime_last_cmd; + uint64_t ktime_seg1_total; + uint64_t ktime_seg1_min; + uint64_t ktime_seg1_max; + uint64_t ktime_seg2_total; + uint64_t ktime_seg2_min; + uint64_t ktime_seg2_max; + uint64_t ktime_seg3_total; + uint64_t ktime_seg3_min; + uint64_t ktime_seg3_max; + uint64_t ktime_seg4_total; + uint64_t ktime_seg4_min; + uint64_t ktime_seg4_max; + uint64_t ktime_seg5_total; + uint64_t ktime_seg5_min; + uint64_t ktime_seg5_max; + uint64_t ktime_seg6_total; + uint64_t ktime_seg6_min; + uint64_t ktime_seg6_max; + uint64_t ktime_seg7_total; + uint64_t ktime_seg7_min; + uint64_t ktime_seg7_max; + uint64_t ktime_seg8_total; + uint64_t ktime_seg8_min; + uint64_t ktime_seg8_max; + uint64_t ktime_seg9_total; + uint64_t ktime_seg9_min; + uint64_t ktime_seg9_max; + uint64_t ktime_seg10_total; + uint64_t ktime_seg10_min; + uint64_t ktime_seg10_max; +#endif }; static inline struct Scsi_Host * diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 8cfeffe..2c051369 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -465,6 +465,10 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type) ndlp = lpfc_setup_disc_node(vport, Did); if (ndlp && NLP_CHK_NODE_ACT(ndlp)) { + lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, + "Parse GID_FTrsp: did:x%x flg:x%x x%x", + Did, ndlp->nlp_flag, vport->fc_flag); + /* By default, the driver expects to support FCP FC4 */ if (fc4_type == FC_TYPE_FCP) ndlp->nlp_fc4_type |= NLP_FC4_FCP; @@ -478,16 +482,24 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type) ndlp->nlp_flag, ndlp->nlp_fc4_type, vport->fc_flag, vport->fc_rscn_id_cnt); - } else + } else { + lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, + "Skip1 GID_FTrsp: did:x%x flg:x%x cnt:%d", + Did, vport->fc_flag, vport->fc_rscn_id_cnt); + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, "0239 Skip x%06x NameServer Rsp " "Data: x%x x%x\n", Did, vport->fc_flag, vport->fc_rscn_id_cnt); - + } } else { if (!(vport->fc_flag & FC_RSCN_MODE) || lpfc_rscn_payload_check(vport, Did)) { + lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, + "Query GID_FTrsp: did:x%x
[PATCH v2 05/18] lpfc: NVME Initiator: Base modifications Part C
NVME Initiator: Base modifications This is part C of parts A..F. Part C is the 1st half of the mods to lpfc_init.c. This is the location of most of changes for the following: - sli3 ring vs sli4 wq splits - buffer pools are allocated/freed - sgl pools allocated/freed - adapter resources split up - queue config decided and enacted - receive buffer management This patch by itself will not result in a compilable driver. All parts A..F must be applied to create a compilable driver. * Refer to Part A for a description of base modifications Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Note: this was patch 4 in the V1 patches Address review items: note: didn't bother refactoring lpfc_hba_clean_txcmplq() Line continuations in lpfc_sli4_nvme_sgl_update() note: pci dev bar setup didn't need modifications. remove from patch Use of for_each_online_cpu() Refactored wq creation in lpfc_sli4_queue_create() Address nvme_xri_cnt access and locks Sync with max_hw_queues/io_channel/io_channel_irqs change drivers/scsi/lpfc/lpfc_init.c | 821 ++ 1 file changed, 516 insertions(+), 305 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index c4e8fad..516542a 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,9 @@ #include "lpfc_sli4.h" #include "lpfc_nl.h" #include "lpfc_disc.h" -#include "lpfc_scsi.h" #include "lpfc.h" +#include "lpfc_scsi.h" +#include "lpfc_nvme.h" #include "lpfc_logmsg.h" #include "lpfc_crtn.h" #include "lpfc_vport.h" @@ -87,6 +89,7 @@ static struct scsi_transport_template *lpfc_transport_template = NULL; static struct scsi_transport_template *lpfc_vport_transport_template = NULL; static DEFINE_IDR(lpfc_hba_index); + /** * lpfc_config_port_prep - Perform lpfc initialization prior to config port * @phba: pointer to lpfc hba data structure. @@ -499,12 +502,10 @@ lpfc_config_port_post(struct lpfc_hba *phba) phba->link_state = LPFC_LINK_DOWN; /* Only process IOCBs on ELS ring till hba_state is READY */ - if (psli->ring[psli->extra_ring].sli.sli3.cmdringaddr) - psli->ring[psli->extra_ring].flag |= LPFC_STOP_IOCB_EVENT; - if (psli->ring[psli->fcp_ring].sli.sli3.cmdringaddr) - psli->ring[psli->fcp_ring].flag |= LPFC_STOP_IOCB_EVENT; - if (psli->ring[psli->next_ring].sli.sli3.cmdringaddr) - psli->ring[psli->next_ring].flag |= LPFC_STOP_IOCB_EVENT; + if (psli->sli3_ring[LPFC_EXTRA_RING].sli.sli3.cmdringaddr) + psli->sli3_ring[LPFC_EXTRA_RING].flag |= LPFC_STOP_IOCB_EVENT; + if (psli->sli3_ring[LPFC_FCP_RING].sli.sli3.cmdringaddr) + psli->sli3_ring[LPFC_FCP_RING].flag |= LPFC_STOP_IOCB_EVENT; /* Post receive buffers for desired rings */ if (phba->sli_rev != 3) @@ -892,7 +893,7 @@ lpfc_hba_free_post_buf(struct lpfc_hba *phba) lpfc_sli_hbqbuf_free_all(phba); else { /* Cleanup preposted buffers on the ELS ring */ - pring = >ring[LPFC_ELS_RING]; + pring = >sli3_ring[LPFC_ELS_RING]; spin_lock_irq(>hbalock); list_splice_init(>postbufq, ); spin_unlock_irq(>hbalock); @@ -925,32 +926,43 @@ static void lpfc_hba_clean_txcmplq(struct lpfc_hba *phba) { struct lpfc_sli *psli = >sli; + struct lpfc_queue *qp = NULL; struct lpfc_sli_ring *pring; LIST_HEAD(completions); int i; - for (i = 0; i < psli->num_rings; i++) { - pring = >ring[i]; - if (phba->sli_rev >= LPFC_SLI_REV4) - spin_lock_irq(>ring_lock); - else + if (phba->sli_rev != LPFC_SLI_REV4) { + for (i = 0; i < psli->num_rings; i++) { + pring = >sli3_ring[i]; spin_lock_irq(>hbalock); - /* At this point in time the HBA is either reset or DOA. Either -* way, nothing should be on txcmplq as it will NEVER complete. -*/ - list_splice_init(>txcmplq, ); - pring->txcmplq_cnt = 0; - - if (phba->sli_rev >= LPFC_SLI_REV4) - spin_unlock_irq(>ring_lock); - else + /* At this point in time the HBA is either reset or DOA +* Nothing should be on txcmplq as it will +* NEVER complete. +*/ + list_splice_init(>txcmplq, ); + pring->txcmplq_cnt = 0; spin_unlock_irq(>hbalock); + lpfc_sli_abort_iocb_ring(phba, pring); + }
[PATCH v2 09/18] lpfc: NVME Initiator: Merge into FC discovery
NVME Initiator: Merge into FC discovery Adds NVME PRLI support and Nameserver registrations and Queries for NVME Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Address review items: Removed the conversions to non-statics BUG() to BUG_ON() drivers/scsi/lpfc/lpfc.h | 6 +- drivers/scsi/lpfc/lpfc_ct.c| 357 - drivers/scsi/lpfc/lpfc_disc.h | 19 +- drivers/scsi/lpfc/lpfc_els.c | 265 --- drivers/scsi/lpfc/lpfc_hbadisc.c | 169 ++ drivers/scsi/lpfc/lpfc_hw.h| 77 +--- drivers/scsi/lpfc/lpfc_hw4.h | 43 + drivers/scsi/lpfc/lpfc_init.c | 7 + drivers/scsi/lpfc/lpfc_nportdisc.c | 198 ++-- 9 files changed, 874 insertions(+), 267 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index e07686a..14a6bc6 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -123,6 +123,8 @@ struct perf_prof { uint16_t wqidx[40]; }; +#define LPFC_FC4_TYPE_BITMASK 0x0100 + /* Provide DMA memory definitions the driver uses per port instance. */ struct lpfc_dmabuf { struct list_head list; @@ -390,7 +392,8 @@ struct lpfc_vport { int32_t stopped; /* HBA has not been restarted since last ERATT */ uint8_t fc_linkspeed; /* Link speed after last READ_LA */ - uint32_t num_disc_nodes;/*in addition to hba_state */ + uint32_t num_disc_nodes;/* in addition to hba_state */ + uint32_t gidft_inp; /* cnt of outstanding GID_FTs */ uint32_t fc_nlp_cnt;/* outstanding NODELIST requests */ uint32_t fc_rscn_id_cnt;/* count of RSCNs payloads in list */ @@ -443,7 +446,6 @@ struct lpfc_vport { uint32_t cfg_max_scsicmpl_time; uint32_t cfg_tgt_queue_depth; uint32_t cfg_first_burst_size; - uint32_t dev_loss_tmo_changed; struct fc_vport *fc_vport; diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 4ac03b1..afb2536 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -40,8 +40,9 @@ #include "lpfc_sli4.h" #include "lpfc_nl.h" #include "lpfc_disc.h" -#include "lpfc_scsi.h" #include "lpfc.h" +#include "lpfc_scsi.h" +#include "lpfc_nvme.h" #include "lpfc_logmsg.h" #include "lpfc_crtn.h" #include "lpfc_version.h" @@ -453,8 +454,73 @@ lpfc_find_vport_by_did(struct lpfc_hba *phba, uint32_t did) { return NULL; } +static void +lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type) +{ + struct lpfc_nodelist *ndlp; + + if ((vport->port_type != LPFC_NPIV_PORT) || + !(vport->ct_flags & FC_CT_RFF_ID) || !vport->cfg_restrict_login) { + + ndlp = lpfc_setup_disc_node(vport, Did); + + if (ndlp && NLP_CHK_NODE_ACT(ndlp)) { + /* By default, the driver expects to support FCP FC4 */ + if (fc4_type == FC_TYPE_FCP) + ndlp->nlp_fc4_type |= NLP_FC4_FCP; + + if (fc4_type == FC_TYPE_NVME) + ndlp->nlp_fc4_type |= NLP_FC4_NVME; + + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, +"0238 Process x%06x NameServer Rsp " +"Data: x%x x%x x%x x%x\n", Did, +ndlp->nlp_flag, ndlp->nlp_fc4_type, +vport->fc_flag, +vport->fc_rscn_id_cnt); + } else + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, +"0239 Skip x%06x NameServer Rsp " +"Data: x%x x%x\n", Did, +vport->fc_flag, +vport->fc_rscn_id_cnt); + + } else { + if (!(vport->fc_flag & FC_RSCN_MODE) || + lpfc_rscn_payload_check(vport, Did)) { + /* +* This NPortID was previously a FCP target, +* Don't even bother to send GFF_ID. +*/ + ndlp = lpfc_findnode_did(vport, Did); + if (ndlp && NLP_CHK_NODE_ACT(ndlp)) + ndlp->nlp_fc4_type = fc4_type; + + if (ndlp && NLP_CHK_NODE_ACT(ndlp)) { + ndlp->nlp_fc4_type = fc4_type; + + if (ndlp->nlp_type & NLP_FCP_TARGET) + lpfc_setup_disc_node(vport, Did); + + else if (lpfc_ns_cmd(vport, SLI_CTNS_GFF_ID, +
[PATCH v2 06/18] lpfc: NVME Initiator: Base modifications Part D
NVME Initiator: Base modifications This is part D of parts A..F. Part D is the 2nd half of the mods to lpfc_init.c. This is the location of most of changes for the following: - sli3 ring vs sli4 wq splits - buffer pools are allocated/freed - sgl pools allocated/freed - adapter resources split up - queue config decided and enacted - receive buffer management This patch by itself will not result in a compilable driver. All parts A..F must be applied to create a compilable driver. * Refer to Part A for a description of base modifications Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Note: this was patch 5 in the V1 patches Address review items: Refactored a lot of queue create routines, deletion routines, etc Sync with max_hw_queues/io_channel/io_channel_irqs change drivers/scsi/lpfc/lpfc_init.c | 1366 + 1 file changed, 700 insertions(+), 666 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 516542a..ea720bc 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -7483,10 +7483,67 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba) /* Get CQ depth from module parameter, fake the default for now */ phba->sli4_hba.cq_esize = LPFC_CQE_SIZE; phba->sli4_hba.cq_ecount = LPFC_CQE_DEF_COUNT; + return 0; +} + +static int +lpfc_alloc_nvme_wq_cq(struct lpfc_hba *phba, int wqidx) +{ + struct lpfc_queue *qdesc; + int cnt; + + qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize, + phba->sli4_hba.cq_ecount); + if (!qdesc) { + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0508 Failed allocate fast-path NVME CQ (%d)\n", + wqidx); + return 1; + } + phba->sli4_hba.nvme_cq[wqidx] = qdesc; + cnt = LPFC_NVME_WQSIZE; + qdesc = lpfc_sli4_queue_alloc(phba, LPFC_WQE128_SIZE, cnt); + if (!qdesc) { + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0509 Failed allocate fast-path NVME WQ (%d)\n", + wqidx); + return 1; + } + phba->sli4_hba.nvme_wq[wqidx] = qdesc; + list_add_tail(>wq_list, >sli4_hba.lpfc_wq_list); + return 0; +} + +static int +lpfc_alloc_fcp_wq_cq(struct lpfc_hba *phba, int wqidx) +{ + struct lpfc_queue *qdesc; + uint32_t wqesize; + + /* Create Fast Path FCP CQs */ + qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize, + phba->sli4_hba.cq_ecount); + if (!qdesc) { + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0499 Failed allocate fast-path FCP CQ (%d)\n", wqidx); + return 1; + } + phba->sli4_hba.fcp_cq[wqidx] = qdesc; + + /* Create Fast Path FCP WQs */ + wqesize = (phba->fcp_embed_io) ? + LPFC_WQE128_SIZE : phba->sli4_hba.wq_esize; + qdesc = lpfc_sli4_queue_alloc(phba, wqesize, phba->sli4_hba.wq_ecount); + if (!qdesc) { + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0503 Failed allocate fast-path FCP WQ (%d)\n", + wqidx); + return 1; + } + phba->sli4_hba.fcp_wq[wqidx] = qdesc; + list_add_tail(>wq_list, >sli4_hba.lpfc_wq_list); return 0; -out_error: - return -ENOMEM; } /** @@ -7507,13 +7564,14 @@ int lpfc_sli4_queue_create(struct lpfc_hba *phba) { struct lpfc_queue *qdesc; - uint32_t wqesize; - int idx; + int idx, io_channel; /* * Create HBA Record arrays. +* Both NVME and FCP will share that same vectors / EQs */ - if (!phba->cfg_fcp_io_channel) + io_channel = phba->io_channel_irqs; + if (!io_channel) return -ERANGE; phba->sli4_hba.mq_esize = LPFC_MQE_SIZE; @@ -7522,9 +7580,14 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) phba->sli4_hba.wq_ecount = LPFC_WQE_DEF_COUNT; phba->sli4_hba.rq_esize = LPFC_RQE_SIZE; phba->sli4_hba.rq_ecount = LPFC_RQE_DEF_COUNT; + phba->sli4_hba.eq_esize = LPFC_EQE_SIZE_4B; + phba->sli4_hba.eq_ecount = LPFC_EQE_DEF_COUNT; + phba->sli4_hba.cq_esize = LPFC_CQE_SIZE; + phba->sli4_hba.cq_ecount = LPFC_CQE_DEF_COUNT; - phba->sli4_hba.hba_eq = kzalloc((sizeof(struct lpfc_queue *) * - phba->cfg_fcp_io_channel), GFP_KERNEL); + phba->sli4_hba.hba_eq = kcalloc(io_channel, + sizeof(struct lpfc_queue *), + GFP_KERNEL); if (!phba->sli4_hba.hba_eq) {
[PATCH v2 03/18] lpfc: NVME Initiator: Base modifications Part A
NVME Initiator: Base modifications This is part A of parts A..F. Part A is the bulk of the file list changed by the modifications as most mods are small-ish. Changes may be for any aspect below. This patch by itself will not result in a compilable driver. All parts A..F must be applied to create a compilable driver. * This set of patches (6 parts) adds base modifications for NVME initiator support to the lpfc driver. The base modifications consist of: - Formal split of SLI3 rings from SLI-4 WQs (sometimes referred to as rings as well) as implementation now widely varies between the two. - Addition of configuration modes: SCSI initiator only; NVME initiator only; NVME target only; and SCSI and NVME initiator. The configuration mode drives overall adapter configuration, offloads enabled, and resource splits. NVME support is only available on SLI-4 devices and newer fw. - Implements the following based on configuration mode: - Exchange resources are split by protocol; Obviously, if only 1 mode, then no split occurs. Default is 50/50. module attribute allows tuning. - Each protocol has it's own set of queues, but share interrupt vectors. SCSI: SLI3 devices have few queues and the original style of queue allocation remains. SLI4 devices piggy back on an "io-channel" concept that eventually needs to merge with scsi-mq/blk-mq support (it is underway). For now, the paradigm continues as it existed prior. io channel allocates N msix and N WQs (N=4 default) and either round robins or uses cpu # modulo N for scheduling. A bunch of module parameters allow the configuration to be tuned. NVME (initiator): Allocates an msix per cpu (or whatever pci_alloc_irq_vectors gets) Allocates a WQ per cpu, and maps the WQs to msix on a WQ # modulo msix vector count basis. Module parameters exist to cap/control the config if desired. - Each protocol has its own buffer and dma pools. Unfortunately, it was very difficult to break out the above into functional patches. A such, they are presented as a 6-patch set to keep email size reasonable. All patches in the set must be applied to create a functional unit. Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Note: this was patch 2 in the V1 patches Note: it was determined that the code base I created the patch set from missed some merges of upstream changes. As such, v1 patches reverted some of the prior patches. They were things such as: the spelling errors, checkpatch items, the rdata null checks, conversion to statics, and pci bar setup. V2 rectifies all this, so that patch deltas are only true mods. Address review items: Spelling errors, indents, typecasting void pointers, unneeded parens Created helper function for assigning the pring pointer Refactored iocb dequeue routines in lpfc_no_rpi() Reworked WQ/CQ relationship. CQs were 1:1 with EQ. Now 1:1 with WQ/MQ Convert phba->io_channel to phba->io_channel_irq Remove cfg_XXX_max_hw_queues. WQs 1:1 with CQs, thus WQ cnt described by cfg_XXX_io_channel (not CQs like it used to) Deleted lpfc_nvme_posted_buf attribute. Unnecessary (note: these changes affect later patches as well) drivers/scsi/lpfc/lpfc.h | 82 +++-- drivers/scsi/lpfc/lpfc_bsg.c | 29 -- drivers/scsi/lpfc/lpfc_crtn.h | 42 - drivers/scsi/lpfc/lpfc_disc.h | 1 + drivers/scsi/lpfc/lpfc_els.c | 38 drivers/scsi/lpfc/lpfc_hbadisc.c | 164 - drivers/scsi/lpfc/lpfc_hw.h| 5 +- drivers/scsi/lpfc/lpfc_hw4.h | 181 +++-- drivers/scsi/lpfc/lpfc_logmsg.h| 4 + drivers/scsi/lpfc/lpfc_mbox.c | 27 -- drivers/scsi/lpfc/lpfc_mem.c | 62 +++-- drivers/scsi/lpfc/lpfc_nportdisc.c | 7 +- drivers/scsi/lpfc/lpfc_nvme.h | 88 ++ drivers/scsi/lpfc/lpfc_scsi.c | 110 -- drivers/scsi/lpfc/lpfc_scsi.h | 18 ++-- drivers/scsi/lpfc/lpfc_sli.h | 37 ++-- drivers/scsi/lpfc/lpfc_sli4.h | 75 +++ drivers/scsi/lpfc/lpfc_vport.c | 3 + 18 files changed, 759 insertions(+), 214 deletions(-) create mode 100644 drivers/scsi/lpfc/lpfc_nvme.h diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 64022d7..e07686a 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -20,6 +20,7 @@ ***/ #include +#include #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_SCSI_LPFC_DEBUG_FS) #define CONFIG_SCSI_LPFC_DEBUG_FS @@ -53,6 +54,7 @@ struct lpfc_sli2_slim; #define LPFC_MAX_SG_SEG_CNT4096/* sg element count per scsi cmnd */ #define
[PATCH v2 12/18] lpfc: NVME Target: Base modifications
NVME Target: Base modifications This set of patches adds the base modifications for NVME target support to the lpfc driver. The base modifications consist of: - Additional module parameters or configuration tuning - Enablement of configuration mode for NVME target. Ties into the queueing model put into place by the initiator basemods patches. - Target-specific buffer pools, dma pools, sgl pools Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Sync with max_hw_queues/io_channel/io_channel_irqs change drivers/scsi/lpfc/lpfc.h | 5 + drivers/scsi/lpfc/lpfc_attr.c| 120 +-- drivers/scsi/lpfc/lpfc_crtn.h| 10 ++ drivers/scsi/lpfc/lpfc_debugfs.c | 7 +- drivers/scsi/lpfc/lpfc_init.c| 241 +-- drivers/scsi/lpfc/lpfc_mem.c | 167 +++ drivers/scsi/lpfc/lpfc_nvmet.h | 102 + drivers/scsi/lpfc/lpfc_sli.c | 107 - drivers/scsi/lpfc/lpfc_sli.h | 1 + drivers/scsi/lpfc/lpfc_sli4.h| 6 + 10 files changed, 746 insertions(+), 20 deletions(-) create mode 100644 drivers/scsi/lpfc/lpfc_nvmet.h diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 03e2703..c5208e2 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -741,6 +741,7 @@ struct lpfc_hba { uint8_t fcp_embed_io; uint8_t nvme_support; /* Firmware supports NVME */ uint8_t nvmet_support; /* driver supports NVMET */ +#define LPFC_NVMET_MAX_PORTS 32 uint8_t mds_diags_support; /* HBA Config Parameters */ @@ -769,6 +770,7 @@ struct lpfc_hba { uint32_t cfg_suppress_rsp; uint32_t cfg_nvme_oas; uint32_t cfg_nvme_io_channel; + uint32_t cfg_enable_nvmet; uint32_t cfg_nvme_posted_buf; uint32_t cfg_nvme_enable_fb; uint32_t cfg_total_seg_cnt; @@ -822,6 +824,7 @@ struct lpfc_hba { #define LPFC_ENABLE_NVME 2 #define LPFC_ENABLE_BOTH 3 uint32_t io_channel_irqs; /* number of irqs for io channels */ + struct nvmet_fc_target_port *targetport; lpfc_vpd_t vpd; /* vital product data */ struct pci_dev *pcidev; @@ -1097,6 +1100,8 @@ struct lpfc_hba { uint16_t cpucheck_on; #define LPFC_CHECK_OFF 0 #define LPFC_CHECK_NVME_IO 1 +#define LPFC_CHECK_NVMET_RCV 2 +#define LPFC_CHECK_NVMET_IO4 uint16_t ktime_on; uint64_t ktime_data_samples; uint64_t ktime_status_samples; diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 2fec637..8058484 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -46,6 +46,7 @@ #include "lpfc.h" #include "lpfc_scsi.h" #include "lpfc_nvme.h" +#include "lpfc_nvmet.h" #include "lpfc_logmsg.h" #include "lpfc_version.h" #include "lpfc_compat.h" @@ -139,6 +140,7 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct lpfc_vport *vport = shost_priv(shost); struct lpfc_hba *phba = vport->phba; + struct lpfc_nvmet_tgtport *tgtp; struct nvme_fc_local_port *localport; struct lpfc_nvme_lport *lport; struct lpfc_nvme_rport *rport; @@ -150,6 +152,92 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr, len += snprintf(buf, PAGE_SIZE, "NVME Disabled\n"); return len; } + if (phba->nvmet_support) { + if (!phba->targetport) { + len = snprintf(buf, PAGE_SIZE, + "NVME Target: x%llx is not allocated\n", + wwn_to_u64(vport->fc_portname.u.wwn)); + return len; + } + /* Port state is only one of two values for now. */ + if (phba->targetport->port_id) + statep = "REGISTERED"; + else + statep = "INIT"; + len += snprintf(buf + len, PAGE_SIZE - len, + "NVME Target: Enabled State %s\n", + statep); + len += snprintf(buf + len, PAGE_SIZE - len, + "%s%d WWPN x%llx WWNN x%llx DID x%06x\n", + "NVME Target: lpfc", + phba->brd_no, + wwn_to_u64(vport->fc_portname.u.wwn), + wwn_to_u64(vport->fc_nodename.u.wwn), + phba->targetport->port_id); + + len += snprintf(buf + len, PAGE_SIZE, + "\nNVME Target: Statistics\n"); + tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; + len += snprintf(buf+len,
[PATCH v2 02/18] lpfc: use pci_irq_alloc_vectors and pci_irq_free_vectors
I replaced the v1 patch with Christoph's original james From: Christoph HellwigThis avoids having to store the msix_entries array and simpliefies the shutdown and cleanup path a lot. Signed-off-by: Christoph Hellwig Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 2 - drivers/scsi/lpfc/lpfc_init.c | 240 ++ drivers/scsi/lpfc/lpfc_sli4.h | 1 - 3 files changed, 54 insertions(+), 189 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 6593b07..64022d7 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -878,8 +878,6 @@ struct lpfc_hba { enum intr_type_t intr_type; uint32_t intr_mode; #define LPFC_INTR_ERROR0x - struct msix_entry msix_entries[LPFC_MSIX_VECTORS]; - struct list_head port_list; struct lpfc_vport *pport; /* physical lpfc_vport pointer */ uint16_t max_vpi; /* Maximum virtual nports */ diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 4776fd8..c4e8fad 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -5510,17 +5510,6 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) goto out_free_fcf_rr_bmask; } - phba->sli4_hba.msix_entries = kzalloc((sizeof(struct msix_entry) * - (fof_vectors + - phba->cfg_fcp_io_channel)), GFP_KERNEL); - if (!phba->sli4_hba.msix_entries) { - lpfc_printf_log(phba, KERN_ERR, LOG_INIT, - "2573 Failed allocate memory for msi-x " - "interrupt vector entries\n"); - rc = -ENOMEM; - goto out_free_fcp_eq_hdl; - } - phba->sli4_hba.cpu_map = kzalloc((sizeof(struct lpfc_vector_map_info) * phba->sli4_hba.num_present_cpu), GFP_KERNEL); @@ -5529,7 +5518,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) "3327 Failed allocate memory for msi-x " "interrupt vector mapping\n"); rc = -ENOMEM; - goto out_free_msix; + goto out_free_fcp_eq_hdl; } if (lpfc_used_cpu == NULL) { lpfc_used_cpu = kzalloc((sizeof(uint16_t) * lpfc_present_cpu), @@ -5540,7 +5529,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) "interrupt vector mapping\n"); kfree(phba->sli4_hba.cpu_map); rc = -ENOMEM; - goto out_free_msix; + goto out_free_fcp_eq_hdl; } for (i = 0; i < lpfc_present_cpu; i++) lpfc_used_cpu[i] = LPFC_VECTOR_MAP_EMPTY; @@ -5575,8 +5564,6 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) return 0; -out_free_msix: - kfree(phba->sli4_hba.msix_entries); out_free_fcp_eq_hdl: kfree(phba->sli4_hba.fcp_eq_hdl); out_free_fcf_rr_bmask: @@ -5612,9 +5599,6 @@ lpfc_sli4_driver_resource_unset(struct lpfc_hba *phba) phba->sli4_hba.num_online_cpu = 0; phba->sli4_hba.curr_disp_cpu = 0; - /* Free memory allocated for msi-x interrupt vector entries */ - kfree(phba->sli4_hba.msix_entries); - /* Free memory allocated for fast-path work queue handles */ kfree(phba->sli4_hba.fcp_eq_hdl); @@ -8485,16 +8469,7 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba) * @phba: pointer to lpfc hba data structure. * * This routine is invoked to enable the MSI-X interrupt vectors to device - * with SLI-3 interface specs. The kernel function pci_enable_msix_exact() - * is called to enable the MSI-X vectors. Note that pci_enable_msix_exact(), - * once invoked, enables either all or nothing, depending on the current - * availability of PCI vector resources. The device driver is responsible - * for calling the individual request_irq() to register each MSI-X vector - * with a interrupt handler, which is done in this function. Note that - * later when device is unloading, the driver should always call free_irq() - * on all MSI-X vectors it has done request_irq() on before calling - * pci_disable_msix(). Failure to do so results in a BUG_ON() and a device - * will be left with MSI-X enabled and leaks its vectors. + * with SLI-3 interface specs. * * Return codes * 0 - successful @@ -8503,33 +8478,24 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba) static int lpfc_sli_enable_msix(struct lpfc_hba *phba) { - int rc, i; + int rc; LPFC_MBOXQ_t *pmb; /* Set up MSI-X multi-message vectors */ - for (i = 0; i < LPFC_MSIX_VECTORS; i++) -
[PATCH v2 04/18] lpfc: NVME Initiator: Base modifications Part B
NVME Initiator: Base modifications This is part B of parts A..F. Part B is limited to lpfc_attr.c: lpfc attribute modifications This patch by itself will not result in a compilable driver. All parts A..F must be applied to create a compilable driver. * Refer to Part A for a description of base modifications Signed-off-by: Dick KennedySigned-off-by: James Smart --- Modifications in V2: Note: this was patch 3 in the V1 patches Address review items: Correct typecast of void ptr assignment Sync with max_hw_queues/io_channel/io_channel_irqs change drivers/scsi/lpfc/lpfc_attr.c | 390 +- 1 file changed, 347 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 50cf402..2fec637 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -35,14 +35,17 @@ #include #include +#include + #include "lpfc_hw4.h" #include "lpfc_hw.h" #include "lpfc_sli.h" #include "lpfc_sli4.h" #include "lpfc_nl.h" #include "lpfc_disc.h" -#include "lpfc_scsi.h" #include "lpfc.h" +#include "lpfc_scsi.h" +#include "lpfc_nvme.h" #include "lpfc_logmsg.h" #include "lpfc_version.h" #include "lpfc_compat.h" @@ -50,9 +53,9 @@ #include "lpfc_vport.h" #include "lpfc_attr.h" -#define LPFC_DEF_DEVLOSS_TMO 30 -#define LPFC_MIN_DEVLOSS_TMO 1 -#define LPFC_MAX_DEVLOSS_TMO 255 +#define LPFC_DEF_DEVLOSS_TMO 30 +#define LPFC_MIN_DEVLOSS_TMO 1 +#define LPFC_MAX_DEVLOSS_TMO 255 /* * Write key size should be multiple of 4. If write key is changed @@ -130,6 +133,124 @@ lpfc_enable_fip_show(struct device *dev, struct device_attribute *attr, } static ssize_t +lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct Scsi_Host *shost = class_to_shost(dev); + struct lpfc_vport *vport = shost_priv(shost); + struct lpfc_hba *phba = vport->phba; + struct nvme_fc_local_port *localport; + struct lpfc_nvme_lport *lport; + struct lpfc_nvme_rport *rport; + struct nvme_fc_remote_port *nrport; + char *statep; + int len = 0; + + if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) { + len += snprintf(buf, PAGE_SIZE, "NVME Disabled\n"); + return len; + } + + localport = vport->localport; + if (!localport) { + len = snprintf(buf, PAGE_SIZE, + "NVME Initiator x%llx is not allocated\n", + wwn_to_u64(vport->fc_portname.u.wwn)); + return len; + } + len = snprintf(buf, PAGE_SIZE, "NVME Initiator Enabled\n"); + + spin_lock_irq(shost->host_lock); + lport = (struct lpfc_nvme_lport *)localport->private; + + /* Port state is only one of two values for now. */ + if (localport->port_id) + statep = "ONLINE"; + else + statep = "UNKNOWN "; + + len += snprintf(buf + len, PAGE_SIZE - len, + "%s%d WWPN x%llx WWNN x%llx DID x%06x %s\n", + "NVME LPORT lpfc", + phba->brd_no, + wwn_to_u64(vport->fc_portname.u.wwn), + wwn_to_u64(vport->fc_nodename.u.wwn), + localport->port_id, statep); + + list_for_each_entry(rport, >rport_list, list) { + /* local short-hand pointer. */ + nrport = rport->remoteport; + + /* Port state is only one of two values for now. */ + switch (nrport->port_state) { + case FC_OBJSTATE_ONLINE: + statep = "ONLINE"; + break; + case FC_OBJSTATE_UNKNOWN: + statep = "UNKNOWN "; + break; + default: + statep = "UNSUPPORTED"; + break; + } + + /* Tab in to show lport ownership. */ + len += snprintf(buf + len, PAGE_SIZE - len, + "NVME RPORT "); + if (phba->brd_no >= 10) + len += snprintf(buf + len, PAGE_SIZE - len, " "); + + len += snprintf(buf + len, PAGE_SIZE - len, "WWPN x%llx ", + nrport->port_name); + len += snprintf(buf + len, PAGE_SIZE - len, "WWNN x%llx ", + nrport->node_name); + len += snprintf(buf + len, PAGE_SIZE - len, "DID x%06x ", + nrport->port_id); + + switch (nrport->port_role) { + case FC_PORT_ROLE_NVME_INITIATOR: + len += snprintf(buf + len, PAGE_SIZE - len, +"INITIATOR "); + break; + case
[PATCH v2 01/18] lpfc: Correct WQ creation for pagesize
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 KennedySigned-off-by: James Smart --- Note: this patch was not in v1 drivers/scsi/lpfc/lpfc_hw4.h | 2 ++ drivers/scsi/lpfc/lpfc_sli.c | 9 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 5646699..964a1fd 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h @@ -1186,6 +1186,7 @@ struct lpfc_mbx_wq_create { #define lpfc_mbx_wq_create_page_size_SHIFT 0 #define lpfc_mbx_wq_create_page_size_MASK 0x00FF #define lpfc_mbx_wq_create_page_size_WORD word1 +#define LPFC_WQ_PAGE_SIZE_4096 0x1 #define lpfc_mbx_wq_create_wqe_size_SHIFT 8 #define lpfc_mbx_wq_create_wqe_size_MASK 0x000F #define lpfc_mbx_wq_create_wqe_size_WORD word1 @@ -1257,6 +1258,7 @@ struct rq_context { #define lpfc_rq_context_page_size_SHIFT0 /* Version 1 Only */ #define lpfc_rq_context_page_size_MASK 0x00FF #define lpfc_rq_context_page_size_WORD word0 +#defineLPFC_RQ_PAGE_SIZE_4096 0x1 uint32_t reserved1; uint32_t word2; #define lpfc_rq_context_cq_id_SHIFT16 diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 3a8470d..dbe9cb1 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -13715,7 +13715,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, LPFC_WQ_WQE_SIZE_128); bf_set(lpfc_mbx_wq_create_page_size, _create->u.request_1, - (PAGE_SIZE/SLI4_PAGE_SIZE)); + LPFC_WQ_PAGE_SIZE_4096); page = wq_create->u.request_1.page; break; } @@ -13741,8 +13741,9 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, LPFC_WQ_WQE_SIZE_128); break; } - bf_set(lpfc_mbx_wq_create_page_size, _create->u.request_1, - (PAGE_SIZE/SLI4_PAGE_SIZE)); + bf_set(lpfc_mbx_wq_create_page_size, + _create->u.request_1, + LPFC_WQ_PAGE_SIZE_4096); page = wq_create->u.request_1.page; break; default: @@ -13928,7 +13929,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, LPFC_RQE_SIZE_8); bf_set(lpfc_rq_context_page_size, _create->u.request.context, - (PAGE_SIZE/SLI4_PAGE_SIZE)); + LPFC_RQ_PAGE_SIZE_4096); } else { switch (hrq->entry_count) { default: -- 2.5.0
[PATCH v2 00/18] lpfc: Add NVME Fabrics support (11.2.0.7)
This patch set add support for NVME over Fabrics FC transport. The internals of the driver are reworked to support being either: a SCSI initiator; a NVME intiator; both a SCSI initiator and a NVME initiator; or a NVME target. More background on the internals is given in patch 3 - for the nvme initiator base modifications. The driver effectively has parallel NVME and SCSI stacks that utilize their own set of resources. They intersect only at the hardware level, mainly in the interrupt handling. A few new files are added to support the interfaces of the FC transport LLDD api for NVME fabrics. The patches were cut against 2/3 scsi.git tree, misc branch. ** THEY ARE INTENDED FOR THE SCSI.GIT TREE, MISC BRANCH ** Note: The lpfc version in the linux-block.git tree is rather old. I have a recipe for how to get it to a version that syncs with the scsi.git/misc tree so that these patches can apply there as well. Contact me if you would like it. -- james James Smart (18): lpfc: Correct WQ creation for pagesize Christophs patch 2 lpfc: NVME Initiator: Base modifications Part A lpfc: NVME Initiator: Base modifications Part B lpfc: NVME Initiator: Base modifications Part C lpfc: NVME Initiator: Base modifications Part D lpfc: NVME Initiator: Base modifications Part E lpfc: NVME Initiator: Base modifications Part F lpfc: NVME Initiator: Merge into FC discovery lpfc: NVME Initiator: bind to nvme_fc api lpfc: NVME Initiator: Add debugfs support lpfc: NVME Target: Base modifications lpfc: NVME Target: Receive buffer updates lpfc: NVME Target: Merge into FC discovery lpfc: NVME Target: bind to nvmet_fc api lpfc: NVME Target: Add debugfs support lpfc: Update copyrights lpfc: Update lpfc version to 11.2.0.7 drivers/scsi/lpfc/Makefile | 11 +- drivers/scsi/lpfc/lpfc.h | 155 +- drivers/scsi/lpfc/lpfc_attr.c | 567 ++- drivers/scsi/lpfc/lpfc_attr.h |4 +- drivers/scsi/lpfc/lpfc_bsg.c | 33 +- drivers/scsi/lpfc/lpfc_bsg.h |6 +- drivers/scsi/lpfc/lpfc_compat.h|4 +- drivers/scsi/lpfc/lpfc_crtn.h | 74 +- drivers/scsi/lpfc/lpfc_ct.c| 388 +++-- drivers/scsi/lpfc/lpfc_debugfs.c | 1919 +--- drivers/scsi/lpfc/lpfc_debugfs.h | 275 ++-- drivers/scsi/lpfc/lpfc_disc.h | 24 +- drivers/scsi/lpfc/lpfc_els.c | 334 - drivers/scsi/lpfc/lpfc_hbadisc.c | 363 +++-- drivers/scsi/lpfc/lpfc_hw.h| 84 +- drivers/scsi/lpfc/lpfc_hw4.h | 506 ++- drivers/scsi/lpfc/lpfc_ids.h |4 +- drivers/scsi/lpfc/lpfc_init.c | 2919 +--- drivers/scsi/lpfc/lpfc_logmsg.h|8 +- drivers/scsi/lpfc/lpfc_mbox.c | 116 +- drivers/scsi/lpfc/lpfc_mem.c | 278 +++- drivers/scsi/lpfc/lpfc_nl.h|4 +- drivers/scsi/lpfc/lpfc_nportdisc.c | 238 ++- drivers/scsi/lpfc/lpfc_nvme.c | 2384 + drivers/scsi/lpfc/lpfc_nvme.h | 103 ++ drivers/scsi/lpfc/lpfc_nvmet.c | 1948 drivers/scsi/lpfc/lpfc_nvmet.h | 117 ++ drivers/scsi/lpfc/lpfc_scsi.c | 114 +- drivers/scsi/lpfc/lpfc_scsi.h | 22 +- drivers/scsi/lpfc/lpfc_sli.c | 2210 +-- drivers/scsi/lpfc/lpfc_sli.h | 42 +- drivers/scsi/lpfc/lpfc_sli4.h | 98 +- drivers/scsi/lpfc/lpfc_version.h | 10 +- drivers/scsi/lpfc/lpfc_vport.c | 21 +- drivers/scsi/lpfc/lpfc_vport.h |4 +- 35 files changed, 12588 insertions(+), 2799 deletions(-) create mode 100644 drivers/scsi/lpfc/lpfc_nvme.c create mode 100644 drivers/scsi/lpfc/lpfc_nvme.h create mode 100644 drivers/scsi/lpfc/lpfc_nvmet.c create mode 100644 drivers/scsi/lpfc/lpfc_nvmet.h -- 2.5.0
Re: [PATCH 3.10 141/319] scsi: mpt3sas: Fix secure erase premature termination
Hi Sathya, On Mon, Feb 06, 2017 at 09:21:44AM -0700, Sathya Prakash Veerichetty wrote: > Willy, > I think this patch had a problem and later modified to a different > blocking mechanism. Could you please pull in the latest change for this? Much appreciated, thanks. I've checked and found the patch you're talking about : commit ffb58456589443ca572221fabbdef3db8483a779 Author: James BottomleyDate: Sun Jan 1 09:39:24 2017 -0800 scsi: mpt3sas: fix hang on ata passthrough commands mpt3sas has a firmware failure where it can only handle one pass through ATA command at a time. If another comes in, contrary to the SAT standard, it will hang until the first one completes (causing long commands like secure erase to timeout). The original fix was to block the device when an ATA command came in, but this caused a regression with commit 669f044170d8933c3d66d231b69ea97cb8447338 Author: Bart Van Assche Date: Tue Nov 22 16:17:13 2016 -0800 scsi: srp_transport: Move queuecommand() wait code to SCSI core So fix the original fix of the secure erase timeout by properly returning SAM_STAT_BUSY like the SAT recommends. The original patch also had a concurrency problem since scsih_qcmd is lockless at that point (this is fixed by using atomic bitops to set and test the flag). [mkp: addressed feedback wrt. test_bit and fixed whitespace] Fixes: 18f6084a989ba1b (mpt3sas: Fix secure erase premature termination) Signed-off-by: James Bottomley Acked-by: Sreekanth Reddy Reviewed-by: Christoph Hellwig Reported-by: Ingo Molnar Tested-by: Ingo Molnar Signed-off-by: Martin K. Petersen We don't have the referenced commit above in 3.10 so we should be safe. Additionally I checked that neither 4.4 nor 3.12 have them either, so that makes me feel confident that we can skip it in 3.10 as well. Thanks! Willy
Re: [PATCHv1] net-next: treewide use is_vlan_dev() helper function.
From: Parav PanditDate: Sat, 4 Feb 2017 11:00:49 -0600 > This patch makes use of is_vlan_dev() function instead of flag > comparison which is exactly done by is_vlan_dev() helper function. > > Signed-off-by: Parav Pandit > Reviewed-by: Daniel Jurgens Applied.
RE: [PATCHv1] net-next: treewide use is_vlan_dev() helper function.
> -Original Message- > From: Parav Pandit [mailto:pa...@mellanox.com] > Sent: Saturday, February 4, 2017 12:01 PM > To: dledf...@redhat.com; Sean Hefty; > hal.rosenst...@gmail.com; mo...@mellanox.com; sant...@chelsio.com; > ganes...@chelsio.com; manish.cho...@cavium.com; rahul.ve...@cavium.com; > dept-gelinuxnic...@cavium.com; harish.pa...@cavium.com; KY Srinivasan > ; Haiyang Zhang ; Stephen > Hemminger ; qlogic-storage-upstr...@qlogic.com; > j...@linux.vnet.ibm.com; martin.peter...@oracle.com; j...@kernel.org; > arvid.bro...@alten.se; da...@davemloft.net; l...@kernel.org; > s...@grimberg.me; sw...@opengridcomputing.com; > bart.vanass...@sandisk.com; va...@mellanox.com; a...@arndb.de; > weiyj...@gmail.com; jmaxwel...@gmail.com; va...@chelsio.com; > jb...@redhat.com; linux-r...@vger.kernel.org; net...@vger.kernel.org; > de...@linuxdriverproject.org; linux-scsi@vger.kernel.org; fcoe- > de...@open-fcoe.org > Cc: Parav Pandit > Subject: [PATCHv1] net-next: treewide use is_vlan_dev() helper function. > > This patch makes use of is_vlan_dev() function instead of flag > comparison which is exactly done by is_vlan_dev() helper function. > > Signed-off-by: Parav Pandit > Reviewed-by: Daniel Jurgens For drivers/net/hyperv/netvsc_drv.c Acked-by: Haiyang Zhang Thanks.
Re: [PATCH V3 2/2] qedf: Add QLogic FastLinQ offload FCoE driver framework.
On Mon, 6 Feb 2017, 3:56pm -, Hannes Reinecke wrote: > On 02/03/2017 08:17 PM, Dupuis, Chad wrote: > > From: "Dupuis, Chad"> > > > The QLogic FastLinQ Driver for FCoE (qedf) is the FCoE specific module for > > 41000 > > Series Converged Network Adapters by QLogic. This patch consists of > > following > > changes: > > > > - MAINTAINERS Makefile and Kconfig changes for qedf > > - PCI driver registration > > - libfc/fcoe host level initialization > > - SCSI host template initialization and callbacks > > - Debugfs and log level infrastructure > > - Link handling > > - Firmware interface structures > > - QED core module initialization > > - Light L2 interface callbacks > > - I/O request initialization > > - Firmware I/O completion handling > > - Firmware ELS request/response handling > > - FIP request/response handled by the driver itself > > > > Signed-off-by: Nilesh Javali > > Signed-off-by: Manish Rangankar > > Signed-off-by: Saurav Kashyap > > Signed-off-by: Arun Easi > > Signed-off-by: Chad Dupuis > > --- > [ .. ] > > +static void qedf_process_l2_frame_compl(struct qedf_rport *fcport, > > + unsigned char *buf, > > + u32 frame_len, u16 l2_oxid) > > +{ > > + struct fc_lport *lport = fcport->qedf->lport; > > + struct fc_frame_header *fh; > > + struct fc_frame *fp; > > + u32 payload_len; > > + u32 crc; > > + > > + payload_len = frame_len - sizeof(struct fc_frame_header); > > + > > + fp = fc_frame_alloc(lport, payload_len); > > + if (!fp) { > > + QEDF_ERR(&(fcport->qedf->dbg_ctx), > > + "fc_frame_alloc failure.\n"); > > + return; > > + } > > + > > + /* Copy FC Frame header and payload into the frame */ > > + fh = (struct fc_frame_header *)fc_frame_header_get(fp); > > + memcpy(fh, buf, frame_len); > > + > > + /* Set the OXID we return to what libfc used */ > > + if (l2_oxid != FC_XID_UNKNOWN) > > + fh->fh_ox_id = htons(l2_oxid); > > + > > + /* Setup header fields */ > > + fh->fh_r_ctl = FC_RCTL_ELS_REP; > > + fh->fh_type = FC_TYPE_ELS; > > + /* Last sequence, end sequence */ > > + fh->fh_f_ctl[0] = 0x98; > > + hton24(fh->fh_d_id, lport->port_id); > > + hton24(fh->fh_s_id, fcport->rdata->ids.port_id); > > + fh->fh_rx_id = 0x; > > + > > + /* Set frame attributes */ > > + crc = fcoe_fc_crc(fp); > > + fc_frame_init(fp); > > + fr_dev(fp) = lport; > > + fr_sof(fp) = FC_SOF_I3; > > + fr_eof(fp) = FC_EOF_T; > > + fr_crc(fp) = cpu_to_le32(~crc); > > + > > + /* Send completed request to libfc */ > > + fc_exch_recv(lport, fp); > > +} > > + > > +/* > > + * In instances where an ELS command times out we may need to restart the > > + * rport by logging out and then logging back in. > > + */ > > +void qedf_restart_rport(struct qedf_rport *fcport) > > +{ > > + struct fc_lport *lport; > > + struct fc_rport_priv *rdata; > > + u32 port_id; > > + > > + if (!fcport) > > + return; > > + > > + rdata = fcport->rdata; > > + if (rdata) { > > + lport = fcport->qedf->lport; > > + port_id = rdata->ids.port_id; > > + QEDF_ERR(&(fcport->qedf->dbg_ctx), > > + "LOGO port_id=%x.\n", port_id); > > + fc_rport_logoff(rdata); > > + /* Recreate the rport and log back in */ > > + rdata = fc_rport_create(lport, port_id); > > + if (rdata) > > + fc_rport_login(rdata); > > + } > > +} > > + > > +static void qedf_l2_els_compl(struct qedf_els_cb_arg *cb_arg) > > +{ > > + struct qedf_ioreq *els_req; > > + struct qedf_rport *fcport; > > + struct qedf_mp_req *mp_req; > > + struct fc_frame_header *fc_hdr; > > + unsigned char *buf; > > + void *resp_buf; > > + u32 resp_len, hdr_len; > > + u16 l2_oxid; > > + int frame_len; > > + > > + l2_oxid = cb_arg->l2_oxid; > > + els_req = cb_arg->io_req; > > + > > + if (!els_req) { > > + QEDF_ERR(NULL, "els_req is NULL.\n"); > > + goto free_arg; > > + } > > + > > + /* > > +* If we are flushing the command just free the cb_arg as none of the > > +* response data will be valid. > > +*/ > > + if (els_req->event == QEDF_IOREQ_EV_ELS_FLUSH) > > + goto free_arg; > > + > > + fcport = els_req->fcport; > > + mp_req = &(els_req->mp_req); > > + fc_hdr = &(mp_req->resp_fc_hdr); > > + resp_len = mp_req->resp_len; > > + resp_buf = mp_req->resp_buf; > > + > > + /* > > +* If a middle path ELS command times out, don't try to return > > +* the command but rather do any internal cleanup and then libfc > > +* timeout the command and clean up its internal resources. > > +*/ > > + if (els_req->event == QEDF_IOREQ_EV_ELS_TMO) { > > + /* > > +* If ADISC times
Re: [PATCH 1/1] iscsi: fix regression caused by session lock patch
Hey Chris and Guilherme, I'm indeed not responsive under this email address. Thanks for the testing, looks like you have the magic target to reproduce this. I think this verifies what Mike's idea of what was going wrong, and we're way overdue to get this fixed upstream. Thanks to IBM for pushing this, I don't think any major distro is shipping this patch and we don't want to keep having to back it out. The options look like 1) back out the session lock changes that split it into two locks 2) add in the additional locking from this test patch 3) some other fix for the issue of targets that complete tasks oddly I'm leaning to #1, as I don't want to keep adding more locks for this. Thanks Chris! IIRC, the lock changes from Shlomo/Or are not on RHEL, SLES and Ubuntu anymore, as you mentioned. We requested them to revert the patch, and it was accepted. On the other hand, your patch is great and a cool fix to this. If we have any good numbers and/or reasons to keep their patch, guess the alternative #2 is cool too. I can perform more testing if you plan to send this (or similar) patch to iscsi list. Sagi, Or, Shlomo? You pushed to keep this from being backed out before. Here's your cause, any better ideas on fixing it? I also tried to go back in the mailing list archives, but I don't see any real numbers for the performance gains. I'll loop Sagi here based on the email I see he's using on NVMe list currently - seems it's different from the one showed in the header of this message. IIRC, this was brought up more than two years ago? it's been a while now. The motivation for the fined grained locking from Shlomo was designed to address the submission/completion inter-locking scheme that was not needed for iser. In iser, task completions are triggered from soft-irq only for task responses, the data-transfer is driven in HW, so we don't need the inter-locking between submissions and task management or error handling. My recollection is that this scheme solved a contention point we had back then, if I'm not mistaken it was as much as 50% improvement in IOPs scalability in some scenarios. Now, this was all pre block-mq. So I think the correct solution for iscsi (iser, tcp and offloads) is to use block-mq facilities for task pre-allocations (scsi host tagset) and have iscsi tcp take care of it's own locking instead of imposing it inherently in libiscsi. We can have LOGIN, LOGOUT, NOOP_OUT, TEXT, TMR as reserved tags, and queue_depth with max session cmds. I had a prototype for that back when I experimented with scsi-mq conversion (way back...), but kinda got stuck with trying to figure out how to convert the offload drivers qla4xxx, bnx2i and cxgbi which seemed to rely heavily on on the task pools. If people are more interested in improving iscsi locking schemes we can discuss on approaches for it.
Re: [PATCH 1/1] iscsi: fix regression caused by session lock patch
On 06/02/2017 15:27, Chris Leech wrote: > - Original Message - >> On 09/11/2016 03:21, Chris Leech wrote: >>> On Mon, Nov 07, 2016 at 04:23:10PM -0200, Guilherme G. Piccoli wrote: Sure! Count on us to test any patches. I guess the first step is to reproduce on upstream right? We haven't tested specifically this scenario for long time. Will try to reproduce on 4.9-rc4 and update here. >>> >>> Great, I'm looking forward to hearing the result. >>> >>> Assuming it reproduces, I don't think this level of fine grained locking >>> is necessarily the best solution, but it may help confirm the problem. >>> Especially if the WARN_ONCE I slipped in here triggers. >> >> Chris, sorry for my huge delay. >> Finally I was able to perform tests and I have good news - seems your >> patch below fixed the issue. > > Thanks for the testing, looks like you have the magic target to reproduce > this. > > I think this verifies what Mike's idea of what was going wrong, and we're way > overdue to get this fixed upstream. Thanks to IBM for pushing this, I don't > think any major distro is shipping this patch and we don't want to keep > having to back it out. > > The options look like > 1) back out the session lock changes that split it into two locks > 2) add in the additional locking from this test patch > 3) some other fix for the issue of targets that complete tasks oddly > > I'm leaning to #1, as I don't want to keep adding more locks for this. Thanks Chris! IIRC, the lock changes from Shlomo/Or are not on RHEL, SLES and Ubuntu anymore, as you mentioned. We requested them to revert the patch, and it was accepted. On the other hand, your patch is great and a cool fix to this. If we have any good numbers and/or reasons to keep their patch, guess the alternative #2 is cool too. I can perform more testing if you plan to send this (or similar) patch to iscsi list. > Sagi, Or, Shlomo? You pushed to keep this from being backed out before. > Here's your cause, any better ideas on fixing it? I also tried to go back in > the mailing list archives, but I don't see any real numbers for the > performance gains. I'll loop Sagi here based on the email I see he's using on NVMe list currently - seems it's different from the one showed in the header of this message. Thanks, Guilherme > > - Chris > >> Firstly, I was able to reproduce with kernel 4.10-rc6. See the file >> repro.out - it's a dump from xmon, the kernel debugger from PowerPC. >> With this tool we can dump the exception details, registers, PACA >> (Processor Address Communication Area, ppc specific structure) and >> dmesg. It took me less than 15 minutes to reproduce. >> >> Then, I applied your patch on the top of this kernel and the benchmark >> was able to successfully complete, in about 3 hours. We can see the >> WARN() you added was reached, the attached file dmesg-cleech_patch shows >> the kernel log with your patch. >> >> The workload was FIO benchmark doing both reads and writes to the remote >> storage via iSCSI, connected over ethernet direct cabling (10Gb speed). >> Distro was Ubuntu 16.04.1 . >> >> Any more tests or info you need, please let me know! >> Cheers, >> >> >> Guilherme >> >> >>> - Chris >>> >>> --- >>> >>> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c >>> index f9b6fba..fbd18ab 100644 >>> --- a/drivers/scsi/libiscsi.c >>> +++ b/drivers/scsi/libiscsi.c >>> @@ -560,8 +560,12 @@ static void iscsi_complete_task(struct iscsi_task >>> *task, int state) >>> WARN_ON_ONCE(task->state == ISCSI_TASK_FREE); >>> task->state = state; >>> >>> - if (!list_empty(>running)) >>> + spin_lock_bh(>taskqueuelock); >>> + if (!list_empty(>running)) { >>> + WARN_ONCE(1, "iscsi_complete_task while task on list"); >>> list_del_init(>running); >>> + } >>> + spin_unlock_bh(>taskqueuelock); >>> >>> if (conn->task == task) >>> conn->task = NULL; >>> @@ -783,7 +787,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct >>> iscsi_hdr *hdr, >>> if (session->tt->xmit_task(task)) >>> goto free_task; >>> } else { >>> + spin_lock_bh(>taskqueuelock); >>> list_add_tail(>running, >mgmtqueue); >>> + spin_unlock_bh(>taskqueuelock); >>> iscsi_conn_queue_work(conn); >>> } >>> >>> @@ -1474,8 +1480,10 @@ void iscsi_requeue_task(struct iscsi_task *task) >>> * this may be on the requeue list already if the xmit_task callout >>> * is handling the r2ts while we are adding new ones >>> */ >>> + spin_lock_bh(>taskqueuelock); >>> if (list_empty(>running)) >>> list_add_tail(>running, >requeue); >>> + spin_unlock_bh(>taskqueuelock); >>> iscsi_conn_queue_work(conn); >>> } >>> EXPORT_SYMBOL_GPL(iscsi_requeue_task); >>> @@ -1512,22 +1520,26 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) >>> * only have one nop-out as a ping from us and targets should not
Re: [bug report] qla2xxx: Add framework for async fabric discovery
Dan, Will take a look and submit patch to remove warning. Thanks. Regards, Quinn Tran -Original Message- From: Dan CarpenterDate: Monday, February 6, 2017 at 3:37 AM To: "Tran, Quinn" Cc: "linux-scsi@vger.kernel.org" Subject: [bug report] qla2xxx: Add framework for async fabric discovery Hello Quinn Tran, The patch b79414ee4988: "qla2xxx: Add framework for async fabric discovery" from Jan 19, 2017, leads to the following static checker warning: drivers/scsi/qla2xxx/qla_init.c:3910 qla2x00_alloc_fcport() warn: use 'flags' here instead of GFP_XXX? drivers/scsi/qla2xxx/qla_init.c 3894 fc_port_t * 3895 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) 3896 { 3897 fc_port_t *fcport; 3898 3899 fcport = kzalloc(sizeof(fc_port_t), flags); In pratice "flags" is always GFP_KERNEL. 3900 if (!fcport) 3901 return NULL; 3902 3903 /* Setup fcport template structure. */ 3904 fcport->vha = vha; 3905 fcport->port_type = FCT_UNKNOWN; 3906 fcport->loop_id = FC_NO_LOOP_ID; 3907 qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED); 3908 fcport->supported_classes = FC_COS_UNSPECIFIED; 3909 3910 fcport->ct_desc.ct_sns = dma_alloc_coherent(>hw->pdev->dev, 3911 sizeof(struct ct_sns_pkt), >ct_desc.ct_sns_dma, 3912 GFP_ATOMIC); There isn't an obvious reason why GFP_ATOMIC is required here. 3913 fcport->disc_state = DSC_DELETED; 3914 fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; 3915 fcport->deleted = QLA_SESS_DELETED; 3916 fcport->login_retry = vha->hw->login_retry_count; 3917 fcport->login_retry = 5; 3918 fcport->logout_on_delete = 1; 3919 3920 if (!fcport->ct_desc.ct_sns) { 3921 ql_log(ql_log_warn, vha, 0x, 3922 "Failed to allocate ct_sns request.\n"); 3923 kfree(fcport); 3924 fcport = NULL; 3925 } 3926 INIT_WORK(>del_work, qla24xx_delete_sess_fn); 3927 INIT_LIST_HEAD(>gnl_entry); 3928 INIT_LIST_HEAD(>list); 3929 3930 return fcport; 3931 } regards, dan carpenter
Re: [PATCH 1/1] iscsi: fix regression caused by session lock patch
- Original Message - > On 09/11/2016 03:21, Chris Leech wrote: > > On Mon, Nov 07, 2016 at 04:23:10PM -0200, Guilherme G. Piccoli wrote: > >> > >> Sure! Count on us to test any patches. I guess the first step is to > >> reproduce on upstream right? We haven't tested specifically this > >> scenario for long time. Will try to reproduce on 4.9-rc4 and update here. > > > > Great, I'm looking forward to hearing the result. > > > > Assuming it reproduces, I don't think this level of fine grained locking > > is necessarily the best solution, but it may help confirm the problem. > > Especially if the WARN_ONCE I slipped in here triggers. > > Chris, sorry for my huge delay. > Finally I was able to perform tests and I have good news - seems your > patch below fixed the issue. Thanks for the testing, looks like you have the magic target to reproduce this. I think this verifies what Mike's idea of what was going wrong, and we're way overdue to get this fixed upstream. Thanks to IBM for pushing this, I don't think any major distro is shipping this patch and we don't want to keep having to back it out. The options look like 1) back out the session lock changes that split it into two locks 2) add in the additional locking from this test patch 3) some other fix for the issue of targets that complete tasks oddly I'm leaning to #1, as I don't want to keep adding more locks for this. Sagi, Or, Shlomo? You pushed to keep this from being backed out before. Here's your cause, any better ideas on fixing it? I also tried to go back in the mailing list archives, but I don't see any real numbers for the performance gains. - Chris > Firstly, I was able to reproduce with kernel 4.10-rc6. See the file > repro.out - it's a dump from xmon, the kernel debugger from PowerPC. > With this tool we can dump the exception details, registers, PACA > (Processor Address Communication Area, ppc specific structure) and > dmesg. It took me less than 15 minutes to reproduce. > > Then, I applied your patch on the top of this kernel and the benchmark > was able to successfully complete, in about 3 hours. We can see the > WARN() you added was reached, the attached file dmesg-cleech_patch shows > the kernel log with your patch. > > The workload was FIO benchmark doing both reads and writes to the remote > storage via iSCSI, connected over ethernet direct cabling (10Gb speed). > Distro was Ubuntu 16.04.1 . > > Any more tests or info you need, please let me know! > Cheers, > > > Guilherme > > > > - Chris > > > > --- > > > > diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c > > index f9b6fba..fbd18ab 100644 > > --- a/drivers/scsi/libiscsi.c > > +++ b/drivers/scsi/libiscsi.c > > @@ -560,8 +560,12 @@ static void iscsi_complete_task(struct iscsi_task > > *task, int state) > > WARN_ON_ONCE(task->state == ISCSI_TASK_FREE); > > task->state = state; > > > > - if (!list_empty(>running)) > > + spin_lock_bh(>taskqueuelock); > > + if (!list_empty(>running)) { > > + WARN_ONCE(1, "iscsi_complete_task while task on list"); > > list_del_init(>running); > > + } > > + spin_unlock_bh(>taskqueuelock); > > > > if (conn->task == task) > > conn->task = NULL; > > @@ -783,7 +787,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct > > iscsi_hdr *hdr, > > if (session->tt->xmit_task(task)) > > goto free_task; > > } else { > > + spin_lock_bh(>taskqueuelock); > > list_add_tail(>running, >mgmtqueue); > > + spin_unlock_bh(>taskqueuelock); > > iscsi_conn_queue_work(conn); > > } > > > > @@ -1474,8 +1480,10 @@ void iscsi_requeue_task(struct iscsi_task *task) > > * this may be on the requeue list already if the xmit_task callout > > * is handling the r2ts while we are adding new ones > > */ > > + spin_lock_bh(>taskqueuelock); > > if (list_empty(>running)) > > list_add_tail(>running, >requeue); > > + spin_unlock_bh(>taskqueuelock); > > iscsi_conn_queue_work(conn); > > } > > EXPORT_SYMBOL_GPL(iscsi_requeue_task); > > @@ -1512,22 +1520,26 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) > > * only have one nop-out as a ping from us and targets should not > > * overflow us with nop-ins > > */ > > + spin_lock_bh(>taskqueuelock); > > check_mgmt: > > while (!list_empty(>mgmtqueue)) { > > conn->task = list_entry(conn->mgmtqueue.next, > > struct iscsi_task, running); > > list_del_init(>task->running); > > + spin_unlock_bh(>taskqueuelock); > > if (iscsi_prep_mgmt_task(conn, conn->task)) { > > /* regular RX path uses back_lock */ > > spin_lock_bh(>session->back_lock); > > __iscsi_put_task(conn->task); > > spin_unlock_bh(>session->back_lock); > > conn->task =
RE: [PATCH 33/39] megaraid_sas: call flush_scheduled_work during controller shutdown/detach
> -Original Message- > From: Tomas Henzl [mailto:the...@redhat.com] > Sent: Monday, February 06, 2017 9:35 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; j...@linux.vnet.ibm.com; > kashyap.de...@broadcom.com; sumit.sax...@broadcom.com; > h...@suse.com > Subject: Re: [PATCH 33/39] megaraid_sas: call flush_scheduled_work during > controller shutdown/detach > > On 6.2.2017 11:00, Shivasharan S wrote: > > Signed-off-by: Kashyap Desai> > Signed-off-by: Shivasharan S > > > --- > > drivers/scsi/megaraid/megaraid_sas_base.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > b/drivers/scsi/megaraid/megaraid_sas_base.c > > index 04ef0a0..b29cfd3 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > > @@ -6393,6 +6393,7 @@ megasas_suspend(struct pci_dev *pdev, > pm_message_t state) > > if (instance->ev != NULL) { > > struct megasas_aen_event *ev = instance->ev; > > cancel_delayed_work_sync(>hotplug_work); > > + flush_scheduled_work(); > > instance->ev = NULL; > > } > > > > @@ -6619,6 +6620,7 @@ static void megasas_detach_one(struct pci_dev > *pdev) > > if (instance->ev != NULL) { > > struct megasas_aen_event *ev = instance->ev; > > cancel_delayed_work_sync(>hotplug_work); > > + flush_scheduled_work(); > > instance->ev = NULL; > > } > > > > Why is cancel_delayed_work_sync not good enough? Megaraid_sas driver use certain work on global work queue. Below are the listed one - if (instance->ctrl_context) { INIT_WORK(>work_init, megasas_fusion_ocr_wq); INIT_WORK(>crash_init, megasas_fusion_crash_dump_wq); } else INIT_WORK(>work_init, process_fw_state_change_wq) Cancel_delayed_work_sync() was mainly targeted for only hotplug AEN work. Calling flush_scheduled_work() we want above listed work to be completed as well. > > tomash
RE: [PATCH 3.10 141/319] scsi: mpt3sas: Fix secure erase premature termination
Willy, I think this patch had a problem and later modified to a different blocking mechanism. Could you please pull in the latest change for this? Thanks Sathya -Original Message- From: Willy Tarreau [mailto:w...@1wt.eu] Sent: Sunday, February 05, 2017 12:19 PM To: linux-ker...@vger.kernel.org; sta...@vger.kernel.org; li...@roeck-us.net Cc: Andrey Grodzovsky; linux-scsi@vger.kernel.org; Sathya Prakash; Chaitra P B; Suganath Prabu Subramani; Sreekanth Reddy; Hannes Reinecke; Martin K . Petersen; Willy Tarreau Subject: [PATCH 3.10 141/319] scsi: mpt3sas: Fix secure erase premature termination From: Andrey Grodzovskycommit 18f6084a989ba1b38702f9af37a2e4049a924be6 upstream. This is a work around for a bug with LSI Fusion MPT SAS2 when perfoming secure erase. Due to the very long time the operation takes, commands issued during the erase will time out and will trigger execution of the abort hook. Even though the abort hook is called for the specific command which timed out, this leads to entire device halt (scsi_state terminated) and premature termination of the secure erase. Set device state to busy while ATA passthrough commands are in progress. [mkp: hand applied to 4.9/scsi-fixes, tweaked patch description] Signed-off-by: Andrey Grodzovsky Acked-by: Sreekanth Reddy Cc: Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Cc: Sreekanth Reddy Cc: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Willy Tarreau --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index f8c4b85..e414b71 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -3515,6 +3515,10 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) SAM_STAT_CHECK_CONDITION; } +static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd) { + return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16); } /** * _scsih_qcmd_lck - main scsi request entry point @@ -3543,6 +3547,13 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) scsi_print_command(scmd); #endif + /* +* Lock the device for any subsequent command until command is +* done. +*/ + if (ata_12_16_cmd(scmd)) + scsi_internal_device_block(scmd->device); + scmd->scsi_done = done; sas_device_priv_data = scmd->device->hostdata; if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { @@ -4046,6 +4057,9 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) if (scmd == NULL) return 1; + if (ata_12_16_cmd(scmd)) + scsi_internal_device_unblock(scmd->device, SDEV_RUNNING); + mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); if (mpi_reply == NULL) { -- 2.8.0.rc2.1.gbe9624a
Re: [PATCH 39/39] megaraid_sas: driver version upgrade
On 6.2.2017 11:00, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 38/39] megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2
On 6.2.2017 11:00, Shivasharan S wrote: > For RAID1 FastPath writes, driver needs to allocate extra commands > internally to accommodate for the extra peer command being sent. > Currently driver is allocating 2 extra commands for each but only > one extra command is necessary. > Set RAID_1_10_RMW_CMDS to 2 and also change macro name to > RAID_1_PEER_CMDS. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 37/39] megaraid_sas: Indentation and smatch warning fixes
On 6.2.2017 11:00, Shivasharan S wrote: > Fix indentation issues and smatch warning reported by Dan Carpenter > for previous series as discussed below. > http://www.spinics.net/lists/linux-scsi/msg103635.html > http://www.spinics.net/lists/linux-scsi/msg103603.html > > Reported-by: Dan Carpenter> Signed-off-by: Kashyap Desai > Signed-off-by: Sasikumar Chandrasekaran Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 36/39] megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints
On 6.2.2017 11:00, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 35/39] megaraid_sas: Increase internal command pool
On 6.2.2017 11:00, Shivasharan S wrote: > Fix - increase internal command pool to 8. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 34/39] megaraid_sas: Use synchronize_irq to wait for IRQs to complete
On 6.2.2017 11:00, Shivasharan S wrote: > FIX - Do not use random delay to synchronize with IRQ. Use kernel API. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 33/39] megaraid_sas: call flush_scheduled_work during controller shutdown/detach
On 6.2.2017 11:00, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_base.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > b/drivers/scsi/megaraid/megaraid_sas_base.c > index 04ef0a0..b29cfd3 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > @@ -6393,6 +6393,7 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t > state) > if (instance->ev != NULL) { > struct megasas_aen_event *ev = instance->ev; > cancel_delayed_work_sync(>hotplug_work); > + flush_scheduled_work(); > instance->ev = NULL; > } > > @@ -6619,6 +6620,7 @@ static void megasas_detach_one(struct pci_dev *pdev) > if (instance->ev != NULL) { > struct megasas_aen_event *ev = instance->ev; > cancel_delayed_work_sync(>hotplug_work); > + flush_scheduled_work(); > instance->ev = NULL; > } > Why is cancel_delayed_work_sync not good enough? tomash
Re: [PATCH 32/39] megaraid_sas: Bail out the driver load if ld_list_query fails
On 6.2.2017 11:00, Shivasharan S wrote: > Error handling: Bail out the driver load if > key FW cmds (LD_LIST) are not return successful. > Clean up error handling in megasas_init_fw. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 31/39] megaraid_sas: Change build_mpt_mfi_pass_thru to return void
On 6.2.2017 11:00, Shivasharan S wrote: > Code refactoring to build_mpt_mfi_pass_thru to return void. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 30/39] megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR
On 6.2.2017 11:00, Shivasharan S wrote: > Error handling: If controller reset is not able to > recover, kill HBA and quit immediately. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 28/39] megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion
On 6.2.2017 11:00, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 29/39] megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool
On 6.2.2017 11:00, Shivasharan S wrote: > FIX - firmware wants non-RW SYS PD IOs to avoid FastPath for > better tracking and other functionalities if the device > is task management capable. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 27/39] megaraid_sas: megasas_return_cmd does not memset IO frame to zero
On 6.2.2017 11:00, Shivasharan S wrote: > Memset the IO frame to zero after release. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH V3 2/2] qedf: Add QLogic FastLinQ offload FCoE driver framework.
On 02/03/2017 08:17 PM, Dupuis, Chad wrote: > From: "Dupuis, Chad"> > The QLogic FastLinQ Driver for FCoE (qedf) is the FCoE specific module for > 41000 > Series Converged Network Adapters by QLogic. This patch consists of following > changes: > > - MAINTAINERS Makefile and Kconfig changes for qedf > - PCI driver registration > - libfc/fcoe host level initialization > - SCSI host template initialization and callbacks > - Debugfs and log level infrastructure > - Link handling > - Firmware interface structures > - QED core module initialization > - Light L2 interface callbacks > - I/O request initialization > - Firmware I/O completion handling > - Firmware ELS request/response handling > - FIP request/response handled by the driver itself > > Signed-off-by: Nilesh Javali > Signed-off-by: Manish Rangankar > Signed-off-by: Saurav Kashyap > Signed-off-by: Arun Easi > Signed-off-by: Chad Dupuis > --- [ .. ] > +static void qedf_process_l2_frame_compl(struct qedf_rport *fcport, > + unsigned char *buf, > + u32 frame_len, u16 l2_oxid) > +{ > + struct fc_lport *lport = fcport->qedf->lport; > + struct fc_frame_header *fh; > + struct fc_frame *fp; > + u32 payload_len; > + u32 crc; > + > + payload_len = frame_len - sizeof(struct fc_frame_header); > + > + fp = fc_frame_alloc(lport, payload_len); > + if (!fp) { > + QEDF_ERR(&(fcport->qedf->dbg_ctx), > + "fc_frame_alloc failure.\n"); > + return; > + } > + > + /* Copy FC Frame header and payload into the frame */ > + fh = (struct fc_frame_header *)fc_frame_header_get(fp); > + memcpy(fh, buf, frame_len); > + > + /* Set the OXID we return to what libfc used */ > + if (l2_oxid != FC_XID_UNKNOWN) > + fh->fh_ox_id = htons(l2_oxid); > + > + /* Setup header fields */ > + fh->fh_r_ctl = FC_RCTL_ELS_REP; > + fh->fh_type = FC_TYPE_ELS; > + /* Last sequence, end sequence */ > + fh->fh_f_ctl[0] = 0x98; > + hton24(fh->fh_d_id, lport->port_id); > + hton24(fh->fh_s_id, fcport->rdata->ids.port_id); > + fh->fh_rx_id = 0x; > + > + /* Set frame attributes */ > + crc = fcoe_fc_crc(fp); > + fc_frame_init(fp); > + fr_dev(fp) = lport; > + fr_sof(fp) = FC_SOF_I3; > + fr_eof(fp) = FC_EOF_T; > + fr_crc(fp) = cpu_to_le32(~crc); > + > + /* Send completed request to libfc */ > + fc_exch_recv(lport, fp); > +} > + > +/* > + * In instances where an ELS command times out we may need to restart the > + * rport by logging out and then logging back in. > + */ > +void qedf_restart_rport(struct qedf_rport *fcport) > +{ > + struct fc_lport *lport; > + struct fc_rport_priv *rdata; > + u32 port_id; > + > + if (!fcport) > + return; > + > + rdata = fcport->rdata; > + if (rdata) { > + lport = fcport->qedf->lport; > + port_id = rdata->ids.port_id; > + QEDF_ERR(&(fcport->qedf->dbg_ctx), > + "LOGO port_id=%x.\n", port_id); > + fc_rport_logoff(rdata); > + /* Recreate the rport and log back in */ > + rdata = fc_rport_create(lport, port_id); > + if (rdata) > + fc_rport_login(rdata); > + } > +} > + > +static void qedf_l2_els_compl(struct qedf_els_cb_arg *cb_arg) > +{ > + struct qedf_ioreq *els_req; > + struct qedf_rport *fcport; > + struct qedf_mp_req *mp_req; > + struct fc_frame_header *fc_hdr; > + unsigned char *buf; > + void *resp_buf; > + u32 resp_len, hdr_len; > + u16 l2_oxid; > + int frame_len; > + > + l2_oxid = cb_arg->l2_oxid; > + els_req = cb_arg->io_req; > + > + if (!els_req) { > + QEDF_ERR(NULL, "els_req is NULL.\n"); > + goto free_arg; > + } > + > + /* > + * If we are flushing the command just free the cb_arg as none of the > + * response data will be valid. > + */ > + if (els_req->event == QEDF_IOREQ_EV_ELS_FLUSH) > + goto free_arg; > + > + fcport = els_req->fcport; > + mp_req = &(els_req->mp_req); > + fc_hdr = &(mp_req->resp_fc_hdr); > + resp_len = mp_req->resp_len; > + resp_buf = mp_req->resp_buf; > + > + /* > + * If a middle path ELS command times out, don't try to return > + * the command but rather do any internal cleanup and then libfc > + * timeout the command and clean up its internal resources. > + */ > + if (els_req->event == QEDF_IOREQ_EV_ELS_TMO) { > + /* > + * If ADISC times out, libfc will timeout the exchange and then > + * try to send a PLOGI which will timeout since the session is > + * still offloaded. Force libfc to
Re: [PATCH 26/39] megaraid_sas: max_fw_cmds are decremented twice, remove duplicate
On 6.2.2017 10:59, Shivasharan S wrote: > Fix to account for the reply_q_sz not exceeding > the maximum commands that the firmware can support, > instance->max_fw_cmds is already decremented in > megasas_fusion_update_can_queue(). > Remove the extra decrement logic in code. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 24/39] megaraid_sas: Change max_cmd from u32 to u16 in all functions
On 6.2.2017 10:59, Shivasharan S wrote: > Since maximum supported FW commands are all defined as u16, change > all local variables referring to max_cmd from u32 to u16. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 25/39] megaraid_sas: update can_queue only if the new value is less
On 6.2.2017 10:59, Shivasharan S wrote: > Minor Optimization: No need to update HBA can_queue value > if the current max FW commands is equal to earlier value. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 23/39] megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID
On 6.2.2017 10:59, Shivasharan S wrote: > Issue is limited for Syncro firmware where pd_after_lb is not set but is > accidentally used. > Not a functional issue, but results in low performance due to improper load > balancing between two LUNs. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 22/39] megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD
On 6.2.2017 10:59, Shivasharan S wrote: > Fetch the latest controller OCR capability from FW before > sending MR_DCMD_CTRL_SHUTDOWN > When application sends a shutdown DCMD (MR_DCMD_CTRL_SHUTDOWN), > driver will fetch latest controller information from firmware. > This is to ensure that driver always has latest OCR capability > of controller before sending the DCMD. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 21/39] megaraid_sas: avoid unaligned access in ioctl path
On 6.2.2017 10:59, Shivasharan S wrote: > Fix kernel warning for accessing unaligned memory access in driver. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 20/39] megaraid_sas: big endian support changes
On 6.2.2017 10:59, Shivasharan S wrote: > Fix endiannes fixes for Ventura specific. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 19/39] megaraid_sas: Big endian RDPQ mode fix
On 6.2.2017 10:59, Shivasharan S wrote: > Fix if RDPQ mode enabled MR FW is deployed on big endian host machine, > driver does not setup reply address correctly. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 17/39] megaraid_sas: In validate raid map, raid capability is not converted to cpu format for all lds
On 6.2.2017 10:59, Shivasharan S wrote: > On a host, if an ld is deleted there is a hole in the ld array returned > by the FW. But in MR_ValidateMapInfo we are not accounting for holes in > the ld array and traverse only upto index num_lds. > This patch takes care of converting the capability field of all the > valid lds in the ld raid map. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 16/39] megaraid_sas: reduce size of fusion_context and use vmalloc if kmalloc fails
On 6.2.2017 10:59, Shivasharan S wrote: > Currently fusion context has fixed array load_balance_info. Use dynamic > allocation. > In few places, driver do not want physically contigious memory. > Attempt to use vmalloc if physical contiguous memory is not available. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 15/39] megaraid_sas: add print in device removal path
On 6.2.2017 10:59, Shivasharan S wrote: > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 14/39] megaraid_sas: enhance debug logs in OCR context
On 6.2.2017 10:59, Shivasharan S wrote: > Add additional logging from driver in OCR context. > Add debug logs for partial completion of IOs is iodone context. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 13/39] megaraid_sas : set residual bytes count during IO compeltion
On 6.2.2017 10:59, Shivasharan S wrote: > Fixing issue of not setting residual bytes correctly. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 12/39] megaraid_sas: raid 1 write performance for large io
On 6.2.2017 10:59, Shivasharan S wrote: > Avoid Host side PCI bandwidth bottleneck and hint FW to do Write buffering > using > RaidFlag MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT. > Once IO is landed in FW with MR_RAID_FLAGS_IO_SUB_TYPE_LDIO_BW_LIMIT, > it will do single DMA from host and buffer the Write operation. On back end, > FW will DMA same buffer to the Mirror and Data Arm. > This will improve large block IO performance which bottleneck due to Host > side PCI bandwidth limitation. > > Consistent ~4000MB T.P for 256K Block size is expected performance numbers. > IOPS for small Block size should be on par with Disk performance. > (E.g 42 SAS Disk in JBOD mode gives 3700MB T.P. > Same Drive used in R1 WT mode, should give ~1800MB T.P) > > Using this patch 24 R1 VDs (HDD) gives below performance for Sequential Write. > Without this patch, we cannot reach above 3200MB (Throughput is in MB. ) > > Block Size50% 256K and 50% 4K 100% 256K > 4K 31002030 > 8K 31402740 > 16K31403140 > 32K34003240 > 64K35003700 > 128K 38703870 > 256K 39203920 > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 11/39] megaraid_sas: NVME interface target prop added
On 6.2.2017 10:59, Shivasharan S wrote: > This patch depends on patch 0008. > This patch fetch true values of NVME property > from FW using New DCMD interface MR_DCMD_DEV_GET_TARGET_PROP > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 10/39] megaraid_sas: NVME interface target prop added
On 6.2.2017 10:59, Shivasharan S wrote: > This patch depends on patch 0008. > This patch fetch true values of NVME property from FW using New DCMD > interface MR_DCMD_DEV_GET_TARGET_PROP > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 08/39] megaraid_sas: megasas_get_request_descriptor always return valid desc
On 6.2.2017 10:59, Shivasharan S wrote: > No functional change. Code clean up. Removing error code which is not > valid scenario. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai I'm not sure if the part which replaces "return 0;" with "return ->issue_dcmd" is an improvement - is there any instance of issue_dcmd which returns anything else but a '0' ? If not, make it a return void and have a tiny perf improvement. Other than that I agree with Hannes, please divide this into two patches. Tomas > --- > drivers/scsi/megaraid/megaraid_sas_base.c | 4 +--- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 33 > + > 2 files changed, 6 insertions(+), 31 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > b/drivers/scsi/megaraid/megaraid_sas_base.c > index 80fcdf5..138d028 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > @@ -5602,9 +5602,7 @@ megasas_register_aen(struct megasas_instance *instance, > u32 seq_num, > /* >* Issue the aen registration frame >*/ > - instance->instancet->issue_dcmd(instance, cmd); > - > - return 0; > + return instance->instancet->issue_dcmd(instance, cmd); > } > > /** > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index d25268a..1ec482e 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -974,8 +974,7 @@ megasas_sync_pd_seq_num(struct megasas_instance > *instance, bool pend) { > dcmd->mbox.b[0] = MEGASAS_DCMD_MBOX_PEND_FLAG; > dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_WRITE); > instance->jbod_seq_cmd = cmd; > - instance->instancet->issue_dcmd(instance, cmd); > - return 0; > + return instance->instancet->issue_dcmd(instance, cmd); > } > > dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_READ); > @@ -1115,7 +1114,7 @@ megasas_get_map_info(struct megasas_instance *instance) > int > megasas_sync_map_info(struct megasas_instance *instance) > { > - int ret = 0, i; > + int i; > struct megasas_cmd *cmd; > struct megasas_dcmd_frame *dcmd; > u32 size_sync_info, num_lds; > @@ -1182,9 +1181,7 @@ megasas_sync_map_info(struct megasas_instance *instance) > > instance->map_update_cmd = cmd; > > - instance->instancet->issue_dcmd(instance, cmd); > - > - return ret; > + return instance->instancet->issue_dcmd(instance, cmd); > } > > /* > @@ -2438,18 +2435,12 @@ megasas_build_io_fusion(struct megasas_instance > *instance, > return 0; > } > > -union MEGASAS_REQUEST_DESCRIPTOR_UNION * > +static union MEGASAS_REQUEST_DESCRIPTOR_UNION * > megasas_get_request_descriptor(struct megasas_instance *instance, u16 index) > { > u8 *p; > struct fusion_context *fusion; > > - if (index >= instance->max_mpt_cmds) { > - dev_err(>pdev->dev, "Invalid SMID (0x%x)request for " > -"descriptor for scsi%d\n", index, > - instance->host->host_no); > - return NULL; > - } > fusion = instance->ctrl_context; > p = fusion->req_frames_desc + > sizeof(union MEGASAS_REQUEST_DESCRIPTOR_UNION) * index; > @@ -2959,7 +2950,7 @@ build_mpt_mfi_pass_thru(struct megasas_instance > *instance, > union MEGASAS_REQUEST_DESCRIPTOR_UNION * > build_mpt_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd) > { > - union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc; > + union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc = NULL; > u16 index; > > if (build_mpt_mfi_pass_thru(instance, cmd)) { > @@ -2971,9 +2962,6 @@ build_mpt_cmd(struct megasas_instance *instance, struct > megasas_cmd *cmd) > > req_desc = megasas_get_request_descriptor(instance, index - 1); > > - if (!req_desc) > - return NULL; > - > req_desc->Words = 0; > req_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << >MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > @@ -2996,11 +2984,6 @@ megasas_issue_dcmd_fusion(struct megasas_instance > *instance, > union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc; > > req_desc = build_mpt_cmd(instance, cmd); > - if (!req_desc) { > - dev_info(>pdev->dev, "Failed from %s %d\n", > - __func__, __LINE__); > - return DCMD_NOT_FIRED; > - } > > megasas_fire_cmd_fusion(instance, req_desc); > return DCMD_SUCCESS; > @@ -3437,12 +3420,6 @@ megasas_issue_tm(struct megasas_instance *instance, > u16 device_handle, > > req_desc = megasas_get_request_descriptor(instance, > (cmd_fusion->index - 1)); > - if (!req_desc)
RE: [PATCH 09/39] megaraid_sas: NVME Interface detection and prop settings
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.com] > Sent: Monday, February 06, 2017 4:17 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; the...@redhat.com; > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com; > sumit.sax...@broadcom.com > Subject: Re: [PATCH 09/39] megaraid_sas: NVME Interface detection and prop > settings > > On 02/06/2017 10:59 AM, Shivasharan S wrote: > > New functionality > > Adding detection logic for NVME device attached behind Ventura controller. > > Driver set HostPageSize in IOC_INIT frame to inform about page size for NVME > devices. > > Firmware reports NVME page size to the driver. > > PD INFO DCMD provide new interface type NVME_PD. Driver set property of > NVME device. > > > > Signed-off-by: Shivasharan S> > Signed-off-by: Kashyap Desai > > --- > > drivers/scsi/megaraid/megaraid_sas.h| 23 ++-- > > drivers/scsi/megaraid/megaraid_sas_base.c | 170 -- > -- > > drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 +- > > drivers/scsi/megaraid/megaraid_sas_fusion.h | 2 +- > > 4 files changed, 142 insertions(+), 59 deletions(-) > > > [ .. ] > > @@ -3983,18 +4037,22 @@ dcmd_timeout_ocr_possible(struct > megasas_instance *instance) { > > return INITIATE_OCR; > > } > > > > -static int > > -megasas_get_pd_info(struct megasas_instance *instance, u16 device_id) > > +static void > > +megasas_get_pd_info(struct megasas_instance *instance, struct > > +scsi_device *sdev) > > { > > int ret; > > struct megasas_cmd *cmd; > > struct megasas_dcmd_frame *dcmd; > > > > + struct MR_PRIV_DEVICE *mr_device_priv_data; > > + u16 device_id = 0; > > + > > + device_id = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) + > > +sdev->id; > > cmd = megasas_get_cmd(instance); > > > > if (!cmd) { > > dev_err(>pdev->dev, "Failed to get cmd %s\n", > __func__); > > - return -ENOMEM; > > + return; > > } > > > > dcmd = >frame->dcmd; > > @@ -4021,7 +4079,9 @@ megasas_get_pd_info(struct megasas_instance > > *instance, u16 device_id) > > > > switch (ret) { > > case DCMD_SUCCESS: > > - instance->pd_list[device_id].interface = > > + mr_device_priv_data = sdev->hostdata; > > + le16_to_cpus((u16 *)>pd_info->state.ddf.pdType); > > + mr_device_priv_data->interface_type = > > instance->pd_info->state.ddf.pdType.intf; > > break; > > > > @@ -4048,7 +4108,7 @@ megasas_get_pd_info(struct megasas_instance > *instance, u16 device_id) > > if (ret != DCMD_TIMEOUT) > > megasas_return_cmd(instance, cmd); > > > > - return ret; > > + return; > > } > > /* > > * megasas_get_pd_list_info - Returns FW's pd_list structure > Please don't do this. > There's a valid reason why there is return value in the first place (hot removal of > devices IIRC), and it's always good manners to provide for an error path instead > of assuming that everything will be fine. megasas_get_pd_info is called to get "interface type" (SAS, SATA or NVME) of non-RAID disks. The interface type is used in IO path (applicable only for NVME based non-RAID disks) and also used for setting the device queue depth. Even if this function returns some error, driver is not going to do anything but continue in low performance mode (for NVME based non-RAID disks driver will not form native PRPs and device QD will be set to default value). > > And, incidentally, this has nothing to do with the NVMe backend changes, right? The "interface type" tells the driver whether a drive is NVME based or not. And if NVME, then we form PRPs. Thanks, Shivasharan > > Cheers, > > Hannes > -- > Dr. Hannes Reinecke zSeries & Storage > h...@suse.com+49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG > Nürnberg)
Re: [PATCH 07/39] megaraid_sas: Use DID_REQUEUE
On 6.2.2017 10:59, Shivasharan S wrote: > Moving to use DID_REQUEUE return type for reliable unconditional retries. > Driver wants unconditional re-queue, so replace DID_RESET with DID_REQUEUE > Discussed below - > https://www.spinics.net/lists/linux-scsi/msg102848.html > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
RE: [PATCH 08/39] megaraid_sas: megasas_get_request_descriptor always return valid desc
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.com] > Sent: Monday, February 06, 2017 4:14 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; the...@redhat.com; > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com; > sumit.sax...@broadcom.com > Subject: Re: [PATCH 08/39] megaraid_sas: megasas_get_request_descriptor > always return valid desc > > On 02/06/2017 10:59 AM, Shivasharan S wrote: > > No functional change. Code clean up. Removing error code which is not > > valid scenario. > > > > Signed-off-by: Shivasharan S> > Signed-off-by: Kashyap Desai > > --- > > drivers/scsi/megaraid/megaraid_sas_base.c | 4 +--- > > drivers/scsi/megaraid/megaraid_sas_fusion.c | 33 > > + > > 2 files changed, 6 insertions(+), 31 deletions(-) > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > > b/drivers/scsi/megaraid/megaraid_sas_base.c > > index 80fcdf5..138d028 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > > @@ -5602,9 +5602,7 @@ megasas_register_aen(struct megasas_instance > *instance, u32 seq_num, > > /* > > * Issue the aen registration frame > > */ > > - instance->instancet->issue_dcmd(instance, cmd); > > - > > - return 0; > > + return instance->instancet->issue_dcmd(instance, cmd); > > } > > > > /** > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > > index d25268a..1ec482e 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > > @@ -974,8 +974,7 @@ megasas_sync_pd_seq_num(struct megasas_instance > *instance, bool pend) { > > dcmd->mbox.b[0] = MEGASAS_DCMD_MBOX_PEND_FLAG; > > dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_WRITE); > > instance->jbod_seq_cmd = cmd; > > - instance->instancet->issue_dcmd(instance, cmd); > > - return 0; > > + return instance->instancet->issue_dcmd(instance, cmd); > > } > > > > dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_READ); @@ -1115,7 > +1114,7 @@ > > megasas_get_map_info(struct megasas_instance *instance) int > > megasas_sync_map_info(struct megasas_instance *instance) { > > - int ret = 0, i; > > + int i; > > struct megasas_cmd *cmd; > > struct megasas_dcmd_frame *dcmd; > > u32 size_sync_info, num_lds; > > @@ -1182,9 +1181,7 @@ megasas_sync_map_info(struct megasas_instance > > *instance) > > > > instance->map_update_cmd = cmd; > > > > - instance->instancet->issue_dcmd(instance, cmd); > > - > > - return ret; > > + return instance->instancet->issue_dcmd(instance, cmd); > > } > > > > /* > > @@ -2438,18 +2435,12 @@ megasas_build_io_fusion(struct > megasas_instance *instance, > > return 0; > > } > > > > -union MEGASAS_REQUEST_DESCRIPTOR_UNION * > > +static union MEGASAS_REQUEST_DESCRIPTOR_UNION * > > megasas_get_request_descriptor(struct megasas_instance *instance, u16 > > index) { > > u8 *p; > > struct fusion_context *fusion; > > > > - if (index >= instance->max_mpt_cmds) { > > - dev_err(>pdev->dev, "Invalid SMID (0x%x)request for > " > > - "descriptor for scsi%d\n", index, > > - instance->host->host_no); > > - return NULL; > > - } > > fusion = instance->ctrl_context; > > p = fusion->req_frames_desc + > > sizeof(union MEGASAS_REQUEST_DESCRIPTOR_UNION) * > index; @@ -2959,7 > > +2950,7 @@ build_mpt_mfi_pass_thru(struct megasas_instance *instance, > > union MEGASAS_REQUEST_DESCRIPTOR_UNION * build_mpt_cmd(struct > > megasas_instance *instance, struct megasas_cmd *cmd) { > > - union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc; > > + union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc = NULL; > > u16 index; > > > > if (build_mpt_mfi_pass_thru(instance, cmd)) { @@ -2971,9 +2962,6 @@ > > build_mpt_cmd(struct megasas_instance *instance, struct megasas_cmd > > *cmd) > > > > req_desc = megasas_get_request_descriptor(instance, index - 1); > > > > - if (!req_desc) > > - return NULL; > > - > > req_desc->Words = 0; > > req_desc->SCSIIO.RequestFlags = > (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << > > > MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > > @@ -2996,11 +2984,6 @@ megasas_issue_dcmd_fusion(struct > megasas_instance *instance, > > union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc; > > > > req_desc = build_mpt_cmd(instance, cmd); > > - if (!req_desc) { > > - dev_info(>pdev->dev, "Failed from %s %d\n", > > - __func__, __LINE__); > > - return DCMD_NOT_FIRED; > > - } > > > > megasas_fire_cmd_fusion(instance, req_desc); > > return DCMD_SUCCESS; > > @@ -3437,12 +3420,6 @@ megasas_issue_tm(struct megasas_instance > > *instance, u16
Re: [PATCH 05/39] megaraid_sas: Refactor MEGASAS_IS_LOGICAL macro using sdev
On 6.2.2017 10:59, Shivasharan S wrote: > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 04/39] megaraid_sas: 32 bit descriptor fire cmd optimization
On 6.2.2017 10:59, Shivasharan S wrote: > No functional change. Code refactor. > megasas_fire_cmd_fusion can always use 32 bit descriptor write for ventura. > No need to pass extra flag. > Only IOC INIT required 64 bit Descriptor write. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 03/39] megaraid_sas: raid 1 fast path code optimize
On 6.2.2017 14:27, Kashyap Desai wrote: >>> /** >>> + * megasas_complete_r1_command - >>> + * completes R1 FP write commands which has valid peer smid >>> + * @instance: Adapter soft state >>> + * @cmd_fusion:MPT command frame >>> + * >>> + */ >>> +static inline void >>> +megasas_complete_r1_command(struct megasas_instance *instance, >>> + struct megasas_cmd_fusion *cmd) { >>> + u8 *sense, status, ex_status; >>> + u32 data_length; >>> + u16 peer_smid; >>> + struct fusion_context *fusion; >>> + struct megasas_cmd_fusion *r1_cmd = NULL; >>> + struct scsi_cmnd *scmd_local = NULL; >>> + struct RAID_CONTEXT_G35 *rctx_g35; >>> + >>> + rctx_g35 = >io_request->RaidContext.raid_context_g35; >>> + fusion = instance->ctrl_context; >>> + peer_smid = le16_to_cpu(rctx_g35->smid.peer_smid); >>> + >>> + r1_cmd = fusion->cmd_list[peer_smid - 1]; >>> + scmd_local = cmd->scmd; >>> + status = rctx_g35->status; >>> + ex_status = rctx_g35->ex_status; >>> + data_length = cmd->io_request->DataLength; >>> + sense = cmd->sense; >>> + >>> + cmd->cmd_completed = true; >>> + >>> + /* Check if peer command is completed or not*/ >>> + if (r1_cmd->cmd_completed) { >>> + if (rctx_g35->status != MFI_STAT_OK) { >>> + status = rctx_g35->status; >>> + ex_status = rctx_g35->ex_status; >> Both status + ex_status were already set to the same value, why is it >> repeated here ? > Tomas, This need a fix. Raid context should be switch to r1_cmd, but it > that is not done here. > We want if r1 cmd is completed with failure, check status and extended > status from r1_cmd to send final status to mid layer. > > We will fix this and resend patch. It will be like this - > > if (r1_cmd->cmd_completed) { > rctx_g35 = > _cmd->io_request->RaidContext.raid_context_g35;<< -This line > should be added. > if (rctx_g35->status != MFI_STAT_OK) { > status = rctx_g35->status; > ex_status = rctx_g35->ex_status; That makes sense, thanks. > > Thanks, Kashyap > >> Tomas >>
RE: [PATCH 03/39] megaraid_sas: raid 1 fast path code optimize
> > > > /** > > + * megasas_complete_r1_command - > > + * completes R1 FP write commands which has valid peer smid > > + * @instance: Adapter soft state > > + * @cmd_fusion:MPT command frame > > + * > > + */ > > +static inline void > > +megasas_complete_r1_command(struct megasas_instance *instance, > > + struct megasas_cmd_fusion *cmd) { > > + u8 *sense, status, ex_status; > > + u32 data_length; > > + u16 peer_smid; > > + struct fusion_context *fusion; > > + struct megasas_cmd_fusion *r1_cmd = NULL; > > + struct scsi_cmnd *scmd_local = NULL; > > + struct RAID_CONTEXT_G35 *rctx_g35; > > + > > + rctx_g35 = >io_request->RaidContext.raid_context_g35; > > + fusion = instance->ctrl_context; > > + peer_smid = le16_to_cpu(rctx_g35->smid.peer_smid); > > + > > + r1_cmd = fusion->cmd_list[peer_smid - 1]; > > + scmd_local = cmd->scmd; > > + status = rctx_g35->status; > > + ex_status = rctx_g35->ex_status; > > + data_length = cmd->io_request->DataLength; > > + sense = cmd->sense; > > + > > + cmd->cmd_completed = true; > > + > > + /* Check if peer command is completed or not*/ > > + if (r1_cmd->cmd_completed) { > > + if (rctx_g35->status != MFI_STAT_OK) { > > + status = rctx_g35->status; > > + ex_status = rctx_g35->ex_status; > > Both status + ex_status were already set to the same value, why is it > repeated here ? Tomas, This need a fix. Raid context should be switch to r1_cmd, but it that is not done here. We want if r1 cmd is completed with failure, check status and extended status from r1_cmd to send final status to mid layer. We will fix this and resend patch. It will be like this - if (r1_cmd->cmd_completed) { rctx_g35 = _cmd->io_request->RaidContext.raid_context_g35;<< -This line should be added. if (rctx_g35->status != MFI_STAT_OK) { status = rctx_g35->status; ex_status = rctx_g35->ex_status; Thanks, Kashyap > > Tomas >
RE: [PATCH 06/39] megaraid_sas: RAID map is accessed for SYS PDs when use_seqnum_jbod_fp is not set
> -Original Message- > From: Hannes Reinecke [mailto:h...@suse.com] > Sent: Monday, February 06, 2017 4:11 PM > To: Shivasharan S; linux-scsi@vger.kernel.org > Cc: martin.peter...@oracle.com; the...@redhat.com; > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com; > sumit.sax...@broadcom.com > Subject: Re: [PATCH 06/39] megaraid_sas: RAID map is accessed for SYS PDs > when use_seqnum_jbod_fp is not set > > On 02/06/2017 10:59 AM, Shivasharan S wrote: > > Signed-off-by: Shivasharan S> > Signed-off-by: Kashyap Desai > > --- > > drivers/scsi/megaraid/megaraid_sas_base.c | 25 > > ++--- > > 1 file changed, 14 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > > b/drivers/scsi/megaraid/megaraid_sas_base.c > > index 6ca49ef..67a205a 100644 > > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > > @@ -1756,28 +1756,31 @@ void megasas_update_sdev_properties(struct > scsi_device *sdev) > > fusion = instance->ctrl_context; > > mr_device_priv_data = sdev->hostdata; > > > > - if (!fusion) > > + if (!fusion || !mr_device_priv_data) > > return; > > > > - if (!MEGASAS_IS_LOGICAL(sdev) && > > - instance->use_seqnum_jbod_fp) { > > - pd_index = (sdev->channel * > MEGASAS_MAX_DEV_PER_CHANNEL) + > > - sdev->id; > > - pd_sync = (void *)fusion->pd_seq_sync > > - [(instance->pd_seq_map_id - 1) & 1]; > > - mr_device_priv_data->is_tm_capable = > > - pd_sync->seq[pd_index].capability.tmCapable; > > - } else { > > + if (MEGASAS_IS_LOGICAL(sdev)) { > > device_id = ((sdev->channel % 2) * > MEGASAS_MAX_DEV_PER_CHANNEL) > > + sdev->id; > > local_map_ptr = fusion->ld_drv_map[(instance->map_id & 1)]; > > ld = MR_TargetIdToLdGet(device_id, local_map_ptr); > > + if (ld >= instance->fw_supported_vd_count) > > + return; > > raid = MR_LdRaidGet(ld, local_map_ptr); > > > > if (raid->capability.ldPiMode == > MR_PROT_INFO_TYPE_CONTROLLER) > > - blk_queue_update_dma_alignment(sdev->request_queue, 0x7); > > + blk_queue_update_dma_alignment(sdev- > >request_queue, > > + 0x7); > > + > > mr_device_priv_data->is_tm_capable = > > raid->capability.tmCapable; > > + } else if (instance->use_seqnum_jbod_fp) { > > + pd_index = (sdev->channel * > MEGASAS_MAX_DEV_PER_CHANNEL) + > > + sdev->id; > > + pd_sync = (void *)fusion->pd_seq_sync > > + [(instance->pd_seq_map_id - 1) & 1]; > > + mr_device_priv_data->is_tm_capable = > > + pd_sync->seq[pd_index].capability.tmCapable; > > } > > } > > > > > Don't you need a sanity check on pd_index, too? > Otherwise you easily overflow the ->seq array ... "pd_index" sanity check is not really required here. pd_index is function of "sdev->id", "sdev->channel" and MEGASAS_MAX_DEV_PER_CHANNEL. Here sdev->channel can either be 0 or 1 as it is under "!MEGASAS_IS_LOGICAL(sdev)", and sdev->id cannot be greater than 127(MEGASAS_MAX_DEV_PER_CHANNEL -1). So maximum possible value of pd_index is 255(256th element) and fusion->pd_seq_sync->seq array size is 256. So pd_index should not overflow fusion->pd_seq_sync->seq array. > > Cheers, > > Hannes > -- > Dr. Hannes Reinecke zSeries & Storage > h...@suse.com+49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG > Nürnberg)
Re: [PATCH 03/39] megaraid_sas: raid 1 fast path code optimize
On 6.2.2017 10:59, Shivasharan S wrote: > No functional change. Code refactor. > Remove function megasas_fpio_to_ldio as we never require to convert fpio to > ldio because of frame unavailability. > Grab extra frame of raid 1 write fast path before it creates first frame as > Fast Path. > Removed is_raid_1_fp_write flag as raid 1 write fast path command is decided > using r1_alt_dev_handle only. > Move resetting megasas_cmd_fusion fields at common function > megasas_return_cmd_fusion. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai > --- > drivers/scsi/megaraid/megaraid_sas_fp.c | 14 +- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 348 > +--- > drivers/scsi/megaraid/megaraid_sas_fusion.h | 3 +- > 3 files changed, 117 insertions(+), 248 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c > b/drivers/scsi/megaraid/megaraid_sas_fp.c > index f1384b0..24258af 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fp.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c > @@ -1338,20 +1338,8 @@ MR_BuildRaidContext(struct megasas_instance *instance, > ref_in_start_stripe, io_info, > pRAID_Context, map); > /* If IO on an invalid Pd, then FP is not possible.*/ > - if (io_info->devHandle == cpu_to_le16(MR_PD_INVALID)) > + if (io_info->devHandle == MR_DEVHANDLE_INVALID) > io_info->fpOkForIo = FALSE; > - /* if FP possible, set the SLUD bit in > - * regLockFlags for ventura > - */ > - else if ((instance->is_ventura) && (!isRead) && > - (raid->writeMode == MR_RL_WRITE_BACK_MODE) && > - (raid->capability.fp_cache_bypass_capable)) > - ((struct RAID_CONTEXT_G35 *) > pRAID_Context)->routing_flags.bits.sld = 1; > - /* set raid 1/10 fast path write capable bit in io_info */ > - if (io_info->fpOkForIo && > - (io_info->r1_alt_dev_handle != MR_PD_INVALID) && > - (raid->level == 1) && !isRead) > - io_info->is_raid_1_fp_write = 1; > return retval; > } else if (isRead) { > uint stripIdx; > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index 514c306..de55dce 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -181,7 +181,9 @@ inline void megasas_return_cmd_fusion(struct > megasas_instance *instance, > struct megasas_cmd_fusion *cmd) > { > cmd->scmd = NULL; > - memset(cmd->io_request, 0, sizeof(struct MPI2_RAID_SCSI_IO_REQUEST)); > + memset(cmd->io_request, 0, MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE); > + cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; > + cmd->cmd_completed = false; > } > > /** > @@ -701,7 +703,7 @@ megasas_alloc_cmds_fusion(struct megasas_instance > *instance) > memset(cmd->io_request, 0, > sizeof(struct MPI2_RAID_SCSI_IO_REQUEST)); > cmd->io_request_phys_addr = io_req_base_phys + offset; > - cmd->is_raid_1_fp_write = 0; > + cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; > } > > if (megasas_create_sg_sense_fusion(instance)) > @@ -1984,7 +1986,7 @@ megasas_build_ldio_fusion(struct megasas_instance > *instance, > io_info.ldStartBlock = ((u64)start_lba_hi << 32) | start_lba_lo; > io_info.numBlocks = datalength; > io_info.ldTgtId = device_id; > - io_info.r1_alt_dev_handle = MR_PD_INVALID; > + io_info.r1_alt_dev_handle = MR_DEVHANDLE_INVALID; > scsi_buff_len = scsi_bufflen(scp); > io_request->DataLength = cpu_to_le32(scsi_buff_len); > > @@ -2025,7 +2027,7 @@ megasas_build_ldio_fusion(struct megasas_instance > *instance, > io_info.isRead && io_info.ra_capable) > fp_possible = false; > > - if (io_info.r1_alt_dev_handle != MR_PD_INVALID) { > + if (io_info.r1_alt_dev_handle != MR_DEVHANDLE_INVALID) { > mrdev_priv = scp->device->hostdata; > > if (atomic_inc_return(>fw_outstanding) > > @@ -2090,9 +2092,10 @@ megasas_build_ldio_fusion(struct megasas_instance > *instance, > } else > scp->SCp.Status &= ~MEGASAS_LOAD_BALANCE_FLAG; > > - cmd->is_raid_1_fp_write = io_info.is_raid_1_fp_write; > - if (io_info.is_raid_1_fp_write) > + if (instance->is_ventura) > cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle; > + else > + cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; > > if ((raidLUN[0] == 1) && >
Re: [PATCH 02/39] megaraid_sas: cpu select rework.
On 6.2.2017 10:59, Shivasharan S wrote: > No functional change. Code refactor. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH 01/39] Revert "scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold Bandwidth"
On 6.2.2017 10:59, Shivasharan S wrote: > This reverts > commit "3e5eadb1a881" ("scsi: megaraid_sas: Enable or Disable Fast path based > on the PCI Threshold Bandwidth") > > This patch was aimed to increase performance of R1 Write operation for large > IO size. > Since this method used timer approach, it turn on/off fast path did not work > as expected. > Patch 0011 describes new algorithm and performance number. > > Signed-off-by: Shivasharan S> Signed-off-by: Kashyap Desai Reviewed-by: Tomas Henzl Tomas
Re: [PATCH V2] mpt3sas: disable ASPM for MPI2 controllers
On 2017/02/06 12:02, Sreekanth Reddy wrote: Hi Ojab, Can I get output of 'lspci -vvv -s' for LSI SAS2 card? On my Supermicro system, I have enabled ASPM in system BIOS but still in lspci output I see this ASPM was disabled for my SAS2 HBA card which has Phase19 firmware (i.e. 19.00.00.00) as shown below, [snip] So, Can you also try once with Phase19 firmware. How can I downgrade firmware? Right now I have FW 20.00.07.00 installed (`lspci` output can be found in the attached file), `sas2flash -fwall [P19_firmaware.bin]` tells me: >ERROR: Cannot downgrade NVDATA version 14.01.00.06 > to 11.00.11.00. > >ERROR: Failed to get valid NVDATA image from File! and `sas2flash -e 6` tells me >ERROR: Erase Flash Operation Failed! //wbr ojab 02:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2308 PCI-Express Fusion-MPT SAS-2 (rev 05) Subsystem: LSI Logic / Symbios Logic Device 3020 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Capabilities: [190 v1] #16 Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI) ARICap: MFVC- ACS-, Next Function: 0 ARICtl: MFVC- ACS-, Function Group: 0 Kernel driver in use: mpt3sas Kernel modules: mpt3sas
Re: [PATCH V2] mpt3sas: disable ASPM for MPI2 controllers
Hi Ojab, Can I get output of 'lspci -vvv -s' for LSI SAS2 card? On my Supermicro system, I have enabled ASPM in system BIOS but still in lspci output I see this ASPM was disabled for my SAS2 HBA card which has Phase19 firmware (i.e. 19.00.00.00) as shown below, # lspci -vvv -s 83:00.0 83:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2308 PCI-Express Fusion-MPT SAS-2 (rev 05) Subsystem: LSI Logic / Symbios Logic SAS2308 PCI-Express Fusion-MPT SAS-2 Physical Slot: 1-1 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Capabilities: [190 v1] #16 Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI) ARICap:MFVC- ACS-, Next Function: 0 ARICtl:MFVC- ACS-, Function Group: 0 Kernel driver in use: mpt3sas Kernel modules: mpt3sas So, Can you also try once with Phase19 firmware. Thanks, Sreekanth On Mon, Feb 6, 2017 at 2:22 PM, ojabwrote: > On 2017/01/30 10:58, ojab wrote: >> >> On 2017/01/23 15:59, ojab wrote: >>> >>> On 2016/12/28 11:05, ojab wrote: MPI2 controllers sometimes got lost (i. e. disappears from /sys/bus/pci/devices) if ASMP is enabled. Signed-off-by: Slava Kardakov Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=60644 >>> >>> >>> Can I haz Reviewed-by? >>> >> >> ping? >> > > Humble ping. > > //wbr ojab
[bug report] qla2xxx: Add framework for async fabric discovery
Hello Quinn Tran, The patch b79414ee4988: "qla2xxx: Add framework for async fabric discovery" from Jan 19, 2017, leads to the following static checker warning: drivers/scsi/qla2xxx/qla_init.c:3910 qla2x00_alloc_fcport() warn: use 'flags' here instead of GFP_XXX? drivers/scsi/qla2xxx/qla_init.c 3894 fc_port_t * 3895 qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) 3896 { 3897 fc_port_t *fcport; 3898 3899 fcport = kzalloc(sizeof(fc_port_t), flags); In pratice "flags" is always GFP_KERNEL. 3900 if (!fcport) 3901 return NULL; 3902 3903 /* Setup fcport template structure. */ 3904 fcport->vha = vha; 3905 fcport->port_type = FCT_UNKNOWN; 3906 fcport->loop_id = FC_NO_LOOP_ID; 3907 qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED); 3908 fcport->supported_classes = FC_COS_UNSPECIFIED; 3909 3910 fcport->ct_desc.ct_sns = dma_alloc_coherent(>hw->pdev->dev, 3911 sizeof(struct ct_sns_pkt), >ct_desc.ct_sns_dma, 3912 GFP_ATOMIC); There isn't an obvious reason why GFP_ATOMIC is required here. 3913 fcport->disc_state = DSC_DELETED; 3914 fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; 3915 fcport->deleted = QLA_SESS_DELETED; 3916 fcport->login_retry = vha->hw->login_retry_count; 3917 fcport->login_retry = 5; 3918 fcport->logout_on_delete = 1; 3919 3920 if (!fcport->ct_desc.ct_sns) { 3921 ql_log(ql_log_warn, vha, 0x, 3922 "Failed to allocate ct_sns request.\n"); 3923 kfree(fcport); 3924 fcport = NULL; 3925 } 3926 INIT_WORK(>del_work, qla24xx_delete_sess_fn); 3927 INIT_LIST_HEAD(>gnl_entry); 3928 INIT_LIST_HEAD(>list); 3929 3930 return fcport; 3931 } regards, dan carpenter
Re: [PATCH 39/39] megaraid_sas: driver version upgrade
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas.h > b/drivers/scsi/megaraid/megaraid_sas.h > index e810057..f8718ea 100644 > --- a/drivers/scsi/megaraid/megaraid_sas.h > +++ b/drivers/scsi/megaraid/megaraid_sas.h > @@ -35,8 +35,8 @@ > /* > * MegaRAID SAS Driver meta data > */ > -#define MEGASAS_VERSION "07.700.00.00-rc1" > -#define MEGASAS_RELDATE "November 29, 2016" > +#define MEGASAS_VERSION "07.701.16.00-rc1" > +#define MEGASAS_RELDATE "February 2, 2017" > > /* > * Device IDs > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 38/39] megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2
On 02/06/2017 11:00 AM, Shivasharan S wrote: > For RAID1 FastPath writes, driver needs to allocate extra commands > internally to accommodate for the extra peer command being sent. > Currently driver is allocating 2 extra commands for each but only > one extra command is necessary. > Set RAID_1_10_RMW_CMDS to 2 and also change macro name to > RAID_1_PEER_CMDS. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- > drivers/scsi/megaraid/megaraid_sas_fusion.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index b5bb33e..6dffb17 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -293,7 +293,7 @@ megasas_fusion_update_can_queue(struct megasas_instance > *instance, int fw_boot_c > > if (instance->is_ventura) > instance->max_mpt_cmds = > - instance->max_fw_cmds * RAID_1_10_RMW_CMDS; > + instance->max_fw_cmds * RAID_1_PEER_CMDS; > else > instance->max_mpt_cmds = instance->max_fw_cmds; > } > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h > b/drivers/scsi/megaraid/megaraid_sas_fusion.h > index 60566e4..c36f9f7 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h > @@ -101,7 +101,7 @@ enum MR_RAID_FLAGS_IO_SUB_TYPE { > #define MEGASAS_FP_CMD_LEN 16 > #define MEGASAS_FUSION_IN_RESET 0 > #define THRESHOLD_REPLY_COUNT 50 > -#define RAID_1_10_RMW_CMDS 3 > +#define RAID_1_PEER_CMDS 2 > #define JBOD_MAPS_COUNT 2 > > enum MR_FUSION_ADAPTER_TYPE { > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 37/39] megaraid_sas: Indentation and smatch warning fixes
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Fix indentation issues and smatch warning reported by Dan Carpenter > for previous series as discussed below. > http://www.spinics.net/lists/linux-scsi/msg103635.html > http://www.spinics.net/lists/linux-scsi/msg103603.html > > Reported-by: Dan Carpenter> Signed-off-by: Kashyap Desai > Signed-off-by: Sasikumar Chandrasekaran > --- > drivers/scsi/megaraid/megaraid_sas.h| 2 +- > drivers/scsi/megaraid/megaraid_sas_base.c | 10 ++-- > drivers/scsi/megaraid/megaraid_sas_fp.c | 57 +- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 92 > ++--- > drivers/scsi/megaraid/megaraid_sas_fusion.h | 2 +- > 5 files changed, 80 insertions(+), 83 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 36/39] megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas.h| 2 - > drivers/scsi/megaraid/megaraid_sas_base.c | 15 -- > drivers/scsi/megaraid/megaraid_sas_fp.c | 266 > +--- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 5 - > 4 files changed, 2 insertions(+), 286 deletions(-) > Maybe you should consider adding debugfs ... Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 34/39] megaraid_sas: Use synchronize_irq to wait for IRQs to complete
On 02/06/2017 11:00 AM, Shivasharan S wrote: > FIX - Do not use random delay to synchronize with IRQ. Use kernel API. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 20 ++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 35/39] megaraid_sas: Increase internal command pool
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Fix - increase internal command pool to 8. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas.h| 2 +- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas.h > b/drivers/scsi/megaraid/megaraid_sas.h > index 59fe39d..1a9a283 100644 > --- a/drivers/scsi/megaraid/megaraid_sas.h > +++ b/drivers/scsi/megaraid/megaraid_sas.h > @@ -1460,7 +1460,7 @@ enum FW_BOOT_CONTEXT { > */ > #define MEGASAS_INT_CMDS 32 > #define MEGASAS_SKINNY_INT_CMDS 5 > -#define MEGASAS_FUSION_INTERNAL_CMDS 5 > +#define MEGASAS_FUSION_INTERNAL_CMDS 8 > #define MEGASAS_FUSION_IOCTL_CMDS3 > #define MEGASAS_MFI_IOCTL_CMDS 27 > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index 5dda73d..65971a9d 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -1347,7 +1347,7 @@ megasas_init_adapter_fusion(struct megasas_instance > *instance) > fusion->last_reply_idx[i] = 0; > > /* > - * For fusion adapters, 3 commands for IOCTL and 5 commands > + * For fusion adapters, 3 commands for IOCTL and 8 commands >* for driver's internal DCMDs. >*/ > instance->max_scsi_cmds = instance->max_fw_cmds - > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 33/39] megaraid_sas: call flush_scheduled_work during controller shutdown/detach
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_base.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > b/drivers/scsi/megaraid/megaraid_sas_base.c > index 04ef0a0..b29cfd3 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > @@ -6393,6 +6393,7 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t > state) > if (instance->ev != NULL) { > struct megasas_aen_event *ev = instance->ev; > cancel_delayed_work_sync(>hotplug_work); > + flush_scheduled_work(); > instance->ev = NULL; > } > > @@ -6619,6 +6620,7 @@ static void megasas_detach_one(struct pci_dev *pdev) > if (instance->ev != NULL) { > struct megasas_aen_event *ev = instance->ev; > cancel_delayed_work_sync(>hotplug_work); > + flush_scheduled_work(); > instance->ev = NULL; > } > > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 32/39] megaraid_sas: Bail out the driver load if ld_list_query fails
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Error handling: Bail out the driver load if > key FW cmds (LD_LIST) are not return successful. > Clean up error handling in megasas_init_fw. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_base.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > Reviewed-by: Hannes Reinecke Cheers Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 31/39] megaraid_sas: Change build_mpt_mfi_pass_thru to return void
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Code refactoring to build_mpt_mfi_pass_thru to return void. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 ++ > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index 9f3cbaa..8edb6ba 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -3225,7 +3225,7 @@ irqreturn_t megasas_isr_fusion(int irq, void *devp) > * mfi_cmd: megasas_cmd pointer > * > */ > -u8 > +void > build_mpt_mfi_pass_thru(struct megasas_instance *instance, > struct megasas_cmd *mfi_cmd) > { > @@ -3275,8 +3275,6 @@ build_mpt_mfi_pass_thru(struct megasas_instance > *instance, > MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; > > mpi25_ieee_chain->Length = cpu_to_le32(instance->max_chain_frame_sz); > - > - return 0; > } > > /** > @@ -3291,11 +3289,7 @@ build_mpt_cmd(struct megasas_instance *instance, > struct megasas_cmd *cmd) > union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc = NULL; > u16 index; > > - if (build_mpt_mfi_pass_thru(instance, cmd)) { > - dev_err(>pdev->dev, "Couldn't build MFI pass thru > cmd\n"); > - return NULL; > - } > - > + build_mpt_mfi_pass_thru(instance, cmd); > index = cmd->context.smid; > > req_desc = megasas_get_request_descriptor(instance, index - 1); > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 30/39] megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR
On 02/06/2017 11:00 AM, Shivasharan S wrote: > Error handling: If controller reset is not able to > recover, kill HBA and quit immediately. > > Signed-off-by: Kashyap Desai> Signed-off-by: Shivasharan S > --- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index d49f6bd..9f3cbaa 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -4281,6 +4281,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int > reason) > __func__, __LINE__); > megaraid_sas_kill_hba(instance); > retval = FAILED; > + goto out; > } > /* Reset load balance info */ > if (fusion->load_balance_info) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)