From patchwork Thu Nov 23 02:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 13465699 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from esa1.hc1455-7.c3s2.iphmx.com (esa1.hc1455-7.c3s2.iphmx.com [207.54.90.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EDBF1B2 for ; Wed, 22 Nov 2023 18:31:21 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="140472642" X-IronPort-AV: E=Sophos;i="6.04,220,1695654000"; d="scan'208";a="140472642" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa1.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 11:31:20 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id E7350D2A01 for ; Thu, 23 Nov 2023 11:31:17 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id DE9DEBF4DF for ; Thu, 23 Nov 2023 11:31:16 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id 7FB0720079111 for ; Thu, 23 Nov 2023 11:31:16 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id F0AEB1A0070; Thu, 23 Nov 2023 10:31:15 +0800 (CST) From: Li Zhijian To: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org, Li Zhijian Subject: [ndctl PATCH 1/3] test/cxl-region-sysfs.sh: covert size and resource to hex before test Date: Thu, 23 Nov 2023 10:30:56 +0800 Message-ID: <20231123023058.2963551-1-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28014.004 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28014.004 X-TMASE-Result: 10--2.693700-10.000000 X-TMASE-MatchedRID: 6dKu2vg/m/jQVDF+NEc7OKqHmm/V4M/PwTlc9CcHMZerwqxtE531VICu qghmtWfXc/72aFsOO+2vgQVzBNg7CEkjllSXrjtQFEUknJ/kEl5lVdRvgpNpe/oLR4+zsDTt+gm Vy5VdZkkoFZWCCVaZXTTuNTcutxmE5oGtlhFa2n9GqDYEsb/9xYcKB/WDLZ7j94QVgFklbyC+NW PBbd+wipp1uSErN3/v1yS0S/9EZEGGk+xUaqdMDwHEKwHwYevbwUSxXh+jiUgkww/gwY7hMA== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 size and resource are both decimal Signed-off-by: Li Zhijian --- test/cxl-region-sysfs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh index 8636392..ded7aa1 100644 --- a/test/cxl-region-sysfs.sh +++ b/test/cxl-region-sysfs.sh @@ -123,6 +123,11 @@ readarray -t switch_decoders < <(echo $json | jq -r ".[].decoder") [ ${#switch_decoders[@]} -ne $nr_switch_decoders ] && err \ "$LINENO: expected $nr_switch_decoders got ${#switch_decoders[@]} switch decoders" +decimal_to_hex() +{ + printf "0x%x" $1 +} + for i in ${switch_decoders[@]} do decoder=$(echo $json | jq -r ".[] | select(.decoder == \"$i\")") @@ -136,8 +141,8 @@ do [ $ig -ne $((r_ig << depth)) ] && err \ "$LINENO: decoder: $i ig: $ig switch_ig: $((r_ig << depth))" - res=$(echo $decoder | jq -r ".resource") - sz=$(echo $decoder | jq -r ".size") + res=$(decimal_to_hex $(echo $decoder | jq -r ".resource")) + sz=$(decimal_to_hex $(echo $decoder | jq -r ".size")) [ $sz -ne $region_size ] && err \ "$LINENO: decoder: $i sz: $sz region_size: $region_size" [ $res -ne $region_base ] && err \ From patchwork Thu Nov 23 02:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 13465700 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from esa3.hc1455-7.c3s2.iphmx.com (esa3.hc1455-7.c3s2.iphmx.com [207.54.90.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281A41B3 for ; Wed, 22 Nov 2023 18:31:22 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="140654054" X-IronPort-AV: E=Sophos;i="6.04,220,1695654000"; d="scan'208";a="140654054" Received: from unknown (HELO yto-r2.gw.nic.fujitsu.com) ([218.44.52.218]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 11:31:21 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id CC07FD6189 for ; Thu, 23 Nov 2023 11:31:17 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 0B89CF915 for ; Thu, 23 Nov 2023 11:31:17 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id A6D51200649DF for ; Thu, 23 Nov 2023 11:31:16 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 4F48E1A0071; Thu, 23 Nov 2023 10:31:16 +0800 (CST) From: Li Zhijian To: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org, Li Zhijian Subject: [ndctl PATCH 2/3] test/cxl-region-sysfs.sh: use operator '!=' to compare hexadecimal value Date: Thu, 23 Nov 2023 10:30:57 +0800 Message-ID: <20231123023058.2963551-2-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123023058.2963551-1-lizhijian@fujitsu.com> References: <20231123023058.2963551-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28014.004 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28014.004 X-TMASE-Result: 10--8.353400-10.000000 X-TMASE-MatchedRID: /2NGPvLZz+PDmO1DJUuxWVRF81tbZq+Ql9q75JzWJRNM+b8yxBqvA78F Hrw7frluf146W0iUu2uHLV03CrWr2cVM5J3Ud/0Uzr16YOzjZ10CtGYG0znilEty8cifGH0Uqzl QyGeIJ2Xi8zVgXoAltuJ5hXsnxp7jC24oEZ6SpSkj80Za3RRg8IU0y08TmYjc55tJ6KD5Hlpawv BGQOevA0Lbc95R1vNyGSCvLi0tcps= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 Fix errors: line 111: [: 0x80000000: integer expression expected line 112: [: 0x3ff110000000: integer expression expected line 141: [: 0x80000000: integer expression expected line 143: [: 0x3ff110000000: integer expression expected Signed-off-by: Li Zhijian --- test/cxl-region-sysfs.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh index ded7aa1..89f21a3 100644 --- a/test/cxl-region-sysfs.sh +++ b/test/cxl-region-sysfs.sh @@ -108,8 +108,8 @@ do sz=$(cat /sys/bus/cxl/devices/$i/size) res=$(cat /sys/bus/cxl/devices/$i/start) - [ $sz -ne $region_size ] && err "$LINENO: decoder: $i sz: $sz region_size: $region_size" - [ $res -ne $region_base ] && err "$LINENO: decoder: $i base: $res region_base: $region_base" + [ "$sz" != "$region_size" ] && err "$LINENO: decoder: $i sz: $sz region_size: $region_size" + [ "$res" != "$region_base" ] && err "$LINENO: decoder: $i base: $res region_base: $region_base" done # validate all switch decoders have the correct settings @@ -143,9 +143,9 @@ do res=$(decimal_to_hex $(echo $decoder | jq -r ".resource")) sz=$(decimal_to_hex $(echo $decoder | jq -r ".size")) - [ $sz -ne $region_size ] && err \ + [ "$sz" != "$region_size" ] && err \ "$LINENO: decoder: $i sz: $sz region_size: $region_size" - [ $res -ne $region_base ] && err \ + [ "$res" != "$region_base" ] && err \ "$LINENO: decoder: $i base: $res region_base: $region_base" done From patchwork Thu Nov 23 02:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 13465704 Authentication-Results: smtp.subspace.kernel.org; dkim=none X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 22 Nov 2023 18:32:25 PST Received: from esa5.hc1455-7.c3s2.iphmx.com (esa5.hc1455-7.c3s2.iphmx.com [68.232.139.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B98CABC for ; Wed, 22 Nov 2023 18:32:25 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="140098755" X-IronPort-AV: E=Sophos;i="6.04,220,1695654000"; d="scan'208";a="140098755" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa5.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2023 11:31:21 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 070B8D6477 for ; Thu, 23 Nov 2023 11:31:18 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 43DED14043 for ; Thu, 23 Nov 2023 11:31:17 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id DE5FB200649DF for ; Thu, 23 Nov 2023 11:31:16 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 818C81A0073; Thu, 23 Nov 2023 10:31:16 +0800 (CST) From: Li Zhijian To: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org, Li Zhijian Subject: [ndctl PATCH 3/3] test/cxl-region-sysfs.sh: Fix cxl-region-sysfs.sh: line 107: [: missing `]' Date: Thu, 23 Nov 2023 10:30:58 +0800 Message-ID: <20231123023058.2963551-3-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123023058.2963551-1-lizhijian@fujitsu.com> References: <20231123023058.2963551-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28014.004 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28014.004 X-TMASE-Result: 10--6.831200-10.000000 X-TMASE-MatchedRID: I1wtkSt6/wI5rof3b4z0VE7nLUqYrlslFIuBIWrdOePfUZT83lbkEKem Jq66qqv9/MknKdGiL9PaDF6lH4tpMDcpdZ3fQiLdFEUknJ/kEl5jFT88f69nG/oLR4+zsDTtjoc zmuoPCq1JvtyeL2z47tQ4zW8zUpL09NWfq1XGzZF9miTv83Zrt+CntM51Lyyy X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 Signed-off-by: Li Zhijian Acked-by: Dan Williams --- test/cxl-region-sysfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh index 89f21a3..3878351 100644 --- a/test/cxl-region-sysfs.sh +++ b/test/cxl-region-sysfs.sh @@ -104,7 +104,7 @@ do iw=$(cat /sys/bus/cxl/devices/$i/interleave_ways) ig=$(cat /sys/bus/cxl/devices/$i/interleave_granularity) [ $iw -ne $nr_targets ] && err "$LINENO: decoder: $i iw: $iw targets: $nr_targets" - [ $ig -ne $r_ig] && err "$LINENO: decoder: $i ig: $ig root ig: $r_ig" + [ $ig -ne $r_ig ] && err "$LINENO: decoder: $i ig: $ig root ig: $r_ig" sz=$(cat /sys/bus/cxl/devices/$i/size) res=$(cat /sys/bus/cxl/devices/$i/start)