Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - QEMU virtio-net networking issue (QNX 7 generic x86_64 image): (4 Items)
   
QEMU virtio-net networking issue (QNX 7 generic x86_64 image)  
Hello all,

I am running QNX 7 on latest mainline QEMU, and after some fiddling around I got it to work.

I encountered a few issues with networking, the most important one being a regression with virtio-net.

I have investigated the issue and reported it to QEMU in this thread.
I am currently disabling ioeventfd as a workaround, and this is making my networking stable, including host TCP and UDP 
forwarding to the guest.

https://www.mail-archive.com/qemu-devel@nongnu.org/msg561163.html

Maybe something is going wrong between the QNX guest driver and the QEMU device?

-----

A second minor issue is that the generic x86 build file does not contain a section for virtio-net,
nor any PCI-IDs that seem to match emulated devices in QEMU.

After creating that section, and with the regression fix applied to QEMU, everything works fine.
I also added INTEL_8086_100e=8086/100e as a PCI-ID for the e1000 driver, which QEMU exposes.

Note that host port forwarding only seems to work with virtio-net (and only after patching QEMU to disable ioeventfd).

Maybe it would be helpful to add something like the following to the generic x86_64 build file?

My current change is:

--- x86_64-generic.build.save	2018-07-31 15:24:03.277092184 +0200
+++ x86_64-generic.build	2018-09-19 14:25:15.935782840 +0200
@@ -215,6 +215,7 @@
 libsocket.so
 devnp-e1000.so
 devnp-rtl8169.so
+devnp-virtio.so
 libcrypto.so
 
 
@@ -231,6 +232,7 @@
 STD_NULL=/dev/null
 
 # supported list for the network devices
+INTEL_8086_100e=8086/100e
 INTEL_8086_100f=8086/100f
 INTEL_8086_1559=8086/1559
 INTEL_8086_1570=8086/1570
@@ -240,6 +242,8 @@
 INTEL_8086_1503=8086/1503
 INTEL_8086_1f41=8086/1f41
 RTL_RTL8169=10ec/8168
+VIRTIO_NET_OLD=1af4/1000
+VIRTIO_NET_NEW=1af4/1041
 
 # uncomment the line below if any driver use the old PCI API's
 export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so
@@ -252,6 +256,7 @@
 
 #check if there is the Intel E1000 Ethernet device in the list
 if  grep $INTEL_8086_100f $PCI_DEVICE_LIST > $STD_NULL || \
+	grep $INTEL_8086_100e $PCI_DEVICE_LIST > $STD_NULL || \
 	grep $INTEL_8086_1559 $PCI_DEVICE_LIST > $STD_NULL || \
 	grep $INTEL_8086_1570 $PCI_DEVICE_LIST > $STD_NULL || \
 	grep $INTEL_8086_15a3 $PCI_DEVICE_LIST > $STD_NULL || \
@@ -269,10 +274,18 @@
 elif grep $RTL_RTL8169 $PCI_DEVICE_LIST > $STD_NULL
 then
 	echo "Starting RTL8169 Ethernet driver ..."
-	io-pkt-v6-hc -d rtl8169
+	io-pkt-v4-hc -d rtl8169
 	if_up -r 10 -p rt0
 	ifconfig rt0 up
 
+elif grep $VIRTIO_NET_NEW $PCI_DEVICE_LIST > $STD_NULL || \
+	grep $VIRTIO_NET_OLD $PCI_DEVICE_LIST > $STD_NULL
+then
+	echo "Starting virtio-net driver ..."
+        io-pkt-v6-hc -d virtio
+        if_up -r 10 -p vt0
+        ifconfig vt0 up
+
 else
 	echo "No Ethernet device has been detected"
 	exit 0;




Re: QEMU virtio-net networking issue (QNX 7 generic x86_64 image)  
fixed the build file patch, there were unrelated changes that crept in (v6->v4).

Here is the fixed patch (also attached).

--- x86_64-generic.build.save	2018-07-31 15:24:03.277092184 +0200
+++ x86_64-generic.build	2018-09-19 14:31:46.174254266 +0200
@@ -215,6 +215,7 @@
 libsocket.so
 devnp-e1000.so
 devnp-rtl8169.so
+devnp-virtio.so
 libcrypto.so
 
 
@@ -231,6 +232,7 @@
 STD_NULL=/dev/null
 
 # supported list for the network devices
+INTEL_8086_100e=8086/100e
 INTEL_8086_100f=8086/100f
 INTEL_8086_1559=8086/1559
 INTEL_8086_1570=8086/1570
@@ -240,6 +242,8 @@
 INTEL_8086_1503=8086/1503
 INTEL_8086_1f41=8086/1f41
 RTL_RTL8169=10ec/8168
+VIRTIO_NET_OLD=1af4/1000
+VIRTIO_NET_NEW=1af4/1041
 
 # uncomment the line below if any driver use the old PCI API's
 export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so
@@ -252,6 +256,7 @@
 
 #check if there is the Intel E1000 Ethernet device in the list
 if  grep $INTEL_8086_100f $PCI_DEVICE_LIST > $STD_NULL || \
