DPDK usage discussions
 help / color / mirror / Atom feed
* How to use DPDK memif between Docker container and native Linux application?
@ 2022-02-16  9:19 Staffan Wiklund
  2022-02-16 18:46 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Staffan Wiklund @ 2022-02-16  9:19 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1632 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use DPDK memif between Docker container and native Linux application?
  2022-02-16  9:19 How to use DPDK memif between Docker container and native Linux application? Staffan Wiklund
@ 2022-02-16 18:46 ` Stephen Hemminger
  2022-02-16 19:09   ` Staffan Wiklund
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2022-02-16 18:46 UTC (permalink / raw)
  To: Staffan Wiklund; +Cc: users

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 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use DPDK memif between Docker container and native Linux application?
  2022-02-16 18:46 ` Stephen Hemminger
@ 2022-02-16 19:09   ` Staffan Wiklund
  0 siblings, 0 replies; 3+ messages in thread
From: Staffan Wiklund @ 2022-02-16 19:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]

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 <staffan491@gmail.com> 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.
>

[-- Attachment #2: Type: text/html, Size: 3231 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-16 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  9:19 How to use DPDK memif between Docker container and native Linux application? Staffan Wiklund
2022-02-16 18:46 ` Stephen Hemminger
2022-02-16 19:09   ` Staffan Wiklund

DPDK usage discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git