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

vmxnet3: disable Large Receive Offload (LRO) feature #1848

Merged
merged 1 commit into from
May 6, 2023

Conversation

francescolavra
Copy link
Member

If the LRO feature is enabled, when the vmwnet3 device coalesces multiple input TCP packets into a single packet, it does not update the checksum in the TCP header of the large packet (because it can indicate that all the checksums are correct by setting the appropriate fields in the completion descriptor); therefore, when the packet is processed by the lwIP TCP stack, the checksum calculation fails, and the packet is discarded. This causes a high performance penalty, since the application needs to wait for the discarded packet to be re-transmitted by the remote peer. On the other hand, checksum calculation by lwIP should be kept enabled because lwIP does not support disabling the calculation on a per-packet basis, and it is not possible for the driver to know beforehand whether the checksum for incoming packets will be calculated by the device.
To fix the above issue, this change disables the LRO feature; in addition, the RX checksum feature is also disabled because we cannot exploit it, since we cannot avoid the checksum calculation in lwIP.
The MTU size is being updated to match the size of the RX buffers (the vmxnet3 device discards any incoming packets larger than the configured MTU value).

If the LRO feature is enabled, when the vmwnet3 device coalesces
multiple input TCP packets into a single packet, it does not update
the checksum in the TCP header of the large packet (because it can
indicate that all the checksums are correct by setting the
appropriate fields in the completion descriptor); therefore, when
the packet is processed by the lwIP TCP stack, the checksum
calculation fails, and the packet is discarded. This causes a high
performance penalty, since the application needs to wait for the
discarded packet to be retransmitted by the remote peer. On the
other hand, checksum calculation by lwIP should be kept enabled
because lwIP does not support disabling the calculation on a
per-packet basis, and it is not possible for the driver to know
beforehand whether the checkusm for incoming packets will be
calculated by the device.
To fix the above issue, this change disables the LRO feature; in
addition, the RX checksum feature is also disabled because we
cannot exploit it, since we cannot avoid the checkusm calculation
in lwIP.
The MTU size is being updated to match the size of the RX buffers
(the vmxnet3 device discards any incoming packets larger than the
configured MTU value).
@sanderssj
Copy link
Collaborator

LGTM!

Copy link
Contributor

@wjhun wjhun left a comment

Choose a reason for hiding this comment

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

LGTM

@francescolavra francescolavra merged commit 9fea844 into master May 6, 2023
@francescolavra francescolavra deleted the fix/vmxnet3_lro branch May 6, 2023 07:10
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

Successfully merging this pull request may close these issues.

3 participants