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

RFC: support for TCP Segmentation Offloading (TSO) #830

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

stlankes
Copy link
Contributor

I tried to extend a driver to support TCP segmentation offloading (TSO). In this case, smoltcp has to create one header (Ethernert+IP+TCP) followed by multiple payloads. To support TSO, I extended the DeviceCapabilities with TsoCapabilities. TsoCapabilities can describe, if TSO is supported for IPv4, IPv6 or both. In case TSO is supported, smoltcp emits packets with the maximum size of the remote window to the device driver.

Maybe my solution is a little bit naive. I am not an TCP expert. My test driver is a revised driver for Virtio. Consquently, my VM uses virtio to forward messages to a tap device. Afterwards, the host forwards the packets over a 10 Gbit/s device to a server, which sends a response back. Both devices (tap and the ethernet device) supports TSO. I monitored the communication with Wireshark. It seems to work and I don't see any strange behavior.

I would appreciate comments to improve my work.

In case of TSO support, the NIC divides larger data chunks into
TCP segments. To support TSO, the `DeviceCapabilities` is extended
with `TsoCapabilities`. It can describe, if TSO supported for IPv4,
IPv6 or both. In case TSO is supported, smoltcp emits packts with
the maximum size of the remote window to the device driver.
@stlankes stlankes marked this pull request as draft August 13, 2023 18:18
Copy link
Contributor

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

The functionality looks fine to me. I'll leave style comments to @Dirbaio.

src/phy/mod.rs Outdated Show resolved Hide resolved
src/phy/mod.rs Outdated Show resolved Hide resolved
stlankes and others added 2 commits August 14, 2023 07:49
Co-authored-by: Catherine <whitequark@whitequark.org>
Co-authored-by: Catherine <whitequark@whitequark.org>
the Virtio specification defines 65550 as maximum packet size
@stlankes
Copy link
Contributor Author

Ok, I found some issues. I have to think about it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants