From 004d8e854ac857fbc6976b6dc9d5cf84d1e0df51 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Mon, 3 May 2021 18:43:42 +0200 Subject: [PATCH] net/virtio: do not touch Tx offload flags Tx offload flags are of the application responsibility. Leave the mbuf alone and use a local storage for implicit tcp checksum offloading in case of TSO. Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin Acked-by: Flavio Leitner --- drivers/net/virtio/virtqueue.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h index e9992b745d..ed3b85080e 100644 --- a/drivers/net/virtio/virtqueue.h +++ b/drivers/net/virtio/virtqueue.h @@ -622,10 +622,12 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr, uint8_t offload) { if (offload) { - if (cookie->ol_flags & PKT_TX_TCP_SEG) - cookie->ol_flags |= PKT_TX_TCP_CKSUM; + uint64_t csum_l4 = cookie->ol_flags & PKT_TX_L4_MASK; - switch (cookie->ol_flags & PKT_TX_L4_MASK) { + if (cookie->ol_flags & PKT_TX_TCP_SEG) + csum_l4 |= PKT_TX_TCP_CKSUM; + + switch (csum_l4) { case PKT_TX_UDP_CKSUM: hdr->csum_start = cookie->l2_len + cookie->l3_len; hdr->csum_offset = offsetof(struct rte_udp_hdr,