From: Stephen Hemminger <stephen@networkplumber.org>
To: Congjie Zhou <zcjie0802@qq.com>
Cc: dev@dpdk.org, anatoly.burakov@intel.com
Subject: Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()
Date: Thu, 14 Nov 2024 08:24:59 -0800 [thread overview]
Message-ID: <20241114082459.10a991aa@hermes.local> (raw)
In-Reply-To: <tencent_B09D0FCCA142E4AE5ABFE584E92DCED8CB0A@qq.com>
On Thu, 14 Nov 2024 16:37:10 +0800
Congjie Zhou <zcjie0802@qq.com> wrote:
>
> +static uint64_t
> +current_time(void)
> +{
> + struct timespec ts;
> + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == -1) {
> + EAL_LOG(ERR, "Fail to get current time");
> + return -1ULL;
> + }
> + uint64_t time_ns = (uint64_t)ts.tv_sec * 1000000000ULL + ts.tv_nsec;
> + return time_ns;
> +}
> +
> static int
> secondary_msl_create_walk(const struct rte_memseg_list *msl,
> void *arg __rte_unused)
> @@ -1447,8 +1460,8 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
> local_msl = &local_memsegs[msl_idx];
>
> /* create distinct fbarrays for each secondary */
> - snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
> - primary_msl->memseg_arr.name, getpid());
> + snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i_%"PRIx64,
> + primary_msl->memseg_arr.name, getpid(), current_time());
>
In general DPDK uses tsc instead of monotonic time, since it is faster and platform
independent (ie Windows).
Why not use use a global counter instead?
next prev parent reply other threads:[~2024-11-14 16:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 8:37 [PATCH] eal/linux: redefine the name for rte_fbarray_init() Congjie Zhou
2024-11-14 16:24 ` Stephen Hemminger [this message]
2024-11-14 17:06 ` Stephen Hemminger
2024-11-15 2:26 ` Zhou congjie
2024-11-15 5:32 ` Stephen Hemminger
2024-11-15 1:57 ` Zhou congjie
2024-11-15 2:00 ` Zhou congjie
2024-11-15 7:50 ` [PATCH v2] eal/linux: fix fbarray name with multiple secondary processes Congjie Zhou
2024-11-15 16:38 ` Stephen Hemminger
2024-11-15 20:09 ` Stephen Hemminger
2024-11-16 2:16 ` [PATCH v2] eal/linux: fix fbarray name with multiple secondaryprocesses Zhou congjie
2024-11-16 2:53 ` Zhou congjie
2024-11-16 4:07 ` [PATCH v3] eal/linux: fix fbarray name with multiple secondary processes Congjie Zhou
2026-01-14 5:25 ` Stephen Hemminger
2026-01-14 5:54 ` [PATCH v4] Subject: eal/linux: fix fbarray name collision in containers Stephen Hemminger
2026-02-13 21:50 ` [PATCH v5] " Stephen Hemminger
2026-02-13 22:00 ` [PATCH v6] " Stephen Hemminger
2026-02-16 17:22 ` David Marchand
2026-02-16 22:26 ` Stephen Hemminger
-- strict thread matches above, loose matches on Subject: below --
2024-11-14 8:10 [PATCH] eal/linux: redefine the name for rte_fbarray_init() Congjie Zhou
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=20241114082459.10a991aa@hermes.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=zcjie0802@qq.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.