gazelle/0255-skip-gro-when-tcp-ip-checksum-offloads-disable.patch
kircher e8e609cb74 sync enable-UDP-CKSUM-in-gazelle
(cherry picked from commit a02db14a02a694717d7b73914667e7bfcb24f868)
2023-06-26 09:02:31 +08:00

29 lines
978 B
Diff

From 9f3faa569a3181585da5650dec66136f89591348 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Tue, 20 Jun 2023 09:20:43 +0800
Subject: [PATCH] skip gro when tcp/ip checksum offloads disable
---
src/lstack/netif/lstack_vdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lstack/netif/lstack_vdev.c b/src/lstack/netif/lstack_vdev.c
index 5ea1f31..4307f24 100644
--- a/src/lstack/netif/lstack_vdev.c
+++ b/src/lstack/netif/lstack_vdev.c
@@ -82,6 +82,11 @@ static uint32_t vdev_rx_poll(struct protocol_stack *stack, struct rte_mbuf **pkt
return pkt_num;
}
+ /* skip gro when tcp/ip cksum offloads disable */
+ if (get_protocol_stack_group()->rx_offload == 0) {
+ return pkt_num;
+ }
+
for (uint32_t i = 0; i < pkt_num; i++) {
struct rte_ether_hdr *ethh = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *);
if (unlikely(RTE_BE16(RTE_ETHER_TYPE_IPV4) != ethh->ether_type)) {
--
2.33.0