From nobody Mon Nov 25 11:21:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=bytedance.com ARC-Seal: i=1; a=rsa-sha256; t=1715174051; cv=none; d=zohomail.com; s=zohoarc; b=jvbU411fPk9UyDatXrvc/a+IOL9cmJC2V4+o1rtAkcDXUZWexAt7NawIVqZW+0CcDtYRgbS+yfYSExBWoItYm7Y0i5UKEjlgeUKwu/XMtzC74cmx785ufyVjpikYBoBzlc+JTjqu9LJhb9iOewdbUq2ZDy0EyB9mkleSGCROl7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715174051; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gFPFIrQSwbonOV1Lxc6f0KhdGy2FCqSxIxef8n97aRY=; b=ACA5DeAbOVfY7z11ErySl3yQpbkFTnEIadm1RfHe6MZYN9ZRwXYGBsr7bbjF5LGcb+JLU+h6lNjzESB4q0j2HblOQ3Wi/fbcOCxReCvxPusAzGpufCsFjuM2TC76Ntgq5cjEmUPzhkEFW5vj6gZ3+WYvkispyjk+uFULgEOnBQU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715174050989641.4120017762724; Wed, 8 May 2024 06:14:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4h5u-0005FA-UC; Wed, 08 May 2024 09:12:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4dkv-0007f0-GH for qemu-devel@nongnu.org; Wed, 08 May 2024 05:38:33 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4dkt-0000aE-TU for qemu-devel@nongnu.org; Wed, 08 May 2024 05:38:33 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5ff57410ebbso3329570a12.1 for ; Wed, 08 May 2024 02:38:31 -0700 (PDT) Received: from n37-006-243.byted.org ([180.184.51.134]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b001ee13eb2bedsm4992178plb.98.2024.05.08.02.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 02:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1715161110; x=1715765910; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gFPFIrQSwbonOV1Lxc6f0KhdGy2FCqSxIxef8n97aRY=; b=D/uBsBmkWjLRrY/iME4smJluXXkpSMzSb4fprqPvDWpbb0h7T4ZERihkmB+VLtRH2d uLrSq/lzeFXDZLMs475ICN13OIKtb4O4jlxUuPuADskSH0c7jWWgcHiPecGQYAM6RN1q GcxdjFiDFbSOMHG36Fdsd/mOf1JVBBdXxxoXG70egBRgyk0uV6TDctDvyi/VqdDML6O7 UMSDGTPgbyX7PC5+7Xk4jhmr6PArO4OJ7eKmo2rgpcVjoMdY2/V1KnKWXGZWsMpgn+8r IjGmp95+Gmn7dZO9Ao7CHS0S+LbBuekNkE5unQ/5x1pOXz6rmXtrXJqHUrwg+zYgUMZK yY4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715161110; x=1715765910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gFPFIrQSwbonOV1Lxc6f0KhdGy2FCqSxIxef8n97aRY=; b=ajXwAnhyBKggDgUDdHA5/ykQyb7ZZyBBz5EUGJAXcBHKIkYFj/sMbHN9+znV3I/yaO 6VzYBGuTdUuSmnfqmetyxSM3bctN3Qo6oJzw01vD33i7waq7jwNKAKiSbY1M28sWIqYn HaKFDq9BHr5kzmo29QGTz4lUo3kdqjjDHleKQBQtnRsYfgscKkhmU72hzYnvb5AE9c5j ny8wsgS/a5exDYUM9ya0KVcOEpMTnJK1SLwh7e+T6dOexMLJyFf6hsvxAauKenTIyIFj uXYPJNj0S0pxJ+mJ7q7OUqOOwspiMKjlL0xzeqMCAa4qbX0T2BeB69C88cA+A4RTF0Fz A7KA== X-Forwarded-Encrypted: i=1; AJvYcCWqXLQ0iW6QnEDCp8IK2WB+z2HBOaYIl+YjzFxoem2IZ1CQ4QnbeYFoOen4OmMcjMqd3C4Y7FTseQpYqfD7enUBWX05pqg= X-Gm-Message-State: AOJu0YyABDR5qVCBe3XvAZTMPuuQhjWyR0jqoCMf8zl8zktzRoP+ihQ0 3Wr/PUQ+aztCiIbjjVFgp904h9xA6j9x59kj8m7ltLQsKJv3W8pUtjsWNELqNrA= X-Google-Smtp-Source: AGHT+IHVkAh3WR5P0kjIKVVEosIeAvI3hhDd1eD4VvY/gSFtVxjx9dZbAysNNXqL9FWwiXwOSv9HfA== X-Received: by 2002:a17:902:b48f:b0:1e4:4000:a576 with SMTP id d9443c01a7336-1eeb0795f3emr19156935ad.43.1715161110685; Wed, 08 May 2024 02:38:30 -0700 (PDT) From: Changqi Lu To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, hreitz@redhat.com, stefanha@redhat.com, fam@euphon.net, ronniesahlberg@gmail.com, pbonzini@redhat.com, pl@dlhnet.de, kbusch@kernel.org, its@irrelevant.dk, foss@defmacro.it, philmd@linaro.org, Changqi Lu , zhenwei pi Subject: [PATCH 6/9] block/nvme: add reservation command protocol constants Date: Wed, 8 May 2024 17:36:26 +0800 Message-Id: <20240508093629.441057-7-luchangqi.123@bytedance.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240508093629.441057-1-luchangqi.123@bytedance.com> References: <20240508093629.441057-1-luchangqi.123@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=luchangqi.123@bytedance.com; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 08 May 2024 09:12:22 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bytedance.com) X-ZM-MESSAGEID: 1715174053100100003 Content-Type: text/plain; charset="utf-8" Add constants for the NVMe persistent command protocol. The constants include the reservation command opcode and reservation type values defined in section 7 of the NVMe 2.0 specification. Signed-off-by: Changqi Lu Signed-off-by: zhenwei pi Reviewed-by: Stefan Hajnoczi --- include/block/nvme.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/block/nvme.h b/include/block/nvme.h index bb231d0b9a..3409fba762 100644 --- a/include/block/nvme.h +++ b/include/block/nvme.h @@ -633,6 +633,10 @@ enum NvmeIoCommands { NVME_CMD_WRITE_ZEROES =3D 0x08, NVME_CMD_DSM =3D 0x09, NVME_CMD_VERIFY =3D 0x0c, + NVME_CMD_RESV_REGISTER =3D 0x0d, + NVME_CMD_RESV_REPORT =3D 0x0e, + NVME_CMD_RESV_ACQUIRE =3D 0x11, + NVME_CMD_RESV_RELEASE =3D 0x15, NVME_CMD_IO_MGMT_RECV =3D 0x12, NVME_CMD_COPY =3D 0x19, NVME_CMD_IO_MGMT_SEND =3D 0x1d, @@ -641,6 +645,32 @@ enum NvmeIoCommands { NVME_CMD_ZONE_APPEND =3D 0x7d, }; =20 +typedef enum { + NVME_RESV_REGISTER_ACTION_REGISTER =3D 0x00, + NVME_RESV_REGISTER_ACTION_UNREGISTER =3D 0x01, + NVME_RESV_REGISTER_ACTION_REPLACE =3D 0x02, +} NVME_RESV_REGISTER_ACTION; + +typedef enum { + NVME_RESV_RELEASE_ACTION_RELEASE =3D 0x00, + NVME_RESV_RELEASE_ACTION_CLEAR =3D 0x01, +} NVME_RESV_RELEASE_ACTION; + +typedef enum { + NVME_RESV_ACQUIRE_ACTION_ACQUIRE =3D 0x00, + NVME_RESV_ACQUIRE_ACTION_PREEMPT =3D 0x01, + NVME_RESV_ACQUIRE_ACTION_PREEMPT_AND_ABORT =3D 0x02, +} NVME_RESV_ACQUIRE_ACTION; + +typedef enum { + NVME_RESV_WRITE_EXCLUSIVE =3D 0x01, + NVME_RESV_EXCLUSIVE_ACCESS =3D 0x02, + NVME_RESV_WRITE_EXCLUSIVE_REGS_ONLY =3D 0x03, + NVME_RESV_EXCLUSIVE_ACCESS_REGS_ONLY =3D 0x04, + NVME_RESV_WRITE_EXCLUSIVE_ALL_REGS =3D 0x05, + NVME_RESV_EXCLUSIVE_ACCESS_ALL_REGS =3D 0x06, +} NVMEResvType; + typedef struct QEMU_PACKED NvmeDeleteQ { uint8_t opcode; uint8_t flags; --=20 2.20.1