From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f226.google.com (mail-yw1-f226.google.com [209.85.128.226]) (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 A969B28467D for ; Tue, 24 Feb 2026 17:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771953305; cv=none; b=ZZxEcPjXXGS+mJtsCVd3VqPDL6N8KALHegUPDyMFQYHsKfMU8dZuxB34QJS86ElDNqZezoIkmCM0aq1Ogp+oLePhgaA3CWflKhE/vnvARGly249vihkh72dGqJqiDSshAHKxExF4F4QIMMXbaVmJbwJ6BHuYclMuz89b5mogMV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771953305; c=relaxed/simple; bh=pBiR297b8PXFueLy2tPMN9uZJGaoOz/0vV31TY2gEY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K5kw1mwYMlveA5FGvwfL1RdDMB/9rYwY0qkYwb+wLH+XY446yLugFISlmIzu4G8V2Bl5AAM3BC4fPJKDEYoPXWBE8PmEIBmWZieWNAlhgjzpNs6WXLXy4hR48kgB29hSn62lpMghag82m1e8HVF1AqTH/Uenefy9vtoKDTmWAyw= 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=gQ9QSnOo; arc=none smtp.client-ip=209.85.128.226 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="gQ9QSnOo" Received: by mail-yw1-f226.google.com with SMTP id 00721157ae682-794cc7e06f0so2935257b3.2 for ; Tue, 24 Feb 2026 09:15:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1771953303; x=1772558103; 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=gQ9QSnOoZkZR1t+RRRGal0Db/KjvR+v0rkXwnhc92m699rXdp0Cen5tKx6f9Y+Q/HD poxnv+3u5TNxhh5v4K7OQT5BHumkd/Cxj1zhXOwctO+1iQjbSTN6oh3A4k0udFd/BeCq PHpQ7B3NW0Iu07blm6JCvG4VY2Js/g1pXp9bMqhRFcu7/MeMi/4wDwOMoWaw/wetPv/T EeAY78iKv63ia1Ol5Zv4yjJrqTQLhJCaE764Yn0b4AVa2bH5jfTZ7dJ9ecB09S3dnFga ioSUp3qDzSOouVAOvgcfnBIbD0YxFha/IgqV/ZZ7WMuTDWmtQXAnfT25Slpd6FVUvRAf IzHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771953303; x=1772558103; 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=qoC1B9URVIt4DhkxQxxzqG3ME2I+7+9DZNP1zDuCa0A0oz7qCVd5RBAp3n772tpJjq /uadJBTe49EFGaGrxIq46DhZLkUpHtohred4pFgkOOMt8uhTQe5gMgLV+VPSDs1ihRM8 tXhrzeFvF0DyugfSZBcWMFVEs6icooAk4niSY+sr0/MGK/BHJCIcJzG/KR4eOiKpuqhw /B+PiG7rT2qiGKQYL1jGwp4yVybl0u+8pwR3vF56KlScOT4iLmoqgqlujdn81uuvUXNW dVd0kAPhv2L2eR8n58w5K48Smo0DpdqwzovgZmEaihyjVDdLZTIVxJTSNrnQ9/+a2u4u Jl/A== X-Forwarded-Encrypted: i=1; AJvYcCWAFc5hb3sIbmHbAgehj7Kkg2N+DnP0GxHzOgVHz57OxTfvM2IzJCwnff6emhCr+IKH0LKOSJaJ5JmyNVE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/k7fDyhreGp7nkS/06ggrrHcBLjHMaqk7Mdf00i3rx9xCJ/N/ OxvV89aJ8BVZfwp+ncWw6o57qKwYBcHQYNHhpuFdGtMUKShlcPYLbzJqYk8dFgLY6EpxueIZ6JO P1J6lpRglUMS10nQRHnvKs+R7Ohjge+6frVTQ X-Gm-Gg: ATEYQzwGsq9tKUY+Bz4mGZrlvYzSyxwgqjCX/vU5vr2knFmDQOCkgcAYWjadC3jwxCX YVs4Zzjgu+RfknunUQBpDTEG3j9tVmGvSjUfw8gozf6HYEszuTNolXIXGbZvZxpXU+k5vwz3hhr 534E4kmd4HMVAcxjgYXnQuxWZ/dg6SU4bjsC3r6NRQMC4da3qEIUDpzolPSGlChxeZLMAVXl71w sxO+NlI+FTxba9XvVgV5Q56eF3e+6ZB6xFnzdIOUx6R5Vfn9DS5dQbSe9vbdPUPwObEX1UP/gCl SWDksQu1GxeYPoLUROcwNZ9uMA900XgUEq+AYizSlayjHqvWNj52HVnB/DhxjzoB7a/IOil/oGi rm1s18wmp5VbptYWg+e7UYXEGFsC9FSMQoComhiB4agBUXg1xHJ92fw== X-Received: by 2002:a05:690c:d8a:b0:797:a52d:85cb with SMTP id 00721157ae682-7982913fd0dmr93190697b3.7.1771953302724; Tue, 24 Feb 2026 09:15:02 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 00721157ae682-7982dc2a057sm13159437b3.13.2026.02.24.09.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 09:15:02 -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 0F72B342244; Tue, 24 Feb 2026 10:15:02 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 0A695E41254; Tue, 24 Feb 2026 10:15:02 -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 v3 7/8] nvmet: use NVME_NS_FEAT_OPTPERF_SHIFT Date: Tue, 24 Feb 2026 10:14:36 -0700 Message-ID: <20260224171437.3175993-8-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260224171437.3175993-1-csander@purestorage.com> References: <20260224171437.3175993-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: 8bit 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, struct nvme_id_ns *id) id->nawun = lpp0b; id->nawupf = lpp0b; id->nacwu = lpp0b; /* - * Bit 4 indicates that the fields NPWG, NPWA, NPDG, NPDA, and + * OPTPERF = 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 |= 1 << 4; + id->nsfeat |= 0x1 << NVME_NS_FEAT_OPTPERF_SHIFT; /* NPWG = Namespace Preferred Write Granularity. 0's based */ id->npwg = to0based(bdev_io_min(bdev) / bdev_logical_block_size(bdev)); /* NPWA = Namespace Preferred Write Alignment. 0's based */ id->npwa = id->npwg; /* NPDG = Namespace Preferred Deallocate Granularity. 0's based */ -- 2.45.2