Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1201016rwd; Wed, 7 Jun 2023 12:34:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E0hFIyj5XGcHTV+O2F8+e0jnDhqD2GQEua8hAwX5uI3yVxrBIy1wuDB1PWQV6BNz4Bxqa X-Received: by 2002:a17:902:c952:b0:1b0:3d03:4179 with SMTP id i18-20020a170902c95200b001b03d034179mr38813pla.6.1686166446316; Wed, 07 Jun 2023 12:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686166446; cv=none; d=google.com; s=arc-20160816; b=NIdQF2wqwhIWpSG7Rj3SPHfUa1oM3JyBMp3xpnrLICXacrHDozCNZNd3PYJFfWCA6D KR2kRyvlKI2OslR9jm6Ai9qNn5h8FiDSS2CQ2qXw8E0ufD2+A6x5IRMttjka6I3uEoKK L1i1wZHpmQ+IOwgMpxJvDcd8CprKzbQwkh802qd0EY8Eaq4KNBDOrjYiixvWq5f1ija2 e6nU5YYHlPdZThrTuDpt5VRqNqP6HRRQYyPRB/Huo1a2fCXXhCIncGZrjsM9WePqmYL7 t5DgL3v4kllMl0THdFqelNzMOgrFKyk4mZ/iwQoH3/vJYcHPjTbM7eDaFnBPBroLz44v 9BVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4vs9tF6XMbe3K7Bn4wkC2Mcg2LxFJdTTVM/OjIPr/1M=; b=j97WuJlQk3+MBRxrjwY7nrF87GrQTAvpos1YGP5pIf5dfWYDLol5u2LHipbQry6BuF sD0Ur+xWAsAHICZ19jlFDsfj/87l9acpXslfaeANZ42HHTaKN0nJkWBvUkwIUkLpAEvq I65sElP4xxrNp/Hjdw0urYuiWKya72VCzOjiT9p32jmOINjtgmCXMoG7vDWiAVlVBiiC nIbmmby2mL2OA0+isUsGuHEYYSOb9kAhYRSVijrHTgzOr2LNRmwqUh3Rgh3Xv5mhGSqj 40MEZlGVq9hg02ErqJdhEYAIe7PZWFTHQFHJDuZTZ5Uv0jU0RaXaUxEOa34CXhxWRvuc zyFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fQPb8aF8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li12-20020a170903294c00b001b25e9a76d7si704274plb.316.2023.06.07.12.33.48; Wed, 07 Jun 2023 12:34:06 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=fQPb8aF8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233090AbjFGTT7 (ORCPT + 99 others); Wed, 7 Jun 2023 15:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbjFGTT6 (ORCPT ); Wed, 7 Jun 2023 15:19:58 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C353A1BD4; Wed, 7 Jun 2023 12:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686165596; x=1717701596; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XMEomkbMgXMC6d/m4cFrF1CnpOyHNvyL7lkPILSp6Lw=; b=fQPb8aF8qdtMVLXvYyBUJ3xIgQZqGuA4GkA0R8keiu1X0jfQ6lEMKhp9 LlcXmiIIiGjUXRHz/bqxCXaxHTvh1iWBfaXy96bKfAW+BE/O2y9natdtw c89JoHVJdOQz1c/SvxQItx2ne1kEYbm9v8ur6CyBPAfMW7R+LdVzBnbsI Brt2WUk9cxh43rDzaqgdLSKvQHmc2Fd15L/mX2qigETjlNbUAsa7swGh1 vzARdqT90BKYR1hS6digg1NcsyAwoz+EKXiEoGDGrUWdxICfsiYK8qGDg UDgnc8ieCG9KMRggenGemfsxjO51Ur7GVsYo8oLUzpyU+8uIRtkwEasYs Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="360415927" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="360415927" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 12:19:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="956411568" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="956411568" Received: from aschofie-mobl2.amr.corp.intel.com (HELO aschofie-mobl2) ([10.209.21.116]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 12:19:55 -0700 Date: Wed, 7 Jun 2023 12:19:54 -0700 From: Alison Schofield To: Vishal Verma Cc: Ira Weiny , Dave Jiang , Ben Widawsky , Dan Williams , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso , Jonathan Cameron , Russ Weight Subject: Re: [PATCH v2 3/4] tools/testing/cxl: Use named effects for the Command Effect Log Message-ID: References: <20230602-vv-fw_update-v2-0-e9e5cd5adb44@intel.com> <20230602-vv-fw_update-v2-3-e9e5cd5adb44@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230602-vv-fw_update-v2-3-e9e5cd5adb44@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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, Jun 05, 2023 at 02:20:24PM -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. Reviewed-by: Alison Schofield > > 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 > --- > 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)), > }, > }; > > > -- > 2.40.1 >