diff mbox series

[ovs-dev] dp-packet: Don't offload inner csum if outer isn't supported.

Message ID 20240220150724.225446-1-mkp@redhat.com
State Superseded
Headers show
Series [ovs-dev] dp-packet: Don't offload inner csum if outer isn't supported. | 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 fail test: fail

Commit Message

Mike Pattrick Feb. 20, 2024, 3:07 p.m. UTC
Some network cards support inner checksum offloading but not outer
checksum offloading. Currently OVS will resolve that outer checksum but
allows the network card to resolve the inner checksum, invalidating the
outer checksum in the process.

Now if we can't offload outer checksums, we don't offload inner either.

Reported-at: https://issues.redhat.com/browse/FDP-363
Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
Signed-off-by: Mike Pattrick <mkp@redhat.com>
---
nb: I also tested a more complex patch that only resolved the inner
checksum and offloaded the UDP layer. This didn't noticably improve
performance.
---
 lib/dp-packet.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Mike Pattrick Feb. 21, 2024, 4:18 a.m. UTC | #1
On Tue, Feb 20, 2024 at 10:07 AM Mike Pattrick <mkp@redhat.com> wrote:
>
> Some network cards support inner checksum offloading but not outer
> checksum offloading. Currently OVS will resolve that outer checksum but
> allows the network card to resolve the inner checksum, invalidating the
> outer checksum in the process.
>
> Now if we can't offload outer checksums, we don't offload inner either.
>
> Reported-at: https://issues.redhat.com/browse/FDP-363
> Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
> Signed-off-by: Mike Pattrick <mkp@redhat.com>

Intel CI failed this patch at "conntrack - invalid", with error
message "upcall_cb failure: ukey installation fails".

I believe this is a false negative.

-M
diff mbox series

Patch

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 305822293..0fc352cce 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -592,6 +592,17 @@  dp_packet_ol_send_prepare(struct dp_packet *p, uint64_t flags)
     if (dp_packet_hwol_is_tunnel_geneve(p) ||
         dp_packet_hwol_is_tunnel_vxlan(p)) {
         tnl_inner = true;
+
+        /* If the TX interface doesn't support UDP tunnel offload but does
+         * support inner checksum offload and an outer UDP checksum is
+         * required, then we can't offload inner checksum either. As that would
+         * invalidate the outer checksum. */
+        if (!(flags & NETDEV_TX_OFFLOAD_OUTER_UDP_CKSUM) &&
+                dp_packet_hwol_is_outer_udp_cksum(p)) {
+            flags &= ~(NETDEV_TX_OFFLOAD_TCP_CKSUM |
+                       NETDEV_TX_OFFLOAD_UDP_CKSUM |
+                       NETDEV_TX_OFFLOAD_SCTP_CKSUM);
+        }
     }
 
     if (dp_packet_hwol_tx_ip_csum(p)) {