Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp698159rwd; Thu, 8 Jun 2023 06:40:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zXiIlfx4pNq2g3XVf0wBT/Unf6sf7b4QQzNMFjWklf8thpBVZw+t+JPMTXCHjKaK1Ve1Y X-Received: by 2002:a05:6a21:33a0:b0:114:f824:655 with SMTP id yy32-20020a056a2133a000b00114f8240655mr7376347pzb.58.1686231624304; Thu, 08 Jun 2023 06:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686231624; cv=none; d=google.com; s=arc-20160816; b=XeAqDLbY4TscggPn9aKo4FAGvQNj9jCTEhuLlghU2EKTyJVHebLCSQ4gS/IjlWJapY 2BSzfpw0TlvP5HAK205ebvRXuMx6KUqhyJv3aIJa2w5dBhdd1FOw9eMTce6z9Z4IluKp qGaOwRktfw+K7BaH3s3HGVoCKLaCVKkNtx8HtqKubAj2R7JJpCQyNxh0G86HfQaHlzOL 1syrqUNdCg4QYvmTPx0YgWcKVqH+5Nl1730ytr9QAgOlDnORcx8cKilWZJmOnlHGkS5D qAso63/fCF2LP4Ny+eum1fQO6vI2FLnexqzNE+Zbbf5htoXxmLsR3wm1O0UjYaxCkePs IsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=+rt5UHbc2lB2OAutuohQEfzcEB4X67SVFEUfv59pa9s=; b=H3lEgB2kVeSHifN7HSsKvfaovamPWb2xKlIuBGzuElVlvvJYy8eM4HaLpAu/MrJDdT dxvL59b9BDmJR/km9XCPTfboIT8cV4i3nODp+6LgfEr7LKxR99cbrFRvWWDasQJ2uFlL PyfK/XLikt7FQwcFOz33CZNhUU6tQlGj6awgsGisAKtHVM+PdqVdIis2Vk3IUVEceW4S hseLpPJNl3SYKWKf362kkTF8kl8g0k0Jpa8D9AkCcejRfTT47g93vj7ut1B610umaDfp xfhEDQ95wHnZchrxu5zLp2M4NTOulTMf++rWqudHtnxpmvbRTD/8UOJrr6TAQrQW4G38 GyUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a63b94c000000b0053094305b59si983099pgo.875.2023.06.08.06.40.12; Thu, 08 Jun 2023 06:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236638AbjFHNb7 (ORCPT + 99 others); Thu, 8 Jun 2023 09:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234860AbjFHNb6 (ORCPT ); Thu, 8 Jun 2023 09:31:58 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E33CEE4A; Thu, 8 Jun 2023 06:31:56 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QcQ6k3MH4z688p7; Thu, 8 Jun 2023 21:29:34 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 8 Jun 2023 14:31:54 +0100 Date: Thu, 8 Jun 2023 14:31:53 +0100 From: Jonathan Cameron To: Vishal Verma CC: Alison Schofield , Ira Weiny , Dave Jiang , Ben Widawsky , Dan Williams , , , Davidlohr Bueso , Russ Weight Subject: Re: [PATCH v2 3/4] tools/testing/cxl: Use named effects for the Command Effect Log Message-ID: <20230608143153.00007ae1@Huawei.com> In-Reply-To: <20230602-vv-fw_update-v2-3-e9e5cd5adb44@intel.com> References: <20230602-vv-fw_update-v2-0-e9e5cd5adb44@intel.com> <20230602-vv-fw_update-v2-3-e9e5cd5adb44@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 05 Jun 2023 14:20:24 -0600 Vishal Verma wrote: > As more emulated mailbox commands are added to cxl_test, it is a pain > point to look up command effect numbers for each effect. Replace the > bare numbers in the mock driver with an enum that lists all possible > effects. > > Suggested-by: Jonathan Cameron > Cc: Davidlohr Bueso > Cc: Jonathan Cameron > Cc: Russ Weight > Cc: Alison Schofield > Cc: Ira Weiny > Cc: Dave Jiang > Cc: Ben Widawsky > Cc: Dan Williams > Signed-off-by: Vishal Verma LGTM Reviewed-by: Jonathan Cameron > --- > tools/testing/cxl/test/mem.c | 32 +++++++++++++++++++++++--------- > 1 file changed, 23 insertions(+), 9 deletions(-) > > diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c > index 403cd3608772..68668d8df1cd 100644 > --- a/tools/testing/cxl/test/mem.c > +++ b/tools/testing/cxl/test/mem.c > @@ -21,42 +21,56 @@ > > static unsigned int poison_inject_dev_max = MOCK_INJECT_DEV_MAX; > > +enum cxl_command_effects { > + CONF_CHANGE_COLD_RESET = 0, > + CONF_CHANGE_IMMEDIATE, > + DATA_CHANGE_IMMEDIATE, > + POLICY_CHANGE_IMMEDIATE, > + LOG_CHANGE_IMMEDIATE, > + SECURITY_CHANGE_IMMEDIATE, > + BACKGROUND_OP, > + SECONDARY_MBOX_SUPPORTED, > +}; > + > +#define CXL_CMD_EFFECT_NONE cpu_to_le16(0) > + > static struct cxl_cel_entry mock_cel[] = { > { > .opcode = cpu_to_le16(CXL_MBOX_OP_GET_SUPPORTED_LOGS), > - .effect = cpu_to_le16(0), > + .effect = CXL_CMD_EFFECT_NONE, > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_IDENTIFY), > - .effect = cpu_to_le16(0), > + .effect = CXL_CMD_EFFECT_NONE, > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_GET_LSA), > - .effect = cpu_to_le16(0), > + .effect = CXL_CMD_EFFECT_NONE, > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_GET_PARTITION_INFO), > - .effect = cpu_to_le16(0), > + .effect = CXL_CMD_EFFECT_NONE, > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_SET_LSA), > - .effect = cpu_to_le16(EFFECT(1) | EFFECT(2)), > + .effect = cpu_to_le16(EFFECT(CONF_CHANGE_IMMEDIATE) | > + EFFECT(DATA_CHANGE_IMMEDIATE)), > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_GET_HEALTH_INFO), > - .effect = cpu_to_le16(0), > + .effect = CXL_CMD_EFFECT_NONE, > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_GET_POISON), > - .effect = cpu_to_le16(0), > + .effect = CXL_CMD_EFFECT_NONE, > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_INJECT_POISON), > - .effect = cpu_to_le16(EFFECT(2)), > + .effect = cpu_to_le16(EFFECT(DATA_CHANGE_IMMEDIATE)), > }, > { > .opcode = cpu_to_le16(CXL_MBOX_OP_CLEAR_POISON), > - .effect = cpu_to_le16(EFFECT(2)), > + .effect = cpu_to_le16(EFFECT(DATA_CHANGE_IMMEDIATE)), > }, > }; > >