DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Usage of example vhost (vhost-switch)
@ 2019-09-18  4:09 Derek
  2019-09-18  9:00 ` madhukar mythri
  0 siblings, 1 reply; 4+ messages in thread
From: Derek @ 2019-09-18  4:09 UTC (permalink / raw)
  To: users

Hi,

I try to run the vhost example in DPDK.

The steps I did are:

(1) The guest vm created by QEMU using the shell script
#!/bin/bash

USER_SOCK="/tmp/sock0"
MPATH="/dev/hugepages"
MEMSZ=2048
IMG=/home/derek/ubuntu-guest.img

qemu-system-x86_64 \
-boot c \
-machine accel=kvm -cpu host \
-m ${MEMSZ} -object
memory-backend-file,id=hugemem,size=${MEMSZ}M,mem-path=/dev/hugepages,share=on
\
-mem-prealloc -smp 2 -numa node,memdev=hugemem \
-chardev socket,id=char1,path=/tmp/sock0,server \
-netdev type=vhost-user,id=hostnet1,chardev=char1  \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:00:00:14 \
-drive format=raw,file=${IMG} -vnc :4,password -monitor stdio

(2) run the vhost-switch on the host
#> ./build/vhost-switch -l 0-3 -n 4--2 uge-dir /dev/hugepages --socket-mem
1024 --log-level 8 -w 00000:73:00.1 -- --socket-file /tmp/sock0 --client -p
0x1 --stats 20

(3) The guest vm is started successfully. Then, in the guest vm i did
#> ./x86_64-native-gcc/app/testpmd -l 0-1 -- -i
> start tx_first

I can see the TX packets on the host's vhost-switch  stats and got the
message
VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered

Device statistics =================================
Statistics for device 0
-----------------------
TX total:              32
TX dropped:            0
TX successful:         32
RX total:              0
RX dropped:            0
RX successful:         0
===================================================


My question is that how can I inject packets to the MAC address and VLAN ID
1000.
I've tried to setup a pktgen on another host whose physical NIC is directly
connected to the physical NIC port of the host. Then, set pktgen's dst mac
to 52:54:00:00:00:14 and vlan id to 1000. But the "Device statistics" is
not changed.

Any idea for this problem? Very thanks.

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

end of thread, other threads:[~2019-09-18 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18  4:09 [dpdk-users] Usage of example vhost (vhost-switch) Derek
2019-09-18  9:00 ` madhukar mythri
2019-09-18 13:55   ` Derek
2019-09-18 16:53     ` madhukar mythri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).