Dear all,
I tried using testpmd(virio-user) <--> (vhost-user)testpmd, this topology
works well.
these are my test command:
sudo ./testpmd -l 0-1 -n 4 --socket-mem 1024,1024 --no-pci --vdev
'eth_vhost0,iface=/tmp/sock0' --file-prefix=host  --single-file-segments --
-i
sudo ./testpmd -l 6-7 -n 4 --socket-mem 1024,1024 --no-pci
--vdev=virtio_user0,path=/tmp/sock0 --file-prefix=container
--single-file-segments -- -i

Then I changed testpmd(virtio-user) to VPP,  all packets VPP sent out would
be dropped.

By the way, I have tried
1. add single-file-segments for rte_eal_init
2.remove in-memory for rte_eal_init

But none of these 2 changes help.
Is there some wrong config in my test environment? Thanks.

Testing topology:
VPP(virtio-user) <--> (vhost-user) openvswitch/testpmd

startup.conf

heapsize 2G
> unix {
>         nodaemon
>         interactive
>         cli-listen /run/vpp/cli.sock
>         exec init.conf
> }
> cpu {
>         workers 1
> }
> dpdk {
>         no-pci
>         vdev virtio_user0,path=/tmp/sock0,mac=00:11:22:33:44:10
> }


init.conf

> set interface ip address VirtioUser0 172.20.224.1/24
> set interface state VirtioUser0 up


The VPP log:

DBGvpp# show version
> vpp v20.05-release built by ubuntu on ubuntu-3 at 2020-06-19T07:16:33
> DBGvpp# show interface addr
> VirtioUser0 (up):
>   L3 172.20.224.1/24
> local0 (dn):
> DBGvpp# show interface
>               Name               Idx    State  MTU (L3/IP4/IP6/MPLS)
> Counter          Count
> VirtioUser0                       1      up          9000/0/0/0
> local0                            0     down          0/0/0/0
> DBGvpp# show interface addr
> VirtioUser0 (up):
>   L3 172.20.224.1/24
> local0 (dn):
> DBGvpp# ping 172.20.224.10
> Statistics: 5 sent, 0 received, 100% packet loss
> DBGvpp# show interface
>               Name               Idx    State  MTU (L3/IP4/IP6/MPLS)
> Counter          Count
> VirtioUser0                       1      up          9000/0/0/0     tx
> packets                     5
>                                                                     tx
> bytes                     210
>                                                                     drops
>                          5
> local0                            0     down          0/0/0/0
> DBGvpp# show hardware-interfaces
>               Name                Idx   Link  Hardware
> 0: format_dpdk_device:588: rte_eth_dev_rss_hash_conf_get returned -95
> VirtioUser0                        1     up   VirtioUser0
>   Link speed: 10 Gbps
>   Ethernet address 00:11:22:33:44:10
>   Virtio User
>     carrier up full duplex mtu 9206
>     flags: admin-up pmd maybe-multiseg
>     Devargs: path=/tmp/sock0,mac=00:11:22:33:44:10
>     rx: queues 1 (max 1), desc 1024 (min 0 max 65535 align 1)
>     tx: queues 1 (max 1), desc 1024 (min 0 max 65535 align 1)
>     max rx packet len: 9728
>     promiscuous: unicast off all-multicast off
>     vlan offload: strip off filter off qinq off
>     rx offload avail:  vlan-strip udp-cksum tcp-cksum tcp-lro jumbo-frame
>     rx offload active: jumbo-frame
>     tx offload avail:  vlan-insert udp-cksum tcp-cksum tcp-tso multi-segs
>     tx offload active: multi-segs
>     rss avail:         none
>     rss active:        none
>     tx burst function: virtio_xmit_pkts_inorder
>     rx burst function: virtio_recv_pkts_inorder
>     tx frames ok                                           5
>     tx bytes ok                                          210
>     extended stats:
>       tx good packets                                      5
>       tx good bytes                                      210
>       tx q0packets                                         5
>       tx q0bytes                                         210
>       tx q0 good packets                                   5
>       tx q0 good bytes                                   210
>       tx q0 broadcast packets                              5
>       tx q0 undersize packets                              5
> local0                             0    down  local0
>   Link speed: unknown
>   local
> DBGvpp# show physmem
>  used-pages 40 reserved-pages 8192 default-page-size 2MB lookup-page-size
> 2MB
>    arena 'buffers-numa-0' pages 20 subpage-size 2MB numa-node 0 shared fd 4
>    arena 'buffers-numa-1' pages 20 subpage-size 2MB numa-node 1 shared fd 5
> DBGvpp# show dpdk physmem
> Segment 8-0: IOVA:0x7fc13fe00000, len:2097152, virt:0x7fc13fe00000,
> socket_id:0, hugepage_sz:2097152, nchannel:0, nrank:0 fd:27
> Segment 8-1: IOVA:0x7fc140000000, len:2097152, virt:0x7fc140000000,
> socket_id:0, hugepage_sz:2097152, nchannel:0, nrank:0 fd:28
> Segment 12-0: IOVA:0x7fb13f600000, len:2097152, virt:0x7fb13f600000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:21
> Segment 12-1: IOVA:0x7fb13f800000, len:2097152, virt:0x7fb13f800000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:29
> Segment 12-2: IOVA:0x7fb13fa00000, len:2097152, virt:0x7fb13fa00000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:30
> Segment 12-3: IOVA:0x7fb13fc00000, len:2097152, virt:0x7fb13fc00000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:32
> Segment 12-4: IOVA:0x7fb13fe00000, len:2097152, virt:0x7fb13fe00000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:33
> Segment 12-5: IOVA:0x7fb140000000, len:2097152, virt:0x7fb140000000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:34
> Segment 12-6: IOVA:0x7fb140200000, len:2097152, virt:0x7fb140200000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:35
> Segment 12-7: IOVA:0x7fb140400000, len:2097152, virt:0x7fb140400000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:36
> Segment 12-8: IOVA:0x7fb140600000, len:2097152, virt:0x7fb140600000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:37
> Segment 12-9: IOVA:0x7fb140800000, len:2097152, virt:0x7fb140800000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:38
> Segment 12-10: IOVA:0x7fb140a00000, len:2097152, virt:0x7fb140a00000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:39
> Segment 12-11: IOVA:0x7fb140c00000, len:2097152, virt:0x7fb140c00000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:40
> Segment 12-12: IOVA:0x7fb140e00000, len:2097152, virt:0x7fb140e00000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:41
> Segment 12-13: IOVA:0x7fb141000000, len:2097152, virt:0x7fb141000000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:42
> Segment 12-14: IOVA:0x7fb141200000, len:2097152, virt:0x7fb141200000,
> socket_id:1, hugepage_sz:2097152, nchannel:0, nrank:0 fd:43


