Bug 438 - memif sock does not honor file-prefix
Summary: memif sock does not honor file-prefix
Status: IN_PROGRESS
Alias: None
Product: DPDK
Classification: Unclassified
Component: ethdev (show other bugs)
Version: 20.02
Hardware: x86 Linux
: Normal normal
Target Milestone: ---
Assignee: Jakub Grajciar
URL:
Depends on:
Blocks:
 
Reported: 2020-04-04 04:42 CEST by Vipin Varghese
Modified: 2020-10-05 15:52 CEST (History)
1 user (show)



Attachments

Description Vipin Varghese 2020-04-04 04:42:15 CEST
CMD:  ./build/l2fwd --vdev=net_tap0 --vdev=net_memif,role=master -l 8,51 --socket-mem=104,0 --socket-limit=1024,0 --file-prefix=custom --proc-type=primary --no-pci -- -p 0x3 -T 1

Issue: start DPDK application with memif.


observation:
`
EAL: Multi-process socket /var/run/dpdk/custom/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
memif_socket_create(): Failed to setup socket /run/memif.sock: Address already in use
`

expectation: memif sock interface is to be in `/run/dpdk/custom/memif.sock` and not `/run/memif.sock`
Comment 1 Stephen Hemminger 2020-04-04 18:54:29 CEST
On Sat, 04 Apr 2020 02:42:15 +0000
bugzilla@dpdk.org wrote:

> https://bugs.dpdk.org/show_bug.cgi?id=438
> 
>             Bug ID: 438
>            Summary: memif sock does not honor file-prefix
>            Product: DPDK
>            Version: 20.02
>           Hardware: x86
>                 OS: Linux
>             Status: UNCONFIRMED
>           Severity: normal
>           Priority: Normal
>          Component: ethdev
>           Assignee: dev@dpdk.org
>           Reporter: vipin.varghese@intel.com
>   Target Milestone: ---
> 
> CMD:  ./build/l2fwd --vdev=net_tap0 --vdev=net_memif,role=master -l 8,51
> --socket-mem=104,0 --socket-limit=1024,0 --file-prefix=custom
> --proc-type=primary --no-pci -- -p 0x3 -T 1
> 
> Issue: start DPDK application with memif.
> 
> 
> observation:
> `
> EAL: Multi-process socket /var/run/dpdk/custom/mp_socket
> EAL: Selected IOVA mode 'VA'
> EAL: Probing VFIO support...
> memif_socket_create(): Failed to setup socket /run/memif.sock: Address
> already
> in use
> `
> 
> expectation: memif sock interface is to be in `/run/dpdk/custom/memif.sock`
> and
> not `/run/memif.sock`

If it just used abstract socket type it would not have this problem.
Comment 2 Anatoly Burakov 2020-07-28 11:22:39 CEST
Why was this assigned to me? I'm not a memif maintainer.
Comment 3 Ajit Khaparde 2020-09-16 23:16:03 CEST
Jakub, Please take a look. Thanks
Comment 4 Jakub Grajciar 2020-09-21 14:02:29 CEST
It's not a good idea that --file-prefix flag should affect memif socket path. 

Reason one: it might be confusing as the documentation states that --file-prefix is used on hugepages to separate shared data files.

The second reason is that in order to establish a connection between independent DPDK processes under different prefixes you need to use the same socket.
Comment 5 Vipin Varghese 2020-09-21 16:00:26 CEST
Hi Jakub, the request or suggestion from my end is to `expectation: memif sock interface is to be in `/run/dpdk/custom/memif.sock` and not `/run/memif.sock` and not `using name defined under file prefix.`

By having the sock file in `/var/run/dpdk` folder is to allow seamless cleanup. Without which today we get the error as reported `20.02` release
Comment 6 Jakub Grajciar 2020-09-21 16:16:46 CEST
But isn't the 'custom' folder a '--file-prefix' argument? Meaning it would cause problem in case of multiple independent dpdk instances.

Example: Let's assume two independent dpdk processes dpdk1 and dpdk2. dpdk1 sets --file-prefix=dpdk1 and dpdk2 sets --file-prefix=dpdk2. dpdk1's master interface creates the socket in /run/dpdk/dpdk1/memif.sock then dpdk2's slave interface looks for the socket in /run/dpdk/dpdk2/memif.sock.

I'll also investigate the abstract socket solution suggested by Stephen, but I'm concerned that it may cause incompatibility with other implementations and older versions.
Comment 7 Jakub Grajciar 2020-10-05 15:52:58 CEST
I submitted a patch to have memif use abstract socket: https://patches.dpdk.org/patch/79675/. This should resolve all issues regarding cleanup.

Note You need to log in before you can comment on or make changes to this bug.