vmxnet3: disable Large Receive Offload (LRO) feature #1848
Merged
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.
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).