From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <users-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 60472A0509
	for <public@inbox.dpdk.org>; Thu, 14 Apr 2022 21:01:54 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 01A774067E;
	Thu, 14 Apr 2022 21:01:54 +0200 (CEST)
Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com
 [209.85.208.179])
 by mails.dpdk.org (Postfix) with ESMTP id F27474067C
 for <users@dpdk.org>; Thu, 14 Apr 2022 21:01:51 +0200 (CEST)
Received: by mail-lj1-f179.google.com with SMTP id 17so7225622lji.1
 for <users@dpdk.org>; Thu, 14 Apr 2022 12:01:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=Nfi0UDDMHMfI4/ob0IswwYlQ96Ck2iJUIc5pZxWldLo=;
 b=Q8ft8Fixwk2neGXyMwDrSJlQaBR1JldViE4kvnPcvm1msU9l2Aedo0lRipjTlYs81R
 B7tbYiqH7DB1glnOxMoTUK1SACQ4Bkj89lXXN7qy7d8uTqSMvhuF/af4KZe17T024JdK
 VM/6oC7PynWwJmyiPPiWM9Iqj3izYuc5e55fwURI076nIOwTSFx5OIpwYxH4+gRSJh/Y
 3Y5X8MOlyNlX/z2b9JvTrAzmMBA/iy8bP2+Y83ZGOkodRcI0ABRUYPbkzT9ccc3TrtPW
 RDb/Lic2gsNjGq9gPrAqnMy9szSrvCKI54GEMNNo2BtEd6o+Br75767TpXcgacTnCYo3
 Z6CQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=Nfi0UDDMHMfI4/ob0IswwYlQ96Ck2iJUIc5pZxWldLo=;
 b=bkSEO5N0aTXZ+FG6rEybq2pPSoArY/CuC8Hqzi7S4Jm8qAwdyzoCAxGvGJAFKn9ALU
 rwYp45HxbO6Ub8Pjgvf8sFfR3isO1iosfBPCT7ZTca/nwrfgeVzEY/OnimJDwOHFQzMd
 Kby+R12XsJdMLC+KaZGFdozKikfFH7cf4wTPdBmwkyM3FS9/oBZc8+37/5gkrsjQGE17
 hFJVgS2EQ9px42OQM18HUocCUfK8+7AYvwcRrqCGv+FtYHY3ZDWiALjPARIo/XT5GWWd
 w6lEeAtNhr7zS0KxAq3vZy7SXikkKqmpfTZueJFfcTbip6C2/C8D+PS4NZilG9FxFfSS
 TVsA==
X-Gm-Message-State: AOAM530NWiIyk4ddI0+x9ANb4zXk+M1Dg47BoHpFtvY6fnk4uw4GyoII
 4Qle5H2NeQcLiLY8pdoRaoli4mOOPlk=
X-Google-Smtp-Source: ABdhPJyyq/wkYAgCl3HLAYRZBg8b2mhXhw2vzJ3iofUfDfsW8dXD+sXqOlD9gFsqha913rVddqqAfg==
X-Received: by 2002:a2e:b88d:0:b0:249:86c0:fbd8 with SMTP id
 r13-20020a2eb88d000000b0024986c0fbd8mr2364919ljp.247.1649962911257; 
 Thu, 14 Apr 2022 12:01:51 -0700 (PDT)
Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru.
 [37.110.65.23]) by smtp.gmail.com with ESMTPSA id
 10-20020a2e080a000000b00247f82bbc6fsm71941lji.54.2022.04.14.12.01.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 14 Apr 2022 12:01:50 -0700 (PDT)
Date: Thu, 14 Apr 2022 22:01:48 +0300
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Antonio Di Bacco <a.dibacco.ks@gmail.com>
Cc: users@dpdk.org
Subject: Re: Shared memory between two primary DPDK processes
Message-ID: <20220414220148.0d638532@sovereign>
In-Reply-To: <CAO8pfF=-cPa0n_AhWdGbqcwEK9n8VHmkRh5qR6UyqbhPRFKZ7w@mail.gmail.com>
References: <CAO8pfFmiSYf=z5kK4EBwJkyJEpSCUrCqZspbNb3dC8nEPipUBw@mail.gmail.com>
 <20220408162629.372dfd0d@sovereign>
 <CAO8pfF=nVXqj5GBZKH3xVtZL79dDRGvXbMMnZiCJdStztGsZfg@mail.gmail.com>
 <CAO8pfFnGc+T0o18zUu8m3JPrkWD6eLG4qQrUu1B9YiTB+TSfSw@mail.gmail.com>
 <20220411203011.4df9f6f4@sovereign>
 <CAO8pfF=-cPa0n_AhWdGbqcwEK9n8VHmkRh5qR6UyqbhPRFKZ7w@mail.gmail.com>
X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
Errors-To: users-bounces@dpdk.org

2022-04-14 10:20 (UTC+0200), Antonio Di Bacco:
[...]
> Ok, after having a look to memif I managed to exchange the fd  between the
> two processes and it works.
> Anyway the procedure seems a little bit clunky and I think I'm going to use
> the new SYSCALL pidfd_getfd
> to achieve the same result.  In your opinion this method (getfd_pidfd)
> could also work if the two DPDK processes
> are inside different docker containers?

Honestly, I've just learned about pidfd_getfd() from you.
But I know that containers use PID namespaces, so there's a question
how you will obtain the pidfd of a process in another container.

In general, any method of sharing FD will work.
Remember that you also need offset and size.
Given that some channel is required to share those,
I think Unix domain socket is still the preferred way.

> Or is there another mechanims like using handles to hugepages present in
> the filesystem to share between two
> different containers?

FD is needed for mmap().
You need to either pass the FD or open() the same hugepage file by path.
I advise against using paths because they are not a part of DPDK API contract.