From nobody Fri May 03 00:15:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VVrtM70v7z5KK63; Fri, 3 May 2024 00:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VVrtM4bFnz4Q5f; Fri, 3 May 2024 00:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714695339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KtOkH4cjyxFRyZgHIFWf7pX42zU2hNZAgpqvUcU3P28=; b=UH30VZZYXOMmYsaIQ9wEKKWIzafzAY/CKliwgpVtkL3oIaQLfT9nWvKfwBMOdMa3Y9eibe q8BT2Y9HNy1qA8LOWBZDbkq2gXcHF2cXEUn5V9crPJRMTFbnRajdwqgBmuRX5zYHDX1V7C o0I9GocbdehNPtBZQNnWSeGCF4pn51GqqEoVvKAbxuBlUsDWJkITKQ1FvcWQE/vrMsQptV g8uuemXN5jfSFpH2npCwsZT1NmAUW+0xExenV1GnJ57jdJ4SxuWCmZO7u4DgIAEjoi9B/q AbK6c7FaTD94t1LT0q91Wfdp6bBKmq1A8fYuq0sIfvasSJ5VSSeq2lIV0WD3Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714695339; a=rsa-sha256; cv=none; b=r7gsX/dGqMrPnoVpAiix6/AZZFhDRP35FgiZE8HGkqwXB88DUfQu96RBuOjhlLeUAzCHTd Lpeg1qi5+vPIleVNAohaQaWfRQqNSjJiG6J56UJTFVT0y8/h3V5kV8SU4VS6Krf+GSyi6R Xmxe0YZnkCbYBNpQEdBu7LXH6dBZluTmke4AIgxFN/wfkQBkkOh9728xodSa+8dt2wPVUP Ufyoil7fF7/Ojq9GYNvmvBJ8DAyOKBdKlQlHrOIERZrJfYiEDpt279isBsk6Js5UuFxNUR Ww1IMhI113ILzKK69bDzkVmNkLNaI329VZgM7l2a730YDyoH0uS2EAA/BoG/+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714695339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KtOkH4cjyxFRyZgHIFWf7pX42zU2hNZAgpqvUcU3P28=; b=gcq2pycFh+qi2uBKNyi+UfrH4qtKZkbju5s9YAd5ruW4r9DOhPx23sPaY/d1OCCYkR/eVe 1/X+b6U+pEamZLvM8WFWgnej4FhB17L/lfQGbdeGzcaxjrbkjFRLRv90iB9F0iS8Rtp/Df hoi5ZXJ5tVKYUgBmmprvcJ5NOKU3qmGea8jjFPaRMwOsxyH1MAOG+PGkrLVDPzArrwrxX7 7JkgA4KXcmqNI07+aBdIFr3GVayKonxvZ6IexbJz09gCN7xjYjA+l8jSL1qXRVdjFdAB2C u6DiHzmWSO2oI0YgmL/OMdJJEh2tMT9kCN7U+wdPfXbidwjV95ciPNUZrpEVIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VVrtM3rPLzP14; Fri, 3 May 2024 00:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4430FdjS078728; Fri, 3 May 2024 00:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430Fd9V078725; Fri, 3 May 2024 00:15:39 GMT (envelope-from git) Date: Fri, 3 May 2024 00:15:39 GMT Message-Id: <202405030015.4430Fd9V078725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 52d5738dc5b3 - main - nvmf_proto.h: Add additional types and constants from the 1.1 spec List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52d5738dc5b399d63497db896e0d25fb33c5538e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=52d5738dc5b399d63497db896e0d25fb33c5538e commit 52d5738dc5b399d63497db896e0d25fb33c5538e Author: John Baldwin AuthorDate: 2024-05-02 23:26:56 +0000 Commit: John Baldwin CommitDate: 2024-05-02 23:26:56 +0000 nvmf_proto.h: Add additional types and constants from the 1.1 spec - Add opcode, command structure, and new error code for Disconnect fabrics opcode. - Add a generic struct nvmf_fabric_command. - Add constants for special controller ID values. - Add constants for the cattr field in the Connect command and the default value for the kato field in the Connect command. - Add constants for the offset of controller properties (Fabrics version of controller registers). Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44705 --- sys/dev/nvmf/nvmf_proto.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/sys/dev/nvmf/nvmf_proto.h b/sys/dev/nvmf/nvmf_proto.h index cb94f472c874..b0be236f77fa 100644 --- a/sys/dev/nvmf/nvmf_proto.h +++ b/sys/dev/nvmf/nvmf_proto.h @@ -43,6 +43,7 @@ enum nvmf_fabric_cmd_types { NVMF_FABRIC_COMMAND_PROPERTY_GET = 0x04, NVMF_FABRIC_COMMAND_AUTHENTICATION_SEND = 0x05, NVMF_FABRIC_COMMAND_AUTHENTICATION_RECV = 0x06, + NVMF_FABRIC_COMMAND_DISCONNECT = 0x08, NVMF_FABRIC_COMMAND_START_VENDOR_SPECIFIC = 0xC0, }; @@ -52,6 +53,7 @@ enum nvmf_fabric_cmd_status_code { NVMF_FABRIC_SC_INVALID_PARAM = 0x82, NVMF_FABRIC_SC_RESTART_DISCOVERY = 0x83, NVMF_FABRIC_SC_INVALID_HOST = 0x84, + NVMF_FABRIC_SC_INVALID_QUEUE_TYPE = 0x85, NVMF_FABRIC_SC_LOG_RESTART_DISCOVERY = 0x90, NVMF_FABRIC_SC_AUTH_REQUIRED = 0x91, }; @@ -166,6 +168,14 @@ enum nvmf_treq_secure_channel { NVMF_TREQ_SECURE_CHANNEL_NOT_REQUIRED = 0x2, }; +struct nvmf_fabric_cmd { + uint8_t opcode; + uint8_t reserved1; + uint16_t cid; + uint8_t fctype; + uint8_t reserved2[59]; +}; + struct nvmf_fabric_auth_recv_cmd { uint8_t opcode; uint8_t reserved1; @@ -225,6 +235,22 @@ struct nvmf_fabric_connect_cmd { }; _Static_assert(sizeof(struct nvmf_fabric_connect_cmd) == 64, "Incorrect size"); +#define NVMF_CNTLID_DYNAMIC 0xFFFF +#define NVMF_CNTLID_STATIC_ANY 0xFFFE + +/* + * XXX: 5.3 in NVMe-over-Fabrics 1.1 gives this as an upper bound in + * the Discovery Log Entry. + */ +#define NVMF_CNTLID_STATIC_MAX 0xFFEF + +/* 5.21.1.15 in NVMe 1.4b */ +#define NVMF_KATO_DEFAULT (120000) + +#define NVMF_CONNECT_ATTR_PRIORITY_CLASS (0x3) +#define NVMF_CONNECT_ATTR_DISABLE_SQ_FC (1u << 2) +#define NVMF_CONNECT_ATTR_IO_QUEUE_DELETION (1u << 3) + struct nvmf_fabric_connect_rsp { union { struct { @@ -249,9 +275,27 @@ struct nvmf_fabric_connect_rsp { }; _Static_assert(sizeof(struct nvmf_fabric_connect_rsp) == 16, "Incorrect size"); +struct nvmf_fabric_disconnect_cmd { + uint8_t opcode; + uint8_t reserved1; + uint16_t cid; + uint8_t fctype; + uint8_t reserved2[19]; + struct nvme_sgl_descriptor sgl1; + uint16_t recfmt; /* Disconnect Record Format */ + uint8_t reserved3[22]; +}; +_Static_assert(sizeof(struct nvmf_fabric_disconnect_cmd) == 64, "Incorrect size"); + #define NVMF_PROP_SIZE_4 0 #define NVMF_PROP_SIZE_8 1 +#define NVMF_PROP_CAP 0x00 /* Controller Capabilities */ +#define NVMF_PROP_VS 0x08 /* Version */ +#define NVMF_PROP_CC 0x14 /* Controller Configuration */ +#define NVMF_PROP_CSTS 0x1C /* Controller Status */ +#define NVMF_PROP_NSSR 0x20 /* NVM Subsystem Reset */ + struct nvmf_fabric_prop_get_cmd { uint8_t opcode; uint8_t reserved1;