From nobody Thu Oct 2 11:50:39 2025 Received: from mail-vs1-f98.google.com (mail-vs1-f98.google.com [209.85.217.98]) (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 84809285C95 for ; Tue, 16 Sep 2025 22:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758060373; cv=none; b=jB7sn3WqLYfsBC8a7cWQm2f6MHywHyJ3+O4rB8hUCc0W5TOs9EBJLLaQbVrF/YUjRwJqDfiH1kEZb67+p3hmk+FPkGrs2o3xFV+f1aJOLxwr5/OQqRphXAEt00By/6Gj2yFrBaY1l65jsyVPbIZ20StfGgkK1VI9oleVTRq8ayY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758060373; c=relaxed/simple; bh=SIKkpUuN+UMf7521jvtEXvNWyyT5bVbD3qrrehDOkvQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sOPKVA5uwGylDhmmI0ygmwCWtS7Wcso5KHaIfF38yvp9FdZSXaJgPrplpn0u/nCXNEn+2N3eQyWEZlFVtA7vmgang5pDl0V4xmcyafatT8dZPpkBeKXjlj4HRLPn08ttsgvw99dUEVh8v7tN1S3tQ59JG2J1XrbIR/sYAD6o6UU= 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=Qa/OtKv4; arc=none smtp.client-ip=209.85.217.98 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="Qa/OtKv4" Received: by mail-vs1-f98.google.com with SMTP id ada2fe7eead31-55716f2d3b9so3586502137.1 for ; Tue, 16 Sep 2025 15:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758060370; x=1758665170; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=N4wsBOfcY7SP6UfIj6tlKK4cAsDmDK/TmLfUs8mNZfw=; b=Qa/OtKv4I0T6S6fGPCaPaJZFvWytzOoXDnT7Q3nH11SuoW9lBlrccns3LRDVfTsrGE yCzfJ+pmIyh1dItShechWM4zUJ2UT5yJQcIsbDg289Gvj5+hDNQ3MGmr4RVcnMrPkKoJ +SN8oHTstQMYL5xHsKPkPr9bqAKrTEBygsxzzUXzy+5hF827qwQtL6Ul8fDFNUg+eax6 FS5e5c+RJO6QQDMmJkTpJpXd7rJzPBVj+bfblBq1QiB9sTkk9rhkp5h7RoeR8mGIQLRw 8ThhbyLjDA4By8EfwTn78mFf4qSL5ndrG5GoWzJBcxlhmhs/h+9+sZy3mLRuPLP77Dip D5Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758060370; x=1758665170; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N4wsBOfcY7SP6UfIj6tlKK4cAsDmDK/TmLfUs8mNZfw=; b=ZJqgZ1uiE94ssTlxQ8BLR/Q+mbcT4dOtBq/ioqdJiKftXoxGWUndQhUg0MqEEdf6Hy EpyaUi3E/upiMyh2fjRnMe8yLHLYesM0g0igXyp06l3rURoMSDInEVsBBjYdB6XrbYzB b7spqSl4XMVprPuJ8QY/7XI1VCpDtjrfP2PNQaTIOYX9qqMmzlKl4Z2ALWexqo9IJVQ2 Btx6Pwck19x7hZ7QnVIwR1cqbWbTxUGSjT/DV6gLV8Un/sXIYqaSlwUwp9xlgbPBHguL CPSJSdG3sf4MCHCT2drb9dmzxaGIPHR/Fys2U25uXHa6igW2FqUawVnAUqo5hkpannjz fWNg== X-Forwarded-Encrypted: i=1; AJvYcCUw/+PdkuSp4C7clIBE8+mcdpaiMOAI9Va7dkM6WpFNeChjRQVoPzxaKL+Th0rdeiH5QTHsZwK/6IUP1Jw=@vger.kernel.org X-Gm-Message-State: AOJu0YyhCx82/LWx0nfwSY6W+lAmzbOe9xmZbb/RoQsiRR0ssi2iaT8P 4Qr05zSeOEGbmkjzMDIGpuuZH8AfffXL6RcodHwVUwg6iQM2CJETFZpUkdBm47U98kHHW0u9EK1 vDeBE4PFCxSQCEM8bqN0OcupGx1jFKYLAfL5mCdLoKUhmlJCV1v7W X-Gm-Gg: ASbGncu8PdvrSShTS6clzDymLw1rrSiXY82qWl7tNVmSavBrz7aHTOdUuXSlKz7c00d EpWPRY7kvcXJUUyA/7+S3NiX2fjaQBgFJQR5AxaMn+nTV8XbICRsGZ8hYdEy8t5a+IuGgMtBfLo a00ZnXVIKqRs5kyqp+fxnsbwITWDmKDl+dDhOXKv7jkdGMP5WyLj/TqUXv1JBwa36IHs+7tK0KO Iey5snjjez5NeJtdW7s/c5lQF9aR/CMQMgsAyZWtybbGGE5FN3iIfwGknIXQQHSZy8rJK9+z3v1 9fM0ej242TdI+eogIi63YLcmOLJO1zPVfxFJBewJZhCUzGcmomqgwDW//ms= X-Google-Smtp-Source: AGHT+IFugGzusLHKIrSZCStJj5Llvm4aQRrc73nKgf/iXkByRK+6zltAVsAANgINDHQF55kouKN5b5uW5P5c X-Received: by 2002:a05:6102:5a92:b0:526:1e74:9548 with SMTP id ada2fe7eead31-55608ea0285mr7126569137.1.1758060370249; Tue, 16 Sep 2025 15:06:10 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id ada2fe7eead31-557f9d4b892sm975973137.5.2025.09.16.15.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Sep 2025 15:06:10 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-ushankar.dev.purestorage.com (dev-ushankar.dev.purestorage.com [IPv6:2620:125:9007:640:7:70:36:0]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id C7E57340A4D; Tue, 16 Sep 2025 16:06:08 -0600 (MDT) Received: by dev-ushankar.dev.purestorage.com (Postfix, from userid 1557716368) id C2794E40837; Tue, 16 Sep 2025 16:06:08 -0600 (MDT) From: Uday Shankar Date: Tue, 16 Sep 2025 16:05:55 -0600 Subject: [PATCH 1/3] selftests: ublk: kublk: simplify feat_map definition Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250916-ublk_features-v1-1-52014be9cde5@purestorage.com> References: <20250916-ublk_features-v1-0-52014be9cde5@purestorage.com> In-Reply-To: <20250916-ublk_features-v1-0-52014be9cde5@purestorage.com> To: Caleb Sander Mateos , Ming Lei , Shuah Khan Cc: linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Uday Shankar X-Mailer: b4 0.14.2 Simplify the definition of feat_map by introducing a helper macro FEAT_NAME to avoid having to type the feature name twice. As a side effect, this changes the names in the feature list to be the full macro name instead of the abbreviated names that were used before, but this is a good change for clarity. Using the full feature macro names ruins the alignment of the output, so change the output format to put each feature's hex value before its name, as this is easier to align nicely. The output now looks as follows: # ./kublk features ublk_drv features: 0x7fff 0x1 : UBLK_F_SUPPORT_ZERO_COPY 0x2 : UBLK_F_URING_CMD_COMP_IN_TASK 0x4 : UBLK_F_NEED_GET_DATA 0x8 : UBLK_F_USER_RECOVERY 0x10 : UBLK_F_USER_RECOVERY_REISSUE 0x20 : UBLK_F_UNPRIVILEGED_DEV 0x40 : UBLK_F_CMD_IOCTL_ENCODE 0x80 : UBLK_F_USER_COPY 0x100 : UBLK_F_ZONED 0x200 : UBLK_F_USER_RECOVERY_FAIL_IO 0x400 : UBLK_F_UPDATE_SIZE 0x800 : UBLK_F_AUTO_BUF_REG 0x1000 : UBLK_F_QUIESCE 0x2000 : UBLK_F_PER_IO_DAEMON 0x4000 : unknown Signed-off-by: Uday Shankar Reviewed-by: Ming Lei --- tools/testing/selftests/ublk/kublk.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests= /ublk/kublk.c index 6512dfbdbce3a82f1202de17319ea593337427e6..4e5d82f2a14a01d9e56d31126ea= e2e26ec718b6c 100644 --- a/tools/testing/selftests/ublk/kublk.c +++ b/tools/testing/selftests/ublk/kublk.c @@ -1363,21 +1363,22 @@ static int cmd_dev_list(struct dev_ctx *ctx) static int cmd_dev_get_features(void) { #define const_ilog2(x) (63 - __builtin_clzll(x)) +#define FEAT_NAME(f) [const_ilog2(f)] =3D #f static const char *feat_map[] =3D { - [const_ilog2(UBLK_F_SUPPORT_ZERO_COPY)] =3D "ZERO_COPY", - [const_ilog2(UBLK_F_URING_CMD_COMP_IN_TASK)] =3D "COMP_IN_TASK", - [const_ilog2(UBLK_F_NEED_GET_DATA)] =3D "GET_DATA", - [const_ilog2(UBLK_F_USER_RECOVERY)] =3D "USER_RECOVERY", - [const_ilog2(UBLK_F_USER_RECOVERY_REISSUE)] =3D "RECOVERY_REISSUE", - [const_ilog2(UBLK_F_UNPRIVILEGED_DEV)] =3D "UNPRIVILEGED_DEV", - [const_ilog2(UBLK_F_CMD_IOCTL_ENCODE)] =3D "CMD_IOCTL_ENCODE", - [const_ilog2(UBLK_F_USER_COPY)] =3D "USER_COPY", - [const_ilog2(UBLK_F_ZONED)] =3D "ZONED", - [const_ilog2(UBLK_F_USER_RECOVERY_FAIL_IO)] =3D "RECOVERY_FAIL_IO", - [const_ilog2(UBLK_F_UPDATE_SIZE)] =3D "UPDATE_SIZE", - [const_ilog2(UBLK_F_AUTO_BUF_REG)] =3D "AUTO_BUF_REG", - [const_ilog2(UBLK_F_QUIESCE)] =3D "QUIESCE", - [const_ilog2(UBLK_F_PER_IO_DAEMON)] =3D "PER_IO_DAEMON", + FEAT_NAME(UBLK_F_SUPPORT_ZERO_COPY), + FEAT_NAME(UBLK_F_URING_CMD_COMP_IN_TASK), + FEAT_NAME(UBLK_F_NEED_GET_DATA), + FEAT_NAME(UBLK_F_USER_RECOVERY), + FEAT_NAME(UBLK_F_USER_RECOVERY_REISSUE), + FEAT_NAME(UBLK_F_UNPRIVILEGED_DEV), + FEAT_NAME(UBLK_F_CMD_IOCTL_ENCODE), + FEAT_NAME(UBLK_F_USER_COPY), + FEAT_NAME(UBLK_F_ZONED), + FEAT_NAME(UBLK_F_USER_RECOVERY_FAIL_IO), + FEAT_NAME(UBLK_F_UPDATE_SIZE), + FEAT_NAME(UBLK_F_AUTO_BUF_REG), + FEAT_NAME(UBLK_F_QUIESCE), + FEAT_NAME(UBLK_F_PER_IO_DAEMON), }; struct ublk_dev *dev; __u64 features =3D 0; @@ -1404,7 +1405,7 @@ static int cmd_dev_get_features(void) feat =3D feat_map[i]; else feat =3D "unknown"; - printf("\t%-20s: 0x%llx\n", feat, 1ULL << i); + printf("0x%-16llx: %s\n", 1ULL << i, feat); } } =20 --=20 2.34.1 From nobody Thu Oct 2 11:50:39 2025 Received: from mail-pl1-f228.google.com (mail-pl1-f228.google.com [209.85.214.228]) (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 5B30D21E098 for ; Tue, 16 Sep 2025 22:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758060372; cv=none; b=OM7dJvkiy9yg9hcvVVM0yT23Qu9fqZ33x/6Q/HfqPVAOOct8iYRifWEal3y0/V6UCqq4WlcJENJ+XYE4BI0yJLxH1WvOhrQQ2ShwtXWhT/czQg7EN2vdU72nPqnj17SBNboI5nuKHrFv6ljdrE9hg27+Av5tC7RJ1+MG6/OQvI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758060372; c=relaxed/simple; bh=O6AFxv2rcQekB70jDscAE0h46bRh5B6ciyiol8NPklo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U7hDNoYZDwkgcnHiAc2v34v5G1A3CFXiP9uvPPZw/GDffmWXL98W2wsnuTt7F695A76UnmqMNnb1H2X25AJqv0UtmXrWBqiAo2RrUKSclZaxYgnvXKK9p25iVCIGT4nJCl6x6hDfP6pjhGJ8Zb2aR7lOAhm/Ucntk3p2u7fK0OI= 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=KgbTqTF6; arc=none smtp.client-ip=209.85.214.228 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="KgbTqTF6" Received: by mail-pl1-f228.google.com with SMTP id d9443c01a7336-24457f581aeso60348625ad.0 for ; Tue, 16 Sep 2025 15:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758060370; x=1758665170; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=URU8cpb810BL84te6erVF0rZVZMOdMRIWlwwvewIU3Y=; b=KgbTqTF6tVUPkFmJfbH2XBJ9uf3YITRO1ppHLk0ksS4pdQKHfc2MWvtwnLFzFP3Vp+ aL9N/n1q6prjlkEoSGYCijdRqYUcLCWJrJbbG7kLDxQVZEMNlLc9VZiA1nz12WOMf7WX GQS6pfj7EvQvHDk3qgXkfQ0Qf+55mG9+BoJsFDPKeplOoP24kuFvsE5Kc614hoaXOO6n BvF3f02WRWBxw8SeKf3ffhId+j5vGhLLcJ7FuPJphZfFjOQhkStwQCYDRDp7W7O7rcMn IDpNEFcT+eucLg8YQWw6euo5MydBMRW3llBBjxv2ud/S63UuH+yJLii5JMDotNQEfJv1 oWWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758060370; x=1758665170; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=URU8cpb810BL84te6erVF0rZVZMOdMRIWlwwvewIU3Y=; b=rEE8cZJOUHSdAFuNDC1OZ+8rQ6SvMr1uuL9Uad1ze88/gDyV4JASlRubWrj/Iwo6aM PDD+wILIfwyGFGnREBW8k3XMEurNmweHdkoxjfm0LHl0edtoBC2U5pBZ8THu8LP+0AEy zwydA/6Sv/s3Vn2sg16aS2F8mYSgGLZECAUQs8BDiBdDRZSizrGzvwAq4lL9dnKMRGZK B32U4Wuo9pIabM/uzyUDu46xFgFAeJtj8AoQUFBbnS5A+pYFWkETy8TFdx/aRwWsEXHN uP/7+Wi9qrsgqIENcg0qTIqQDOHQHc+9pYvxclSjClcjAbN7HA0ZFnnpO9IzkhZLvm3X H3dA== X-Forwarded-Encrypted: i=1; AJvYcCXBmtXtcLHmsZwfCUVGUTyNWYfQjcAlmfFeoFCYmF9ZEOWYZ8eAhXb0VPlcLSWG4CgJG3TPWIsoCazUt04=@vger.kernel.org X-Gm-Message-State: AOJu0YyBy5oO7zl53rKzU91P2yo+I0lq0o4EAwrrsTax9a8+mb7qFwaK bhNac9+5h8LUSZNZIQFSkP307Q+bsLa0zXAC7jmaHP/WTyVMIV4VdYzkaiwHI6C8sb4/V/4zL6E IMV34i+JOXtouFR9PTTHX4STICHedpYKoHgHl X-Gm-Gg: ASbGncvEIu4aWNmWCGVwg2iA4cJxsHYTTj47Kx/an4ydheoeQQ9IXAiOxCm9EX9x2it AejJyktjdEUX+PpU4o4M0qcpD0Og1nB+Mw+O4xWyqA5aUWaIqQrdSTp/qtyz0+M9U2lb4Frxk0U vSfR1yO8C2eHyRcxb8o2PpnDCneDdqjv82DsxlGvJbgWaD0wPxZE9n4RVypC6mCgDehvKPf3K/c gN6ljJ+CkfNvZGxS7XzCDqw/qc0ft1Hv09yQORiamSG/jn3VGKZK+qmteHAXtpLfDxFZgVQNnCn BUmZNVwD6ApIZ+4lo3JmqWjWLIJmkULzruFarIfzScfgseTF1ITA6hk7uTfVD4XEXChd/TTOcQ= = X-Google-Smtp-Source: AGHT+IGhjrS0yeLgkgtHFsVSqkeM5EALRxY7xkF7ANB453NveU5cvNrdW/AhOprgzqEc6fqLFtySHktbSA6v X-Received: by 2002:a17:902:d48f:b0:266:702a:616b with SMTP id d9443c01a7336-266702a6ed5mr129310065ad.18.1758060369693; Tue, 16 Sep 2025 15:06:09 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-32ed2673d71sm63225a91.2.2025.09.16.15.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Sep 2025 15:06:09 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-ushankar.dev.purestorage.com (dev-ushankar.dev.purestorage.com [10.7.70.36]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id C5CEB340325; Tue, 16 Sep 2025 16:06:08 -0600 (MDT) Received: by dev-ushankar.dev.purestorage.com (Postfix, from userid 1557716368) id CBA08E41748; Tue, 16 Sep 2025 16:06:08 -0600 (MDT) From: Uday Shankar Date: Tue, 16 Sep 2025 16:05:56 -0600 Subject: [PATCH 2/3] selftests: ublk: kublk: add UBLK_F_BUF_REG_OFF_DAEMON to feat_map Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250916-ublk_features-v1-2-52014be9cde5@purestorage.com> References: <20250916-ublk_features-v1-0-52014be9cde5@purestorage.com> In-Reply-To: <20250916-ublk_features-v1-0-52014be9cde5@purestorage.com> To: Caleb Sander Mateos , Ming Lei , Shuah Khan Cc: linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Uday Shankar X-Mailer: b4 0.14.2 When UBLK_F_BUF_REG_OFF_DAEMON was added, we missed updating kublk's feat_map, which results in the feature being reported as "unknown." Add UBLK_F_BUF_REG_OFF_DAEMON to feat_map to fix this. Signed-off-by: Uday Shankar Reviewed-by: Ming Lei --- tools/testing/selftests/ublk/kublk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests= /ublk/kublk.c index 4e5d82f2a14a01d9e56d31126eae2e26ec718b6c..b636d40b4889d88f7d64d0e71c6= f09eca17e3989 100644 --- a/tools/testing/selftests/ublk/kublk.c +++ b/tools/testing/selftests/ublk/kublk.c @@ -1379,6 +1379,7 @@ static int cmd_dev_get_features(void) FEAT_NAME(UBLK_F_AUTO_BUF_REG), FEAT_NAME(UBLK_F_QUIESCE), FEAT_NAME(UBLK_F_PER_IO_DAEMON), + FEAT_NAME(UBLK_F_BUF_REG_OFF_DAEMON), }; struct ublk_dev *dev; __u64 features =3D 0; --=20 2.34.1 From nobody Thu Oct 2 11:50:39 2025 Received: from mail-pl1-f231.google.com (mail-pl1-f231.google.com [209.85.214.231]) (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 80B9A283680 for ; Tue, 16 Sep 2025 22:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.231 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758060372; cv=none; b=ebjPUmqUexfGGmCv4dcM2QuaIefXfUAHVqveSQC3wTKYHWpZbKt79DT5twWmc71cAeNnKQbhMg45P/ISQOEVvYXogk2NczGv/3JmFL18msKkbGGXOgkmXVf8mVi/YGvA7yyAZsHe3JXVaITQVpZe5vZEZPQQcfNNZRb+dC0OxNs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758060372; c=relaxed/simple; bh=Dlk+Oewhzc94sbibKhlkOgC+Y4VS05JHCp7u906DoAo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mbBTaJFn9ILCHPGxmfgfohAgTA+qLFAj0WqL3p12yFiDmjJcIvUV47/P2FEte5LyrymOj+S54PeB20S/sjuTO9HuyZaK22j1xRLfY4+AuOakG3aApaYng6+/BYHPpUGF/fw21NRAIt1Nq2BfoXsUGXVFlh2qKXrMqWy2Daw6K+U= 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=GiEOpzmm; arc=none smtp.client-ip=209.85.214.231 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="GiEOpzmm" Received: by mail-pl1-f231.google.com with SMTP id d9443c01a7336-2445805aa2eso53377215ad.1 for ; Tue, 16 Sep 2025 15:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758060370; x=1758665170; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YsZQAdC9OI0Rh5GwGUr4F2H2VDgxQJ1oYUQ+4QI9neI=; b=GiEOpzmm146jS+vUcOSY7qfUF3ppLfDs5XrQ9048hXO9D8g3ZVFYdhcDW/VGm9YNb4 dsNilTqG0PRzVAEC6sff0cQfMaJK0NGm2U6Ci63mO7E/T1jmO59wsHCVMcz8MmHEQOIx U2r9aQ9x9Z72eQ3qZ5T9hYUZq47M4ooBeJwqxUFym0PXpVhcT11Kc8pk4M1QZt0KlJQI muQ2fJV7oFFJZxUQYvyzlRPs4NE0c/bzzxeG0Sj8k7w5w73sXiVh3hywVU/ahfUJKf5z GD1Cr0CRyBN17/DFpSA6u5UlT3QNR89jtE6aC4PMpr1iGKDjK2HJwoMBDhrGYlS+w1l2 aukg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758060370; x=1758665170; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YsZQAdC9OI0Rh5GwGUr4F2H2VDgxQJ1oYUQ+4QI9neI=; b=GeJ7qDLJ0+pLcuqP6SgA+ORjGDTaxDqJXUizUkhSWt90y/GJC5Jo7p6xMpLi+TbMS2 smGwj8TXS9IsDyykl0jZwXvTu5LhLir4ReFc595gIiaGQVTWGMBelsQqkAGSNWLA/RVO 8TWYX3lxdjms253HvFoSMYoH4jfgmai1AS6fZjsl0mBkQcMj1RPxV9XJW/RbZwf8VHBt juYT9Aah0ZAI49oAbCMDHM623CVdteKtR+crFUwgegsNJHksnRCCRfXDFKY8yDUUta1l qpdTwhWlxo+OqW5ay1MSNsPX6tpbQOlJXJnv52gMTR9E+bru8g3gFawifGGh7olC4WO3 kFBw== X-Forwarded-Encrypted: i=1; AJvYcCVaceRUO+XQ75d/hHRN9Z5PaBku9vI/p1NtR95rVi+1FUl2nH0v88ZTvEcmHYj531yBWBEVkyUPSq3FXDk=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6hmGOYGZKxA2+6aBH8v0ZeNINee+IrHoXZ1a6FP0Q1wzSU6Dh G3mSJEKiRUboAZam6bnppnnVzOSIn8T+qb15P8CCOtKUff+CRsY5GVklHFsqpdsdmEtNYVwCg1L BnkqI/PQv9Q8ea5TVyyFPvYOIY+bcWQKeImVrF7Vrki7yP9KjsqgD X-Gm-Gg: ASbGncuVr8nurNZtcVWllqxRViZ47qyRk4SHVg63xBkk+9ybdf2rG90d6iImXSQ5wty wVnVG31eENyiQZWhdQIFGdEHL5Pv96NK8iLSx6S4yxI0qV3CLDxaBMO/I8NdaAN9XX8RXPeDa8d AW5sTl5YAIEm+5m4HOcKLAYHGuGXkbPoyC4H+D2PBoWPZHwCB6eR2JMtPLeCcVMkKb7ljalrTwy pIT4eLuxGZvMOerBfiFkFlgQ/AZKXfAaLdfLdCvnGh+KZiSzmaaO4bTef0DIeT07pusqCybAyEz N2fejnicnuLCRtVclb+MmY6Y/VR0Zcrcs2RqP/AYsqy6mIIlVLh2BAGrOQM= X-Google-Smtp-Source: AGHT+IGiJoUhPEuZtFF4wpQYOfXhxSk41Sg03uqDc+U/rjhi5emgbi/g/GBhLda0R/YDZKF9WeQoPhy4MKQY X-Received: by 2002:a17:903:2985:b0:266:63de:eefc with SMTP id d9443c01a7336-26663defc4fmr95694425ad.14.1758060369683; Tue, 16 Sep 2025 15:06:09 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-265dc1db297sm8154155ad.26.2025.09.16.15.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Sep 2025 15:06:09 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-ushankar.dev.purestorage.com (dev-ushankar.dev.purestorage.com [10.7.70.36]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id C48DA34023F; Tue, 16 Sep 2025 16:06:08 -0600 (MDT) Received: by dev-ushankar.dev.purestorage.com (Postfix, from userid 1557716368) id D4C4DE41772; Tue, 16 Sep 2025 16:06:08 -0600 (MDT) From: Uday Shankar Date: Tue, 16 Sep 2025 16:05:57 -0600 Subject: [PATCH 3/3] selftests: ublk: add test to verify that feat_map is complete Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250916-ublk_features-v1-3-52014be9cde5@purestorage.com> References: <20250916-ublk_features-v1-0-52014be9cde5@purestorage.com> In-Reply-To: <20250916-ublk_features-v1-0-52014be9cde5@purestorage.com> To: Caleb Sander Mateos , Ming Lei , Shuah Khan Cc: linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Uday Shankar X-Mailer: b4 0.14.2 Add a test that verifies that the currently running kernel does not report support for any features that are unrecognized by kublk. This should catch cases where features are added without updating kublk's feat_map accordingly, which has happened multiple times in the past (see [1], [2]). Note that this new test may fail if the test suite is older than the kernel, and the newer kernel contains a newly introduced feature. I believe this is not a use case we currently care about - we only care about newer test suites passing on older kernels. [1] https://lore.kernel.org/linux-block/20250606214011.2576398-1-csander@pu= restorage.com/t/#u [2] https://lore.kernel.org/linux-block/2a370ab1-d85b-409d-b762-f9f3f6bdf70= 5@nvidia.com/t/#m1c520a058448d594fd877f07804e69b28908533f Signed-off-by: Uday Shankar Reviewed-by: Ming Lei --- tools/testing/selftests/ublk/Makefile | 1 + tools/testing/selftests/ublk/test_generic_13.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftest= s/ublk/Makefile index 5d7f4ecfb81612f919a89eb442f948d6bfafe225..770269efe42ab460366485ccc80= abfa145a0c57b 100644 --- a/tools/testing/selftests/ublk/Makefile +++ b/tools/testing/selftests/ublk/Makefile @@ -20,6 +20,7 @@ TEST_PROGS +=3D test_generic_09.sh TEST_PROGS +=3D test_generic_10.sh TEST_PROGS +=3D test_generic_11.sh TEST_PROGS +=3D test_generic_12.sh +TEST_PROGS +=3D test_generic_13.sh =20 TEST_PROGS +=3D test_null_01.sh TEST_PROGS +=3D test_null_02.sh diff --git a/tools/testing/selftests/ublk/test_generic_13.sh b/tools/testin= g/selftests/ublk/test_generic_13.sh new file mode 100755 index 0000000000000000000000000000000000000000..ff5f22b078ddd08bc19f82aa66d= a6a44fa073f6f --- /dev/null +++ b/tools/testing/selftests/ublk/test_generic_13.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh + +TID=3D"generic_13" +ERR_CODE=3D0 + +_prep_test "null" "check that feature list is complete" + +if ${UBLK_PROG} features | grep -q unknown; then + ERR_CODE=3D255 +fi + +_cleanup_test "null" +_show_result $TID $ERR_CODE --=20 2.34.1