+	grep $INTEL_8086_100e $PCI_DEVICE_LIST > $STD_NULL || \
 	grep $INTEL_8086_1559 $PCI_DEVICE_LIST > $STD_NULL || \
 	grep $INTEL_8086_1570 $PCI_DEVICE_LIST > $STD_NULL || \
 	grep $INTEL_8086_15a3 $PCI_DEVICE_LIST > $STD_NULL || \
@@ -273,6 +278,14 @@
 	if_up -r 10 -p rt0
 	ifconfig rt0 up
 
+elif grep $VIRTIO_NET_NEW $PCI_DEVICE_LIST > $STD_NULL || \
+	grep $VIRTIO_NET_OLD $PCI_DEVICE_LIST > $STD_NULL
+then
+	echo "Starting virtio-net driver ..."
+        io-pkt-v6-hc -d virtio
+        if_up -r 10 -p vt0
+        ifconfig vt0 up
+
 else
 	echo "No Ethernet device has been detected"
 	exit 0;
Attachment: Text x86_64-generic.build.diff 1.42 KB
Re: QEMU virtio-net networking issue (QNX 7 generic x86_64 image)  
Hi Claudio,
We had found this issue with the "virtio-net ctrl missing headers" and have resolved it but it hasn't yet completed 
testing and been generally released. The issue id is 2554032, please contact your support representative to see about 
obtaining the fix.
Regards,
Nick.
Re: QEMU virtio-net networking issue (QNX 7 generic x86_64 image)  
> Hello all,
> 
> I am running QNX 7 on latest mainline QEMU, and after some fiddling around I 
> got it to work.
> 
> I encountered a few issues with networking, the most important one being a 
> regression with virtio-net.
> 
> I have investigated the issue and reported it to QEMU in this thread.
> I am currently disabling ioeventfd as a workaround, and this is making my 
> networking stable, including host TCP and UDP forwarding to the guest.
> 
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg561163.html
> 
> Maybe something is going wrong between the QNX guest driver and the QEMU 
> device?
> 
> -----
> 
> A second minor issue is that the generic x86 build file does not contain a 
> section for virtio-net,
> nor any PCI-IDs that seem to match emulated devices in QEMU.
> 
> After creating that section, and with the regression fix applied to QEMU, 
> everything works fine.
> I also added INTEL_8086_100e=8086/100e as a PCI-ID for the e1000 driver, which
>  QEMU exposes.
> 
> Note that host port forwarding only seems to work with virtio-net (and only 
> after patching QEMU to disable ioeventfd).
> 
> Maybe it would be helpful to add something like the following to the generic 
> x86_64 build file?
> 
> My current change is:
> 
> --- x86_64-generic.build.save	2018-07-31 15:24:03.277092184 +0200
> +++ x86_64-generic.build	2018-09-19 14:25:15.935782840 +0200
> @@ -215,6 +215,7 @@
>  libsocket.so
>  devnp-e1000.so
>  devnp-rtl8169.so
> +devnp-virtio.so
>  libcrypto.so
>  
>  
> @@ -231,6 +232,7 @@
>  STD_NULL=/dev/null
>  
>  # supported list for the network devices
> +INTEL_8086_100e=8086/100e
>  INTEL_8086_100f=8086/100f
>  INTEL_8086_1559=8086/1559
>  INTEL_8086_1570=8086/1570
> @@ -240,6 +242,8 @@
>  INTEL_8086_1503=8086/1503
>  INTEL_8086_1f41=8086/1f41
>  RTL_RTL8169=10ec/8168
> +VIRTIO_NET_OLD=1af4/1000
> +VIRTIO_NET_NEW=1af4/1041
>  
>  # uncomment the line below if any driver use the old PCI API's
>  export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so
> @@ -252,6 +256,7 @@
>  
>  #check if there is the Intel E1000 Ethernet device in the list
>  if  grep $INTEL_8086_100f $PCI_DEVICE_LIST > $STD_NULL || \
> +	grep $INTEL_8086_100e $PCI_DEVICE_LIST > $STD_NULL || \
>  	grep $INTEL_8086_1559 $PCI_DEVICE_LIST > $STD_NULL || \
>  	grep $INTEL_8086_1570 $PCI_DEVICE_LIST > $STD_NULL || \
>  	grep $INTEL_8086_15a3 $PCI_DEVICE_LIST > $STD_NULL || \
> @@ -269,10 +274,18 @@
>  elif grep $RTL_RTL8169 $PCI_DEVICE_LIST > $STD_NULL
>  then
>  	echo "Starting RTL8169 Ethernet driver ..."
> -	io-pkt-v6-hc -d rtl8169
> +	io-pkt-v4-hc -d rtl8169
>  	if_up -r 10 -p rt0
>  	ifconfig rt0 up
>  
> +elif grep $VIRTIO_NET_NEW $PCI_DEVICE_LIST > $STD_NULL || \
> +	grep $VIRTIO_NET_OLD $PCI_DEVICE_LIST > $STD_NULL
> +then
> +	echo "Starting virtio-net driver ..."
> +        io-pkt-v6-hc -d virtio
> +        if_up -r 10 -p vt0
> +        ifconfig vt0 up
> +
>  else
>  	echo "No Ethernet device has been detected"
>  	exit 0;
> 
> 
> 
> 


Attachment: Text 111.txt 3 bytes