The testpmd(vhost-user) log:
sudo ./testpmd -l 0-1 -n 4 --socket-mem 1024,1024 --no-pci --vdev
'eth_vhost0,iface=/tmp/sock0' --file-prefix=host  --single-file-segments --
-i

VHOST_CONFIG: new vhost user connection is 38
> VHOST_CONFIG: new device, handle is 0
> VHOST_CONFIG: read message VHOST_USER_SET_OWNER
> VHOST_CONFIG: read message VHOST_USER_GET_FEATURES
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_CALL
> VHOST_CONFIG: vring call idx:0 file:39
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_CALL
> VHOST_CONFIG: vring call idx:1 file:40
> VHOST_CONFIG: read message VHOST_USER_SET_FEATURES
> VHOST_CONFIG: negotiated Virtio features: 0x910008000
> VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE
> VHOST_CONFIG: guest memory region 0, size: 0x200000
> guest physical addr: 0x7fb13f600000
> guest virtual  addr: 0x7fb13f600000
> host  virtual  addr: 0x7f5730c00000
> mmap addr : 0x7f5730c00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_KICK
> VHOST_CONFIG: vring kick idx:0 file:42
> VHOST_CONFIG: reallocate vq from 0 to 1 node
> VHOST_CONFIG: reallocate dev from 0 to 1 node
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_KICK
> VHOST_CONFIG: vring kick idx:1 file:43
> VHOST_CONFIG: reallocate vq from 0 to 1 node
> Port 0: queue state event
> VHOST_CONFIG: virtio is now ready for processing.
> Port 0: link state change event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 0
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 1
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE
> VHOST_CONFIG: guest memory region 0, size: 0x200000
> guest physical addr: 0x7fc13fe00000
> guest virtual  addr: 0x7fc13fe00000
> host  virtual  addr: 0x7f5730c00000
> mmap addr : 0x7f5730c00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 1, size: 0x200000
> guest physical addr: 0x7fc140000000
> guest virtual  addr: 0x7fc140000000
> host  virtual  addr: 0x7f5730a00000
> mmap addr : 0x7f5730a00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 2, size: 0x200000
> guest physical addr: 0x7fb13f600000
> guest virtual  addr: 0x7fb13f600000
> host  virtual  addr: 0x7f5730800000
> mmap addr : 0x7f5730800000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE
> VHOST_CONFIG: guest memory region 0, size: 0x200000
> guest physical addr: 0x7fc13fe00000
> guest virtual  addr: 0x7fc13fe00000
> host  virtual  addr: 0x7f5730c00000
> mmap addr : 0x7f5730c00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 1, size: 0x200000
> guest physical addr: 0x7fc140000000
> guest virtual  addr: 0x7fc140000000
> host  virtual  addr: 0x7f5730a00000
> mmap addr : 0x7f5730a00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 2, size: 0x200000
> guest physical addr: 0x7fb13f600000
> guest virtual  addr: 0x7fb13f600000
> host  virtual  addr: 0x7f5730800000
> mmap addr : 0x7f5730800000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 3, size: 0x200000
> guest physical addr: 0x7fb13f800000
> guest virtual  addr: 0x7fb13f800000
> host  virtual  addr: 0x7f5730600000
> mmap addr : 0x7f5730600000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 4, size: 0x200000
> guest physical addr: 0x7fb13fa00000
> guest virtual  addr: 0x7fb13fa00000
> host  virtual  addr: 0x7f5730400000
> mmap addr : 0x7f5730400000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE
> VHOST_CONFIG: guest memory region 0, size: 0x200000
> guest physical addr: 0x7fc13fe00000
> guest virtual  addr: 0x7fc13fe00000
> host  virtual  addr: 0x7f5730c00000
> mmap addr : 0x7f5730c00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 1, size: 0x200000
> guest physical addr: 0x7fc140000000
> guest virtual  addr: 0x7fc140000000
> host  virtual  addr: 0x7f5730a00000
> mmap addr : 0x7f5730a00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 2, size: 0x200000
> guest physical addr: 0x7fb13f600000
> guest virtual  addr: 0x7fb13f600000
> host  virtual  addr: 0x7f5730800000
> mmap addr : 0x7f5730800000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 3, size: 0x200000
> guest physical addr: 0x7fb13f800000
> guest virtual  addr: 0x7fb13f800000
> host  virtual  addr: 0x7f5730600000
> mmap addr : 0x7f5730600000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 4, size: 0x200000
> guest physical addr: 0x7fb13fa00000
> guest virtual  addr: 0x7fb13fa00000
> host  virtual  addr: 0x7f5730400000
> mmap addr : 0x7f5730400000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 5, size: 0x200000
> guest physical addr: 0x7fb13fc00000
> guest virtual  addr: 0x7fb13fc00000
> host  virtual  addr: 0x7f5730200000
> mmap addr : 0x7f5730200000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: guest memory region 6, size: 0x200000
> guest physical addr: 0x7fb13fe00000
> guest virtual  addr: 0x7fb13fe00000
> host  virtual  addr: 0x7f572be00000
> mmap addr : 0x7f572be00000
> mmap size : 0x200000
> mmap align: 0x200000
> mmap off  : 0x0
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 0 to qp idx: 1
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 0
> Port 0: queue state event
> VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE
> VHOST_CONFIG: set queue enable: 1 to qp idx: 1
> Port 0: queue state event


BR,
Wai
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16791): https://lists.fd.io/g/vpp-dev/message/16791
Mute This Topic: https://lists.fd.io/mt/74982077/21656
Mute #vpp: https://lists.fd.io/g/fdio+vpp-dev/mutehashtag/vpp
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to