diff mbox series

[ovs-dev,v2,3/4] netdev-linux: Only repair IP checksum in IPv4.

Message ID 20240212195030.190385-3-mkp@redhat.com
State Changes Requested
Delegated to: Simon Horman
Headers show
Series [ovs-dev,v2,1/4] Userspace: Software fallback for UDP encapsulated TCP segmentation. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Mike Pattrick Feb. 12, 2024, 7:50 p.m. UTC
Previously a change was added to the vnet prepend code to solve for the
case where no L4 checksum offloading was needed but the L3 checksum
hadn't been calculated. But the added check didn't properly account
for IPv6 traffic.

Fixes: 85bcbbed839a ("userspace: Enable tunnel tests with TSO.")
Signed-off-by: Mike Pattrick <mkp@redhat.com>
---
 lib/netdev-linux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 7a156cc28..51517854b 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -7191,8 +7191,8 @@  netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu)
         /* The packet has good L4 checksum. No need to validate again. */
         vnet->csum_start = vnet->csum_offset = (OVS_FORCE __virtio16) 0;
         vnet->flags = VIRTIO_NET_HDR_F_DATA_VALID;
-        if (!dp_packet_ip_checksum_good(b)) {
-            /* It is possible that L4 is good but the IP checksum isn't
+        if (dp_packet_hwol_tx_ip_csum(b) && !dp_packet_ip_checksum_good(b)) {
+            /* It is possible that L4 is good but the IPv4 checksum isn't
              * complete. For example in the case of UDP encapsulation of an ARP
              * packet where the UDP checksum is 0. */
             dp_packet_ip_set_header_csum(b, false);