HomeFreeBSD

Add support for hardware Tx and Rx checksums to VNIC driver

Description

Add support for hardware Tx and Rx checksums to VNIC driver

  • The network controller verifies Rx TCP/UDP/SCTP checksums by default. Communicate this to the stack when the packet is not marked as erroneous to avoid redundant checksum calculation in kernel.
  • It is not uncommon to get the mbuf with m_len that is less than the minimal size for the IP, TCP, UDP, etc. when HW checsumming is enabled. To avoid data corruption performed by the HW that is intended to write IP and TCP/UDP/SCTP checksums to the data segment, the mbuf needs to be pulled up by the required number of bytes.
  • Make sure that one can modify the mbufs that require checsum calculation rather than check for NULL mbuf on each transmission.

Reviewed by: wma
Obtained from: Semihalf
Sponsored by: Cavium
Differential Revision: https://reviews.freebsd.org/D5320