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 66455A00BE for ; Wed, 16 Feb 2022 20:09:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03AF640150; Wed, 16 Feb 2022 20:09:52 +0100 (CET) Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by mails.dpdk.org (Postfix) with ESMTP id 3EC1940042 for ; Wed, 16 Feb 2022 20:09:51 +0100 (CET) Received: by mail-vs1-f49.google.com with SMTP id e5so3570597vsg.12 for ; Wed, 16 Feb 2022 11:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=15SaHPEVJ1NqzBX2jtndhi6yHzsX/h3VqPkpJPAAm30=; b=QpaV+2hr/D8yj/UnryYz/JNvDPNUO4DKIar4KwZSmcESVT3IdglyFKCEdQuHQCtCIq t7HPS8lSHaLmKJpec9QB2UrhML8p7Y3KVujeuvnSYSuWjfGpj9yjhmWxjkq35rn0XxC1 l1tEIIXd7P5OGhhaVCRLAlU/rRx1nvyLt25kdEJLZNSHIXHE6scoR2SJF4xTaeWqJWn+ IKIrf7x6dW1sNKFRQ9e6sS9bS3lHDt1FEyW4gS395wJ3ClplZB9JYtzpRD3DbIF8S4jP nvSJp6y6P/hVfuPiMmyZY2P5tq5QbRwkJ7FLAnIGqzJPLWc1blzPbwe5Rb5UQmepS+SU mKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=15SaHPEVJ1NqzBX2jtndhi6yHzsX/h3VqPkpJPAAm30=; b=Lkb8UTN/eFHw9eB+g0jf0/xhex8B/Tl9vxcFlY2AFIaFo3+m4CKyGgW9403R2yrSmL L5yqH1kX26dE3gMWHzFF/bcR8SMz5a0smu7RB88qS4MdeiriKf6dPzo/OEait5Z50yRl cJXSEDI8iWpuaVyAo1PRwsY3EM8pCIjU9Wfq3UgASpnS7NxdwVxqJtPx6diDXh+uzz1v tecbwRJ594vlLg58Jf170JlECh9DMxpSM/5pf1RDooWRWeryGNJ3Q83w2z8dnufF2xzP qxA0M+fiiTXrTovf4WXb3wuZ/X8PcD+aYHS7AJad5VCjxqnHQwZkFVQnYF/8w+h364AY IcUA== X-Gm-Message-State: AOAM531hmJ6lvvdtnRuNq4P3tj0USjLOeCNGk47UoGF0EPQvll4Wb3ti wB5HxCSXKsT5ZFVgRt+oAx8+JT7EOgpr+F5axMzMrThFrEgvpg== X-Google-Smtp-Source: ABdhPJyfw+UUixSWxEecFckeeyfoXVnzYnbAHVUi3cv6wFP/BXv+sQoAdraAJTO0nOtzv7ncJFGx2L6BnDyr0Hpi74I= X-Received: by 2002:a05:6102:32d2:b0:31b:72ed:30c4 with SMTP id o18-20020a05610232d200b0031b72ed30c4mr1670969vss.31.1645038590435; Wed, 16 Feb 2022 11:09:50 -0800 (PST) MIME-Version: 1.0 References: <20220216104637.4632aa3b@hermes.local> In-Reply-To: <20220216104637.4632aa3b@hermes.local> From: Staffan Wiklund Date: Wed, 16 Feb 2022 20:09:47 +0100 Message-ID: Subject: Re: How to use DPDK memif between Docker container and native Linux application? To: Stephen Hemminger Cc: users Content-Type: multipart/alternative; boundary="000000000000d3250405d8276451" 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 --000000000000d3250405d8276451 Content-Type: text/plain; charset="UTF-8" Thanks for your help. I will then try with the "socket-abstract=yes" to memif. Regards Staffan Den ons 16 feb. 2022 kl 19:46 skrev Stephen Hemminger < stephen@networkplumber.org>: > On Wed, 16 Feb 2022 10:19:02 +0100 > Staffan Wiklund wrote: > > > Hello > > > > I wonder if it is possible for a DPDK application using the memif feature > > to communicate with a native Linux application? > > > > I have tried to create a Docker container and start the image by: > > docker run -ti --privileged -v "/mnt/huge:/mnt/huge" -v > "/var/run:/var/run" > > -v "/tmp:/tmp" -v "/run:/run" -v "/sys:/sys" -v "/dev:/dev" testpmd > > /bin/bash > > > > In this container I start the dpdk-testpmd application in server mode by: > > ./dpdk-testpmd -l 1-2 --no-pci --proc-type=primary --file-prefix=td1 > > --vdev=net_memif,role=server,mac=00:00:00:00:00:01 -- -i > > > > From a UNIX shell in the same server I start the dpdk-testpmd in client > > mode: > > sudo ./dpdk-testpmd -l 3-4 --no-pci --proc-type=primary > --file-prefix=td2 > > --vdev=net_memif,zero-copy=yes,mac=00:00:00:00:00:02 > --single-file-segments > > -- -i > > > > This results in the following error message on the client side: > > . . . > > Configuring Port 0 (socket 0) > > memif_connect_client(): Failed to connect socket: /run/memif.sock. > > Fail to start port 0 > > . . . > > > > If I start both sides in a UNIX shell, the client can connect to the > server. > > Do you know what can be the fault when executing in a Docker container > and > > in a UNIX shell for communication using the DPDK memif feature? > > > > Thanks > > Staffan > > The docker container is in a different filesystem namespace so the two > can't > talk to each other. You might get it to work with the abstract option to > memif. > --000000000000d3250405d8276451 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for your help.
I will then try= with the "socket-abstract=3Dyes" t= o memif.

