On Wed, Mar 02, 2016 at 06:07:11PM +0100, Christoph Hellwig wrote: > Factor out a helper to set all the device specific queue limits and apply > them to the admin queue in addition to the I/O queues. Without this the > command size on the admin queue is arbitrarily low, and the missing > other limitations are just minefields waiting for victims. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > Reported-by: Jeff Lien <Jeff.Lien@xxxxxxxx> > Tested-by: Jeff Lien <Jeff.Lien@xxxxxxxx> Looks fine. The chunk size and flush settings don't hurt, but are unnecessary for an admin queue. Reviewed-by: Keith Busch <keith.busch@xxxxxxxxx> > +static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, > + struct request_queue *q) > +{ > + if (ctrl->max_hw_sectors) { > + blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); > + blk_queue_max_segments(q, > + (ctrl->max_hw_sectors / (ctrl->page_size >> 9)) + 1); > + } > + if (ctrl->stripe_size) > + blk_queue_chunk_sectors(q, ctrl->stripe_size >> 9); > + if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) > + blk_queue_flush(q, REQ_FLUSH | REQ_FUA); > + blk_queue_virt_boundary(q, ctrl->page_size - 1); > +} -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html