On 6/5/25 19:29, Charlie Li wrote:
John Baldwin wrote:
The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=60159a98a83747e539eb14c6a0eaaa1875e2cacc

commit 60159a98a83747e539eb14c6a0eaaa1875e2cacc
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2025-06-05 21:03:01 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2025-06-05 21:03:01 +0000

      nvme: Move opcode and status code tables from base CAM to nvme_util.c
This makes it possible to share these tables with the nvme(4) driver
      in custom kernels that do not include any CAM support, only nvd(4).
Reviewed by: imp
      Sponsored by:   Chelsio Communications
      Differential Revision:  https://reviews.freebsd.org/D50685
---
   sys/cam/nvme/nvme_all.c  | 224 ---------------------------------------------
   sys/cam/nvme/nvme_all.h  |   2 -
   sys/conf/files           |   2 +-
   sys/dev/nvme/nvme.h      |   4 +
   sys/dev/nvme/nvme_util.c | 231 
+++++++++++++++++++++++++++++++++++++++++++++++
   5 files changed, 236 insertions(+), 227 deletions(-)

diff --git a/sys/cam/nvme/nvme_all.c b/sys/cam/nvme/nvme_all.c
index 4145aa16ed49..2ab8ae5340c6 100644
--- a/sys/cam/nvme/nvme_all.c
+++ b/sys/cam/nvme/nvme_all.c
@@ -292,24 +130,6 @@ nvme_command_string(struct ccb_nvmeio *nvmeio, char 
*cmd_string, size_t len)
        return(sbuf_data(&sb));
   }
-void
-nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb)
-{
-       const char *s, *type;
-
-       if (admin) {
-               s = admin_opcode[opc];
-               type = "ADMIN";
-       } else {
-               s = nvm_opcode[opc];
-               type = "NVM";
-       }
-       if (s == NULL)
-               sbuf_printf(sb, "%s:0x%02x", type, opc);
-       else
-               sbuf_printf(sb, "%s", s);
-}
-
diff --git a/sys/cam/nvme/nvme_all.h b/sys/cam/nvme/nvme_all.h
index 17c068b825be..2bc1953e79be 100644
--- a/sys/cam/nvme/nvme_all.h
+++ b/sys/cam/nvme/nvme_all.h
@@ -42,11 +42,9 @@ struct sbuf;
   void nvme_print_ident(const struct nvme_controller_data *, const struct 
nvme_namespace_data *, struct sbuf *);
   void nvme_print_ident_short(const struct nvme_controller_data *,
       const struct nvme_namespace_data *, struct sbuf *);
-void nvme_opcode_sbuf(bool admin, uint8_t opc, struct sbuf *sb);
   void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb);
   int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb);
   const char *nvme_command_string(struct ccb_nvmeio *nvmeio, char *, size_t);
-void nvme_cpl_sbuf(const struct nvme_completion *cpl, struct sbuf *sbuf);
   int nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb);
   const void *nvme_get_identify_cntrl(struct cam_periph *);
   const void *nvme_get_identify_ns(struct cam_periph *);


<sys/dev/nvme.h> doesn't appear to be making it in nvme_all.h as the
build complains about missing nvme_opcode_sbuf() in nvme_all.c.

Are you getting a link error or a compile error?  I built this locally several 
times
today to test various combinations (kernels with and without either CAM or nvme 
and
loading nvme.ko in kernels without to make sure it worked).  I also built 
GENERIC
prior to pushing and it built fine.

Sigh, so from ci.freebsd.org, it appears to be userland that is choking (libcam)
rather than the kernel.  I'll fix shortly (mostly it just means removing the
#ifdef _KERNEL).

--
John Baldwin


Reply via email to