All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Matias Bjørling" <m@bjorling.me>
Subject: [PATCH 5/5] lightnvm: set block priority in nvm_set_rqd_ppalist()
Date: Tue, 26 Apr 2016 12:31:10 +0200	[thread overview]
Message-ID: <1461666670-30996-6-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1461666670-30996-1-git-send-email-m@bjorling.me>

When a ppa_list with vblks is expanded, it can either go block or
plane first. Currently it is been plane first. This works well for a
single vblk that is expanded, but fails for controllers that
require data for all planes is grouped together. Make the ppa_list
expand first expand with block, and then plane to support this
behavior.

 Before (2 blocks, 4 planes per vblk)
  idx block plane
   0      0     0
   1      1     0
   2      0     1
   3      1     1
   4      0     2
   5      1     2
   6      0     3
   7      1     3

 After
  idx block plane
   0      0     0
   1      0     1
   2      0     2
   3      0     3
   4      1     0
   5      1     1
   6      1     2
   7      1     3

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/lightnvm/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index de5db7b..0e82798 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -279,7 +279,8 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd,
 		for (i = 0; i < nr_ppas; i++) {
 			for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) {
 				ppas[i].g.pl = pl_idx;
-				rqd->ppa_list[(pl_idx * nr_ppas) + i] = ppas[i];
+				rqd->ppa_list[(plane_cnt * i) + pl_idx] =
+									ppas[i];
 			}
 		}
 	}
-- 
2.1.4

  parent reply	other threads:[~2016-04-26 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 10:31 [PATCH 0/5] LightNVM fixes Matias Bjørling
2016-04-26 10:31 ` [PATCH 1/5] lightnvm: introduce nvm_for_each_lun_ppa() macro Matias Bjørling
2016-04-26 10:31 ` [PATCH 2/5] lightnvm: refactor device ops->get_bb_tbl() Matias Bjørling
2016-04-26 10:31 ` [PATCH 3/5] lightnvm: remove struct factory_blks Matias Bjørling
2016-04-26 10:31 ` [PATCH 4/5] lightnvm: make nvm_set_rqd_ppalist() aware of vblks Matias Bjørling
2016-04-26 10:31 ` Matias Bjørling [this message]
2016-04-26 14:35 ` [PATCH 0/5] LightNVM fixes Jens Axboe
2016-04-26 14:57   ` Matias Bjørling

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=1461666670-30996-6-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.