lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <EA06876956CB4AC4A0678AD1E6E72840@usish.com.cn>
Date:	Wed, 27 Oct 2010 09:52:07 +0800
From:	"Jack Wang" <jack_wang@...sh.com>
To:	"'Nicholas A. Bellinger'" <nab@...ux-iscsi.org>,
	"'linux-scsi'" <linux-scsi@...r.kernel.org>,
	"'linux-kernel'" <linux-kernel@...r.kernel.org>,
	"'Vasu Dev'" <vasu.dev@...ux.intel.com>,
	"'Tim Chen'" <tim.c.chen@...ux.intel.com>,
	"'Andi Kleen'" <ak@...ux.intel.com>,
	"'Matthew Wilcox'" <willy@...ux.intel.com>,
	"'James Bottomley'" <James.Bottomley@...e.de>,
	"'Mike Christie'" <michaelc@...wisc.edu>,
	"'Jens Axboe'" <jaxboe@...ionio.com>
Cc:	"'James Smart'" <james.smart@...lex.com>,
	"'Andrew Vasquez'" <andrew.vasquez@...gic.com>,
	"'FUJITA Tomonori'" <fujita.tomonori@....ntt.co.jp>,
	"'Hannes Reinecke'" <hare@...e.de>,
	"'Joe Eykholt'" <jeykholt@...co.com>,
	"'Christoph Hellwig'" <hch@....de>,
	"'Jon Hawley'" <warthog9@...nel.org>,
	"'MPTFusionLinux'" <DL-MPTFusionLinux@....com>,
	"'eata.c maintainer'" <dario.ballabio@...ind.it>,
	"'Luben Tuikov'" <ltuikov@...oo.com>,
	"'mvsas maintainer'" <kewei@...vell.com>
Subject: RE: [PATCH] scsi: Add SHT->unlocked_qcmd for host_lock less SHT->queuecommand() dispatch


From: Nicholas Bellinger <nab@...ux-iscsi.org>

Greetings all,

This patch adds scsi_dispatch_cmd_unlocked() and scsi_dispatch_cmd_locked()
which are now called directly from scsi_dispatch_cmd() depending upon what
is reported by SHT->unlocked_qcmd on a per driver basis.  Note that by
default
unlocked_qcmd is disabled, and all LLDs not defining a SHT->unlocked_qcmd
will
be using the legacy scsi_dispatch_cmd_locked().

This patch also drops the usage of scsi_cmd_get_serial() in
scsi_dispatch_cmd()
and assumes the legacy SCSI LLDs that depend upon struct
scsi_cmnd->serial_number
will call the now EXPORT_SYMBOL()'ed scsi_cmd_get_serial() call.

This patch also adds a cmd->eh_eflags |= SCSI_EH_SOFTIRQ_DONE assignment in
scsi_softirq_done() in order to signal scsi_try_to_abort_cmd() that the
command
has been completed.  This patch uses blk_test_rq_complete() together with a
new SCSI_EH_SOFTIRQ_DONE in scsi_error.c:scsi_try_to_abort_cmd() in order to
handle the struct scsi_cmnd timeout case intsead w/o scmd->serial_number
usage:

-	if (scmd->serial_number == 0)
+	if ((blk_test_rq_complete(scmd->request)) &&
+	    (scmd->eh_eflags & SCSI_EH_SOFTIRQ_DONE))
		return SUCCESS;

Finally, this patch also converts the remaining struct
Scsi_Host->cmd_serial_number
to atomic_t following a recommedation by Joe Eykholt to start struct
Scsi_Host->
cmd_serial_number at 1, and increment each serial_number by 2 so that the
serial is odd, and wraps to 1 instead of 0.  struct
Scsi_Host->cmd_serial_number
is initialized to '1' in drivers/scsi/hosts.c:scsi_host_alloc().

Along with the changes to SCSI ML, this series includes the following LLD
commits to enable lock-less operation for certain LLDs, and adds the explict
scsi_cmd_get_serial() to the legacy LLDs still requring cmd->serial_number
for anything beyond informational purposes:

libiscsi: Remove host_lock unlock() + lock() from iscsi_queuecommand()
libsas: Remove host_lock unlock() + lock() from sas_queuecommand()
aic94xx: Set SHT->unlocked_qcmd=1 for libsas queuecommand()
mvsas: Set SHT->unlocked_qcmd=1 for libsas queuecommand()
pm8001: Set SHT->unlocked_qcmd=1 for libsas queuecommand()
libata: Remove host_lock unlock() + lock() from ata_scsi_queuecmd()
lpfc: Remove host_lock unlock() + lock() from lpfc_queuecommand()
qla4xxx: Remove host_lock unlock() + lock() from qla4xxx_queuecommand()
qla2xxx: Remove host_lock unlock() + lock() from qla2xxx_queuecommand()
fnic: Remove host_lock unlock() + lock() from fnic_queuecommand()
mpt2sas: Add scsi_cmd_get_serial() call and set SHT->unlocked_qcmd=1
mpt/fusion: Add scsi_cmd_get_serial() call and set SHT->unlocked_qcmd=1
dpt_i2o: Add scsi_cmd_get_serial() call
eata: Add scsi_cmd_get_serial() call
u14-34f: Add scsi_cmd_get_serial() call


Signed-off-by: Nicholas A. Bellinger <nab@...ux-iscsi.org>
Acked-by: Ravi Anand <ravi.anand@...gic.com> (for qla2xx)
Acked-by: Luben Tuikov <ltuikov@...oo.com> (for aic94xx)

Hi, Nab

Please consider to add my ack. Thanks!
Acked-by: Jack Wang <jack_wang@...sh.com> (for pm8001)

Jack

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