Skip to contentSkip to conversation

seg fault in InterVM communication using virtio

DISCUSSION Priyanka 3 participants 10 messages Feb 20, 2017 – Mar 2, 2017

lore
Share & tools
lore

Priyanka

author
#0 lore raw

Hi All,

We have 2 VM running on qemu-kvm hypervisor. We have provided vNIC to the VMs using macvtap device and virtio as the device model in bridge mode. We are running DPDK applications (udp client and server) on the VMs. We observe that the inter-VM communication is not happening using drivers i.e igb_uio and uio_pci_generic. We were able to communicate between the VMs properly using SRIOV. But we were not getting performance as expected so we switched to virtio. But using virtio the DPDK communication hangs after sending 128 packets. We also observe a seg fault in the dmesg of the VM.

Please provide us some guideline to do the inter-VM communication using virtio. Are we correct if we are using rte_eth_tx/rx_burst to send and receive packets from the vNIC.

Thanks,

Priyanka

#1 lore raw
Quoted 11 lines · Priyanka

Hi All,

We have 2 VM running on qemu-kvm hypervisor. We have provided vNIC to the VMs using macvtap device and virtio as the device model in bridge mode. We are running DPDK applications (udp client and server) on the VMs. We observe that the inter-VM communication is not happening using drivers i.e igb_uio and uio_pci_generic. We were able to communicate between the VMs properly using SRIOV. But we were not getting performance as expected so we switched to virtio. But using virtio the DPDK communication hangs after sending 128 packets. We also observe a seg fault in the dmesg of the VM.

Quoted 3 lines

Please provide us some guideline to do the inter-VM communication using virtio. Are we correct if we are using rte_eth_tx/rx_burst to send and receive packets from the vNIC.

Would you provide more info, say how do you start the vm, and how do you run the dpdk apps? Providing all the commands that could reproduce your issue will be better.

	--yliu
#2 lore raw

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

*./build/app/dpdkapi -c 1 -- -p 1* where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Thanks,

Mitali

Quoted 20 lines · Yuanhan Liu
Quoted 11 lines · Priyanka

Hi All,

We have 2 VM running on qemu-kvm hypervisor. We have provided vNIC to the VMs using macvtap device and virtio as the device model in bridge mode. We are running DPDK applications (udp client and server) on the VMs. We observe that the inter-VM communication is not happening using drivers i.e igb_uio and uio_pci_generic. We were able to communicate between the VMs properly using SRIOV. But we were not getting performance as expected so we switched to virtio. But using virtio the DPDK communication hangs after sending 128 packets. We also observe a seg fault in the dmesg of the VM.

Quoted 3 lines

Please provide us some guideline to do the inter-VM communication using virtio. Are we correct if we are using rte_eth_tx/rx_burst to send and receive packets from the vNIC.

Would you provide more info, say how do you start the vm, and how do you run the dpdk apps? Providing all the commands that could reproduce your issue will be better.

	--yliu
#3 lore raw
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu
#4 lore raw

Hi,

We have some doubt regarding virtio front end. As we are running dpdk application inside VM with virtio setup, do we need to use virtio specific functions like virtio_recv_pkts() and virtio_xmit_pkts() to receive and transmit packets, functions for port initialization like virtio_dev_queue_setup()? If yes, we are unable to find any application which uses these functions. Can you provide us some pointers on examples which uses these functions.

Thanks,
Mitali

Quoted 24 lines · Yuanhan Liu
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu
author
#9 lore raw
In reply to Yuanhan Liu

Hi,

We have some doubt regarding virtio front end. As we are running dpdk application inside VM with virtio setup, do we need to use virtio specific functions like virtio_recv_pkts() and virtio_xmit_pkts() to receive and transmit packets, functions for port initialization like virtio_dev_queue_setup()? If yes, we are unable to find any application which uses these functions. Can you provide us some pointers on examples which uses these functions.

Thanks,
Priyanka

Quoted 25 lines · Yuanhan Liu
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu
#5 lore raw
In reply to mitali
Quoted 9 lines · mitali

Hi,

We have some doubt regarding virtio front end. As we are running dpdk application inside VM with virtio setup, do we need to use virtio specific functions like virtio_recv_pkts() and virtio_xmit_pkts() to receive and transmit packets, functions for port initialization like virtio_dev_queue_setup()? If yes, we are unable to find any application which uses these functions. Can you provide us some pointers on examples which uses these functions.

If you are running DPDK inside guest (with virtio), then the virtio is yet another PMD, meaning you should program it with the normal DPDK ethdev APIs, something like rte_eth_dev_configure, rte_eth_rx/tx_queue_setup, etc.

	--yliu
Quoted 29 lines

Thanks,
Mitali

Quoted 24 lines · Yuanhan Liu
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu
#6 lore raw

Hi,

