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)
Thu, Apr 11, 1:32 PM
Unknown Object (File)
Wed, Apr 3, 7:21 AM
Unknown Object (File)
Jan 22 2024, 1:52 AM
Unknown Object (File)
Jan 13 2024, 4:48 AM
Unknown Object (File)
Dec 23 2023, 5:34 PM
Unknown Object (File)
Dec 20 2023, 3:52 AM
Unknown Object (File)
Nov 19 2023, 3:18 PM
Unknown Object (File)
Nov 18 2023, 7:29 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable