diff mbox series

[ovs-dev,1/3] netdev-dpdk: Clear inner packet marks if no inner offloads requested.

Message ID 20240313172949.158842-2-i.maximets@ovn.org
State Accepted
Commit f8809760fcc237ca0677b81166831400b141878f
Headers show
Series netdev-dpdk: More Tx offlaod fixes. | expand

Checks

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

Commit Message

Ilya Maximets March 13, 2024, 5:29 p.m. UTC
In some cases only outer offloads may be requested for a tunneled
packet.  In this case there is no need to mark the type of an
inner packet.  Clean these flags up to avoid potential confusion
of DPDK drivers.

Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 lib/netdev-dpdk.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mike Pattrick March 14, 2024, 1:36 p.m. UTC | #1
On Wed, Mar 13, 2024 at 1:29 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> In some cases only outer offloads may be requested for a tunneled
> packet.  In this case there is no need to mark the type of an
> inner packet.  Clean these flags up to avoid potential confusion
> of DPDK drivers.
>
> Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>

Acked-by: Mike Pattrick <mkp@redhat.com>
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 8c52accff..270d3e11c 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2607,6 +2607,15 @@  netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf)
                  (char *) dp_packet_eth(pkt);
         mbuf->outer_l3_len = (char *) dp_packet_l4(pkt) -
                  (char *) dp_packet_l3(pkt);
+
+        /* If neither inner checksums nor TSO is requested, inner marks
+         * should not be set. */
+        if (!(mbuf->ol_flags & (RTE_MBUF_F_TX_IP_CKSUM |
+                                RTE_MBUF_F_TX_L4_MASK  |
+                                RTE_MBUF_F_TX_TCP_SEG))) {
+            mbuf->ol_flags &= ~(RTE_MBUF_F_TX_IPV4 |
+                                RTE_MBUF_F_TX_IPV6);
+        }
     } else {
         mbuf->l2_len = (char *) dp_packet_l3(pkt) -
                (char *) dp_packet_eth(pkt);