From patchwork Thu Feb 25 06:13:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Sivaraj X-Patchwork-Id: 12103341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9362EC433E0 for ; Thu, 25 Feb 2021 06:13:15 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12F0964EBD for ; Thu, 25 Feb 2021 06:13:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12F0964EBD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fossix.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8DACC100EB338; Wed, 24 Feb 2021 22:13:14 -0800 (PST) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::1031; helo=mail-pj1-x1031.google.com; envelope-from=santosh@fossix.org; receiver= Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AAD57100EB84F for ; Wed, 24 Feb 2021 22:13:12 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id i14so1245141pjz.4 for ; Wed, 24 Feb 2021 22:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8QIXWc8wfA9Cjw0TZUWfQhKZd/QAeiKZT+i++8Gju+E=; b=j5ojXWZzHjFbpaKa3Ei9U2+AtjZKt/3wL1tjUUgzYwnsglOoho19epOQkafRa5wHXw 7wEafD4NA/jJ1ETO7pnd7vXRYvFKBz1RfZA6b0JjiTcU5pyktVcGlhIwuXewzt0WHm/8 n7paSN6pYoJIRneSU9FLxRPMSaxr7hiC0gEyBSGOe4X/QBgjjrKh5+pVtgHAtGvQ1r0+ ZYuzpj472NQKRhZG3GHSZ+kPseWoCh44IdOT1rgKri6FQVhP2ulQCF9JawEbwYqeCjim XhjZJcjXG8epzc1k/p4gUJZA1JnRiqwa4gwxZGD+hZ9c7ZnNliERphCyd+gI+QTFyxI+ Tgfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8QIXWc8wfA9Cjw0TZUWfQhKZd/QAeiKZT+i++8Gju+E=; b=il8UQXAsr0SIJvQp0xEwhaAVrcbhj8w7/qEiPrOW8P2jsXbUqUWhjfcVOVr+F8jOFw feCKHEBOOJXhICBQW/YITAyNfwxCURdzB74B9f1dhIHT8qSoEmFg0juxvj4n+0W+TaFH m83muocnHRrgj3QrYDiMO9OXalae7BYDY0Z2AH+TRqhXwdiQQcwin5cOlglhs5+44efy Yr2mVbvYnJJsx+heKvET3DFBQ5DFUn42wZ+ldvPTFLifwOdJ9fZzSRcO/09wgoaWLtOv 3hOQAtFfpWbA/vkKX/5Jo+5jY/yYJi9IHt3hEVV5fa6XgUa+64lcmz2FxgNgnd01KMGM 9a3g== X-Gm-Message-State: AOAM530KYPLibvVRVTPxG5OuOXrk8H8X6YhRwH62PLwrQA3Kjs7A1uZ5 DLv3qV9xGL6Atp3pBh+ys3X9g7RhgueXOQ== X-Google-Smtp-Source: ABdhPJww3viEwDVlUf5DBw8SvVZYOdTQREAa5ppwdTCiBonRLkFrSMBBwATXGlaVxYMu98jAMDQVZw== X-Received: by 2002:a17:90a:b38b:: with SMTP id e11mr1710199pjr.205.1614233591714; Wed, 24 Feb 2021 22:13:11 -0800 (PST) Received: from santosiv.in.ibm.com.com ([103.21.79.4]) by smtp.gmail.com with ESMTPSA id d24sm4327803pfr.139.2021.02.24.22.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 22:13:11 -0800 (PST) From: Santosh Sivaraj To: Linux NVDIMM , Vishal Verma , Vaibhav Jain , Shivaprasad G Bhat , Harish Sriram , Dan Williams Cc: Santosh Sivaraj Subject: [PATCH v2 1/4] test: Don't skip tests if nfit modules are missing Date: Thu, 25 Feb 2021 11:43:00 +0530 Message-Id: <20210225061303.654267-1-santosh@fossix.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Message-ID-Hash: T4I2Q6AF7ZJKXKBVVXC3BEULW2Y6LKTO X-Message-ID-Hash: T4I2Q6AF7ZJKXKBVVXC3BEULW2Y6LKTO X-MailFrom: santosh@fossix.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: For NFIT to be available ACPI is a must, so don't fail when nfit modules are missing on a platform that doesn't support ACPI. Signed-off-by: Santosh Sivaraj --- test.h | 2 +- test/ack-shutdown-count-set.c | 2 +- test/blk_namespaces.c | 2 +- test/core.c | 23 +++++++++++++++++++++-- test/dpa-alloc.c | 2 +- test/dsm-fail.c | 2 +- test/libndctl.c | 2 +- test/multi-pmem.c | 2 +- test/parent-uuid.c | 2 +- test/pmem_namespaces.c | 2 +- 10 files changed, 30 insertions(+), 11 deletions(-) Changelog: v2: * Patch 2: Fix a bug, I skip erroring out if PAPR family, but condition had INTEL family instead. That change was there to test the same code on x86, but accidently committed. Now have a environment variable to force test PAPR family on x86. * Patch 4: Remove stray code, artifact of refactoring in patch 1. diff --git a/test.h b/test.h index 3f6212e..94d8936 100644 --- a/test.h +++ b/test.h @@ -30,7 +30,7 @@ void builtin_xaction_namespace_reset(void); struct kmod_ctx; struct kmod_module; -int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod, +int ndctl_test_init(struct kmod_ctx **ctx, struct kmod_module **mod, struct ndctl_ctx *nd_ctx, int log_level, struct ndctl_test *test); diff --git a/test/ack-shutdown-count-set.c b/test/ack-shutdown-count-set.c index 742e976..6315a94 100644 --- a/test/ack-shutdown-count-set.c +++ b/test/ack-shutdown-count-set.c @@ -99,7 +99,7 @@ static int test_ack_shutdown_count_set(int loglevel, struct ndctl_test *test, int result = EXIT_FAILURE, err; ndctl_set_log_priority(ctx, loglevel); - err = nfit_test_init(&kmod_ctx, &mod, NULL, loglevel, test); + err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test); if (err < 0) { result = 77; ndctl_test_skip(test); diff --git a/test/blk_namespaces.c b/test/blk_namespaces.c index 437fcad..dfb0332 100644 --- a/test/blk_namespaces.c +++ b/test/blk_namespaces.c @@ -240,7 +240,7 @@ int test_blk_namespaces(int log_level, struct ndctl_test *test, if (!bus) { fprintf(stderr, "ACPI.NFIT unavailable falling back to nfit_test\n"); - rc = nfit_test_init(&kmod_ctx, &mod, NULL, log_level, test); + rc = ndctl_test_init(&kmod_ctx, &mod, NULL, log_level, test); ndctl_invalidate(ctx); bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0"); if (rc < 0 || !bus) { diff --git a/test/core.c b/test/core.c index 5118d86..8e48fd6 100644 --- a/test/core.c +++ b/test/core.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #define KVER_STRLEN 20 @@ -116,11 +117,11 @@ int ndctl_test_get_skipped(struct ndctl_test *test) return test->skip; } -int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod, +int ndctl_test_init(struct kmod_ctx **ctx, struct kmod_module **mod, struct ndctl_ctx *nd_ctx, int log_level, struct ndctl_test *test) { - int rc; + int rc, family = NVDIMM_FAMILY_INTEL; unsigned int i; const char *name; struct ndctl_bus *bus; @@ -137,6 +138,19 @@ int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod, "nd_e820", "nd_pmem", }; + char *test_env; + + /* Do we want to force test PAPR? */ + test_env = getenv("NDCTL_TEST_FAMILY"); + if (test_env && strcmp(test_env, "PAPR") == 0) + family = NVDIMM_FAMILY_PAPR; + + /* ACPI is a must for nfit, so if ACPI is not available let's default to + * PAPR */ + if (access("/sys/bus/acpi", F_OK) == -1) { + if (errno == ENOENT) + family = NVDIMM_FAMILY_PAPR; + } log_init(&log_ctx, "test/init", "NDCTL_TEST"); log_ctx.log_priority = log_level; @@ -195,6 +209,11 @@ retry: path = kmod_module_get_path(*mod); if (!path) { + if (family == NVDIMM_FAMILY_PAPR && + (strcmp(name, "nfit") == 0 || + strcmp(name, "nd_e820") == 0)) + continue; + log_err(&log_ctx, "%s.ko: failed to get path\n", name); break; } diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c index b757b9a..10af189 100644 --- a/test/dpa-alloc.c +++ b/test/dpa-alloc.c @@ -299,7 +299,7 @@ int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx) return 77; ndctl_set_log_priority(ctx, loglevel); - err = nfit_test_init(&kmod_ctx, &mod, NULL, loglevel, test); + err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test); if (err < 0) { ndctl_test_skip(test); fprintf(stderr, "nfit_test unavailable skipping tests\n"); diff --git a/test/dsm-fail.c b/test/dsm-fail.c index b2c51db..1d03470 100644 --- a/test/dsm-fail.c +++ b/test/dsm-fail.c @@ -356,7 +356,7 @@ int test_dsm_fail(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx) int result = EXIT_FAILURE, err; ndctl_set_log_priority(ctx, loglevel); - err = nfit_test_init(&kmod_ctx, &mod, NULL, loglevel, test); + err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test); if (err < 0) { result = 77; ndctl_test_skip(test); diff --git a/test/libndctl.c b/test/libndctl.c index 994e0fa..5043ae0 100644 --- a/test/libndctl.c +++ b/test/libndctl.c @@ -2696,7 +2696,7 @@ int test_libndctl(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx) daxctl_set_log_priority(daxctl_ctx, loglevel); ndctl_set_private_data(ctx, test); - err = nfit_test_init(&kmod_ctx, &mod, ctx, loglevel, test); + err = ndctl_test_init(&kmod_ctx, &mod, ctx, loglevel, test); if (err < 0) { ndctl_test_skip(test); fprintf(stderr, "nfit_test unavailable skipping tests\n"); diff --git a/test/multi-pmem.c b/test/multi-pmem.c index cb7cd40..111aa28 100644 --- a/test/multi-pmem.c +++ b/test/multi-pmem.c @@ -259,7 +259,7 @@ int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx ndctl_set_log_priority(ctx, loglevel); - err = nfit_test_init(&kmod_ctx, &mod, NULL, loglevel, test); + err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test); if (err < 0) { result = 77; ndctl_test_skip(test); diff --git a/test/parent-uuid.c b/test/parent-uuid.c index f41ca2c..1e5a503 100644 --- a/test/parent-uuid.c +++ b/test/parent-uuid.c @@ -230,7 +230,7 @@ int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ct return 77; ndctl_set_log_priority(ctx, loglevel); - err = nfit_test_init(&kmod_ctx, &mod, NULL, loglevel, test); + err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test); if (err < 0) { ndctl_test_skip(test); fprintf(stderr, "nfit_test unavailable skipping tests\n"); diff --git a/test/pmem_namespaces.c b/test/pmem_namespaces.c index eac56ce..afa79a2 100644 --- a/test/pmem_namespaces.c +++ b/test/pmem_namespaces.c @@ -203,7 +203,7 @@ int test_pmem_namespaces(int log_level, struct ndctl_test *test, if (!bus) { fprintf(stderr, "ACPI.NFIT unavailable falling back to nfit_test\n"); - rc = nfit_test_init(&kmod_ctx, &mod, NULL, log_level, test); + rc = ndctl_test_init(&kmod_ctx, &mod, NULL, log_level, test); ndctl_invalidate(ctx); bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0"); if (rc < 0 || !bus) { From patchwork Thu Feb 25 06:13:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Sivaraj X-Patchwork-Id: 12103343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_50,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68044C433DB for ; Thu, 25 Feb 2021 06:13:18 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D748464EBA for ; Thu, 25 Feb 2021 06:13:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D748464EBA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fossix.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A21AE100F2249; Wed, 24 Feb 2021 22:13:17 -0800 (PST) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::435; helo=mail-pf1-x435.google.com; envelope-from=santosh@fossix.org; receiver= Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1CF3E100F2243 for ; Wed, 24 Feb 2021 22:13:15 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id q204so1869402pfq.10 for ; Wed, 24 Feb 2021 22:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BvIuIKkdW9j0AHuyohk7gLtOKcKtkr3zFaTFC3boKqc=; b=nafdjHrjCc3xu9uG6bfqimsiIz4dcBkLWl5q+HyGQ8ILkmg8J5yWJtE26uJs4XIWXM M3WWFtQK3egtukZSPwgGrZvofGwg5UginpCcNzNteNFRdRF8LiGpznj3dauZlJGjNOD5 EUdcNaiezSxgEcO4VVds21gezzNpwdc4+HFaGQ/j1R0x0DBImqH7DLLIeIZ30aGtFs6B awxs9Ui6fj3Qyb9Pko+JI3JK5NHmPoToUN/COi8FXRzQtkvJse+qbqSECjjquK3/Mn3V av1R25QcPH/33iO1hQ0e4zZfS+FPy1vmjNJR3oF16My0jOZ00c/Y7QAT4aOVtSv2XuVl Oqow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BvIuIKkdW9j0AHuyohk7gLtOKcKtkr3zFaTFC3boKqc=; b=gNP7xi9QV9pDMCmpn9qnFGVTs9nPELR95TdV2rm9uDD8uAM5w1E1/SB0/T0mzmhXSM 0sX0XEuBCMBIizyXlwX8XtrCEy85kk/Lj18HvITXkMKpOx7gFs5jyK1VpOcqMzfY4GGl o0hQv4fge2CHYnqeaf7NhH6l2PqZcJ9Aa1yTOvYJMU7K8dzvhd6/0wDgq90TW+y8YkkM hKYHjcisnPiBs39od1S3Urdhz0VylYPdSTUDDvXWCUCPvJPD0sT6Z0L7vJTejUXFcvDN 22SrScUzozf8ZyKRUb2M44PnqbUKdlmQQ5+bTMa9GJ2BIuARlOE2nvfqSWjWDGQpiwiN G8Kg== X-Gm-Message-State: AOAM530TFmQRmmNhBfv22MOBvOMWduWSRURqFAavZiykIwgFqPqAxbCQ llmiVL4vsp8YbT71QvXV/NqV/s9wZfTUbQ== X-Google-Smtp-Source: ABdhPJz1Npcns3TO68e9726TMU4BR235ylkfOz4bTeRptXW1A9szgL1CMXW0xFw3gZjUepF1WCbCLw== X-Received: by 2002:aa7:94b7:0:b029:1ed:c7e8:d7f3 with SMTP id a23-20020aa794b70000b02901edc7e8d7f3mr1796917pfl.28.1614233594476; Wed, 24 Feb 2021 22:13:14 -0800 (PST) Received: from santosiv.in.ibm.com.com ([103.21.79.4]) by smtp.gmail.com with ESMTPSA id d24sm4327803pfr.139.2021.02.24.22.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 22:13:14 -0800 (PST) From: Santosh Sivaraj To: Linux NVDIMM , Vishal Verma , Vaibhav Jain , Shivaprasad G Bhat , Harish Sriram , Dan Williams Cc: Santosh Sivaraj Subject: [PATCH v2 2/4] papr: Add support to parse save_fail flag for dimm Date: Thu, 25 Feb 2021 11:43:01 +0530 Message-Id: <20210225061303.654267-2-santosh@fossix.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210225061303.654267-1-santosh@fossix.org> References: <20210225061303.654267-1-santosh@fossix.org> MIME-Version: 1.0 Message-ID-Hash: RF5MYFSLWVV64UCLJCA3X3WWWKORTFPL X-Message-ID-Hash: RF5MYFSLWVV64UCLJCA3X3WWWKORTFPL X-MailFrom: santosh@fossix.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: This will help in getting the dimm fail tests to run on papr family too. Also add nvdimm_test compatibility string for recognizing the test module. Signed-off-by: Santosh Sivaraj --- ndctl/lib/libndctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c index 5f09628..3fb3aed 100644 --- a/ndctl/lib/libndctl.c +++ b/ndctl/lib/libndctl.c @@ -815,6 +815,8 @@ static void parse_papr_flags(struct ndctl_dimm *dimm, char *flags) dimm->flags.f_restore = 1; else if (strcmp(start, "smart_notify") == 0) dimm->flags.f_smart = 1; + else if (strcmp(start, "save_fail") == 0) + dimm->flags.f_save = 1; start = end + 1; } if (end != start) @@ -1044,7 +1046,8 @@ NDCTL_EXPORT int ndctl_bus_is_papr_scm(struct ndctl_bus *bus) if (sysfs_read_attr(bus->ctx, bus->bus_buf, buf) < 0) return 0; - return (strcmp(buf, "ibm,pmemory") == 0); + return (strcmp(buf, "ibm,pmemory") == 0 || + strcmp(buf, "nvdimm_test") == 0); } /** From patchwork Thu Feb 25 06:13:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Sivaraj X-Patchwork-Id: 12103345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_50,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B529C433DB for ; Thu, 25 Feb 2021 06:13:22 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0945364EBA for ; Thu, 25 Feb 2021 06:13:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0945364EBA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fossix.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BC078100F2250; Wed, 24 Feb 2021 22:13:21 -0800 (PST) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::632; helo=mail-pl1-x632.google.com; envelope-from=santosh@fossix.org; receiver= Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9F3C3100F224F for ; Wed, 24 Feb 2021 22:13:19 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id z7so2621309plk.7 for ; Wed, 24 Feb 2021 22:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9Vgl9Y4OYOa6q+Jg6IebbG7CPmzxNl71ZksxhDAHmug=; b=F2MvFHKYJx1fBqiqDqfWBJYYT7nvrPfyvBt/a95xDdDI+Z0NY6suIZOTsoSafk47lk p95LYVIjRCfARy5ppEWIJtRAuNAHNq65/keL6qlHv9xICOAhC3jIeefxG/0IVzFNBYo+ EOWoHLQr9JSYZkDJUjJmWIe0AvSvGILIHkU6X8tR/K9W3qK+ibRx88fvuxPzq8hdgrDP YqvFgUQUYBYqm/n2q8y0vQx3KRRG3bGYBBlAynbErLjS6UfH5CD7TrmEQ+7w6Xsvu01g kYktrfVL/XtBeu1Shr/BoG7k5H9rjMOeL3tcJFhIVSLf/cta9DF4coGBJYkwjGbZNLjn is5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9Vgl9Y4OYOa6q+Jg6IebbG7CPmzxNl71ZksxhDAHmug=; b=lXFUH1oPAg8abiMG3ynCun/J8hEwddNdP5xQQMKe1yxMNMpMvEt17Cg9gf55Pc+YxN v+XHVpcNJcy/lExX7FY7rn2QKcCf1ZrBZ111hqfTMpwhLIgDD9SZSimKCDTPwnl0scFA 5ro8zkGPKLQU57Q+XCVVExaw+gPpcWS1VZOSky5eVtKbSVqLvGn0blwJMp7jykjCZSj+ aSLv38O79szSusnDIVp1KWNQnpatZB2UDOk5CzGWfs9aczzn172jm5+4K2Us5LEZkh23 yi6dbNQ8qPwYXMbkU82HAm6QSymDswUUMtJtkCsZbfRfZERgD8dZKZnVLzDMlRK3sniB wEZw== X-Gm-Message-State: AOAM531Sq4twxN7L1L+25a6YEQORW0eJERQctOtYEVHK2U/tc3DB84Sh AR8O2A2qi8P9KzYyZDweVVNylsdNEhWKyg== X-Google-Smtp-Source: ABdhPJzzGG8Npg6O1AkThj1UHEvsRpbeMufmRjCJgvQzAaLoYakBGK3RHxeF70XKXx6/0cOrMq2ZWQ== X-Received: by 2002:a17:903:188:b029:e3:dd4b:f6c1 with SMTP id z8-20020a1709030188b02900e3dd4bf6c1mr1472866plg.81.1614233598937; Wed, 24 Feb 2021 22:13:18 -0800 (PST) Received: from santosiv.in.ibm.com.com ([103.21.79.4]) by smtp.gmail.com with ESMTPSA id d24sm4327803pfr.139.2021.02.24.22.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 22:13:18 -0800 (PST) From: Santosh Sivaraj To: Linux NVDIMM , Vishal Verma , Vaibhav Jain , Shivaprasad G Bhat , Harish Sriram , Dan Williams Cc: Santosh Sivaraj Subject: [PATCH v2 3/4] test/libndctl: skip SMART tests on non-nfit devices Date: Thu, 25 Feb 2021 11:43:02 +0530 Message-Id: <20210225061303.654267-3-santosh@fossix.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210225061303.654267-1-santosh@fossix.org> References: <20210225061303.654267-1-santosh@fossix.org> MIME-Version: 1.0 Message-ID-Hash: G3AK2NUAKD5YXYTTHPCWQCNL3CR3UC7T X-Message-ID-Hash: G3AK2NUAKD5YXYTTHPCWQCNL3CR3UC7T X-MailFrom: santosh@fossix.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: This is just a temporary check till the new module has SMART capabilities emulated. Signed-off-by: Santosh Sivaraj --- test/libndctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/libndctl.c b/test/libndctl.c index 5043ae0..001f78a 100644 --- a/test/libndctl.c +++ b/test/libndctl.c @@ -2427,7 +2427,8 @@ static int check_commands(struct ndctl_bus *bus, struct ndctl_dimm *dimm, * The kernel did not start emulating v1.2 namespace spec smart data * until 4.9. */ - if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 9, 0))) + if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 9, 0)) + || !ndctl_bus_has_nfit(bus)) dimm_commands &= ~((1 << ND_CMD_SMART) | (1 << ND_CMD_SMART_THRESHOLD)); From patchwork Thu Feb 25 06:13:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Sivaraj X-Patchwork-Id: 12103347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94C66C433DB for ; Thu, 25 Feb 2021 06:13:25 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B2B164EBA for ; Thu, 25 Feb 2021 06:13:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B2B164EBA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fossix.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D4896100F2253; Wed, 24 Feb 2021 22:13:24 -0800 (PST) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::433; helo=mail-pf1-x433.google.com; envelope-from=santosh@fossix.org; receiver= Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 73C5D100F2251 for ; Wed, 24 Feb 2021 22:13:22 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id t29so2905594pfg.11 for ; Wed, 24 Feb 2021 22:13:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cxLCdkplDyvMu3gLpnfnAF7R65b6IFXac/smsmfloRo=; b=m23CY318Fy5Nz0GsvfauZ3kt8cZk8q2JSMr5cEHLFJhfxHjhj2w5HGRRt6oUWn2Hfj zRVAkahdJeT03K0gI8dwKJ04SaIwztpOC6ZnpIv5LA1qWC0oHXh0ucD38RxuvY+l5WHR vDIN4+v7cO/vX1tJzf+enx0DzkwbRLKD9MYkMnuY8xpxCKQ2l/9YZC1JAgOeUfMF8tIX D2wBexpqV6nbhZ7fkxhll8ejcR/vbNmY46eLugKbG2fof4Ih+y79PqJwy780wghl1VsL LBC/GMG7vI8mNtwqM5AJXlv8v4oDdk8CmWX9Yp97SaM4DFwWmDShZVowj7qICQmdplCK 5v8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cxLCdkplDyvMu3gLpnfnAF7R65b6IFXac/smsmfloRo=; b=tOHUceg4Gqi8d04gYLpKgpoWPeh1pfuUnDzm/d6FGueXwyFGjsP9eyBtYckhc9o/Ra T+SIiQj+0GTXgliuuiKWyIjSDMShPZs/Lr+JrADNNNK5YvZ15U6yDosxbjYAn6CcdEiS e1fy/BUoCjJA2W6wCOx3mjqs2jnmtdX1L/x/QOEiscmJlkGww2OtT/HUamEPjgotsnlz zk4FIio7dL0rsdeYGN9wG0+DXqPmG2yHeXk+FZ1hkDqIQGGWaiDfjpurElGHJrtGNJr5 IssaALAG5MWNAdcEaANlzhjVF8sNiBho9/HZ9z3LejbU86QbZVn1FcRujfsTx4ZIkVQ4 ZiEg== X-Gm-Message-State: AOAM531DGqBwW/GbPswbvx4mbJOvA4IpkpfyGjR9Pt97YDwbm5JcCIQp +gqWVj4TK0IuspGKyouX07ZIP1raNfM66Q== X-Google-Smtp-Source: ABdhPJxgaCMKIebt3Toe/F2HAjYDUJqlbv7VK2OwsNt6w+5XR8G1NFqTxIWdhp8sfjWpGZjlVl89NA== X-Received: by 2002:a63:5c1e:: with SMTP id q30mr1528671pgb.259.1614233601734; Wed, 24 Feb 2021 22:13:21 -0800 (PST) Received: from santosiv.in.ibm.com.com ([103.21.79.4]) by smtp.gmail.com with ESMTPSA id d24sm4327803pfr.139.2021.02.24.22.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 22:13:21 -0800 (PST) From: Santosh Sivaraj To: Linux NVDIMM , Vishal Verma , Vaibhav Jain , Shivaprasad G Bhat , Harish Sriram , Dan Williams Cc: Santosh Sivaraj Subject: [PATCH v2 4/4] Use page size as alignment value Date: Thu, 25 Feb 2021 11:43:03 +0530 Message-Id: <20210225061303.654267-4-santosh@fossix.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210225061303.654267-1-santosh@fossix.org> References: <20210225061303.654267-1-santosh@fossix.org> MIME-Version: 1.0 Message-ID-Hash: 2CMXGUZGZVLFWRXKCS6U6U77IGVRRSGK X-Message-ID-Hash: 2CMXGUZGZVLFWRXKCS6U6U77IGVRRSGK X-MailFrom: santosh@fossix.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: The alignment sizes passed to ndctl in the tests are all hardcoded to 4k, the default page size on x86. Change those to the default page size on that architecture (sysconf/getconf). No functional changes otherwise. Signed-off-by: Santosh Sivaraj --- test/dpa-alloc.c | 15 ++++++++------- test/multi-dax.sh | 6 ++++-- test/sector-mode.sh | 4 +++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c index 10af189..ef3a1a9 100644 --- a/test/dpa-alloc.c +++ b/test/dpa-alloc.c @@ -48,12 +48,13 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test) struct ndctl_region *region, *blk_region = NULL; struct ndctl_namespace *ndns; struct ndctl_dimm *dimm; - unsigned long size; + unsigned long size, page_size; struct ndctl_bus *bus; char uuid_str[40]; int round; int rc; + page_size = sysconf(_SC_PAGESIZE); /* disable nfit_test.1, not used in this test */ bus = ndctl_bus_get_by_provider(ctx, NFIT_PROVIDER1); if (!bus) @@ -134,11 +135,11 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test) return rc; } ndctl_namespace_disable_invalidate(ndns); - rc = ndctl_namespace_set_size(ndns, SZ_4K); + rc = ndctl_namespace_set_size(ndns, page_size); if (rc) { - fprintf(stderr, "failed to init %s to size: %d\n", + fprintf(stderr, "failed to init %s to size: %lu\n", ndctl_namespace_get_devname(ndns), - SZ_4K); + page_size); return rc; } namespaces[i].ndns = ndns; @@ -160,7 +161,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test) ndns = namespaces[i % ARRAY_SIZE(namespaces)].ndns; if (i % ARRAY_SIZE(namespaces) == 0) round++; - size = SZ_4K * round; + size = page_size * round; rc = ndctl_namespace_set_size(ndns, size); if (rc) { fprintf(stderr, "%s: set_size: %lx failed: %d\n", @@ -176,7 +177,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test) i--; round++; ndns = namespaces[i % ARRAY_SIZE(namespaces)].ndns; - size = SZ_4K * round; + size = page_size * round; rc = ndctl_namespace_set_size(ndns, size); if (rc) { fprintf(stderr, "%s failed to update while labels full\n", @@ -185,7 +186,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test) } round--; - size = SZ_4K * round; + size = page_size * round; rc = ndctl_namespace_set_size(ndns, size); if (rc) { fprintf(stderr, "%s failed to reduce size while labels full\n", diff --git a/test/multi-dax.sh b/test/multi-dax.sh index 110ba3d..8250128 100755 --- a/test/multi-dax.sh +++ b/test/multi-dax.sh @@ -21,6 +21,8 @@ check_min_kver "4.13" || do_skip "may lack multi-dax support" trap 'err $LINENO' ERR +ALIGN_SIZE=`getconf PAGESIZE` + # setup (reset nfit_test dimms) modprobe nfit_test $NDCTL disable-region -b $NFIT_TEST_BUS0 all @@ -31,9 +33,9 @@ rc=1 query=". | sort_by(.available_size) | reverse | .[0].dev" region=$($NDCTL list -b $NFIT_TEST_BUS0 -t pmem -Ri | jq -r "$query") -json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a 4096 -s 16M) +json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a $ALIGN_SIZE -s 16M) chardev1=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev") -json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a 4096 -s 16M) +json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a $ALIGN_SIZE -s 16M) chardev2=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev") _cleanup diff --git a/test/sector-mode.sh b/test/sector-mode.sh index eef8dc6..cee0313 100755 --- a/test/sector-mode.sh +++ b/test/sector-mode.sh @@ -18,6 +18,8 @@ rc=77 set -e trap 'err $LINENO' ERR +ALIGN_SIZE=`getconf PAGESIZE` + # setup (reset nfit_test dimms) modprobe nfit_test $NDCTL disable-region -b $NFIT_TEST_BUS0 all @@ -34,7 +36,7 @@ NAMESPACE=$($NDCTL list -b $NFIT_TEST_BUS1 -N | jq -r "$query") REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r "(.[]) | .dev") echo 0 > /sys/bus/nd/devices/$REGION/read_only $NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K -$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m dax -f -a 4K +$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m dax -f -a $ALIGN_SIZE $NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K _cleanup