All of lore.kernel.org
 help / color / mirror / Atom feed
From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH V6 0/6] nvme-cli: Introduce nvme-status mapping with errno
Date: Wed,  5 Jun 2019 00:40:28 +0900	[thread overview]
Message-ID: <20190604154034.23386-1-minwoo.im.dev@gmail.com> (raw)

Hi,

The first three patches have been added in this series to make sure
the previous ununiformed return type and positions in the subcommands.
Some commands used to return the negative error values in case of
internal errors, but some didn't.  Also returning in the middle of the
subcommands are not proper for the errno-mapping which is introduced
here.  The first three patches are going to fix them first.

This patchset introduces nvme-status module to manage mapping
relationships between nvme error status and errno.  It cannot be
directly mapped in 1:1, but we can figure out what kind of errors
happended by the return value of nvme-cli.

NVMe status fields are 16bits to indicate, but UNIX return value from
main() will be parsed in 8bits so that we need to do something about
return value to indicate nvme error status.

This patch series has been tested with:
  - nvme pcie device controller/namespaces
  - nvme loop target with nvme-fabrics

The branch on github can be found at:
  https://github.com/minwooim/nvme-cli.git for-1.9/return-negative-errno-v6

Please review.
Thanks,

Changes to previous V5:
  - The first patch has been updated being without an whitespace in
    front of new label("ret") in a function.  The other lables added
    followed the existing style in where it belongs to.
    The default style would be great to follow the kernel style which
    is non-space label, as suggested by Chaitanya.
  - The second patch has been updated to have "out" named label just
    like the others in that file(fabrics).
  - No functional changed in this version 6.  Only style change has been
    applied.

Changes to previous V4:
  - Add the first three patches before introducing errno mapping module.

Changes to previous V3:
  - Fix to return 0 when given error is 0 which means success.
    (Chaitanya)

Changes to previous V2:
  - do not overwrite the err local variable, instead returning the
    converted errno mapped directly.
  - return ECOMM in case of linux internal err which indicates the
    negative values from in the middle of the subcommand.

Changes to previous V1:
  - make switch-case inline in nvme-status (Chaitanya)


Minwoo Im (6):
  nvme: Do not return in the middle of the subcommand
  fabrics: Do not return in the middle of the subcommand
  nvme: Return negative error value for internal errors
  nvme-status: Introduce nvme status module to map errno
  nvme: Return errno mapped for nvme error status
  fabrics: Return errno mapped for fabrics error status

 Makefile      |   3 +-
 fabrics.c     |  46 ++--
 linux/nvme.h  |   6 +
 nvme-status.c | 155 +++++++++++
 nvme-status.h |  14 +
 nvme.c        | 701 ++++++++++++++++++++++++++++++--------------------
 6 files changed, 622 insertions(+), 303 deletions(-)
 create mode 100644 nvme-status.c
 create mode 100644 nvme-status.h

-- 
2.21.0

             reply	other threads:[~2019-06-04 15:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 15:40 Minwoo Im [this message]
2019-06-04 15:40 ` [PATCH V6 1/6] nvme: Do not return in the middle of the subcommand Minwoo Im
2019-06-08 19:16   ` Chaitanya Kulkarni
2019-06-08 19:48     ` Minwoo Im
2019-06-08 20:00       ` Chaitanya Kulkarni
2019-06-04 15:40 ` [PATCH V6 2/6] fabrics: " Minwoo Im
2019-06-08 19:19   ` Chaitanya Kulkarni
2019-06-04 15:40 ` [PATCH V6 3/6] nvme: Return negative error value for internal errors Minwoo Im
2019-06-04 15:40 ` [PATCH V6 4/6] nvme-status: Introduce nvme status module to map errno Minwoo Im
2019-06-04 15:40 ` [PATCH V6 5/6] nvme: Return errno mapped for nvme error status Minwoo Im
2019-06-04 15:40 ` [PATCH V6 6/6] fabrics: Return errno mapped for fabrics " Minwoo Im
2019-06-08 19:36   ` Chaitanya Kulkarni
2019-06-08 20:01     ` Minwoo Im
2019-06-08 20:13       ` Chaitanya Kulkarni
2019-06-10  9:17         ` Minwoo Im
2019-06-10  9:26         ` Minwoo Im
2019-06-11  0:01       ` Sagi Grimberg
2019-06-11  5:13         ` Minwoo Im
2019-06-11 17:36           ` Sagi Grimberg
2019-06-12 12:26             ` Minwoo Im
2019-06-17 17:39               ` Sagi Grimberg
2019-06-18  4:17                 ` Minwoo Im

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=20190604154034.23386-1-minwoo.im.dev@gmail.com \
    --to=minwoo.im.dev@gmail.com \
    /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.