All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Tao Xu <tao3.xu@intel.com>
Cc: lvivier@redhat.com, thuth@redhat.com, ehabkost@redhat.com,
	mst@redhat.com, qemu-devel@nongnu.org, jingqi.liu@intel.com,
	fan.du@intel.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com,
	jonathan.cameron@huawei.com
Subject: Re: [PATCH v16 13/14] tests/numa: Add case for QMP build HMAT
Date: Wed, 20 Nov 2019 13:32:14 +0100	[thread overview]
Message-ID: <20191120133214.6fb83c92@redhat.com> (raw)
In-Reply-To: <20191115075352.17734-14-tao3.xu@intel.com>

On Fri, 15 Nov 2019 15:53:51 +0800
Tao Xu <tao3.xu@intel.com> wrote:

> Check configuring HMAT usecase
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Tao Xu <tao3.xu@intel.com>
> ---
> 
> New patch in v16.
> ---
>  tests/numa-test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)

I'd also add X-FAIL variants here, to test fail conditions.
Taking in account that QMP interface returns error without
affecting QEMU state, you can do it within one test case without
restarting it on every fail scenario.
(just add appropriate comments so reader would know that you are
testing this and that failure path)

So I'd first test x-fail variants and then finish test with
valid configuration.

> 
> diff --git a/tests/numa-test.c b/tests/numa-test.c
> index 8de8581231..15889c26c0 100644
> --- a/tests/numa-test.c
> +++ b/tests/numa-test.c
> @@ -327,6 +327,56 @@ static void pc_dynamic_cpu_cfg(const void *data)
>      qtest_quit(qs);
>  }
>  
> +static void pc_build_hmat_cfg(const void *data)
> +{
> +    QTestState *qs;
> +
> +    qs = qtest_initf("%s -nodefaults --preconfig -machine hmat=on "
> +                     "-smp 2,sockets=2 "
> +                     "-m 128M,slots=2,maxmem=1G "
> +                     "-object memory-backend-ram,size=64M,id=m0 "
> +                     "-object memory-backend-ram,size=64M,id=m1 "
> +                     "-numa node,nodeid=0,memdev=m0 "
> +                     "-numa node,nodeid=1,memdev=m1,initiator=0 "
> +                     "-numa cpu,node-id=0,socket-id=0 "
> +                     "-numa cpu,node-id=0,socket-id=1",
> +                     data ? (char *)data : "");
> +
> +    /* Configuring HMAT bandwidth and latency details */
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
> +        " 'arguments': { 'type': 'hmat-lb', 'initiator': 0, 'target': 0,"
> +        " 'hierarchy': \"memory\", 'data-type': \"access-latency\","
> +        " 'latency': 5 } }")));
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
> +        " 'arguments': { 'type': 'hmat-lb', 'initiator': 0, 'target': 0,"
> +        " 'hierarchy': \"memory\", 'data-type': \"access-bandwidth\","
> +        " 'bandwidth': 524288000 } }")));
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
> +        " 'arguments': { 'type': 'hmat-lb', 'initiator': 0, 'target': 1,"
> +        " 'hierarchy': \"memory\", 'data-type': \"access-latency\","
> +        " 'latency': 10 } }")));
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
> +        " 'arguments': { 'type': 'hmat-lb', 'initiator': 0, 'target': 1,"
> +        " 'hierarchy': \"memory\", 'data-type': \"access-bandwidth\","
> +        " 'bandwidth': 104857600 } }")));
> +
> +    /* Configuring HMAT memory side cache attributes */
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
> +        " 'arguments': { 'type': 'hmat-cache', 'node-id': 0, 'size': 10240,"
> +        " 'level': 1, 'assoc': \"direct\", 'policy': \"write-back\","
> +        " 'line': 8 } }")));
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'set-numa-node',"
> +        " 'arguments': { 'type': 'hmat-cache', 'node-id': 1, 'size': 10240,"
> +        " 'level': 1, 'assoc': \"direct\", 'policy': \"write-back\","
> +        " 'line': 8 } }")));
> +
> +    /* let machine initialization to complete and run */
> +    g_assert(!qmp_rsp_is_err(qtest_qmp(qs, "{ 'execute': 'x-exit-preconfig' }")));
> +    qtest_qmp_eventwait(qs, "RESUME");
> +
> +    qtest_quit(qs);
> +}
> +
>  int main(int argc, char **argv)
>  {
>      const char *args = NULL;
> @@ -346,6 +396,7 @@ int main(int argc, char **argv)
>      if (!strcmp(arch, "i386") || !strcmp(arch, "x86_64")) {
>          qtest_add_data_func("/numa/pc/cpu/explicit", args, pc_numa_cpu);
>          qtest_add_data_func("/numa/pc/dynamic/cpu", args, pc_dynamic_cpu_cfg);
> +        qtest_add_data_func("/numa/pc/build/hmat", args, pc_build_hmat_cfg);
>      }
>  
>      if (!strcmp(arch, "ppc64")) {



  reply	other threads:[~2019-11-20 12:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15  7:53 [PATCH v16 00/14] Build ACPI Heterogeneous Memory Attribute Table (HMAT) Tao Xu
2019-11-15  7:53 ` [PATCH v16 01/14] util/cutils: Add Add qemu_strtold and qemu_strtold_finite Tao Xu
2019-11-15  7:53 ` [PATCH v16 02/14] util/cutils: Use qemu_strtold_finite to parse size Tao Xu
2019-11-15  7:53 ` [PATCH v16 03/14] util/cutils: refactor do_strtosz() to support suffixes list Tao Xu
2019-11-15 12:11   ` Philippe Mathieu-Daudé
2019-11-18  7:35     ` Tao Xu
2019-11-15  7:53 ` [PATCH v16 04/14] util/cutils: Add qemu_strtotime_ns() Tao Xu
2019-11-15  7:53 ` [PATCH v16 05/14] qapi: Add builtin type time Tao Xu
2019-11-15  7:53 ` [PATCH v16 06/14] tests: Add test for QAPI " Tao Xu
2019-11-15  7:53 ` [PATCH v16 07/14] numa: Extend CLI to provide initiator information for numa nodes Tao Xu
2019-11-15  7:53 ` [PATCH v16 08/14] numa: Extend CLI to provide memory latency and bandwidth information Tao Xu
2019-11-19 11:03   ` Igor Mammedov
2019-11-20  7:55     ` Tao Xu
2019-11-20 12:56       ` Igor Mammedov
2019-11-21  1:07         ` Tao Xu
2019-11-15  7:53 ` [PATCH v16 09/14] numa: Extend CLI to provide memory side cache information Tao Xu
2019-11-19 11:47   ` Igor Mammedov
2019-11-20  6:51     ` Tao Xu
2019-11-15  7:53 ` [PATCH v16 10/14] hmat acpi: Build Memory Proximity Domain Attributes Structure(s) Tao Xu
2019-11-15  7:53 ` [PATCH v16 11/14] hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s) Tao Xu
2019-11-20 10:09   ` Igor Mammedov
2019-11-21  1:28     ` Tao Xu
2019-11-15  7:53 ` [PATCH v16 12/14] hmat acpi: Build Memory Side Cache " Tao Xu
2019-11-20 12:50   ` Igor Mammedov
2019-11-15  7:53 ` [PATCH v16 13/14] tests/numa: Add case for QMP build HMAT Tao Xu
2019-11-20 12:32   ` Igor Mammedov [this message]
2019-11-21  0:56     ` Tao Xu
2019-11-15  7:53 ` [PATCH v16 14/14] tests/bios-tables-test: add test cases for ACPI HMAT Tao Xu
2019-11-15  8:58 ` [PATCH v16 00/14] Build ACPI Heterogeneous Memory Attribute Table (HMAT) no-reply

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=20191120133214.6fb83c92@redhat.com \
    --to=imammedo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=fan.du@intel.com \
    --cc=jingqi.liu@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tao3.xu@intel.com \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.