Ok. But with other PMDs like igb, when we are providing sriov vf to VM and running our client/server dpdk application then there is no issue in communication between VMs.
As soon as we use virtio setup for VMs and running same dpdk application, it stops after sending 127 packet and seg fault comes while executing rte_eth_tx_burst(). We are still not clear why with virtio its creating this issue but not with any other PMD.

Mitali

Quoted 44 lines · Yuanhan Liu
Quoted 9 lines · mitali

Hi,

We have some doubt regarding virtio front end. As we are running dpdk application inside VM with virtio setup, do we need to use virtio specific functions like virtio_recv_pkts() and virtio_xmit_pkts() to receive and transmit packets, functions for port initialization like virtio_dev_queue_setup()? If yes, we are unable to find any application which uses these functions. Can you provide us some pointers on examples which uses these functions.

If you are running DPDK inside guest (with virtio), then the virtio is yet another PMD, meaning you should program it with the normal DPDK ethdev APIs, something like rte_eth_dev_configure, rte_eth_rx/tx_queue_setup, etc.

	--yliu
Quoted 28 lines

Thanks,
Mitali

Quoted 24 lines · Yuanhan Liu
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu
#7 lore raw
Quoted 9 lines · mitali

Hi,

Ok. But with other PMDs like igb, when we are providing sriov vf to VM and running our client/server dpdk application then there is no issue in communication between VMs.
As soon as we use virtio setup for VMs and running same dpdk application, it stops after sending 127 packet and seg fault comes while executing rte_eth_tx_burst(). We are still not clear why with virtio its creating this issue but not with any other PMD.

No idea. You don't provide any further details. Please, would you just enable the debug info, rebuild, run it with gdb and then dump the call stack after crash?

	--yliu
Quoted 48 lines

Mitali

Quoted 44 lines · Yuanhan Liu
Quoted 9 lines · mitali

Hi,

We have some doubt regarding virtio front end. As we are running dpdk application inside VM with virtio setup, do we need to use virtio specific functions like virtio_recv_pkts() and virtio_xmit_pkts() to receive and transmit packets, functions for port initialization like virtio_dev_queue_setup()? If yes, we are unable to find any application which uses these functions. Can you provide us some pointers on examples which uses these functions.

If you are running DPDK inside guest (with virtio), then the virtio is yet another PMD, meaning you should program it with the normal DPDK ethdev APIs, something like rte_eth_dev_configure, rte_eth_rx/tx_queue_setup, etc.

	--yliu
Quoted 28 lines

Thanks,
Mitali

Quoted 24 lines · Yuanhan Liu
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu
#8 lore raw

Hi,

I rebuild dpdk with debug enabled and running the same dpdk application.

Please go through the attached images showing the error as well as call stack.

Mitali

Quoted 62 lines · Yuanhan Liu
Quoted 9 lines · mitali

Hi,

Ok. But with other PMDs like igb, when we are providing sriov vf to VM and running our client/server dpdk application then there is no issue in communication between VMs.
As soon as we use virtio setup for VMs and running same dpdk application, it stops after sending 127 packet and seg fault comes while executing rte_eth_tx_burst(). We are still not clear why with virtio its creating this issue but not with any other PMD.

No idea. You don't provide any further details. Please, would you just enable the debug info, rebuild, run it with gdb and then dump the call stack after crash?

	--yliu
Quoted 47 lines

Mitali

Quoted 44 lines · Yuanhan Liu
Quoted 9 lines · mitali

Hi,

We have some doubt regarding virtio front end. As we are running dpdk application inside VM with virtio setup, do we need to use virtio specific functions like virtio_recv_pkts() and virtio_xmit_pkts() to receive and transmit packets, functions for port initialization like virtio_dev_queue_setup()? If yes, we are unable to find any application which uses these functions. Can you provide us some pointers on examples which uses these functions.

If you are running DPDK inside guest (with virtio), then the virtio is yet another PMD, meaning you should program it with the normal DPDK ethdev APIs, something like rte_eth_dev_configure, rte_eth_rx/tx_queue_setup, etc.

	--yliu
Quoted 28 lines

Thanks,
Mitali

Quoted 24 lines · Yuanhan Liu
Quoted 8 lines · mitali

Hi Yuanhan,

We are using virt-manager to start the VMs. We are attaching the image which shows the vNIC setup for the VMs.

We have written our own dpdk application to send and receive UDP packets. The command we are using is

Quoted 8 lines

./build/app/dpdkapi -c 1 -- -p 1 where dpdkapi is our application.

Inside the application we are sending and receiving packets from vNIC using rte_eth_tx_burst() and rte_eth_rx_burst().

At the sender side after 127 packets the application stops and we observe a seg fault in dmesg. Using the print statements we observed that it faults in rte_eth_tx_burst(). All the 127 were received at the receiving VM.

Would you recompile dpdk with debug info enaled, which could be done by:

	make ... EXTRA_CFLAGS='-g3 -O0'

And run it with gdb then dump the call stack?

	--yliu