Imx8qm XEN ethernet passthrough

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Imx8qm XEN ethernet passthrough

1,238 Views
jsah
Contributor I

I'm working with imx8qm board and have tried to get ethernet (fec1) device passthrough to work in the NXP provided XEN VM environment.
The ethernet device was not directly setup for passthrough so (in short) i had to change the devices a bit by enabling iommu on fec1 on dom0 and add the fec1 devices to domu tree.

I ended up with a guest in which i was able to see fec1 as an ethernet device and turn the link on & off on command line. However no data was actually coming through to guest. I narrowed down the issue to a problem with interrupts not getting through to guest (or possibly not even to host either).

Would you happen to have example or can you provide some assistance for getting ethernet device passed through to guest in XEN?


For now my team has a temporary solution of using USB ethernet adapter but we would rather use the on board adapter as we have other plans for usb devices.

0 Kudos
Reply
4 Replies

1,221 Views
hector_delgado
NXP TechSupport
NXP TechSupport

Hi @jsah ,

I hope you're doing well. Could you let me know your BSP version? 

Thanks in advance.

Best regards,
Hector.

0 Kudos
Reply

1,219 Views
jsah
Contributor I

For XEN i have tried with imx_4.14.98_2.0.0_ga

My actual goal is to get passthrough working in KVM in which i have tried with lf-5.15.y. With both XEN and QEMU/KVM the results are exactly the same. I'm getting the device visible and mostly operational in guest but there is no interrupts coming through.

More details of the QEMU/KVM work in different ticket:

https://community.nxp.com/t5/i-MX-Processors/Imx8qm-qemu-ethernet-passthrough-almost-working/m-p/154...

We have managed to get GPU passthrough to work with imx8qm (both in XEN and QEMU/KVM) with lf-5.15.y so our environment should be okay.

Even though my eventual goal is working with QEMU/KVM I'm happy to do the setup in XEN first to get things working.

0 Kudos
Reply

1,179 Views
hector_delgado
NXP TechSupport
NXP TechSupport

Hi @jsah ,

Sorry for the late response. Just to be completely sure, have you checked XEN's documentation on device passthrough? Details and examples can be found there (https://xenbits.xen.org/docs/unstable/misc/arm/passthrough.txt).

If so, are the connections (bridge/NAT mode) for guests and Dom0 set up correctly? 

Thanks in advance.

Best regards,
Hector.

0 Kudos
Reply

1,043 Views
jsah
Contributor I
We basically stopped working with imx8 board as it was not sufficient for our needs.
We have managed to get GPU passthrough working in XEN (and also in QEMU/KVM).
So Yes we have studied XEN passthrough documentation and examples but NXP examples do no provide networking device passthrough for XEN so we are kind of on our own there.
We have tried to apply similar methods as what worked with GPU passthrough for ethernet device with some success.
Currently the ethernet device can be seen in guest (both in XEN and KVM) but the problem is that the ethernet device interrupts do not get to the guest kernel. I can see the interrupts are set for vfio in host but still nothing goes through to guest.

If I'm not mistaken bridge/NAT mode are for routing the network traffic from host to guest and NOT related to this issue. We can use virtual networking between host and guest in routed or NAT mode but that is not what we want to do.
0 Kudos
Reply