patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: David Marchand <david.marchand@redhat.com>
Cc: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	dev <dev@dpdk.org>, dpdk stable <stable@dpdk.org>,
	Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Subject: Re: [dpdk-stable] [PATCH v4 1/1] fbarray: get fbarrays from containerized secondary
Date: Sun, 27 Oct 2019 03:11:40 +0900	[thread overview]
Message-ID: <8d3e968b-6aae-95ad-7105-730ab63586fa@gmail.com> (raw)
In-Reply-To: <CAJFAV8zYypQmS=2CB+Bz406n68W9s-xBBR0VZfMdhDhv0o53sQ@mail.gmail.com>

On 2019/10/27 1:15, David Marchand wrote:
> On Fri, Oct 25, 2019 at 9:55 PM Yasufumi Ogawa <yasufum.o@gmail.com> wrote:
>>>>
>>>> The title does not reflect the observed issue.
>> I would like to consider to revise it.
>>
>>>> I understand that secondary processeses can't be started from a docker
>>>> container.
>> I've confirmed that secondary process can be started as a container app
>> with SPP, and DPDK v18.08 and v19.08. SPP is a multi-process app
>> supporting container usecases.
>> http://git.dpdk.org/apps/spp/
> 
> Sorry, I don't understand.
> Do you mean the secondary processes can be run from containers without
> this patch?
> Or once this patch is applied?
Secondary processes can be run from a container. The problem is we 
cannot run two or more secondary app containers. It is because each of 
secondary app container tries to create its metadata file and the name 
is decided with PID, and PID is 1 in all of containers. It means that 
all of secondaries try to have the same name of metadata file, and 
failed to create the same file. The first container app can create 
metadata file with PID 1, but failed to create second one with the same 
PID 1.

This patch is to change creating metadata file from using PID 1 to 
hostname which is unique in each of secondary containers.

To summarize, we can run just one secondary app container without this 
patch, but cannot two or more secondary app containers.

> 
> 
>>
>>>> The patch title should reflect this.
>>>>
>>>> On Wed, Jul 24, 2019 at 10:20 AM <yasufum.o@gmail.com> wrote:
>>>>>
>>>>> From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
>>>>>
>>>>> In secondary_msl_create_walk(), it creates a file for fbarrays with its
>>>>> PID for reserving unique name among secondary processes. However, it
>>>>> does not work if secondary is run as app container because each of
>>>>> containerized secondary has PID 1. To reserve unique name, use hostname
>>>>> instead of PID because hostname is assigned as a short form of 64
>>>>> digits full container ID in docker.
>>>>>
>>>>> Cc: stable@dpdk.org
>>>>
>>>> I don't think we want to backport this behavior change.
>> This issue was included from DPDK v18.08, and some users of SPP are
>> still using stable 18.11. So, I would appreciate if you agree to backport.
> 
> This can be discussed later.
> Ok to keep stable in CC: then.
Thanks.

> 
> 
>>
>>>>
>>>>>
>>>>> Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
>>>>> ---
>>>>>    lib/librte_eal/linux/eal/eal_memalloc.c | 28 +++++++++++++++++++++++--
>>>>>    1 file changed, 26 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
>>>>> index 1f6a7c18f..356b304a8 100644
>>>>> --- a/lib/librte_eal/linux/eal/eal_memalloc.c
>>>>> +++ b/lib/librte_eal/linux/eal/eal_memalloc.c
>>>>> @@ -1366,6 +1366,7 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
>>>>>           struct rte_memseg_list *primary_msl, *local_msl;
>>>>>           char name[PATH_MAX];
>>>>>           int msl_idx, ret;
>>>>> +       char proc_id[33] = { 0 };  /* 32bytes is enough if using hostname */
>>>>
>>>> This variable only makes sense in the if (getpid() == 1) branch,
>>>> please move it there, and see below comment about using gethostname().
>> Sure. It works correctly in secondary app container and I should replace it.
> 
> Great, can you send a new version of this patch?
Yes, I will fix it soon.

