From: Reinette Chatre <reinette.chatre@intel.com>
To: Yifan Wu <wuyifan50@huawei.com>, <tony.luck@intel.com>,
<Dave.Martin@arm.com>, <james.morse@arm.com>,
<babu.moger@amd.com>, <shuah@kernel.org>,
<tan.shaopeng@fujitsu.com>, <fenghuay@nvidia.com>,
<ben.horgan@arm.com>, <jonathan.cameron@huawei.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kselftest@vger.kernel.org>, <linuxarm@huawei.com>
Cc: <xiaqinxin@huawei.com>, <prime.zeng@hisilicon.com>,
<wangyushan12@huawei.com>, <xuwei5@huawei.com>,
<fanghao11@huawei.com>, <wangzhou1@hisilicon.com>
Subject: Re: [RFC patch 5/9] selftests/resctrl: Refactor CPU vendor detection to use lookup table
Date: Thu, 12 Mar 2026 13:59:19 -0700 [thread overview]
Message-ID: <e72e0719-615a-470c-821e-dc02c81ef77f@intel.com> (raw)
In-Reply-To: <20260304040334.765860-6-wuyifan50@huawei.com>
Hi Yifan,
On 3/3/26 8:03 PM, Yifan Wu wrote:
...
> ---
> .../testing/selftests/resctrl/resctrl_tests.c | 82 ++++++++++++++-----
> 1 file changed, 60 insertions(+), 22 deletions(-)
>
> diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
> index dbcd5eea9fbc..419d876a97c2 100644
> --- a/tools/testing/selftests/resctrl/resctrl_tests.c
> +++ b/tools/testing/selftests/resctrl/resctrl_tests.c
> @@ -23,39 +23,77 @@ static struct resctrl_test *resctrl_tests[] = {
> &l2_noncont_cat_test,
> };
>
> +#define VENDOR_ENTRY struct {\
> + unsigned int vendor_id; \
> + void *arg; \
> + }
> +
> +#define SEQ_ENTRY struct {\
> + char *format; \
> + VENDOR_ENTRY *vendor; \
> + }
> +
> +#define DETECTION_ENTRY struct {\
> + char *pathname; \
> + SEQ_ENTRY *seq; \
> + }
> +
> +static DETECTION_ENTRY vendor_detection[] = {
> + {
> + .pathname = "/proc/cpuinfo",
> + .seq = (SEQ_ENTRY[]) {
> + {
> + .format = "vendor_id\t: %s\n",
> + .vendor = (VENDOR_ENTRY[]) {
> + { .vendor_id = ARCH_INTEL, .arg = "GenuineIntel" },
> + { .vendor_id = ARCH_AMD, .arg = "AuthenticAMD" },
> + { .vendor_id = ARCH_HYGON, .arg = "HygonGenuine" },
> + { .vendor_id = 0, .arg = NULL }
> + }
> + }
> + }
> + },
> + { .pathname = NULL, .seq = NULL}
> +};
This is very complex why not just https://lore.kernel.org/lkml/20260123044034.141247-2-tan.shaopeng@fujitsu.com/ ?
Reinette
next prev parent reply other threads:[~2026-03-12 20:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 4:03 [RFC patch 0/9] Add support for HiSilicon platforms and refactor Yifan Wu
2026-03-04 4:03 ` [RFC patch 1/9] selftests/resctrl: Move CPU affinity and resctrl FS setup to child process Yifan Wu
2026-03-12 20:53 ` Reinette Chatre
2026-03-23 9:18 ` wuyifan
2026-03-23 15:51 ` Reinette Chatre
2026-03-04 4:03 ` [RFC patch 2/9] selftests/resctrl: Refactor resctrl_val.c for vendor-specific mem bw measurement Yifan Wu
2026-03-04 4:03 ` [RFC patch 3/9] selftests/resctrl: Use dynamic linked list for iMC counters config Yifan Wu
2026-03-12 20:57 ` Reinette Chatre
2026-03-04 4:03 ` [RFC patch 4/9] selftests/resctrl: Move memory bandwidth measurement init and cleanup to resctrl_val.c Yifan Wu
2026-03-04 4:03 ` [RFC patch 5/9] selftests/resctrl: Refactor CPU vendor detection to use lookup table Yifan Wu
2026-03-12 20:59 ` Reinette Chatre [this message]
2026-03-23 9:18 ` wuyifan
2026-03-04 4:03 ` [RFC patch 6/9] selftests/resctrl: Add support for HiSilicon CPU detection Yifan Wu
2026-03-04 4:03 ` [RFC patch 7/9] selftests/resctrl: Add support for HiSilicon memory bandwidth measurement Yifan Wu
2026-03-04 4:03 ` [RFC patch 8/9] selftests/resctrl: Add support for HiSilicon MBM/MBA test Yifan Wu
2026-03-12 21:01 ` Reinette Chatre
2026-03-23 9:19 ` wuyifan
2026-03-23 15:52 ` Reinette Chatre
2026-03-24 1:52 ` wuyifan
2026-03-04 4:03 ` [RFC patch 9/9] selftests/resctrl: Add support for HiSilicon CAT/CMT test Yifan Wu
2026-03-06 10:45 ` [RFC patch 0/9] Add support for HiSilicon platforms and refactor Jonathan Cameron
2026-03-09 3:09 ` wuyifan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e72e0719-615a-470c-821e-dc02c81ef77f@intel.com \
--to=reinette.chatre@intel.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=ben.horgan@arm.com \
--cc=fanghao11@huawei.com \
--cc=fenghuay@nvidia.com \
--cc=james.morse@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=prime.zeng@hisilicon.com \
--cc=shuah@kernel.org \
--cc=tan.shaopeng@fujitsu.com \
--cc=tony.luck@intel.com \
--cc=wangyushan12@huawei.com \
--cc=wangzhou1@hisilicon.com \
--cc=wuyifan50@huawei.com \
--cc=xiaqinxin@huawei.com \
--cc=xuwei5@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox