DPDK usage discussions
 help / color / 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

* Re: [dpdk-users] Usage of example vhost (vhost-switch)
  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
  0 siblings, 1 reply; 4+ messages in thread
From: madhukar mythri @ 2019-09-18  9:00 UTC (permalink / raw)
  To: Derek; +Cc: users

Did you configured the testpmd with "io" forwarding mode?
you can cross-check with this command: "show config rxtx".
For more information, you can go-through this testpmd documentation under
"4.4.7" section:
https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html

~~ Madhukar.

On Wed, Sep 18, 2019 at 9:39 AM Derek <jwsu1986@gmail.com> wrote:

> 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

* Re: [dpdk-users] Usage of example vhost (vhost-switch)
  2019-09-18  9:00 ` madhukar mythri
@ 2019-09-18 13:55   ` Derek
  2019-09-18 16:53     ` madhukar mythri
  0 siblings, 1 reply; 4+ messages in thread
From: Derek @ 2019-09-18 13:55 UTC (permalink / raw)
  To: madhukar mythri, users

Hi,  Madhukar

The io forwarding mode is set.
One question is
when using pktgen generates packets to the host, in addition to the vlan id
and mac, does it need to set the IP of source NIC and dst NIC?

Thanks,
Derek

madhukar mythri <madhukar.mythri@gmail.com> 於 2019年9月18日 週三 下午5:00寫道:

> Did you configured the testpmd with "io" forwarding mode?
> you can cross-check with this command: "show config rxtx".
> For more information, you can go-through this testpmd documentation under
> "4.4.7" section:
> https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html
>
> ~~ Madhukar.
>
> On Wed, Sep 18, 2019 at 9:39 AM Derek <jwsu1986@gmail.com> wrote:
>
>> 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

* Re: [dpdk-users] Usage of example vhost (vhost-switch)
  2019-09-18 13:55   ` Derek
@ 2019-09-18 16:53     ` madhukar mythri
  0 siblings, 0 replies; 4+ messages in thread
From: madhukar mythri @ 2019-09-18 16:53 UTC (permalink / raw)
  To: Derek; +Cc: users

IP addresses are not required to set.
Did you cross check the log-file of OVS, whether started successfully on
the PF.

On Wed, Sep 18, 2019, 7:25 PM Derek <jwsu1986@gmail.com> wrote:

> Hi,  Madhukar
>
> The io forwarding mode is set.
> One question is
> when using pktgen generates packets to the host, in addition to the vlan
> id and mac, does it need to set the IP of source NIC and dst NIC?
>
> Thanks,
> Derek
>
> madhukar mythri <madhukar.mythri@gmail.com> 於 2019年9月18日 週三 下午5:00寫道:
>
>> Did you configured the testpmd with "io" forwarding mode?
>> you can cross-check with this command: "show config rxtx".
>> For more information, you can go-through this testpmd documentation under
>> "4.4.7" section:
>> https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html
>>
>> ~~ Madhukar.
>>
>> On Wed, Sep 18, 2019 at 9:39 AM Derek <jwsu1986@gmail.com> wrote:
>>
>>> 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, back to index

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

DPDK usage discussions

Archives are clonable:
	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


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


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