feat(phy): add TCP segmentation support#1
Open
cagatay-y wants to merge 2 commits intohermit-os:mainfrom
Open
Conversation
mkroening
requested changes
Mar 11, 2026
Member
mkroening
left a comment
There was a problem hiding this comment.
The code looks good to me, though I am not too familiar with smoltcp's internals.
The PR could use a description discussing the design and differentiating itself from smoltcp-rs#830, though.
Furthermore, CI does not pass at the moment.
I have updated our fork, so if you force-push, the commits should show up more nicely.
66cbb06 to
4e99514
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
577b356 to
1f2bb37
Compare
f4a6220 to
a8877fc
Compare
It is possible for packets larger than the current capture limits to be sent with the segmentation offload feature.
a8877fc to
1b220b0
Compare
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.
The Windows and Linux documentations for the same feature were used as references. It was more difficult to find information on how devices support the feature, so the interface is mostly based on how virtio-net devices expect to be driven. The code was tested on the Hermit kernel with a virtio-net device, but only with IPv4, as Hermit does not support IPv6.
Design rationale
packetmeta-id.TcpPackets to set the partial checksum in our case) functional for sufficiently small unsegmented packets. On the other hand, it can also be argued that causing a failure even for smaller packets can help uncover the error case with the larger packets earlier in the development of the device drivers.Comparison to smoltcp-rs#830
ChecksumCapabilities. This PR does not do so for the following reasons:SegmentationCapabilitiesrather than the TCP specific nameTsoCapabilities. I believe the current structure can be expanded to support UDP, though I currently do not have a prototype for that.