OpenDataPlane / odp

The ODP project is an open-source, cross-platform set of application programming interfaces (APIs) for the networking data plane

Home Page:https://opendataplane.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid packets received when using vfio-pci driver

bogdanPricope opened this issue · comments

ODP-DPDK v1.37.1.0
Platform: linux-generic
Config options: --enable-dpdk --enable-dpdk-zero-copy
Driver: vfio-pci

Issue: odp-dpdk returns invalid (zeroed) packets when using vfio-pci driver with linux-generic platform.

AFAIK, it works fine with following combination:
Platform: linux-generic and uio_pci_generic
Platform: linux-dpdk and drivers uio_pci_generic, vfio-pci

E,g: For code:
printf("Pkt len: %d: data: %p\n", odp_packet_len(pkt), odp_packet_data(pkt));

	if (odp_packet_l2_ptr(pkt, NULL)) {
		p = odp_packet_l2_ptr(pkt, &len);

		printf("L2: %p %d: ", p, len);
		for (i = 0; i < 14; i++)
			printf("%x ", *(p + i));
		printf("\n");
	}

	if (odp_packet_l3_ptr(pkt, NULL)) {
		p = odp_packet_l3_ptr(pkt, &len);
		printf("L3: %p %d: ", p, len);
		for (i = 0; i < 20; i++)
			printf("%x ", *(p + i));
		printf("\n");
	}

I am getting
Pkt len: 60: data: 0x7f65f535c300
L2: 0x7f65f535c300 60: 0 0 0 0 0 0 0 0 0 0 0 0 0 0
L3: 0x7f65f535c316 38: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Pkt len: 60: data: 0x7f65f535b7c0
L2: 0x7f65f535b7c0 60: 0 0 0 0 0 0 0 0 0 0 0 0 0 0
L3: 0x7f65f535b7d6 38: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

I've also bumped into this issue with zero-copy DPDK pktio. This happens possibly due to missing IOMMU mappings for packet memory. As you've noticed, a workaround is to use igb_ui driver or copy mode.

Hi Matias,

It works fine on the same machine but with linux-dpdk platform. It is likely an ODP issue.

I am using the following boot params:
ro quiet splash iommu=pt intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 default_hugepagesz=2M hugepagesz=2M hugepages=4096 vt.handoff=7

Do you see something wrong with those params?

Hi Bogdan,

Your boot parameters seem fine. I meant IOMMU mapping could be missing from odp-linux zero-copy pktio code, where ODP packet buffers are passed to DPDK. ODP-DPDK is working as it uses "native" DPDK pools/buffers.