Thread (63 messages) 63 messages, 9 authors, 2021-05-13

[dpdk-dev] [PATCH v3 2/4] net/virtio: do not touch Tx offload flags

From: David Marchand <hidden>
Date: 2021-05-03 13:27:20
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 <redacted>
Reviewed-by: Maxime Coquelin <redacted>
Acked-by: Flavio Leitner <redacted>
---
 drivers/net/virtio/virtqueue.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 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) {
+		uint64_t csum_l4 = cookie->ol_flags & PKT_TX_L4_MASK;
+
 		if (cookie->ol_flags & PKT_TX_TCP_SEG)
-			cookie->ol_flags |= PKT_TX_TCP_CKSUM;
+			csum_l4 |= PKT_TX_TCP_CKSUM;
 
-		switch (cookie->ol_flags & PKT_TX_L4_MASK) {
+		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,
-- 
2.23.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help