c9ea670c1d
TSO is now enabled, but it's not actually being used by default in a simple L2 forward mode. In such case, we have to zero the virtio net headers, to inform the vhost backend that no offload is being used: hdr->csum_start = 0; hdr->csum_offset = 0; hdr->flags = 0; hdr->gso_type = 0; hdr->gso_size = 0; hdr->hdr_len = 0; Such writes could be very costly; it introduces severe cache issues: The above operations introduce cache write for each packet, which stalls the read operation from the vhost backend. The fact that virtio net header is initiated to zero in PMD driver init stage means that these costly writes are unnecessary and could be avoided: if (hdr->csum_start != 0) hdr->csum_start = 0; And that's what the macro ASSIGN_UNLESS_EQUAL does. With this, the performance drop introduced by TSO enabling is recovered: it could be up to 20% in micro benchmarking. Fixes: |
||
---|---|---|
.. | ||
crypto | ||
net | ||
Makefile |