aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/avf
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-05-04 15:46:33 +0200
committerNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-05-07 10:13:36 +0200
commitbd376a8ce8425f45b23074398949e8055de29280 (patch)
treeedcf64e46016b2b20a4d62f34857e8c6f4dcdc0c /src/plugins/avf
parente3e355507508ccbe1a14b78e0654775af8d932fe (diff)
avf: Fix cksum offload / ipsec
VNET_BUFFER_F_OFFLOAD means 'check 2nd cacheline' but we can still have TCP_CKSUM=0 & UDP_CKSUM=0 Type: fix Change-Id: I42b5974f6d34b777aa959c06c67619a5c83c5805 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/avf')
-rw-r--r--src/plugins/avf/output.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/avf/output.c b/src/plugins/avf/output.c
index b50a1e23c7a..decd8b5b939 100644
--- a/src/plugins/avf/output.c
+++ b/src/plugins/avf/output.c
@@ -63,9 +63,14 @@ avf_tx_prepare_cksum (vlib_buffer_t * b, u8 is_tso)
vnet_buffer_oflags_t oflags = vnet_buffer (b)->oflags;
u32 is_tcp = is_tso || oflags & VNET_BUFFER_OFFLOAD_F_TCP_CKSUM;
u32 is_udp = !is_tso && oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM;
+
+ if (!is_tcp && !is_udp)
+ return 0;
+
u32 is_ip4 = b->flags & VNET_BUFFER_F_IS_IP4;
u32 is_ip6 = b->flags & VNET_BUFFER_F_IS_IP6;
- ASSERT (!is_tcp || !is_udp);
+
+ ASSERT (!(is_tcp && is_udp));
ASSERT (is_ip4 || is_ip6);
i16 l2_hdr_offset = b->current_data;
i16 l3_hdr_offset = vnet_buffer (b)->l3_hdr_offset;