From nobody Tue Apr 7 18:46:41 2026 Received: from mail-qt1-f225.google.com (mail-qt1-f225.google.com [209.85.160.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 568703859D4 for ; Thu, 26 Feb 2026 19:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772132672; cv=none; b=KCi7lfcA4CF9bhCrQURb1zZiASOEKyOfOwUjUOQruvTQe1T1SrTAiLl9uOzXZR2Av8MCzM10eqTdjpuloU0ZwNKXxKmthu7kg3uRda0LDFKfliHh//q60pHZWfdQpiV8BstIBahCN5oHf4vcSdxkk6a9YvVzIhifKIv1m5R+BAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772132672; c=relaxed/simple; bh=pBiR297b8PXFueLy2tPMN9uZJGaoOz/0vV31TY2gEY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e+Y0TQpK2YRl9Yf1WGtyTRah7Z9D3mRfqJES3sKY6Mny+ZYJeB+g+TVlJvpqY6ydHFxVbNBAFpA57D5xattMNElZ6hPwJtpq7jA6PZ5zKs3XZSUzHk3/8JzuQvKmRbEC5ch7Sdu4DYwCKtBWCcZ0lUxn3bPUYz6NRp5lwsdPqBo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=QIUmYAKB; arc=none smtp.client-ip=209.85.160.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="QIUmYAKB" Received: by mail-qt1-f225.google.com with SMTP id d75a77b69052e-50332392929so1634891cf.2 for ; Thu, 26 Feb 2026 11:04:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1772132662; x=1772737462; darn=vger.kernel.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=chF3cAD1j09EpR3bM9lUaumkQDJZpAeYYRmoTp9QLII=; b=QIUmYAKBktMi5Lgw82setDs5X+sA0VKtFN+IIRphkRG07t2XlU7f8HKfRksfhbB4o4 pPoPbF2rc/J2DOjNAUOP+Y/8vczGWLXFKYgwArTxbkDuQSb/EXuEGAbXZf1AutPfa1Tc WYhGXfVG6FV3yQi6+ZC3TfgDyaINeeHmPaOYb1jCDVc0boSSCX3omvkJvhJDxXi/O3NB rDnrKsEczgnPQe27QiePVIntgMkUQSVxQoJCh3FIi/rsGc+rSY1mvW9a4wGpKd9uC+K8 Qem3ZjS3z4/IPEP0kLt+I/i9Nirfz+oVJEZW7fOU0hvgBlrX9VAYjt5X6Sq6naA8yIdS P+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772132662; x=1772737462; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=chF3cAD1j09EpR3bM9lUaumkQDJZpAeYYRmoTp9QLII=; b=bJEmyA7wGM0enOtOLdllu45AY2u1dIv0A28A337xr4DmFh0R32OM1vy+dGXU/lX8Cy LuV/jjNybr3kBayG+ykzMrj5BkdWrUfiPe3cvOkBq39jo7C/37lN6GRO5J712DWST/8/ 3LVGp6z6Ncm60O9ahIEsnSkeK03QHWk23W+NqCmiuqp5XeJEvM0b6lUHitccweqA/R0+ SeftkucT5OwT2oxwhvVCq8eY8wx6sfonhVxFFQu8Wqc/u+WLor8zsag74qWxYa7o4RL/ 49+TAYye6igSaNaDHORcBHKKRLgK0Ucq5m5I5tJZ3TveFGbcSqtaWmrUJ4vHw9NsmGcf jhCg== X-Forwarded-Encrypted: i=1; AJvYcCV7kv67lXluqEbdQ3FAHds7Z9vBWtqKME2zRf1uwBa3iPSFPWJqasjGDvaSD2jD4IDNotjVKd5nJzbOwxo=@vger.kernel.org X-Gm-Message-State: AOJu0YzfChazlvMGNNkx8VlwhCKbcsZoIXps5SHaawoZ+v2AY8xxMo1M DBiuV8J1fGaBMSpM6Xckz39YNLDctLlvdlQR1PeV6sjuE7Y4nzfgdFQleJM7U+dptWuIfazepIj iHPLQIQDIJ3BVfR23BEdeU+osYyDJoOl3mcbb X-Gm-Gg: ATEYQzyeqSOkvlE8c6Uz53hDDgQ4havZpIOcXeJEdoyC3vOrSmSihuxvkNEaI3TpyLI nUusK2ybv2vie+1Rtshz1Szr6iuqG6p65nkXqvKeqrdtAVa3z5hmwQ/KEJXFINmjakLDx2vE6vv LVzLpOvMZ8Ld6CDSa+wrw8b1lcE4/vXC+IFV8DTZKTMDU0ZdyfHkaLZFwC0LQEgqyGgAGhav2vh RZjdOzQ0PSOcjOs8kOgcjA758bQH0PLxTtD+Ja6tZ9I6gAwsSIgrrnyCj2awEhb7m6RL28+/PzM cYmA8zkuZFaNLgEE8KLJ7rCtT7UIyOLyi+MV2GK0MaPWFJAfxvrup/6pyKn4k5Ni3ben7OzYPXg gNu9E+IO+5C+h/p1RL/AP0S9JBoWcfZfliaXOUJO3qlV1SVL3QQPO+w== X-Received: by 2002:a05:622a:4c7:b0:4ee:87e:dedf with SMTP id d75a77b69052e-507528847dcmr126891cf.8.1772132661604; Thu, 26 Feb 2026 11:04:21 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id d75a77b69052e-50744a369d9sm3317611cf.5.2026.02.26.11.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 11:04:21 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.29.101]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id DB507340245; Thu, 26 Feb 2026 12:04:20 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id D652EE41254; Thu, 26 Feb 2026 12:04:20 -0700 (MST) From: Caleb Sander Mateos To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v4 7/8] nvmet: use NVME_NS_FEAT_OPTPERF_SHIFT Date: Thu, 26 Feb 2026 12:04:14 -0700 Message-ID: <20260226190416.297725-8-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260226190416.297725-1-csander@purestorage.com> References: <20260226190416.297725-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the NVME_NS_FEAT_OPTPERF_SHIFT constant in nvmet_bdev_set_limits() to set the OPTPERF bits of the nvme_id_ns NSFEAT field instead of the magic number 4. Signed-off-by: Caleb Sander Mateos Reviewed-by: Christoph Hellwig --- drivers/nvme/target/io-cmd-bdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd= -bdev.c index 8d246b8ca604..d94f885a56d9 100644 --- a/drivers/nvme/target/io-cmd-bdev.c +++ b/drivers/nvme/target/io-cmd-bdev.c @@ -28,15 +28,15 @@ void nvmet_bdev_set_limits(struct block_device *bdev, s= truct nvme_id_ns *id) id->nawun =3D lpp0b; id->nawupf =3D lpp0b; id->nacwu =3D lpp0b; =20 /* - * Bit 4 indicates that the fields NPWG, NPWA, NPDG, NPDA, and + * OPTPERF =3D 01b indicates that the fields NPWG, NPWA, NPDG, NPDA, and * NOWS are defined for this namespace and should be used by * the host for I/O optimization. */ - id->nsfeat |=3D 1 << 4; + id->nsfeat |=3D 0x1 << NVME_NS_FEAT_OPTPERF_SHIFT; /* NPWG =3D Namespace Preferred Write Granularity. 0's based */ id->npwg =3D to0based(bdev_io_min(bdev) / bdev_logical_block_size(bdev)); /* NPWA =3D Namespace Preferred Write Alignment. 0's based */ id->npwa =3D id->npwg; /* NPDG =3D Namespace Preferred Deallocate Granularity. 0's based */ --=20 2.45.2