diff mbox series

[ovs-dev,v4,3/6] netdev-dpdk: Fix inner checksum when outer is not supported.

Message ID 20240530131014.2207345-3-david.marchand@redhat.com
State Accepted
Delegated to: Kevin Traynor
Headers show
Series [ovs-dev,v4,1/6] netdev-dpdk: Fallback to non tunnel checksum offloading. | expand

Checks

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

Commit Message

David Marchand May 30, 2024, 1:10 p.m. UTC
If outer checksum is not supported and OVS already set L3/L4 outer
checksums in the packet, no outer mark should be left in ol_flags
(as it confuses some driver, like net/ixgbe).

l2_len must be adjusted to account for the tunnel header.

Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
---
 lib/netdev-dpdk.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

Comments

Ilya Maximets May 31, 2024, 9:47 a.m. UTC | #1
On 5/30/24 15:10, David Marchand wrote:
> If outer checksum is not supported and OVS already set L3/L4 outer
> checksums in the packet, no outer mark should be left in ol_flags
> (as it confuses some driver, like net/ixgbe).
> 
> l2_len must be adjusted to account for the tunnel header.
> 
> Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Kevin Traynor <ktraynor@redhat.com>
> ---
>  lib/netdev-dpdk.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 


Recheck-request: github-robot
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7c910cac8e..0c624d5d38 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2628,10 +2628,21 @@  netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf)
     }
 
     if (tunnel_type && (mbuf->ol_flags & all_inner_requests)) {
-        mbuf->outer_l2_len = (char *) dp_packet_l3(pkt) -
-                             (char *) dp_packet_eth(pkt);
-        mbuf->outer_l3_len = (char *) dp_packet_l4(pkt) -
-                             (char *) dp_packet_l3(pkt);
+        if (mbuf->ol_flags & all_outer_requests) {
+            mbuf->outer_l2_len = (char *) dp_packet_l3(pkt) -
+                                 (char *) dp_packet_eth(pkt);
+            mbuf->outer_l3_len = (char *) dp_packet_l4(pkt) -
+                                 (char *) dp_packet_l3(pkt);
+        } else {
+            /* If no outer offloading is requested, clear outer marks. */
+            mbuf->ol_flags &= ~all_outer_marks;
+            mbuf->outer_l2_len = 0;
+            mbuf->outer_l3_len = 0;
+
+            /* Skip outer headers. */
+            mbuf->l2_len += (char *) dp_packet_l4(pkt) -
+                            (char *) dp_packet_eth(pkt);
+        }
     } else {
         if (tunnel_type) {
             /* No inner offload is requested, fallback to non tunnel