* [PATCH 4/6] scsi-mq: init sg in scsi_init_io.
@ 2013-11-29 8:42 majianpeng
2013-12-23 6:43 ` Nicholas A. Bellinger
0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-11-29 8:42 UTC (permalink / raw)
To: nab; +Cc: linux-scsi
Make scsi-mq support blk-pc-command.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
drivers/scsi/scsi_lib.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index bed596e..679e840 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1059,9 +1059,11 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)
/*
* Use pre-allocation of cmd->sdb scatterlists with scsi-mq..
*/
-//FIXME: scsi-mq dif descriptor init within scsi_init_io
if (rq->mq_ctx) {
BUG_ON(rq->nr_phys_segments > SCSI_MAX_SG_SEGMENTS);
+ cmd->sdb.table.sgl = cmd->mq_sgl;
+ cmd->sdb.table.nents = rq->nr_phys_segments;
+ sg_init_table(cmd->sdb.table.sgl, rq->nr_phys_segments);
scsi_init_sgtable(rq, &cmd->sdb);
return BLKPREP_OK;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4/6] scsi-mq: init sg in scsi_init_io.
2013-11-29 8:42 [PATCH 4/6] scsi-mq: init sg in scsi_init_io majianpeng
@ 2013-12-23 6:43 ` Nicholas A. Bellinger
0 siblings, 0 replies; 2+ messages in thread
From: Nicholas A. Bellinger @ 2013-12-23 6:43 UTC (permalink / raw)
To: majianpeng; +Cc: linux-scsi
On Fri, 2013-11-29 at 16:42 +0800, majianpeng wrote:
> Make scsi-mq support blk-pc-command.
>
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
> drivers/scsi/scsi_lib.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index bed596e..679e840 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1059,9 +1059,11 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)
> /*
> * Use pre-allocation of cmd->sdb scatterlists with scsi-mq..
> */
> -//FIXME: scsi-mq dif descriptor init within scsi_init_io
> if (rq->mq_ctx) {
> BUG_ON(rq->nr_phys_segments > SCSI_MAX_SG_SEGMENTS);
> + cmd->sdb.table.sgl = cmd->mq_sgl;
> + cmd->sdb.table.nents = rq->nr_phys_segments;
> + sg_init_table(cmd->sdb.table.sgl, rq->nr_phys_segments);
> scsi_init_sgtable(rq, &cmd->sdb);
> return BLKPREP_OK;
> }
Doesn't seem to be necessary for TYPE_ROM either..?
So requests of REQ_TYPE_BLOCK_PC for TYPE_ROM with scsi-mq are having
their sc->sdb.table setup from pre-allocated SGLs at the start of
scsi_mq_queue_rq(), before q->prep_rq_fn() -> sr_prep_fn() ->
scsi_setup_blk_pc_cmnd() is called.
--nab
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-23 6:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29 8:42 [PATCH 4/6] scsi-mq: init sg in scsi_init_io majianpeng
2013-12-23 6:43 ` Nicholas A. Bellinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).