Regards
Staffan

Den ons 16 feb. 2022 kl 19:46 skrev = Stephen Hemminger <stephen= @networkplumber.org>:
On Wed, 16 Feb 2022 10:19:02 +0100
Staffan Wiklund <staffan491@gmail.com> wrote:

> Hello
>
> I wonder if it is possible for a DPDK application using the memif feat= ure
> to communicate with a native Linux application?
>
> I have tried to create a Docker container and start the image by:
> docker run -ti --privileged -v "/mnt/huge:/mnt/huge" -v &quo= t;/var/run:/var/run"
> -v "/tmp:/tmp" -v "/run:/run" -v "/sys:/sys&q= uot; -v "/dev:/dev" testpmd
> /bin/bash
>
> In this container I start the dpdk-testpmd application in server mode = by:
> ./dpdk-testpmd -l 1-2=C2=A0 --no-pci=C2=A0 --proc-type=3Dprimary --fil= e-prefix=3Dtd1
> --vdev=3Dnet_memif,role=3Dserver,mac=3D00:00:00:00:00:01 -- -i
>
> From a UNIX shell in the same server I start the dpdk-testpmd in clien= t
> mode:
> sudo ./dpdk-testpmd -l 3-4=C2=A0 --no-pci --proc-type=3Dprimary --file= -prefix=3Dtd2
> --vdev=3Dnet_memif,zero-copy=3Dyes,mac=3D00:00:00:00:00:02 --single-fi= le-segments
> -- -i
>
> This results in the following error message on the client side:
> . . .
> Configuring Port 0 (socket 0)
> memif_connect_client(): Failed to connect socket: /run/memif.sock.
> Fail to start port 0
> . . .
>
> If I start both sides in a UNIX shell, the client can connect to the s= erver.
> Do you know what can be the fault when executing in a Docker container= and
> in a UNIX shell for communication using the DPDK memif feature?
>
> Thanks
> Staffan

The docker container is in a different filesystem namespace so the two can&= #39;t
talk to each other. You might get it to work with the abstract option to me= mif.
--000000000000d3250405d8276451--