Hi,

 I was able to get the ports working using the below docker command,
testpmd commands..

 - docker run -it -v /tmp/sock1.sock:/var/run/usvhost1 -v
/tmp/sock2.sock:/var/run/usvhost2 -v /dev/hugepages/:/dev/hugepages
dpdk_app_l2fwd
 - ./bin/testpmd -l 16-17  -n 4 --log-level=8 --socket-mem=1024,1024
--no-pci --vdev=virtio_user0,path=/var/run/usvhost1,mac=00:00:00:01:01:01
--vdev=virtio_user1,path=/var/run/usvhost2,mac=00:00:00:01:01:02 --  -i
--txqflags=0xf00 --disable-hw-vlan


EAL: Master lcore 16 is ready (tid=2c6fd8c0;cpuset=[16])
EAL: lcore 17 is ready (tid=2add9700;cpuset=[17])
EAL: Search driver virtio_user0 to probe device virtio_user0
EAL: Search driver virtio_user1 to probe device virtio_user1
Interactive-mode selected
Warning: NUMA should be configured manually by using --port-numa-config and
--ring-numa-config parameters along with --numa.
USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=155456, size=2176,
socket=0
USER1: create a new mbuf pool <mbuf_pool_socket_1>: n=155456, size=2176,
socket=1
Configuring Port 0 (socket 0)
Port 0: 00:00:00:01:01:01
Configuring Port 1 (socket 0)
Port 1: 00:00:00:01:01:02
Checking link statuses...
Done
testpmd> help



Regards,
Shiv


On Tue, Jan 2, 2018 at 10:34 PM, Shiv Dev <shivfs...@gmail.com> wrote:

> I find that changing the vdev  in the l2fwd command line to virtio_user
> helps..
>
> shiv@shiv-lenovo-v310:~/work/docker$ docker run -it -v
> /tmp/sock1.sock:/tmp/sock1.sock -v /mnt/huge_vhost/:/mnt/huge_vhost
> dpdk_app_l2fwd  l2fwd -c 0x4 -n 4 -m 1024 --no-pci --vdev=*virtio_user0*
> ,path=/tmp/sock1.sock -- -p 0x1.
>
> However, now the error is
>
> EAL: Fail to configure port 0..
> Start ports failed..
>
> Regards,
> Shiv
>
> On Fri, Dec 29, 2017 at 10:49 AM, Akshaya Nadahalli <aksh...@rtbrick.com>
> wrote:
>
>> Hi Shiv,
>>
>> Not sure about vhost interfaces, but should be doable with tap/veth
>> pairs.  Refer to below links:
>>
>> https://wiki.fd.io/view/VPP/Configure_VPP_TAP_Interfaces_For
>> _Container_Routing
>> https://wiki.fd.io/view/VPP/Configure_VPP_As_A_Router_Between_Namespaces
>>
>> I had used veth pairs to communicate with each other via VPP instances
>> running under different lxc containers. Procedure I followed was as below
>> and i think same should work for docker as well:
>>
>> 1. Create Veth pair with command:
>>     sudo ip link add name <container1 interface> type veth peer name
>> <container2 interface>
>>
>> 2. Findout the network namespace of conatiners and move the veth
>> interfaces to corresponding namespaces:
>>
>>     sudo lxc-info --name <container_name> | grep "PID:" | awk '{print
>> $2}' ---> for lxc containers
>>
>>     docker inspect -f '{{.State.Pid}}' <container_name>   ----> for docker
>>
>>     sudo ip link set netns <lxc-pid/docker-pid> dev <link to be moved to
>> container>
>>
>> 3. Login to VPP within the container and take over the host interface
>> with the command:
>>     create host-interface name <container interface>
>>
>> --
>> HTH,
>> Akshaya N
>>
>>
>> -----Original Message-----
>> *From*: Shiv Dev <shivfs...@gmail.com
>> <shiv%20dev%20%3cshivfs...@gmail.com%3e>>
>> *To*: vpp-dev@lists.fd.io
>> *Subject*: [vpp-dev] Docker containers
>> *Date*: Thu, 28 Dec 2017 21:51:15 +0530
>>
>>
>>
>> Hi VPP Team,
>>
>>    I am trying to interface docker containers to VPP through an
>> vhost-user device.
>>
>>   The page here (https://wiki.fd.io/view/VPP/U
>> se_VPP_to_connect_VMs_Using_Vhost-User_Interface) explains how to do it
>> for VMs.  Is there any page that explains it for docker containers ?
>>
>>   As explained in the above page, I have setup the vhost-user interfaces
>> in VPP. I am getting a problem when I try to pass the vhost information to
>> the docker container.
>>
>> vpp# show vhost-user Virtio vhost-user interfaces .. Interface:
>> VirtualEthernet0/0/0 (ifindex 1) virtio_net_hdr_sz 0 ... Interface:
>> VirtualEthernet0/0/1 (ifindex 2) virtio_net_hdr_sz 0 ..
>>
>> shiv@shiv-lenovo-v310:~/work/docker$ docker run -it -v
>> /tmp/sock1.sock:/tmp/sock1.sock -v /mnt/huge_vhost/:/mnt/huge_vhost
>> dpdk_app_l2fwd  l2fwd -c 0x4 -n 4 -m 1024 --no-pci
>> --vdev=virtio-user0,path=/tmp/sock1.sock -- -p 0x1 EAL: Detected 4
>> lcore(s) EAL: No free hugepages reported in hugepages-1048576kB EAL: Cannot
>> obtain physical addresses: Success. Only vfio will function. EAL: Failed to
>> get current mempolicy: Operation not permitted. Assuming MPOL_DEFAULT.
>> ERROR: failed to parse device "virtio-user0" EAL: Unable to parse device
>> 'virtio-user0,path=/tmp/sock1.sock' EAL: Error - exiting with code: 1
>> Cause: Invalid EAL arguments
>>
>> Basically, how do we pass virtio-user devices to container app ? Is there
>> any way to check if the virtio-user devices are available in the kernel ?
>>
>> Regards, Shiv
>>
>>
>>
>> _______________________________________________
>> vpp-dev mailing 
>> listvpp-...@lists.fd.iohttps://lists.fd.io/mailman/listinfo/vpp-dev
>>
>>
>> --
>> Regards,
>> Akshaya N
>>
>
>
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to