[RESEND-nvme-4.13] nvme: Implement NS Optimal IO Boundary from 1.3 Spec

Christoph Hellwig hch at lst.de
Thu Jun 15 05:27:17 PDT 2017


Hi Scott,

can you resend this against the nvme-4.13 tree, it clashes badly
with some of the other changes.

Also a few comments:

>  	blk_queue_logical_block_size(ns->queue, bs);
> +	if (ns->noiob) {
> +		/* Convert from controller logical blocks to 512 sectors. */
> +		iob = (((unsigned int)ns->noiob) << ns->lba_shift) >> 9;
> +		iob = rounddown_pow_of_two(iob);
> +		blk_queue_chunk_sectors(ns->queue, iob);
> +	}

What about moving this into a little helper:

static void nvme_set_chunk_size(struct nvme_ns *ns)
{
	unsigned int chunk_size = (((u32)ns->noiob) << ns->lba_shift) >> 9;

	blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(chunk_size));
}



More information about the Linux-nvme mailing list