Bug 1376 - A BPF can no longer include header rte_mbuf_core.h
Summary: A BPF can no longer include header rte_mbuf_core.h
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: other (show other bugs)
Version: 23.11
Hardware: x86 Linux
: Normal major
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2024-01-30 16:42 CET by Michel Machado
Modified: 2024-01-30 22:27 CET (History)
1 user (show)



Attachments
Compilation errors for t2.c and t3.c (710 bytes, text/plain)
2024-01-30 16:42 CET, Michel Machado
Details

Description Michel Machado 2024-01-30 16:42:05 CET
Created attachment 272 [details]
Compilation errors for t2.c and t3.c

A BPF needs to include the header <rte_mbuf_core.h> to access struct rte_mbuf. But the current version of the header <rte_mbuf_core.h> cannot be included in a BPF. The attached file shows the errors one gets while compiling the files examples/bpf/t2.c and examples/bpf/t3.c.
Comment 1 Tyler Retzlaff 2024-01-30 20:15:48 CET
(In reply to Michel Machado from comment #0)
> Created attachment 272 [details]
> Compilation errors for t2.c and t3.c
> 
> A BPF needs to include the header <rte_mbuf_core.h> to access struct
> rte_mbuf. But the current version of the header <rte_mbuf_core.h> cannot be
> included in a BPF. The attached file shows the errors one gets while
> compiling the files examples/bpf/t2.c and examples/bpf/t3.c.

a bug was fixed where rte_arch_bswap16 was being hidden except when
RTE_FORCE_INTRINSICS was defined.

i suspect -t bpf should likely define RTE_FORCE_INTRINSICS since it
seems generally unreasonable to have x86 inline asm in a bpf translation
unit.

if there are problems with RTE_FORCE_INTRINSICS they'll have to be
addressed as separate bugs.
Comment 2 Michel Machado 2024-01-30 22:27:53 CET
Adding "-D RTE_FORCE_INTRINSICS" to the parameters of clang works around the problem. This is a reasonable workaround while the headers are being patched to identify -t bpf. Thank you, Tyler, for the suggestion.

Note You need to log in before you can comment on or make changes to this bug.