From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 517BBA00BE for ; Mon, 11 Apr 2022 19:30:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C634B41611; Mon, 11 Apr 2022 19:30:15 +0200 (CEST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mails.dpdk.org (Postfix) with ESMTP id 2CF22415D7 for ; Mon, 11 Apr 2022 19:30:14 +0200 (CEST) Received: by mail-lf1-f45.google.com with SMTP id b21so27914177lfb.5 for ; Mon, 11 Apr 2022 10:30:14 -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=SFFsXokMZZFE8tYfzc9XRR4plloFFQ79F2/cSKh32pE=; b=BcDyafhgglRjOOAHrrhr03kBA0SrBHyWi/jQH9kTopiJtMYE9Q+/zcgvmSmK2y3Qqe 0RbdPkTPvso5by90m1FFxcaPQq9E6Y5D22tm7W18VT6qEv2Cv63r/ZsvWv7HyO/ggkWL 0be/Arvnaftt+hH4r5CA+cJZFiIXVz41aqhGJPDfb60vkmsZiV+h0Pequ2Cj6LTB7eqK CB45KU2sOjy3a5xkX9rpEWE7nqAHAVQQuQnBwz/lWn2Y1zVRPGQBDAYAiMP01fIiaR3m 5LPWxEP07RaTZVhN1ElWjTvdoX6buKhsDeJf7MD25oo9335lh/AMgX1K1r7USrse4enk /xSA== 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=SFFsXokMZZFE8tYfzc9XRR4plloFFQ79F2/cSKh32pE=; b=jf2hU8snm6f0J658BsJl6hp+7bB2dptCF38FKl4f5e8dQnxul3im7ONdk9Cy218Wn9 3Ugh5uumq/q8+z2HMi4rQbUb8NUQFsd8DSzYSCtFsCsLDNSxikIauyiLXFkd2Z/QeP2P hxATqXKIbiiu+ZjGxONW6dMiQOEZuhXbm/7VC+bXpnSfdvmJkc5ZmQD/I0PsyxTnV+QE I4UP+6RqlEUh/4EG+ppZsU++G3JJ2jvqyWs2lWx/WZ0kLmTLqsUn874XcguacL20Moy+ EyzVDpqkD0WkDLxdCRCTbAF6MN3Mqn5ChcZ46rbIaUzzdWeTQOTZ8W0VJx9qgv911BVm 9X7g== X-Gm-Message-State: AOAM531tq50z6tbG+6vqFZTYLjC5wiEokEL5mu4/3uXSlyVDTkwdQoic hxP6i2r8zOlvFD3GTZj0+lM= X-Google-Smtp-Source: ABdhPJxc/BNIQi7R4NuCkaeVyo/NWPEYUNlkm57zir0LOevBTRuqsWX//loZ6nz6xD4CXHO3Dn3IxQ== X-Received: by 2002:a05:6512:6cf:b0:44a:2472:78b9 with SMTP id u15-20020a05651206cf00b0044a247278b9mr22864737lff.635.1649698213419; Mon, 11 Apr 2022 10:30:13 -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 n5-20020a2e82c5000000b0024b0f44848asm2887932ljh.59.2022.04.11.10.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 10:30:12 -0700 (PDT) Date: Mon, 11 Apr 2022 20:30:11 +0300 From: Dmitry Kozlyuk To: Antonio Di Bacco Cc: users@dpdk.org Subject: Re: Shared memory between two primary DPDK processes Message-ID: <20220411203011.4df9f6f4@sovereign> In-Reply-To: References: <20220408162629.372dfd0d@sovereign> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org 2022-04-11 15:03 (UTC+0200), Antonio Di Bacco: > I did a short program where a primary (--file-prefix=p1) allocates a > memzone and generates a file descriptor that is passed to another primary > (--file-prefix=p2) . > The process P2 tries to mmap the memory but I get an error (Bad file > descriptor): > > uint64_t* addr = mmap(NULL, 1024*1024*1024, PROT_READ, flags, > mem_fd, 0); > if (addr == -1) > perror("mmap"); How do you pass the FD? Memif does the same thing under the hood, so you should be able too.