Re: [PATCH] scsi: scsi_debug: Fix pointer stying issues
As per the subject line, I wouldn't mind putting these changes in with the pigs :-) On 2018-02-09 09:12 PM, John Pittman wrote: Pointer styling issues exposed by checkpatch.pl in scsi_debug.c: ERROR: "foo * bar" should be "foo *bar" Fixed 37 total errors reported. Signed-off-by: John PittmanAck-ed by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 72 +++ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5986da..a1f867f 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1155,8 +1155,8 @@ static int inquiry_vpd_84(unsigned char *arr) static int inquiry_vpd_85(unsigned char *arr) { int num = 0; - const char * na1 = "https://www.kernel.org/config;; - const char * na2 = "http://www.kernel.org/log;; + const char *na1 = "https://www.kernel.org/config;; + const char *na2 = "http://www.kernel.org/log;; int plen, olen; arr[num++] = 0x1; /* lu, storage config */ @@ -1372,7 +1372,7 @@ static int inquiry_vpd_b2(unsigned char *arr) static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) { unsigned char pq_pdt; - unsigned char * arr; + unsigned char *arr; unsigned char *cmd = scp->cmnd; int alloc_len, n, ret; bool have_wlun, is_disk; @@ -1523,10 +1523,10 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) static unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0, 0, 0, 0x0, 0x0}; -static int resp_requests(struct scsi_cmnd * scp, -struct sdebug_dev_info * devip) +static int resp_requests(struct scsi_cmnd *scp, +struct sdebug_dev_info *devip) { - unsigned char * sbuff; + unsigned char *sbuff; unsigned char *cmd = scp->cmnd; unsigned char arr[SCSI_SENSE_BUFFERSIZE]; bool dsense; @@ -1584,8 +1584,8 @@ static int resp_requests(struct scsi_cmnd * scp, return fill_from_dev_buffer(scp, arr, len); } -static int resp_start_stop(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_start_stop(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char *cmd = scp->cmnd; int power_cond, stop; @@ -1612,8 +1612,8 @@ static sector_t get_sdebug_capacity(void) } #define SDEBUG_READCAP_ARR_SZ 8 -static int resp_readcap(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_readcap(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char arr[SDEBUG_READCAP_ARR_SZ]; unsigned int capac; @@ -1631,8 +1631,8 @@ static int resp_readcap(struct scsi_cmnd * scp, } #define SDEBUG_READCAP16_ARR_SZ 32 -static int resp_readcap16(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_readcap16(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char *cmd = scp->cmnd; unsigned char arr[SDEBUG_READCAP16_ARR_SZ]; @@ -1670,11 +1670,11 @@ static int resp_readcap16(struct scsi_cmnd * scp, #define SDEBUG_MAX_TGTPGS_ARR_SZ 1412 -static int resp_report_tgtpgs(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_report_tgtpgs(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char *cmd = scp->cmnd; - unsigned char * arr; + unsigned char *arr; int host_no = devip->sdbg_host->shost->host_no; int n, ret, alen, rlen; int port_group_a, port_group_b, port_a, port_b; @@ -1926,7 +1926,7 @@ static int resp_rsup_tmfs(struct scsi_cmnd *scp, /* <> */ -static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target) +static int resp_err_recov_pg(unsigned char *p, int pcontrol, int target) { /* Read-Write Error Recovery page for mode_sense */ unsigned char err_recov_pg[] = {0x1, 0xa, 0xc0, 11, 240, 0, 0, 0, 5, 0, 0xff, 0xff}; @@ -1937,7 +1937,7 @@ static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target) return sizeof(err_recov_pg); } -static int resp_disconnect_pg(unsigned char * p, int pcontrol, int target) +static int resp_disconnect_pg(unsigned char *p, int pcontrol, int target) { /* Disconnect-Reconnect page for mode_sense */ unsigned char disconnect_pg[] = {0x2, 0xe, 128, 128, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -1948,7 +1948,7 @@ static int resp_disconnect_pg(unsigned char * p, int pcontrol, int target) return sizeof(disconnect_pg); } -static
[PATCH v2] scsi_debug: implement IMMED bit
The Start Stop Unit (SSU) command takes in the order of a second to complete on some SAS SSDs and longer on hard disks. Synchronize Cache (SC) can also take some time. Both commands have an IMMED bit in their cdbs for those apps that don't want to wait. This patch introduces a long delay for those commands when the IMMED bit is clear. Since SC is a media access command then when the fake_rw option is active, its cdb processing is skipped and it returns immediately. The SSU command is not altered by the setting of the fake_rw option. These actions are not changed by this patch. Changes since v1: - clear the cdb mask of SYNCHRONIZE CACHE(16) cdb in byte 1, bit 0 Changes: - add the SYNCHRONIZE CACHE(16) command - together with the existing START STOP UNIT and SYNCHRONIZE CACHE(10) commands process the IMMED bit in their cdbs - if the IMMED bit is set, return immediately - if the IMMED bit is clear, treat the delay parameter as having a unit of one second - in the SYNCHRONIZE CACHE processing do a bounds check Signed-off-by: Douglas Gilbert--- drivers/scsi/scsi_debug.c | 76 --- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5986dae9020..828b27188f28 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -6,7 +6,7 @@ * anything out of the ordinary is seen. * ^^^ Original ^^^ * - * Copyright (C) 2001 - 2017 Douglas Gilbert + * Copyright (C) 2001 - 2018 Douglas Gilbert * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,8 +61,8 @@ #include "scsi_logging.h" /* make sure inq_product_rev string corresponds to this version */ -#define SDEBUG_VERSION "0187" /* format to fit INQUIRY revision field */ -static const char *sdebug_version_date = "20171202"; +#define SDEBUG_VERSION "0188" /* format to fit INQUIRY revision field */ +static const char *sdebug_version_date = "20180128"; #define MY_NAME "scsi_debug" @@ -234,6 +234,7 @@ static const char *sdebug_version_date = "20171202"; #define F_INV_OP 0x200 #define F_FAKE_RW 0x400 #define F_M_ACCESS 0x800 /* media access */ +#define F_LONG_DELAY 0x1000 #define FF_RESPOND (F_RL_WLUN_OK | F_SKIP_UA | F_DELAY_OVERR) #define FF_MEDIA_IO (F_M_ACCESS | F_FAKE_RW) @@ -349,7 +350,7 @@ enum sdeb_opcode_index { SDEB_I_XDWRITEREAD = 25,/* 10 only */ SDEB_I_WRITE_BUFFER = 26, SDEB_I_WRITE_SAME = 27, /* 10, 16 */ - SDEB_I_SYNC_CACHE = 28, /* 10 only */ + SDEB_I_SYNC_CACHE = 28, /* 10, 16 */ SDEB_I_COMP_WRITE = 29, SDEB_I_LAST_ELEMENT = 30, /* keep this last (previous + 1) */ }; @@ -382,7 +383,7 @@ static const unsigned char opcode_ind_arr[256] = { /* 0x80; 0x80->0x9f: 16 byte cdbs */ 0, 0, 0, 0, 0, SDEB_I_ATA_PT, 0, 0, SDEB_I_READ, SDEB_I_COMP_WRITE, SDEB_I_WRITE, 0, 0, 0, 0, 0, - 0, 0, 0, SDEB_I_WRITE_SAME, 0, 0, 0, 0, + 0, SDEB_I_SYNC_CACHE, 0, SDEB_I_WRITE_SAME, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, SDEB_I_SERV_ACT_IN_16, SDEB_I_SERV_ACT_OUT_16, /* 0xa0; 0xa0->0xbf: 12 byte cdbs */ SDEB_I_REPORT_LUNS, SDEB_I_ATA_PT, 0, SDEB_I_MAINT_IN, @@ -398,6 +399,14 @@ static const unsigned char opcode_ind_arr[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; +/* + * The following "response" functions return the SCSI mid-level's 4 byte + * tuple-in-an-int. To handle commands with an IMMED bit, for a faster + * command completion, they can mask their return value with + * SDEG_RES_IMMED_MASK . + */ +#define SDEG_RES_IMMED_MASK 0x4000 + static int resp_inquiry(struct scsi_cmnd *, struct sdebug_dev_info *); static int resp_report_luns(struct scsi_cmnd *, struct sdebug_dev_info *); static int resp_requests(struct scsi_cmnd *, struct sdebug_dev_info *); @@ -420,6 +429,7 @@ static int resp_write_same_16(struct scsi_cmnd *, struct sdebug_dev_info *); static int resp_xdwriteread_10(struct scsi_cmnd *, struct sdebug_dev_info *); static int resp_comp_write(struct scsi_cmnd *, struct sdebug_dev_info *); static int resp_write_buffer(struct scsi_cmnd *, struct sdebug_dev_info *); +static int resp_sync_cache(struct scsi_cmnd *, struct sdebug_dev_info *); /* * The following are overflow arrays for cdbs that "hit" the same index in @@ -499,6 +509,12 @@ static const struct opcode_info_t release_iarr[] = { {6, 0x1f, 0xff, 0, 0, 0xc7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, }; +static const struct opcode_info_t sync_cache_iarr[] = { + {0, 0x91, 0, F_LONG_DELAY | F_M_ACCESS, resp_sync_cache, NULL, + {16, 0x6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0x3f, 0xc7} }, /*
[PATCH] scsi: scsi_debug: Fix pointer stying issues
Pointer styling issues exposed by checkpatch.pl in scsi_debug.c: ERROR: "foo * bar" should be "foo *bar" Fixed 37 total errors reported. Signed-off-by: John Pittman--- drivers/scsi/scsi_debug.c | 72 +++ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5986da..a1f867f 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1155,8 +1155,8 @@ static int inquiry_vpd_84(unsigned char *arr) static int inquiry_vpd_85(unsigned char *arr) { int num = 0; - const char * na1 = "https://www.kernel.org/config;; - const char * na2 = "http://www.kernel.org/log;; + const char *na1 = "https://www.kernel.org/config;; + const char *na2 = "http://www.kernel.org/log;; int plen, olen; arr[num++] = 0x1; /* lu, storage config */ @@ -1372,7 +1372,7 @@ static int inquiry_vpd_b2(unsigned char *arr) static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) { unsigned char pq_pdt; - unsigned char * arr; + unsigned char *arr; unsigned char *cmd = scp->cmnd; int alloc_len, n, ret; bool have_wlun, is_disk; @@ -1523,10 +1523,10 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) static unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0, 0, 0, 0x0, 0x0}; -static int resp_requests(struct scsi_cmnd * scp, -struct sdebug_dev_info * devip) +static int resp_requests(struct scsi_cmnd *scp, +struct sdebug_dev_info *devip) { - unsigned char * sbuff; + unsigned char *sbuff; unsigned char *cmd = scp->cmnd; unsigned char arr[SCSI_SENSE_BUFFERSIZE]; bool dsense; @@ -1584,8 +1584,8 @@ static int resp_requests(struct scsi_cmnd * scp, return fill_from_dev_buffer(scp, arr, len); } -static int resp_start_stop(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_start_stop(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char *cmd = scp->cmnd; int power_cond, stop; @@ -1612,8 +1612,8 @@ static sector_t get_sdebug_capacity(void) } #define SDEBUG_READCAP_ARR_SZ 8 -static int resp_readcap(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_readcap(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char arr[SDEBUG_READCAP_ARR_SZ]; unsigned int capac; @@ -1631,8 +1631,8 @@ static int resp_readcap(struct scsi_cmnd * scp, } #define SDEBUG_READCAP16_ARR_SZ 32 -static int resp_readcap16(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_readcap16(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char *cmd = scp->cmnd; unsigned char arr[SDEBUG_READCAP16_ARR_SZ]; @@ -1670,11 +1670,11 @@ static int resp_readcap16(struct scsi_cmnd * scp, #define SDEBUG_MAX_TGTPGS_ARR_SZ 1412 -static int resp_report_tgtpgs(struct scsi_cmnd * scp, - struct sdebug_dev_info * devip) +static int resp_report_tgtpgs(struct scsi_cmnd *scp, + struct sdebug_dev_info *devip) { unsigned char *cmd = scp->cmnd; - unsigned char * arr; + unsigned char *arr; int host_no = devip->sdbg_host->shost->host_no; int n, ret, alen, rlen; int port_group_a, port_group_b, port_a, port_b; @@ -1926,7 +1926,7 @@ static int resp_rsup_tmfs(struct scsi_cmnd *scp, /* <> */ -static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target) +static int resp_err_recov_pg(unsigned char *p, int pcontrol, int target) { /* Read-Write Error Recovery page for mode_sense */ unsigned char err_recov_pg[] = {0x1, 0xa, 0xc0, 11, 240, 0, 0, 0, 5, 0, 0xff, 0xff}; @@ -1937,7 +1937,7 @@ static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target) return sizeof(err_recov_pg); } -static int resp_disconnect_pg(unsigned char * p, int pcontrol, int target) +static int resp_disconnect_pg(unsigned char *p, int pcontrol, int target) { /* Disconnect-Reconnect page for mode_sense */ unsigned char disconnect_pg[] = {0x2, 0xe, 128, 128, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -1948,7 +1948,7 @@ static int resp_disconnect_pg(unsigned char * p, int pcontrol, int target) return sizeof(disconnect_pg); } -static int resp_format_pg(unsigned char * p, int pcontrol, int target) +static int resp_format_pg(unsigned char *p, int pcontrol, int target) { /* Format device page for mode_sense */ unsigned char
Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & introduce force_blk_mq
Hi Kashyap, On Fri, Feb 09, 2018 at 02:12:16PM +0530, Kashyap Desai wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Friday, February 9, 2018 11:01 AM > > To: Kashyap Desai > > Cc: Hannes Reinecke; Jens Axboe; linux-bl...@vger.kernel.org; Christoph > > Hellwig; Mike Snitzer; linux-scsi@vger.kernel.org; Arun Easi; Omar > Sandoval; > > Martin K . Petersen; James Bottomley; Christoph Hellwig; Don Brace; > Peter > > Rivera; Paolo Bonzini; Laurence Oberman > > Subject: Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & introduce > > force_blk_mq > > > > On Fri, Feb 09, 2018 at 10:28:23AM +0530, Kashyap Desai wrote: > > > > -Original Message- > > > > From: Ming Lei [mailto:ming@redhat.com] > > > > Sent: Thursday, February 8, 2018 10:23 PM > > > > To: Hannes Reinecke > > > > Cc: Kashyap Desai; Jens Axboe; linux-bl...@vger.kernel.org; > > > > Christoph Hellwig; Mike Snitzer; linux-scsi@vger.kernel.org; Arun > > > > Easi; Omar > > > Sandoval; > > > > Martin K . Petersen; James Bottomley; Christoph Hellwig; Don Brace; > > > Peter > > > > Rivera; Paolo Bonzini; Laurence Oberman > > > > Subject: Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & > > > > introduce force_blk_mq > > > > > > > > On Thu, Feb 08, 2018 at 08:00:29AM +0100, Hannes Reinecke wrote: > > > > > On 02/07/2018 03:14 PM, Kashyap Desai wrote: > > > > > >> -Original Message- > > > > > >> From: Ming Lei [mailto:ming@redhat.com] > > > > > >> Sent: Wednesday, February 7, 2018 5:53 PM > > > > > >> To: Hannes Reinecke > > > > > >> Cc: Kashyap Desai; Jens Axboe; linux-bl...@vger.kernel.org; > > > > > >> Christoph Hellwig; Mike Snitzer; linux-scsi@vger.kernel.org; > > > > > >> Arun Easi; Omar > > > > > > Sandoval; > > > > > >> Martin K . Petersen; James Bottomley; Christoph Hellwig; Don > > > > > >> Brace; > > > > > > Peter > > > > > >> Rivera; Paolo Bonzini; Laurence Oberman > > > > > >> Subject: Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & > > > > > >> introduce force_blk_mq > > > > > >> > > > > > >> On Wed, Feb 07, 2018 at 07:50:21AM +0100, Hannes Reinecke > wrote: > > > > > >>> Hi all, > > > > > >>> > > > > > >>> [ .. ] > > > > > > > > > > > > Could you share us your patch for enabling global_tags/MQ on > > > > > megaraid_sas > > > > > > so that I can reproduce your test? > > > > > > > > > > > >> See below perf top data. "bt_iter" is consuming 4 times > > > > > >> more > > > CPU. > > > > > > > > > > > > Could you share us what the IOPS/CPU utilization effect is > > > > > > after > > > > > applying the > > > > > > patch V2? And your test script? > > > > > Regarding CPU utilization, I need to test one more time. > > > > > Currently system is in used. > > > > > > > > > > I run below fio test on total 24 SSDs expander attached. > > > > > > > > > > numactl -N 1 fio jbod.fio --rw=randread --iodepth=64 --bs=4k > > > > > --ioengine=libaio --rw=randread > > > > > > > > > > Performance dropped from 1.6 M IOPs to 770K IOPs. > > > > > > > > > > >>> This is basically what we've seen with earlier iterations. > > > > > >> > > > > > >> Hi Hannes, > > > > > >> > > > > > >> As I mentioned in another mail[1], Kashyap's patch has a big > > > > > >> issue, > > > > > > which > > > > > >> causes only reply queue 0 used. > > > > > >> > > > > > >> [1] https://marc.info/?l=linux-scsi=151793204014631=2 > > > > > >> > > > > > >> So could you guys run your performance test again after fixing > > > > > >> the > > > > > > patch? > > > > > > > > > > > > Ming - > > > > > > > > > > > > I tried after change you requested. Performance drop is still > > > unresolved. > > > > > > From 1.6 M IOPS to 770K IOPS. > > > > > > > > > > > > See below data. All 24 reply queue is in used correctly. > > > > > > > > > > > > IRQs / 1 second(s) > > > > > > IRQ# TOTAL NODE0 NODE1 NAME > > > > > > 360 16422 0 16422 IR-PCI-MSI 70254653-edge megasas > > > > > > 364 15980 0 15980 IR-PCI-MSI 70254657-edge megasas > > > > > > 362 15979 0 15979 IR-PCI-MSI 70254655-edge megasas > > > > > > 345 15696 0 15696 IR-PCI-MSI 70254638-edge megasas > > > > > > 341 15659 0 15659 IR-PCI-MSI 70254634-edge megasas > > > > > > 369 15656 0 15656 IR-PCI-MSI 70254662-edge megasas > > > > > > 359 15650 0 15650 IR-PCI-MSI 70254652-edge megasas > > > > > > 358 15596 0 15596 IR-PCI-MSI 70254651-edge megasas > > > > > > 350 15574 0 15574 IR-PCI-MSI 70254643-edge megasas > > > > > > 342 15532 0 15532 IR-PCI-MSI 70254635-edge megasas > > > > > > 344 15527 0 15527 IR-PCI-MSI 70254637-edge megasas > > > > > > 346 15485 0 15485 IR-PCI-MSI 70254639-edge megasas > > > > > > 361 15482 0 15482 IR-PCI-MSI 70254654-edge megasas > > > > > > 348 15467 0 15467 IR-PCI-MSI 70254641-edge megasas > > > > > > 368 15463 0
Re: [PATCH] scsi: pmcraid: remove redundant initializations of pointer 'ioadl'
Colin, > There are several occurrances where pointer ioadl is initialized with a > value that is never read and where it is re-assigned a new value later > on, hence the initialization is redundant and can be removed. Applied to 4.17/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 3/6] scsi: sym53c416: avoid section mismatch with LTO
Arnd, > Building with link time optimizations produces a false-postive section > mismatch warning: Applied to 4.17/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH] scsi: isci: remove redundant initialization to 'bit'
Colin, > Variable bit is initialized with a value that is never read and is > being updated immediately after the initialization, hence the > initialization is redundant and can be removed. Applied to 4.17/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 2/6] scsi: NCR53c406a: avoid section mismatch with LTO
Arnd, > Building with link time optimizations produces a false-postive section > mismatch warning: Applied to 4.17/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH v2 0/3] scsi: aacraid: Multi controller Kdump IOP reset handling
Raghava, > During Kdump aacraid controller IOP reset is invoked, IOP reset > takes approx 40 seconds to bring the controller back up and running. > with timeout of 120 seconds and anything more than 2 controllers > will cause kdump to timeout. > > This patchset implements a new reset mechanism called DropIO, that > induces the fw to drop any pending IO in the fw and making the reset > process quicker. Applied to 4.17/scsi-queue. Thanks for rebasing! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 6/6] scsi: qedf: use correct strncpy() size
Arnd, > gcc-8 warns during link-time optimization that the strncpy() call > passes the size of the source buffer rather than the destination: Applied to 4.17/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH] aacraid: fix shutdown crash when init fails
Meelis, > When aacraid init fails with "AAC0: adapter self-test failed.", > shutdown leads to UBSAN warning and then oops: Applied to 4.16/scsi-fixes. Thank you! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH v3 0/2] Code cleanup and bug fix for truncated CHAP name and secret
Nilesh, > Please consider below patch set for next 'scsi-fixes' submission. Applied to 4.16/scsi-fixes. Thank you! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 4/6] scsi: qedf: fix LTO-enabled build
Arnd, > The prototype for qedf_dbg_fops/qedf_debugfs_ops doesn't match the > definition, which causes the final link to fail with link-time > optimizations: Applied to 4.17/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH v2] scsi: mpt3sas: fix oops in error handlers after shutdown/unload
> This patch adds checks for 'ioc->remove_host' in the SCSI error > handlers, so not to access pointers/resources potentially freed > in the PCI shutdown/module unload path. The error handlers may > be invoked after shutdown/unload, depending on other components. Broadcom folks: Please review! -- Martin K. Petersen Oracle Linux Engineering
Re: rescan-scsi-bus causes arcmsr death
On Fri, 2018-02-09 at 19:58 +, Alex Richman wrote: > Feb 9 11:55:05 Space kernel: [58801.943460] BUG: scheduling while > atomic: ksoftirqd/19/85/0x0100 > [ ... ] > Feb 9 11:55:05 Space kernel: [58801.943546] [] > msleep+0x37/0x50 > Feb 9 11:55:05 Space kernel: [58801.943552] [] > arcmsr_queue_command+0x82/0xf40 [arcmsr] > [ ... ] (+Ching Huang) A SCSI .queuecommand() implementation must not sleep so I think this is a driver bug. Since I'm not familiar with the arcmsr driver I have CC'ed Ching Huang. I hope that he will be able to help you. Bart.
RE: [PATCH] aacraid: fix shutdown crash when init fails
> -Original Message- > From: mr...@math.ut.ee [mailto:mr...@math.ut.ee] On Behalf Of Meelis > Roos > Sent: Thursday, February 08, 2018 11:58 PM > To: linux-scsi@vger.kernel.org; dl-esc-Aacraid Linux Driver >> Subject: [PATCH] aacraid: fix shutdown crash when init fails > > > When aacraid init fails with "AAC0: adapter self-test failed.", shutdown > leads to > UBSAN warning and then oops: > > [154316.118423] > = > === > [154316.118508] UBSAN: Undefined behaviour in drivers/scsi/scsi_lib.c:2328:27 > [154316.118566] member access within null pointer of type 'struct Scsi_Host' > [154316.118631] CPU: 2 PID: 14530 Comm: reboot Tainted: GW > 4.15.0- > dirty #89 > [154316.118701] Hardware name: Hewlett Packard HP NetServer/HP System > Board, BIOS 4.06.46 PW 06/25/2003 [154316.118774] Call Trace: > [154316.118848] dump_stack+0x48/0x65 > [154316.118916] ubsan_epilogue+0xe/0x40 [154316.118976] > __ubsan_handle_type_mismatch+0xfb/0x180 > [154316.119043] scsi_block_requests+0x20/0x30 [154316.119135] > aac_shutdown+0x18/0x40 [aacraid] [154316.119196] > pci_device_shutdown+0x33/0x50 [154316.119269] > device_shutdown+0x18a/0x390 [...] [154316.123435] BUG: unable to handle > kernel NULL pointer dereference at 00f4 [154316.123515] IP: > scsi_block_requests+0xa/0x30 > > This is because aac_shutdown() does > > struct Scsi_Host *shost = pci_get_drvdata(dev); > scsi_block_requests(shost); > > and that assumes shost has been assigned with pci_set_drvdata(). > > However, pci_set_drvdata(pdev, shost) is done in aac_probe_one() far after > bailing out with error from calling the init function > ((*aac_drivers[index].init)(aac)), and when the init function fails, no error > is > returned from aac_probe_one() so PCI layer assumes there is driver attached, > and tries to shut it down later. > > Fix it by returning error from aac_probe_one() when card-specific init > function > fails. > > This fixes reboot on my HP NetRAID-4M with dead battery. > > Signed-off-by: Meelis Roos Reviewed-by: Dave Carroll
rescan-scsi-bus causes arcmsr death
Hi, We're seeing an odd rare interaction between rescan-scsi-bus and arcmsr, which manifests as these log messages, then a hang/panic: Feb 9 18:51:19 Space kernel: [ 2624.283565] arcmsr: abort scsi_cmnd(0x8807d06cc900), cmnd[0x8a,0x 0,0x 0,0x 0,0x 0,0x 1,0x 8,0xc0,0x2b,0xe8,0x 0,0x 0], scsi_id = 0x 0, scsi_lun = 0x 0. Feb 9 18:51:19 Space kernel: [ 2624.283604] arcmsr0: to abort command(0x8807d06cc900), ccb = 0x881058b11180 Feb 9 18:51:21 Space kernel: [ 2625.924838] arcmsr0: abort ccb = 0x881058b11180 not done yet, do not force aborting command! --- Snip many more --- On the (seemingly less common) occasion that it panics rather than hangs, it looks like this: Feb 9 11:55:05 Space kernel: [58801.943419] arcmsr9: abort scsi_cmnd(0x881027968900), cmnd[0x 0,0x 0,0x 0,0x 0,0x 0,0x 0,0x 0,0x 0,0x 0,0x 0,0x 0,0x 0], scsi_id = 0x 0, scsi_lun = 0x 0. Feb 9 11:55:05 Space kernel: [58801.943427] arcmsr9: to abort command(0x881027968900), ccb = 0x88085864a580 Feb 9 11:55:05 Space kernel: [58801.943429] arcmsr9: scsi id = 0 lun = 0 ccb = '0x88085864a580' polling a done ccb, abort successfully Feb 9 11:55:05 Space kernel: [58801.943460] BUG: scheduling while atomic: ksoftirqd/19/85/0x0100 Feb 9 11:55:05 Space kernel: [58801.943463] Modules linked in: xfs libcrc32c mlx4_ib ib_sa ib_mad ib_core ib_addr mlx4_en mlx4_core myri10ge bonding target_core_mod configfs ip6table_filter ip6_tables iptable_filter ip_tables ebtable_nat ebtables x_tables dm_crypt ipmi_ssif x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd sb_edac microcode edac_core lpc_ich ioatdma tpm_tis ipmi_si ipmi_msghandler 8250_fintek mac_hid nfsd auth_rpcgss pcspkr nfs_acl nfs lockd grace sunrpc fscache ext2 mlx5_core raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq raid1 raid0 multipath linear vxlan ip6_udp_tunnel udp_tunnel bcache hid_generic igb isci usbhid i2c_algo_bit libsas ahci dca hid libahci ptp scsi_transport_sas pps_core arcmsr(OE) [last unloaded: mlx4_core] Feb 9 11:55:05 Space kernel: [58801.943511] CPU: 19 PID: 85 Comm: ksoftirqd/19 Tainted: G OE 3.19.0-21-spacev3 #160915 Feb 9 11:55:05 Space kernel: [58801.943512] Hardware name: GBLabs Space+/X9DRH-7TF/7F/iTF/iF, BIOS 3.2 06/04/2015 Feb 9 11:55:05 Space kernel: [58801.943514] 88105bd13a08 88105bd13948 af6e521c Feb 9 11:55:05 Space kernel: [58801.943516] 88107fcf29c0 88105bd13958 af6dfa07 88105bd139c8 Feb 9 11:55:05 Space kernel: [58801.943517] af6e84fc 88105bcb41a0 000129c0 88105bd13fd8 Feb 9 11:55:05 Space kernel: [58801.943519] Call Trace: Feb 9 11:55:05 Space kernel: [58801.943528] [] dump_stack+0x45/0x57 Feb 9 11:55:05 Space kernel: [58801.943533] [] __schedule_bug+0x4b/0x59 Feb 9 11:55:05 Space kernel: [58801.943535] [] __schedule+0x75c/0x780 Feb 9 11:55:05 Space kernel: [58801.943537] [] schedule+0x29/0x70 Feb 9 11:55:05 Space kernel: [58801.943540] [] schedule_timeout+0x10b/0x210 Feb 9 11:55:05 Space kernel: [58801.943544] [] ? internal_add_timer+0x80/0x80 Feb 9 11:55:05 Space kernel: [58801.943546] [] msleep+0x37/0x50 Feb 9 11:55:05 Space kernel: [58801.943552] [] arcmsr_queue_command+0x82/0xf40 [arcmsr] Feb 9 11:55:05 Space kernel: [58801.943553] [] ? __slab_free+0x101/0x2c1 Feb 9 11:55:05 Space kernel: [58801.943555] [] ? __slab_free+0x101/0x2c1 Feb 9 11:55:05 Space kernel: [58801.943561] [] scsi_dispatch_cmd+0xaf/0x310 Feb 9 11:55:05 Space kernel: [58801.943563] [] scsi_request_fn+0x4f0/0x7e0 Feb 9 11:55:05 Space kernel: [58801.943566] [] __blk_run_queue+0x37/0x50 Feb 9 11:55:05 Space kernel: [58801.943568] [] blk_run_queue+0x26/0x40 Feb 9 11:55:05 Space kernel: [58801.943570] [] scsi_run_queue+0x230/0x2d0 Feb 9 11:55:05 Space kernel: [58801.943572] [] ? scsi_put_command+0x7d/0xd0 Feb 9 11:55:05 Space kernel: [58801.943575] [] scsi_end_request+0x142/0x1e0 Feb 9 11:55:05 Space kernel: [58801.943576] [] scsi_io_completion+0x109/0x6b0 Feb 9 11:55:05 Space kernel: [58801.943578] [] scsi_finish_command+0xcf/0x130 Feb 9 11:55:05 Space kernel: [58801.943580] [] scsi_softirq_done+0x137/0x160 Feb 9 11:55:05 Space kernel: [58801.943583] [] blk_done_softirq+0x83/0xa0 Feb 9 11:55:05 Space kernel: [58801.943587] [] __do_softirq+0xe4/0x270 Feb 9 11:55:05 Space kernel: [58801.943588] [] run_ksoftirqd+0x29/0x40 Feb 9 11:55:05 Space kernel: [58801.943593] [] smpboot_thread_fn+0x143/0x1b0 Feb 9 11:55:05 Space kernel: [58801.943596] [] ? SyS_setgroups+0x180/0x180 Feb 9 11:55:05 Space kernel: [58801.943598] [] kthread+0xd2/0xf0 Feb 9 11:55:05 Space kernel: [58801.943600] [] ? kthread_create_on_node+0x1c0/0x1c0 Feb 9 11:55:05 Space kernel: [58801.943602] [] ret_from_fork+0x58/0x90 Feb
[GIT PULL] target updates for v4.16-rc1
Hi Linus, Here are the target-pending updates for v4.16-rc1. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next The highlights include: - Numerous target-core-user improvements related to queue full and timeout handling. (MNC) - Prevent target-core-user corruption when invalid data page is requested. (MNC) - Add target-core device action configfs attributes to allow user-space to trigger events separate from existing attributes exposed to end-users. (MNC) - Fix iscsi-target NULL pointer dereference 4.6+ regression in CHAP error path. (David Disseldorp) - Avoid target-core backend UNMAP callbacks if range is zero. (Andrei Vagin) - Fix a iscsi-target 4.14+ regression related multiple PDU logins, that was exposed due to removal of TCP prequeue support. (Florian Westphal + MNC) Also, there is a iser-target bug still being worked on for post -rc1 code to address a long standing issue resulting in persistent ib_post_send() failures, for RNICs with small max_send_sge. Thank you, --nab Andrei Vagin (1): target: don't call an unmap callback if a range length is zero David Disseldorp (1): target/iscsi: avoid NULL dereference in CHAP auth error path Florian Westphal (1): iscsi-target: make sure to wake up sleeping login worker Luis de Bethencourt (1): tcmu: Fix trailing semicolon Markus Elfring (7): sbp-target: Delete an error message for a failed memory allocation in three functions target: tcm_loop: Delete an error message for a failed memory allocation in four functions target: tcm_loop: Improve a size determination in two functions target: tcm_loop: Combine substrings for 26 messages target: tcm_loop: Delete two unnecessary variable initialisations in tcm_loop_issue_tmr() target: tcm_loop: Delete an unnecessary return statement in tcm_loop_submission_work() target: tcm_loop: Use seq_puts() in tcm_loop_show_info() Mike Christie (19): tcmu: merge common block release code tcmu: split unmap_thread_fn tcmu: fix unmap thread race tcmu: move expired command completion to unmap thread tcmu: remove commands_lock tcmu: release blocks for partially setup cmds tcmu: simplify scatter_data_area error handling tcmu: fix free block calculation tcmu: prep queue_cmd_ring to be used by unmap wq tcmu: simplify dbi thresh handling tcmu: don't block submitting context for block waits tcmu: make ring buffer timer configurable tcmu: allow max block and global max blocks to be settable tcmu: prevent corruption when invalid data page requested target: add SAM_STAT_BUSY sense reason target_core_user: add cmd id to broken ring message target core: add device action configfs files tcmu: allow userspace to reset ring tcmu: fix cmd user after free Rasmus Villemoes (1): target-core: don't use "const char*" for a buffer that is written to Varun Prakash (1): cxgbit: call neigh_event_send() to update MAC address Wei Yongjun (1): tcmu: fix error return code in tcmu_configure_device() Xiubo Li (1): tcmu: clean up the scatter helper tangwenji (2): tcmu: fix page addr in tcmu_flush_dcache_range target: fix destroy device in target_configure_device drivers/target/iscsi/cxgbit/cxgbit_cm.c | 3 + drivers/target/iscsi/iscsi_target_auth.c | 3 +- drivers/target/iscsi/iscsi_target_nego.c | 3 + drivers/target/loopback/tcm_loop.c | 145 ++--- drivers/target/sbp/sbp_target.c | 13 +- drivers/target/target_core_configfs.c| 6 + drivers/target/target_core_device.c | 4 +- drivers/target/target_core_fabric_lib.c | 6 +- drivers/target/target_core_internal.h| 3 +- drivers/target/target_core_pr.c | 4 +- drivers/target/target_core_sbc.c | 8 +- drivers/target/target_core_transport.c | 3 + drivers/target/target_core_user.c| 983 ++- include/target/target_core_backend.h | 1 + include/target/target_core_base.h| 2 + 15 files changed, 798 insertions(+), 389 deletions(-)
RE: [PATCH 0/5] blk-mq/scsi-mq: support global tags & introduce force_blk_mq
> -Original Message- > From: Ming Lei [mailto:ming@redhat.com] > Sent: Friday, February 9, 2018 11:01 AM > To: Kashyap Desai > Cc: Hannes Reinecke; Jens Axboe; linux-bl...@vger.kernel.org; Christoph > Hellwig; Mike Snitzer; linux-scsi@vger.kernel.org; Arun Easi; Omar Sandoval; > Martin K . Petersen; James Bottomley; Christoph Hellwig; Don Brace; Peter > Rivera; Paolo Bonzini; Laurence Oberman > Subject: Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & introduce > force_blk_mq > > On Fri, Feb 09, 2018 at 10:28:23AM +0530, Kashyap Desai wrote: > > > -Original Message- > > > From: Ming Lei [mailto:ming@redhat.com] > > > Sent: Thursday, February 8, 2018 10:23 PM > > > To: Hannes Reinecke > > > Cc: Kashyap Desai; Jens Axboe; linux-bl...@vger.kernel.org; > > > Christoph Hellwig; Mike Snitzer; linux-scsi@vger.kernel.org; Arun > > > Easi; Omar > > Sandoval; > > > Martin K . Petersen; James Bottomley; Christoph Hellwig; Don Brace; > > Peter > > > Rivera; Paolo Bonzini; Laurence Oberman > > > Subject: Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & > > > introduce force_blk_mq > > > > > > On Thu, Feb 08, 2018 at 08:00:29AM +0100, Hannes Reinecke wrote: > > > > On 02/07/2018 03:14 PM, Kashyap Desai wrote: > > > > >> -Original Message- > > > > >> From: Ming Lei [mailto:ming@redhat.com] > > > > >> Sent: Wednesday, February 7, 2018 5:53 PM > > > > >> To: Hannes Reinecke > > > > >> Cc: Kashyap Desai; Jens Axboe; linux-bl...@vger.kernel.org; > > > > >> Christoph Hellwig; Mike Snitzer; linux-scsi@vger.kernel.org; > > > > >> Arun Easi; Omar > > > > > Sandoval; > > > > >> Martin K . Petersen; James Bottomley; Christoph Hellwig; Don > > > > >> Brace; > > > > > Peter > > > > >> Rivera; Paolo Bonzini; Laurence Oberman > > > > >> Subject: Re: [PATCH 0/5] blk-mq/scsi-mq: support global tags & > > > > >> introduce force_blk_mq > > > > >> > > > > >> On Wed, Feb 07, 2018 at 07:50:21AM +0100, Hannes Reinecke wrote: > > > > >>> Hi all, > > > > >>> > > > > >>> [ .. ] > > > > > > > > > > Could you share us your patch for enabling global_tags/MQ on > > > > megaraid_sas > > > > > so that I can reproduce your test? > > > > > > > > > >> See below perf top data. "bt_iter" is consuming 4 times > > > > >> more > > CPU. > > > > > > > > > > Could you share us what the IOPS/CPU utilization effect is > > > > > after > > > > applying the > > > > > patch V2? And your test script? > > > > Regarding CPU utilization, I need to test one more time. > > > > Currently system is in used. > > > > > > > > I run below fio test on total 24 SSDs expander attached. > > > > > > > > numactl -N 1 fio jbod.fio --rw=randread --iodepth=64 --bs=4k > > > > --ioengine=libaio --rw=randread > > > > > > > > Performance dropped from 1.6 M IOPs to 770K IOPs. > > > > > > > > >>> This is basically what we've seen with earlier iterations. > > > > >> > > > > >> Hi Hannes, > > > > >> > > > > >> As I mentioned in another mail[1], Kashyap's patch has a big > > > > >> issue, > > > > > which > > > > >> causes only reply queue 0 used. > > > > >> > > > > >> [1] https://marc.info/?l=linux-scsi=151793204014631=2 > > > > >> > > > > >> So could you guys run your performance test again after fixing > > > > >> the > > > > > patch? > > > > > > > > > > Ming - > > > > > > > > > > I tried after change you requested. Performance drop is still > > unresolved. > > > > > From 1.6 M IOPS to 770K IOPS. > > > > > > > > > > See below data. All 24 reply queue is in used correctly. > > > > > > > > > > IRQs / 1 second(s) > > > > > IRQ# TOTAL NODE0 NODE1 NAME > > > > > 360 16422 0 16422 IR-PCI-MSI 70254653-edge megasas > > > > > 364 15980 0 15980 IR-PCI-MSI 70254657-edge megasas > > > > > 362 15979 0 15979 IR-PCI-MSI 70254655-edge megasas > > > > > 345 15696 0 15696 IR-PCI-MSI 70254638-edge megasas > > > > > 341 15659 0 15659 IR-PCI-MSI 70254634-edge megasas > > > > > 369 15656 0 15656 IR-PCI-MSI 70254662-edge megasas > > > > > 359 15650 0 15650 IR-PCI-MSI 70254652-edge megasas > > > > > 358 15596 0 15596 IR-PCI-MSI 70254651-edge megasas > > > > > 350 15574 0 15574 IR-PCI-MSI 70254643-edge megasas > > > > > 342 15532 0 15532 IR-PCI-MSI 70254635-edge megasas > > > > > 344 15527 0 15527 IR-PCI-MSI 70254637-edge megasas > > > > > 346 15485 0 15485 IR-PCI-MSI 70254639-edge megasas > > > > > 361 15482 0 15482 IR-PCI-MSI 70254654-edge megasas > > > > > 348 15467 0 15467 IR-PCI-MSI 70254641-edge megasas > > > > > 368 15463 0 15463 IR-PCI-MSI 70254661-edge megasas > > > > > 354 15420 0 15420 IR-PCI-MSI 70254647-edge megasas > > > > > 351 15378 0 15378 IR-PCI-MSI 70254644-edge megasas > > > > > 352 15377 0 15377 IR-PCI-MSI 70254645-edge megasas > > > > > 356 15348 0 15348
Re: [PATCH] scsi: storvsc: missing error code in storvsc_probe()
On Thu, Feb 08, 2018 at 04:50:40PM -0700, Long Li wrote: > From: Long LiNo, Dan wrote the first patch here, don't change the authorship of a patch :( Now fixed up by hand...