From 9f3faa569a3181585da5650dec66136f89591348 Mon Sep 17 00:00:00 2001 From: jiangheng 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