> 
>>
>>>>
>>>>>
>>>>>           if (msl->external)
>>>>>                   return 0;
>>>>> @@ -1375,8 +1376,31 @@ 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());
>>>>> +       /* If run secondary in a container, the name of fbarray file should
>>>>> +        * not be decided with pid because getpid() always returns 1.
>>>>> +        * In docker, hostname is assigned as a short form of full container
>>>>> +        * ID. So use hostname as unique ID among containers instead.
>>>>
>>>> I understand this is how it works for docker.
>>>> Is this the same in other container environments?
>> Umm... I've tested on other than docker because I don't have test
>> environment. I am not sure which of container runtimes should be
>> supported actually. I think it is enough as the first step to fix this
>> issue of docker. Moreover, the essential problem is that getpid()
>> returns 1 in docker or not.
>>
>> I am also not sure which of environments other than docker should be
>> supported if necessary. What do you think?
> 
> No problem if you don't know.
Thanks.

Yasufumi
> 
> 
> 
> --
> David Marchand
> 

  reply	other threads:[~2019-10-26 18:11 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  1:59 [dpdk-stable] [PATCH] " ogawa.yasufumi
2019-04-16  3:43 ` [dpdk-stable] [PATCH v2 0/1] Get " ogawa.yasufumi
2019-04-16  3:43   ` [dpdk-stable] [PATCH v2 1/1] fbarray: get " ogawa.yasufumi
2019-07-04 20:17     ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2019-07-05  8:53     ` [dpdk-stable] " Burakov, Anatoly
2019-07-09 10:22       ` [dpdk-stable] [dpdk-dev] " Yasufumi Ogawa
2019-07-09 10:24         ` Burakov, Anatoly
2019-07-09 10:26           ` Burakov, Anatoly
2019-07-11  9:37             ` Yasufumi Ogawa
2019-07-11  9:43               ` Burakov, Anatoly
2019-07-11 10:31 ` [dpdk-stable] [PATCH v3 0/1] " yasufum.o
2019-07-11 10:31   ` [dpdk-stable] [PATCH v3 1/1] " yasufum.o
2019-07-11 10:53     ` Burakov, Anatoly
2019-07-11 11:57       ` Yasufumi Ogawa
2019-07-11 13:14         ` Burakov, Anatoly
2019-07-12  2:22           ` Yasufumi Ogawa
2019-07-22  1:06             ` Ogawa Yasufumi
2019-07-22  9:33               ` Burakov, Anatoly
2019-07-22  9:25             ` Burakov, Anatoly
2019-07-24  8:20   ` [dpdk-stable] [PATCH v4 0/1] " yasufum.o
2019-07-24  8:20     ` [dpdk-stable] [PATCH v4 1/1] " yasufum.o
2019-07-24  9:59       ` Burakov, Anatoly
2019-07-30  8:16         ` Thomas Monjalon
2019-07-30  9:18           ` Burakov, Anatoly
2019-07-31  5:48             ` Yasufumi Ogawa
2019-10-11  9:36       ` David Marchand
2019-10-25 15:36         ` David Marchand
2019-10-25 19:54           ` Yasufumi Ogawa
2019-10-26 16:15             ` David Marchand
2019-10-26 18:11               ` Yasufumi Ogawa [this message]
2019-10-28  8:07     ` [dpdk-stable] [PATCH v5 0/1] fbarray: fix duplicated fbarray file in secondary yasufum.o
2019-10-28  8:07       ` [dpdk-stable] [PATCH v5 1/1] " yasufum.o
2019-10-29 12:03         ` [dpdk-stable] [dpdk-dev] " Ananyev, Konstantin
2019-10-30 13:42           ` Yasufumi Ogawa
2019-10-30 19:00             ` Ananyev, Konstantin
2019-10-31 10:03               ` Yasufumi Ogawa
2019-10-31 10:32                 ` Ananyev, Konstantin
2019-11-01  9:04     ` [dpdk-stable] [PATCH v6 0/1] " yasufum.o
2019-11-01  9:04       ` [dpdk-stable] [PATCH v6 1/1] " yasufum.o
2019-11-01 12:01         ` Ananyev, Konstantin
2019-11-04 10:20         ` Burakov, Anatoly
2019-11-05 10:13           ` David Marchand
2019-11-05 11:31             ` Burakov, Anatoly
2019-11-05 11:41               ` Ananyev, Konstantin
2019-11-06 10:37                 ` Burakov, Anatoly
2019-11-08  3:19                   ` Yasufumi Ogawa
2019-11-13 21:43     ` [dpdk-stable] [PATCH v7 0/1] " yasufum.o
2019-11-13 21:43       ` [dpdk-stable] [PATCH v7 1/1] " yasufum.o
2019-11-14 10:01         ` Burakov, Anatoly
2019-11-14 11:42           ` Yasufumi Ogawa
2019-11-14 12:27             ` David Marchand
2019-11-26 19:40               ` Yasufumi Ogawa
2019-11-27 10:26                 ` Burakov, Anatoly
2019-11-14 12:55         ` David Marchand
2019-11-14 17:32         ` Ananyev, Konstantin
2023-06-13 16:51 ` [dpdk-dev] [PATCH] fbarray: get fbarrays from containerized secondary 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=8d3e968b-6aae-95ad-7105-730ab63586fa@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=stable@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).