Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AF_XDP transmit checksum offload #375

Merged
merged 33 commits into from
Dec 17, 2024
Merged

Conversation

mtfriesen
Copy link
Contributor

@mtfriesen mtfriesen commented Aug 11, 2023

Description

Describe the purpose of and changes within this Pull Request.

Add AF_XDP transmit checksum offload: add a socket option to enable the offload, as well as socket options to query the assigned extension offsets within each AF_XDP frame descriptor.

Testing

Do any existing tests cover this change? Are new tests needed?

Added functional and spin tests.

Documentation

Is there any documentation impact for this change?

No, this is still in experimental headers. There is some documentation added to those headers.

Installation

Is there any installer impact for this change?

No.

@mtfriesen mtfriesen added feature request New feature or request offloads Hardware and software offloads af_xdp APIs API design and implementation labels Jul 18, 2024
@mtfriesen mtfriesen requested review from a team and removed request for a team December 10, 2024 21:58
@mtfriesen mtfriesen changed the title Provide minimum UDP checksum and segmentation offload Add AF_XDP transmit checksum offload Dec 16, 2024
@mtfriesen mtfriesen marked this pull request as ready for review December 16, 2024 22:21
@mtfriesen mtfriesen requested a review from a team as a code owner December 16, 2024 22:21
@@ -94,6 +95,8 @@ XdpExtensionSetAssignLayout(
UINT8 MaxAlignment = BaseAlignment;
UINT8 CurrentAlignment;

FRE_ASSERT(!ExtensionSet->LayoutAssigned);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you choose a free assert instead of a debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module includes enforcement of the native XDP driver API, so these FRE_ASSERTs are designed to detect driver misbehavior on any system, not just with CHK builds. It's not a performance-sensitive path.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you had support for driver verifier, would you enable these only if driver verifier was enabled? QUIC has 4 types of assert validation:

  • Debug
  • Telemetry
  • Free
  • Verifier

We haven't made a huge distinction, but the verifier ones are nice if the assert is about external conformance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we would ideally have a separate verifier mode. Right now we just have debug/release builds, plus a knob to make the debug build also inject random failures.

src/xdp/xsk.c Show resolved Hide resolved
src/xdp/xsk.c Outdated Show resolved Hide resolved
src/xdp/xsk.c Show resolved Hide resolved
src/xdplwf/send.c Outdated Show resolved Hide resolved
@mtfriesen mtfriesen merged commit 16ca3c0 into main Dec 17, 2024
53 checks passed
@mtfriesen mtfriesen deleted the mtfriesen/udp_checksum_uso_poc branch December 17, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
af_xdp APIs API design and implementation feature request New feature or request offloads Hardware and software offloads
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants