All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: Read request exceeding max_hw_sectors_kb
Date: Wed, 13 Jun 2018 13:47:56 +0200	[thread overview]
Message-ID: <20180613114756.GA27631@lst.de> (raw)
In-Reply-To: <0ba3cccb9d2ee7cba50a91bfc92b373a@mail.gmail.com>

On Wed, Jun 13, 2018@04:11:56PM +0530, Jitendra Bhivare wrote:
> So something like resolves the issue:
> static void nvme_set_chunk_size(struct nvme_ns *ns)
> {
> 	u32 chunk_size = (((u32)ns->noiob) << (ns->lba_shift - 9));
> 
> 	chunk_size = rounddown_pow_of_two(chunk_size);
> 	chunk_size = min(ns->ctrl->max_hw_sectors, chunk_size);
> 	blk_queue_chunk_sectors(ns->queue,
> rounddown_pow_of_two(chunk_size));
> }
> 
> Please do let me know if this is the right approach or SPDK should set
> noiob appropriately.

I think the answer is both:  The kernel code should be more robust
in handling bogus noiob sizes, so please submit a patch per your above
analysis.  spdk should be fixed to not expose a bogus noiob size as well.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch at lst.de>
To: spdk@lists.01.org
Subject: Re: [SPDK] Read request exceeding max_hw_sectors_kb
Date: Wed, 13 Jun 2018 13:47:56 +0200	[thread overview]
Message-ID: <20180613114756.GA27631@lst.de> (raw)
In-Reply-To: 0ba3cccb9d2ee7cba50a91bfc92b373a@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

On Wed, Jun 13, 2018 at 04:11:56PM +0530, Jitendra Bhivare wrote:
> So something like resolves the issue:
> static void nvme_set_chunk_size(struct nvme_ns *ns)
> {
> 	u32 chunk_size = (((u32)ns->noiob) << (ns->lba_shift - 9));
> 
> 	chunk_size = rounddown_pow_of_two(chunk_size);
> 	chunk_size = min(ns->ctrl->max_hw_sectors, chunk_size);
> 	blk_queue_chunk_sectors(ns->queue,
> rounddown_pow_of_two(chunk_size));
> }
> 
> Please do let me know if this is the right approach or SPDK should set
> noiob appropriately.

I think the answer is both:  The kernel code should be more robust
in handling bogus noiob sizes, so please submit a patch per your above
analysis.  spdk should be fixed to not expose a bogus noiob size as well.

  reply	other threads:[~2018-06-13 11:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 10:41 Read request exceeding max_hw_sectors_kb Jitendra Bhivare
2018-06-13 10:41 ` [SPDK] " Jitendra Bhivare
2018-06-13 11:47 ` Christoph Hellwig [this message]
2018-06-13 11:47   ` Christoph Hellwig
2018-06-13 17:00   ` Daniel Verkamp
2018-06-13 17:00     ` [SPDK] " Daniel Verkamp
2018-06-14 10:16     ` Jitendra Bhivare
2018-06-14 10:16       ` [SPDK] " Jitendra Bhivare
2018-06-14 14:54 ` Keith Busch
2018-06-14 14:54   ` [SPDK] " Keith Busch
2018-06-15 13:58   ` Jitendra Bhivare
2018-06-15 13:58     ` [SPDK] " Jitendra Bhivare
2018-06-26 10:47   ` Jitendra Bhivare
2018-06-26 10:47     ` [SPDK] " Jitendra Bhivare
2018-06-26 15:07     ` Keith Busch
2018-06-26 15:07       ` [SPDK] " Keith Busch
2018-06-27 10:28       ` Jitendra Bhivare
2018-06-27 10:28         ` [SPDK] " Jitendra Bhivare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180613114756.GA27631@lst.de \
    --to=hch@lst.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.