Skip to content

Commit

Permalink
netdev-dpdk: Fix inner checksum when outer is not supported.
Browse files Browse the repository at this point in the history
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: 084c808 ("userspace: Support VXLAN and GENEVE TSO.")
Signed-off-by: David Marchand <[email protected]>
  • Loading branch information
david-marchand committed Apr 19, 2024
1 parent 0327bb0 commit 8ee5899
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lib/netdev-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2629,10 +2629,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
Expand Down

0 comments on commit 8ee5899

Please sign in to comment.