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

[VPP-2119] Provide TP_STATUS_CSUM_VALID, TP_STATUS_CSUMNOTREADY for host-interfaces #3580

Open
vvalderrv opened this issue Feb 2, 2025 · 0 comments

Comments

@vvalderrv
Copy link
Contributor

Description

In order to connect kernel interfaces into VPP's dataplane, VPP uses host-interfaces , and VPP applications use AF_PACKET type sockets to implement host interfaces.

As packets which are received by the AF_PACKET type socket are exact copies of the packets that are received on the interface, the TCP checksum field will not be recalculated to contain a full checksum when the packet is copied to the socket.

Instead, if a GRO offloaded packet with a partial checksum is received, the copy that is sent into the userspace application will contain the same partial checksum. VPP plugins that wish to verify checksums must thus be prepared to verify full or partial checksums.

However, on Linux, userspace applications setting the PACKET_AUXDATA socket option with setsockopt(SOL_PACKET, PACKET_AUXDATA, 1) can receive auxiliary data from the kernel containing the tp_status field which itself holds flags TP_STATUS_CSUM_VALID and TP_STATUS_CSUMNOTREADY. These flags are used to communicate to userspace that the kernel already (partially) verified the transport layer checksum:

TP_STATUS_CSUM_VALID  : This flag indicates that at least the transport

                        header checksum of the packet has been already

                        validated on the kernel side. If the flag is not set

                        then we are free to check the checksum by ourselves

                        provided that TP_STATUS_CSUMNOTREADY is also not set. 

It would be nice to be able to access this packet auxdata for VPP host interfaces, so that plugins which verify checksums can rely on the kernel provided data. The advantabe being that the VPP plugin doesn't have to recalculate the checksum in all cases, and it also avoids issues with partial vs full checksum calculation.

Assignee

Unassigned

Reporter

Andreas Karis

Comments

No comments.

Original issue: https://jira.fd.io/browse/VPP-2119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant