[PATCH v2 0/4] clarify NVMe status symbol names

Weiwen Hu huweiwen at linux.alibaba.com
Mon Jun 3 05:56:58 PDT 2024


This patchset clarifies the NVMe status related symbol names.
- status: the u16 field in the struct nvme_request.
- SC:     status code,      status & 0x00FF
- SCT:    status code type, status & 0x0700
This should match the NVMe spec and most of the existing code.
The exceptions are unified in this patchset.

It may be a little bit strange that we should use NVME_SCT_SC_MASK when
matching the NVME_SC_* codes. But changing all the codes to NVME_SCT_SC_*
requires too much changes, and making the names too long.
So I choose to keep them.

The previous version is:
https://lore.kernel.org/linux-nvme/20240529122300.92377-1-huweiwen@linux.alibaba.com/T

Changes in v2:
- Add a mailmap entry for myself.
- Rebased on nvme-6.10, dropped the patch that is already applied.
- The parameter of nvme_status_to_pr_err is renamed to "status", to make it
  shorter and matching the existing code.

Weiwen Hu (4):
  nvme: rename nvme_sc_to_pr_err to nvme_status_to_pr_err
  nvme: fix status magic numbers
  nvme: rename CDR/MORE/DNR to NVME_STATUS_*
  mailmap: add entry for Weiwen Hu

 .mailmap                               |  1 +
 drivers/nvme/host/constants.c          |  2 +-
 drivers/nvme/host/core.c               | 40 +++++++++++-----------
 drivers/nvme/host/fabrics.c            | 10 +++---
 drivers/nvme/host/fault_inject.c       |  2 +-
 drivers/nvme/host/fc.c                 |  6 ++--
 drivers/nvme/host/multipath.c          |  2 +-
 drivers/nvme/host/nvme.h               |  6 ++--
 drivers/nvme/host/pr.c                 | 10 +++---
 drivers/nvme/target/admin-cmd.c        | 24 +++++++-------
 drivers/nvme/target/core.c             | 46 +++++++++++++-------------
 drivers/nvme/target/discovery.c        | 14 ++++----
 drivers/nvme/target/fabrics-cmd-auth.c | 16 ++++-----
 drivers/nvme/target/fabrics-cmd.c      | 36 ++++++++++----------
 drivers/nvme/target/io-cmd-bdev.c      | 12 +++----
 drivers/nvme/target/passthru.c         | 10 +++---
 drivers/nvme/target/rdma.c             | 10 +++---
 drivers/nvme/target/tcp.c              |  4 +--
 drivers/nvme/target/zns.c              | 30 ++++++++---------
 include/linux/nvme.h                   | 16 +++++++--
 20 files changed, 154 insertions(+), 143 deletions(-)

-- 
2.45.1




More information about the Linux-nvme mailing list