All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] nvme: nidt and ns-desc related clanup
@ 2021-05-18  5:05 Chaitanya Kulkarni
  2021-05-18  5:05 ` [PATCH 1/4] nvme: calculate data offset once for ns-desc Chaitanya Kulkarni
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-18  5:05 UTC (permalink / raw)
  To: linux-nvme; +Cc: kbusch, hch, sagi, Chaitanya Kulkarni

Hi,

This is a small patch-series tries to minimize the number of the macro
identifiers. 

In the current code we maintain NVME_NIDT_XXX identifire values and the
their length NVME_NIDT_XXX_LEN separately which has 1:1 mapping. This
adds founr extra macros and open coding of such macros in the host and
the target.

With this open coding in future we will have to maintain one extra macro
representing length for each new NIDT identifire that we will add.

I did the light testing on this with nvme-loop [1].

-ck

Chaitanya Kulkarni (4):
  nvme: calculate data offset once for ns-desc
  nvme-core: add a helper to get the len from nid
  nvmet: use nvme_nidt_len() helper for id-desc
  nvme-core: remove the NVME_NIDT_XXX_LEN macros

 drivers/nvme/host/core.c        | 25 +++++++++++++------------
 drivers/nvme/target/admin-cmd.c |  8 +++++---
 include/linux/nvme.h            | 21 ++++++++++++++++-----
 3 files changed, 34 insertions(+), 20 deletions(-)

# nvme list  | tr -s ' ' ' ' | grep -v '-'
Node SN Model Namespace Usage Format FW Rev 
/dev/nvme0n1 foo QEMU NVMe Ctrl 1 1.07 GB / 1.07 GB 512 B + 0 B 1.0 
/dev/nvme1n1 e3a9ed423c786510 Linux 1 2.15 GB / 2.15 GB 4 KiB + 0 B 5.12.0nv
# cat /sys/kernel/config/nvmet/subsystems/z/namespaces/1/device_nguid 
11111111-2222-3333-4444-000000000000
# cat /sys/kernel/config/nvmet/subsystems/z/namespaces/1/device_uuid 
aeed37e9-39b3-48cc-bc9d-1c799fa56df7
# nvme ns-descs /dev/nvme1n1 
NVME Namespace Identification Descriptors NS 1:
uuid    : aeed37e9-39b3-48cc-bc9d-1c799fa56df7
nguid   : 11111111222233334444000000000000

-- 
2.22.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-18 20:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  5:05 [PATCH 0/4] nvme: nidt and ns-desc related clanup Chaitanya Kulkarni
2021-05-18  5:05 ` [PATCH 1/4] nvme: calculate data offset once for ns-desc Chaitanya Kulkarni
2021-05-18  5:05 ` [PATCH 2/4] nvme-core: add a helper to get the len from nid Chaitanya Kulkarni
2021-05-18  5:05 ` [PATCH 3/4] nvmet: use nvme_nidt_len() helper for id-desc Chaitanya Kulkarni
2021-05-18  5:05 ` [PATCH 4/4] nvme-core: remove the NVME_NIDT_XXX_LEN macros Chaitanya Kulkarni
2021-05-18  6:49 ` [PATCH 0/4] nvme: nidt and ns-desc related clanup Christoph Hellwig
2021-05-18 20:29   ` Chaitanya Kulkarni

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.