From 771e0fd62e57f54aa25c732d8e67d1c8530f9d53 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Thu, 10 Sep 2015 08:10:32 -0700 Subject: [PATCH] NVMe: Setup max hardware sector count to 512KB MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Linux in box NVMe driver does not handle 0 MDTS as expected •0 MDTS - the drive can accept any request size. •The device driver set up max hardware sector size by BLK_SAFE_MAX_SECTORS or 124KB. •Every IO size greater than 124KB is splitted by 124KB and remainder. Hence performance drop at 128KB IO size. Orabug: 21818316 Acked-by: Martin K. Petersen Signed-off-by: Santosh Shilimkar --- drivers/block/nvme-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 244fda76b689..b1b808cf375b 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -2447,6 +2447,9 @@ static int nvme_dev_add(struct nvme_dev *dev) memcpy(dev->firmware_rev, ctrl->fr, sizeof(ctrl->fr)); if (ctrl->mdts) dev->max_hw_sectors = 1 << (ctrl->mdts + shift - 9); + else + dev->max_hw_sectors = 512 * 1024 / 512; + if ((pdev->vendor == PCI_VENDOR_ID_INTEL) && (pdev->device == 0x0953) && ctrl->vs[3]) { unsigned int max_hw_sectors; -- 2.50.1