Repository navigation
Conversation
bindgen 0.47 panics on the _Complex _Float16 builtin that clang 15+ exposes, so bump it to 0.73 (and the clang crate to 2.x so both share clang-sys 1.x). rustfmt_bindings was removed upstream; rustfmt is now the default formatter. DPDK 23.11 ships rte_crc_generic.h next to rte_crc_x86.h; including both in the all-in-one header redefines the CRC functions, so skip it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since DPDK 21.x rte_get_main_lcore is an exported function rather than static inline, so it is absent from the generated lib.rs. Also look in dpdk.rs, and declare main_lcore_name for check-cfg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dpdk-sys wraps every static inline, including the TSX helpers (rte_xbegin, rte_try_tm, ...). With -march=native on a CPU without RTM, GCC refuses to inline _xbegin. DPDK gates these paths on rte_rtm_supported() at runtime, so enabling RTM codegen is safe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bindgen emits packed+align reprs for __tile1024i_str and rte_avp_desc, and packed structs containing the aligned rte_ether_addr for rte_arp_ipv4/rte_arp_hdr; rustc rejects both. Make them opaque. Also skip Debug for rte_flow_item_gtp_psc, whose packed field has none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Define _GNU_SOURCE for bindgen, clang and the wrapper build, so RTE_HAS_CPUSET is set and rte_lcore_cpuset/rte_thread_set_affinity are declared. - Use the RTE_ETH_* names (link status, MQ modes). - Read link_status through the new anonymous union in rte_eth_link. - Replace rxmode.max_rx_pkt_len with rxmode.mtu. - Build rss_hf from RTE_ETH_FLOW_* bits, since RTE_ETH_RSS_* are RTE_BIT64() macros bindgen cannot expand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Md Safiyat Reza <reza.safiyat@gmail.com>
Signed-off-by: Md Safiyat Reza <reza.safiyat@gmail.com>
Port::socket_id() panicked when rte_eth_dev_socket_id() returned SOCKET_ID_ANY (-1), as it does for a VF passed through to a VM. It now returns Option<SocketId>, and UninitPort::init places RX pools and rings on SOCKET_ID_ANY when the node is unknown. Requested RSS hash types are masked with flow_type_rss_offloads, since VFs often support fewer and rte_eth_dev_configure rejects the rest. Signed-off-by: Md Safiyat Reza <reza.safiyat@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes
dpdk-sysanddpdkbuild and run against DPDK 23.11 LTS with a current toolchain (clang 18, a recent stable Rust). Each commit fixes one build or runtime failure seen on the way, so it can be reviewed commit by commit.Build fixes (
dpdk-sys)clangto 2.x, so both shareclang-sys1.x)._Complex _Float16builtin that clang 15+ exposes.rustfmt_bindingsis gone upstream; rustfmt is now the default.rte_crc_generic.hin the all-in-one header. 23.11 ships it next torte_crc_x86.h, and including both redefines the CRC functions.rte_get_main_lcorein the bindgen output (dpdk.rs). Since DPDK 21.x it is an exported function rather thanstatic inline, so it never appears among the generated wrappers.main_lcore_nameis declared forcheck-cfg.-mrtmon x86_64.rte_xbegin,rte_try_tm, ...).-march=nativeon a CPU without RTM, GCC refuses to inline_xbegin.rte_rtm_supported()at runtime, so emitting RTM code is safe.packed+alignfor__tile1024i_strandrte_avp_desc.rte_arp_ipv4andrte_arp_hdrare packed structs that contain the alignedrte_ether_addr.Debugis skipped forrte_flow_item_gtp_psc, whose packed field has none._GNU_SOURCEfor bindgen, clang and the wrapper build. This setsRTE_HAS_CPUSET, sorte_lcore_cpusetandrte_thread_set_affinity(used byLCoreId::launch) are declared.ethdev API port (
dpdk)RTE_ETH_*names for link status and MQ modes.link_statusthrough the new anonymous union inrte_eth_link.rxmode.max_rx_pkt_lenwithrxmode.mtu.rss_hffromRTE_ETH_FLOW_*bits. TheRTE_ETH_RSS_*constants areRTE_BIT64()macros, which bindgen can't expand.Linking
+whole-archive, as DPDK's own static pkg-config does.-a 0000:xx:yy.zfails with "failed to parse device"), and no ports are found.ibverbs/mlx5special case is removed, because the system-library list below covers it.Libs.privateandRequires.privateinlibdpdk.pcandlibdpdk-libs.pc, each resolved withpkg-config --libs.pkg-config --static --libs libdpdkis too broad: it also pulls in the static-only dependencies of DPDK's dependencies (for example-lsystemdanddbusthrough libpcap, plus the RDMA providers), which a dynamic link doesn't need and which often aren't installed.Compatibility
RTE_ETH_*,rxmode.mtu) don't exist in older releases. If supporting older DPDK matters, this could go behind a feature or version check instead.+whole-archivelink modifier.