From nobody Thu Oct 2 07:49:00 2025 Received: from mail-il1-f227.google.com (mail-il1-f227.google.com [209.85.166.227]) (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 96C712D8776 for ; Thu, 18 Sep 2025 19:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758224056; cv=none; b=fJr1EP4t1au34i7F4k5IMEWl2c+LC8kS4DMuUFdQs8529M4eyRL/fcYUUQ+IhVblYXRxGuEhs17QwzEdyVsoMD7VB1jLLhFu8yGtuhS263T5/CGwseSexNpg6rDBFGqLojUhYIPWTR5KDrq1RGscrE4yCotd7jd7APkb6Xuj6X8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758224056; c=relaxed/simple; bh=I1SvgDPbViudLFOaGAb6f8a3G0PYsCRpE1vM8Gvi1dc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WzT11FUU9zmCbluB6ybsSWl+HZoU2Wv0h2AcTvCjRsyjFZKfCJMqwqcxt1GxiaS9/KJKp1qYbSczmgvY839bB/XrO5mvWqD5hm1D5gONyqNGKQ3F6v8YLlOfYCqXR40wCFg/dccjSkN3c7f7OclvKThSqzIHAXBd1GxJpupaQqU= 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=ZL6YDe3Y; arc=none smtp.client-ip=209.85.166.227 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="ZL6YDe3Y" Received: by mail-il1-f227.google.com with SMTP id e9e14a558f8ab-417661ecc5eso7612685ab.0 for ; Thu, 18 Sep 2025 12:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758224053; x=1758828853; 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=yGgcbSkc4b3TEAlty1vI9MIlV1K03L2tgLefNKM4ZS4=; b=ZL6YDe3YckrDXAaaWbx3/TfDA6hxeiGENu7eH4biMVW4KdBXwbLCb8NJArqML6vjLK HyYQPQlofeDAz0U7N+KgCLc34SFLacpWeLfBNsMXAWtcmnuhsBW3mtFWxGODNPYm33aG 3+59jvrmf8FrglWW1Li+nkpC22+XB1WNTEYg1E2n/MpjxgislggAQE6EDlB//514H/4w R4rf7pj4rqPYKBTq+vkS4pJx/QC3AsrscD05IP4iepSY+B/94Cb/I50n9gYEr1aoiZVW hmpkVRxkWazwtPLOsYiEYAvVVAuPwDnWoUKpZQ+Zstf/Iu5ng+FEzC33B/tZOExZ/tuz WsXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758224053; x=1758828853; 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=yGgcbSkc4b3TEAlty1vI9MIlV1K03L2tgLefNKM4ZS4=; b=exoC+gC20LGptsHZczYdHvxwfe12CC/KgaICR1Uso2GmJHXR+M5LwF27y4aTY14OSb a8KaAcekJ2UCbamybvYkJ4pgc419J5tGaTW4MkdWSJ9vyqvmyq/SlyYoEL6s726chVVO Hpv+dzMEO+sUl7SZ2h2EdgXF7tgGRz3l2teT82KJhN5QKHw1Y2tDS1evR4ClNVXNj+Ro aam8s+QefNwBeBztRueLYe5mPcru/WxiE9f722GqeMSnYJQGn7Js5zdl1qMC9RhilBCG EhPP02FvRI2s2ht82LwTehNnUs1mzcHH1aGkMkbKabB0gmPt8oekEaMhB0ZILoehq6Dt NEKQ== X-Forwarded-Encrypted: i=1; AJvYcCX+gG2HeJiMebnic4c/LcEpyDWhOnzZD6fgE1Y00eoMMSuz8bI5VhY9TjXNZtH9mAKo77o9feNx93Eixg8=@vger.kernel.org X-Gm-Message-State: AOJu0YwFh2Odem3uMw/YcsfAUA1a4fgY1e531CcZMWQlcb81txtpa5of Mbot5FZseR9TYlGVLpaBtDFwYWq01e8gSfKouyjgWogDWj8uSD790GY49ru2PM10ddgBEM+1288 xDcmJlT+RVNjg6bVoupo5mk7AFcaYKlhb2scBp90sgnAqirKspE2M X-Gm-Gg: ASbGncu+XoyDe9nVBRo3GipQ5p7wacFzzRKooxhFSoPMoBvZy69Mls6MPDMR0PUZyI4 eAzK+/ZtxM0N9xrEhCkDP2Kn7mm8d+rlNtwPmQTJaUx/i/ozqq954g2N0JIPyN5UWvchQoUw+rL y9KzBMTY6hTnI4vLadK/32i2BZ3cM8OwWnI+UiVxq9xfpqja/GRLFYuwPgoKWXlfvP5XIIvU0g5 O42HhUtv0T1srajB/DwdryFDtq3jwtxvK7PIpZRjH9BI0lltaHDc4Vm07o3QKVm2ITHtNvOzYiU PIGv3RcJlmgUtM0JtgFJ8gwA9gjoduOCUClF1oRBp15OFEenxJzoOy4cfc0= X-Google-Smtp-Source: AGHT+IHFBuXdBHcUoocU29bhImj7n4wo7JMQqdfOvZ3xQYknkYkVo1GnnTsv5mYjprk2aGCiMz9ql+ezl0L1 X-Received: by 2002:a05:6e02:2293:b0:423:fce3:9255 with SMTP id e9e14a558f8ab-4248197c39fmr12210055ab.23.1758224052653; Thu, 18 Sep 2025 12:34:12 -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 8926c6da1cb9f-53d56e41e6bsm198876173.44.2025.09.18.12.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Sep 2025 12:34:12 -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 35A05340853; Thu, 18 Sep 2025 13:34:12 -0600 (MDT) Received: by dev-ushankar.dev.purestorage.com (Postfix, from userid 1557716368) id F2C33E40696; Thu, 18 Sep 2025 13:34:11 -0600 (MDT) From: Uday Shankar Date: Thu, 18 Sep 2025 13:34:07 -0600 Subject: [PATCH v2 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: <20250918-ublk_features-v2-1-77d2a3064c15@purestorage.com> References: <20250918-ublk_features-v2-0-77d2a3064c15@purestorage.com> In-Reply-To: <20250918-ublk_features-v2-0-77d2a3064c15@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: root# ./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 07:49:00 2025 Received: from mail-yb1-f226.google.com (mail-yb1-f226.google.com [209.85.219.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 ECF642D94B4 for ; Thu, 18 Sep 2025 19:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758224057; cv=none; b=g4LbyXKGXe6eBJT62++iDMKSCi1h6osBKrC6ttfKXVmdt8+ZJn9iS7rXa9MVwlG4rn8hZ1PupVuUdAMXX8Qyobs1XN38dncYs03jDOSHZFPBSu5QpW0tXxwnDxAQYIOlDHBmSq1TUNTVE3kGiZKl6lsqpTSY2tt28xwRYXUfDMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758224057; c=relaxed/simple; bh=Y9/Ne8zaqdwA/LXEG0LconEi+zVGsXicyRVHEDgancw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Og3LKZLvQoODKbvWUMmrk64Uxeb6ktnMVPV+78xCloP6CxQLf+iNri4tsiG16ZoMfR6YbAxGPgZCuVpDvtZDnkSnPFLV4L/trsd4oMKi/VvRmv2RkLqliRPkKkhXyF6fnMwb0955R9oSlj7edJSYlhh5r/8YuSRwTUE8neqOZTw= 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=UKq2ug09; arc=none smtp.client-ip=209.85.219.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="UKq2ug09" Received: by mail-yb1-f226.google.com with SMTP id 3f1490d57ef6-ea3dbcc5525so988634276.2 for ; Thu, 18 Sep 2025 12:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758224053; x=1758828853; 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=zUwZ0WSYzRWLsV37Zv2zW5RoOF8gsqcC5qtG3FfYLLc=; b=UKq2ug09nECDKJ8qP52M5tEonD4ouB9EMtR+X7SlGgf8Q5ifu431/jNdxo/guiTZiL e6rcrF9vVt36B1VXSVd99J27eJpitA2CIRozfsKJfFd4dxujbtidpWvFNa27ls1jA+Rs 63fZcd0W9kBh0DeAnKh7bvJ0i+PnBaid3V4aE2cotImXwL7AcsTG4PmF6pVBwa/tUNDy pAiduAQec/w+HLMGpfIj6Fyiqbjq6FuJMmHmhm1moADeopI51gClaamKT6dlwg62Bxn0 3CwM3JLsWKmakrQn8vhJ3xRelgw+5vBpTrJl5cGOX9e1O9ZI5tGecMLTW89dS2ipHn+6 /y4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758224053; x=1758828853; 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=zUwZ0WSYzRWLsV37Zv2zW5RoOF8gsqcC5qtG3FfYLLc=; b=or9dWjhK6Ex5m/aWqJZjeKD9464Qtol/xwmubqvN8nv5PhK91QWfrMe6ZXbyaXKdZD cRcQRkZeMtL2/ZASAp+gOhh8fbC1Oqg8ns3ePU+UrtzgITmx8GjnlOQV9PBVbI4hWo27 xkB4JBk+TGxcK0zELXTjuhOziXpgeMljpztUgRLgNzkyVCRfUyIJwjQDho1d23FrBTUw pc6T1/uHOa75zH5lnJjrDi0YsHhOyQUkMDe7+yjsMo0a/y8PPpI0amu/t8WnL+cwQIQT RJM+E3xXMih/+s819gA3xWC67JJdjn7Qlhv1VQSY4nCXRTjgx53WbgXoCzz0vRsiW/Ey 2Frg== X-Forwarded-Encrypted: i=1; AJvYcCVhLA7u3Xmw8EFoyoKPY0ELBhKkKzBBSY6gd4c8m1EAXmC05PDZyMB0TvcvTUDcB2ksQvG5Juo09ao6fvc=@vger.kernel.org X-Gm-Message-State: AOJu0YyC745o/z8TzU/FrXbkTauu62+hQxdimgTciIWGXVj9MZd6fJ48 kqJx0vIHFFwT+BGiqrEc/6mG1EtbXb8NHKYNtm67UzeYmvMYGXWaDzf33qiWgwi0zUCmug3VUpW NvkICqvlzpiMppFb2JHMga26vG9HLoIUygesV X-Gm-Gg: ASbGnctPgRIjXw6D4d7X0aoD6mvpiKi/zlAzOAbniBD8zlYXc953NdXKqRkRNsgDufO ryfGgMudnI1/RrBTEMfAChdbE20V4laIS4r9LCMFonig/E5O0qkqXjV2/TNO36xdS2mE8kCo80P EFhnM3teocXweg443U/nueh8YE3vT+rzaWfQjvpdsxL5m6gyGkoRwnfn4kCujsjEuevuz2C+9fj ZVpgDyvsjzGvFeynDXpcOgLsfFyvgL5/smILqR61IRXK45eSvwlVQDlSAq2YI0XhLQBH2b8bSmp Z8ovEzPX8MVr9aGtBlOMvEBWgwjEqhfeE4YD++oegn1dKsPgzZfwJW4MXX8VMm+M2RnHlYET/A= = X-Google-Smtp-Source: AGHT+IFECpZeDDEGAhBtzHw6/PxcEE3TRQwhyGlv3EpuDKpWXDFvddkM3Bj/6+YKpS1VWGtiLzjjfhO9SUic X-Received: by 2002:a05:6902:150b:b0:ea4:d1:e832 with SMTP id 3f1490d57ef6-ea8a867ea09mr636869276.42.1758224052816; Thu, 18 Sep 2025 12:34:12 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 3f1490d57ef6-ea5ce832831sm198429276.16.2025.09.18.12.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Sep 2025 12:34:12 -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 3432334049A; Thu, 18 Sep 2025 13:34:12 -0600 (MDT) Received: by dev-ushankar.dev.purestorage.com (Postfix, from userid 1557716368) id 0452BE541CA; Thu, 18 Sep 2025 13:34:12 -0600 (MDT) From: Uday Shankar Date: Thu, 18 Sep 2025 13:34:08 -0600 Subject: [PATCH v2 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: <20250918-ublk_features-v2-2-77d2a3064c15@purestorage.com> References: <20250918-ublk_features-v2-0-77d2a3064c15@purestorage.com> In-Reply-To: <20250918-ublk_features-v2-0-77d2a3064c15@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 07:49:00 2025 Received: from mail-il1-f229.google.com (mail-il1-f229.google.com [209.85.166.229]) (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 BC32B2D8792 for ; Thu, 18 Sep 2025 19:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.229 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758224056; cv=none; b=C5ey603ke+wAEbKunRToFeZA34t7Q3WkkrsDfV3nTFOkzyTBn4qHz5yq1qtsGJ2AY/D2T9QfD04+4Ia02njqBOlx8Wmgkszi7RvbQrVzTUB+wuCK4Jbh4IjIG44Kjj2bYAG/XpwKHnTTlfNNxZYiJfCPzE8y9e+Zft56P+KkO4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758224056; c=relaxed/simple; bh=kqKHD5ehZXD1Rt9JUSSGS9cTnlizM80DHb0RRMG6eqQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E2Ah02pLq/QaUm7ewp9QQgK+8LUNBdWNDwwBy4vEwo9boHp9ojUEViWanjGq1r44jgyP7DBSSfIobNyrwY5CX8WxUbxmUVDL34zjMMpAeQmrnzCkFxfej7WWYyNIbDDIiiDGmQGmVRDRgqm8UqewB5UTePQTW9MIa50zQ6NkOF4= 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=C8uDV37Y; arc=none smtp.client-ip=209.85.166.229 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="C8uDV37Y" Received: by mail-il1-f229.google.com with SMTP id e9e14a558f8ab-42403719c73so12568675ab.0 for ; Thu, 18 Sep 2025 12:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758224053; x=1758828853; 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=Qfla8bZUs3WSTY0zGPzDgRTSRNvs3BA8rlHoMH79c3A=; b=C8uDV37Y2VswDKnS+t0TMJnfJNOIvf6AItaCMVr71z8IBBquG2BS0qtyDwlCjK0t/u lvowz64VnudEGWKK39HAqnaI/IPXcbFLNLkEJE/qlF3CZlOS0MlevOADdQ1upRNMDptW naoqZMArCUlbqT8DLPqSS/Ni6ZobTPHAycmy5EY0CbNd77qRX5RCHE7z5nRvyvCQAR+s kgFvWM6dGnBwAg0DSfjX0/Y1aRAC3hPZYw/VzHNvluSBcf+HL/lBLI6qW4KPzyxEw7Su dxpmJN/PtM74hkj9TaxekQ0iBpZbMt5PpkbM2aWywxi31xrWqyf8aQ6ZVciCvtQGbFDN thzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758224053; x=1758828853; 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=Qfla8bZUs3WSTY0zGPzDgRTSRNvs3BA8rlHoMH79c3A=; b=M/IjwzhAxsBGX8aMtjwXN6YouZpURHfQ+afzk4WrSHTfL+yYlP4AcRZ2VF/XF7bqN+ 7MgXa4WmV8tzcLOEGbZcAwEEVbiiivh2FsjxYYF8aRbJn/gZdfq69ehRpXqvv5eWWXi5 EKIetOZvsjsG1efgq6Q3iDsZHgfkVFS3qb2ie71HZZ6xfRl15JxiIx1EYAXTaRs3eIQh CcjibDHMPEEi8L7SfN3O4uvtrBuwUkp6RfyKRHzIyM1UsSOUFlmTKMr1xB9gfytBduPb Nb8GngYiAhjUsKrHLtJdpqdpeZnfaSTs9ko14Q6tMvAcLpErJ9/tpiSoDNkYNI1Axcwp Zgxg== X-Forwarded-Encrypted: i=1; AJvYcCWsfMJkTGNeo70rmHjVNtfT5T3TyE4nfKKQbs7RfoWwqfZ1J4XPtV28kUZj+EftyvWExsQll+fff4MxGko=@vger.kernel.org X-Gm-Message-State: AOJu0YzlzdGXrsqzxcKj+3SaDT3e3bLXpSM2UUsRzlntWEFGI0GkYBAf wkTZLIo5qmzebztPG5ivfNFsPwVu6EQHxKtIPooeGDtlfN88LGWTIiMiCUSe7Zq33C1rm2RZoBJ HMwWa78u66iGhrDEcPmwWnxE6/oH/9OHv4Ofx X-Gm-Gg: ASbGnctKkhHDhuJ63+K41dL+LJJtadwqTslszd6Qju0z7IsyQR3eudlPD5moPxhLWHw N7qnq6hUZwhpGvLnXHAJEobqcfrGLqykWrolxuRFP1806QDae3TSVYI4H0RQFyCIKUlGGMkQPpZ g82vpZ8f2noumXcdlBsmOESYOVY0prgB/RuIsZiUDvpf8u1Xt0xkTsZ/Cr05A1gDWIhVsu7EBZA 5K4IypIioHq+++Aae/rypISiySg16X5msK91otY+h0IOpt+4Lk/X0lUoC1WASOSb8jLyVY8Bug/ Xwxntqqg2VduP9qQ8033N4DIgJtWiDQOnONLxtEXqGxrt6i7DJHbdHCgpm3BENk/QsD2lkwVfw= = X-Google-Smtp-Source: AGHT+IElwU4J+0k5G0xjwarOPJhNJ8IHRnrr1sD6xBB+QeAq7JN53s/aglucgmQ+/5PoOoj3mnPaBPT+Q8cE X-Received: by 2002:a05:6e02:2509:b0:410:f09a:28a6 with SMTP id e9e14a558f8ab-42481925dd8mr13628105ab.13.1758224052667; Thu, 18 Sep 2025 12:34:12 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id e9e14a558f8ab-4247353db28sm1480915ab.32.2025.09.18.12.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Sep 2025 12:34:12 -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 370BC34142D; Thu, 18 Sep 2025 13:34:12 -0600 (MDT) Received: by dev-ushankar.dev.purestorage.com (Postfix, from userid 1557716368) id 0F0EEE541CB; Thu, 18 Sep 2025 13:34:12 -0600 (MDT) From: Uday Shankar Date: Thu, 18 Sep 2025 13:34:09 -0600 Subject: [PATCH v2 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: <20250918-ublk_features-v2-3-77d2a3064c15@purestorage.com> References: <20250918-ublk_features-v2-0-77d2a3064c15@purestorage.com> In-Reply-To: <20250918-ublk_features-v2-0-77d2a3064c15@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 | 20 ++++++++++++++++++++ 2 files changed, 21 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..b7aa90b1cb74615dd4727187a6a= 5aa9ed93088f7 --- /dev/null +++ b/tools/testing/selftests/ublk/test_generic_13.sh @@ -0,0 +1,20 @@ +#!/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 + echo "# unknown feature detected!" + echo "# did you add a feature and forget to update feat_map in kub= lk?" + echo "# this failure is expected if running an older test suite ag= ainst" + echo "# a newer kernel with new features added" + ERR_CODE=3D255 +fi + +_cleanup_test "null" +_show_result $TID $ERR_CODE --=20 2.34.1