Page MenuHomeFreeBSD

Fix if_vmx receive checksum offload bug and harden against the device skipping receive descriptors
ClosedPublic

Authored by pkelsey on Mar 3 2020, 5:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 4:04 PM
Unknown Object (File)
Wed, Dec 11, 1:27 PM
Unknown Object (File)
Nov 23 2024, 12:30 AM
Unknown Object (File)
Nov 19 2024, 1:43 AM
Unknown Object (File)
Sep 12 2024, 1:58 AM
Unknown Object (File)
Sep 8 2024, 11:21 PM
Unknown Object (File)
Sep 8 2024, 12:48 AM
Unknown Object (File)
Sep 1 2024, 8:58 AM
Subscribers

Details

Summary

This patch:

  • Fixes a bug where the checksum offload status of received packets was being taken from the first descriptor instead of the last descriptor. For LRO packets, whose checksums are always offloaded, and whose synthesized packet header does not contain valid checksum information, this resulted in the LRO packets being dropped, and the data only eventually getting through via retransmits that did not result in LRO processing. For single-descriptor packets and for multi-descriptor, non-LRO, jumbo frames, there is no impact.
  • Hardens the driver against device-skipped descriptors. Skipping of descriptors has yet to be observed during operation. It is currently believed that existing reports of this with this implementation were actually state corruption resulting from the iflib bug fixed by D23943, and that the device only skips descriptors with configurations that mix head and body type descriptors on the same receive ring (which this implementation does not). This relies on the patches in D23943 and D23946.
  • Avoids passing packets received with the error indicator set into the stack by forcing all fragment lengths of such packets when handing off to iflib. Such packets should wind up being discarded at some point in the stack, but this removes any questions by killing them in the driver. If LRO is enabled, and iflib refill limits are not disabled and/or the receive queue size is too small, there may be many such packets due to the device (apparently) running out of receive descriptors while constructing an LRO packet. This relies on the patch in D23945.
  • Adds sysctl-visible counters for skipped descriptor detection, zero-length packet reception, and reception of packets with the error indicator set.
Test Plan

This has been tested on a 12.1 system (with r356932 applied) with em and vmx devices, and with the patches from D23943, D23945, and D23946 applied.

This builds for 13-current, but testing on 13-current is waiting for the package system to get fixed.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped