DPDK patches and discussions
 help / color / mirror / Atom feed
From: wangyunjian <wangyunjian@huawei.com>
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "users@dpdk.org" <users@dpdk.org>
Cc: Feifei Wang <Feifei.Wang2@arm.com>,
	Ruifeng Wang <Ruifeng.Wang@arm.com>,
	Huangshaozhang <huangshaozhang@huawei.com>,
	dingxiaoxiong <dingxiaoxiong@huawei.com>, nd <nd@arm.com>
Subject: RE: [dpdk-dev][dpdk-users] A problem about  memory may not be all-zero allocated by rte_zmalloc_socket()
Date: Mon, 7 Feb 2022 02:43:57 +0000	[thread overview]
Message-ID: <c46f2cfe9ee34d79b7fd80dabc642dcf@huawei.com> (raw)
In-Reply-To: <DBAPR08MB58145AE8598C5B3E38A91AF298259@DBAPR08MB5814.eurprd08.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3054 bytes --]

Hi, Honnappa



This problem is probability. Test case need to be executed multiple times.



The test steps and code are as follows:



/home/dpdk #./arm64-armv8a-linuxapp-gcc/app/dpdk-testpmd --legacy-mem  -c 0xC  -m 8192



app/test-pmd/testpmd.c | 14 ++++++++++++++

1 file changed, 14 insertions(+)



diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c

index 55eb293cc0..3c127f9623 100644

--- a/app/test-pmd/testpmd.c

+++ b/app/test-pmd/testpmd.c

@@ -4251,6 +4251,20 @@ main(int argc, char** argv)

                  rte_stats_bitrate_reg(bitrate_data);

        }

#endif

+

+       printf("start test rte_zmalloc_socket\n");

+       char *a;

+       while((a = rte_zmalloc_socket(NULL, 1024 * 1024, 0, SOCKET_ID_ANY)) != NULL) {

+                for (int i = 0; i < 1024 * 1024; i++) {

+                          if (a[i] != 0) {

+                                   printf("a[%d] = %d\n",i,a[i]);

+                          }

+                          a[i] = 255; // This assignment is important. It can increase the probability.

+                }

+       }

+       printf("end test rte_zmalloc_socket\n");

+       return EXIT_SUCCESS;

+

#ifdef RTE_LIB_CMDLINE

        if (strlen(cmdline_filename) != 0)

                  cmdline_read_from_file(cmdline_filename);

Thanks,
Yunjian

From: Honnappa Nagarahalli [mailto:Honnappa.Nagarahalli@arm.com]
Sent: Monday, January 31, 2022 12:22 PM
To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org; users@dpdk.org
Cc: Feifei Wang <Feifei.Wang2@arm.com>; Ruifeng Wang <Ruifeng.Wang@arm.com>; Huangshaozhang <huangshaozhang@huawei.com>; dingxiaoxiong <dingxiaoxiong@huawei.com>; Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
Subject: RE: [dpdk-dev][dpdk-users] A problem about memory may not be all-zero allocated by rte_zmalloc_socket()

Hi Yunjian,
                That's interesting. Is it possible to elaborate the use case or possibly provide the code snippet?

It is possible that it is a synchronization problem due to relaxed memory model that Arm architecture uses. There could be a barrier missing in the code.

Thanks,
Honnappa

From: wangyunjian <wangyunjian@huawei.com<mailto:wangyunjian@huawei.com>>
Sent: Saturday, January 29, 2022 9:21 PM
To: dev@dpdk.org<mailto:dev@dpdk.org>; users@dpdk.org<mailto:users@dpdk.org>
Cc: Feifei Wang <Feifei.Wang2@arm.com<mailto:Feifei.Wang2@arm.com>>; Ruifeng Wang <Ruifeng.Wang@arm.com<mailto:Ruifeng.Wang@arm.com>>; Huangshaozhang <huangshaozhang@huawei.com<mailto:huangshaozhang@huawei.com>>; dingxiaoxiong <dingxiaoxiong@huawei.com<mailto:dingxiaoxiong@huawei.com>>
Subject: [dpdk-dev][dpdk-users] A problem about memory may not be all-zero allocated by rte_zmalloc_socket()

Hi, all

There's a problem that the memory are allocated by rte_zmalloc_socket()
may not be all-zero on the ARM platform.

However, the x86 platform does not have this problem.


Any ideas ?


Thanks,

Yunjian


[-- Attachment #2: Type: text/html, Size: 12603 bytes --]

  reply	other threads:[~2022-02-07  2:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30  3:21 wangyunjian
2022-01-31  4:21 ` Honnappa Nagarahalli
2022-02-07  2:43   ` wangyunjian [this message]
2022-02-08  8:01   ` wangyunjian
2022-02-08 18:05     ` Honnappa Nagarahalli
2022-02-10 12:11       ` wangyunjian
2022-02-22  9:17         ` Ruifeng Wang
2022-02-23 11:22           ` wangyunjian
2022-02-23 15:38             ` Honnappa Nagarahalli
2023-04-12 17:35               ` Stephen Hemminger

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=c46f2cfe9ee34d79b7fd80dabc642dcf@huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=Feifei.Wang2@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=dev@dpdk.org \
    --cc=dingxiaoxiong@huawei.com \
    --cc=huangshaozhang@huawei.com \
    --cc=nd@arm.com \
    --cc=users@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).