[PATCH v2 3/4] nvme: enable SG gaps support

Sagi Grimberg sagi at grimberg.me
Sun Apr 23 02:45:39 PDT 2017


> Each block queue has a ->dma_alignment field, which is set to 511
> by default unless changed.  Everything not aligned to that will be
> bounced in __blk_rq_map_user_iov and friends before we send it to
> the driver.

Thanks, I missed the default setting...

>> I also just tested Bart's unaligned test [1] on scsi_debug and it seems
>> to go through as well (alignment and length are 4)...
>
> SCSI reduces the alignment in __scsi_init_queue:
>
> 	/*
>          * set a reasonable default alignment on word boundaries: the
> 	 * host and device may alter it using
> 	 * blk_queue_update_dma_alignment() later.
> 	 */
> 	blk_queue_dma_alignment(q, 0x03);

That explains why I was able to test that with iSER :)

I guess I didn't test single byte alignment after all, but
I definitely remember using less than a sector...

> still would fit NVMe dword-alignment SGLs, though :)

I would say its useful to have, but its only relevant to ioctls as
normal io we explicitly on sub logical block size alignment.

Anyways, I still think having ctrl->virt_boundary instead of
ctrl->sg_gap_support is cleaner...



More information about the Linux-nvme mailing list