[WIP] Fix build errors caused by latest XDP submodule #5525
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.
Fix XDP submodule build failures after update
Problem
After updating the XDP submodule from commit
793dc2ato23fbfdd, all Windows builds were failing with compilation errors like:error C2065: 'XDP_TX_PACKET': undeclared identifiererror C2065: 'XdpFrameTxChecksumActionPassthrough': undeclared identifiererror C2065: 'XdpFrameLayer3TypeIPv4NoOptions': undeclared identifiererror C2065: 'XdpFrameTxChecksumActionRequired': undeclared identifierRoot Cause
The file
src/platform/datapath_raw_xdp_win.cuses XDP offload types and enums (XDP_FRAME_LAYOUT,XDP_FRAME_CHECKSUM,XdpFrameTxChecksumActionPassthrough, etc.) but was not explicitly including<xdp/offload.h>.These types are defined in
xdp/offload.hin the XDP submodule, but this header is not transitively included by any other XDP headers. The build likely worked before due to some implicit includes that may have changed with the XDP update.Solution
#include <xdp/offload.h>todatapath_raw_xdp_win.cChanges Made
Added a single line to
src/platform/datapath_raw_xdp_win.c:This provides the definitions for:
XDP_FRAME_LAYOUTstructXDP_FRAME_CHECKSUMstructXdpFrameTxChecksumActionPassthroughenum valueXdpFrameTxChecksumActionRequiredenum valueXdpFrameLayer3TypeIPv4NoOptionsenum valueXdpFrameLayer3TypeIPv6NoExtensionsenum valueXdpFrameLayer4TypeTcpenum valueXdpFrameLayer4TypeUdpenum valueVerification
✅ All required types verified to exist in
xdp/offload.hin the updated XDP submodule (commit23fbfdd)✅ No other source files affected (only
datapath_raw_xdp_win.cuses these types)✅ Linux XDP files don't need this header (they don't use these Windows-specific offload types)
Original prompt
Fixes #5524
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.