From ba622f18c9549f116b9cae9af14ebab7d8a8a028 Mon Sep 17 00:00:00 2001 From: Lukas Sismis Date: Fri, 25 Sep 2026 20:30:22 +0200 Subject: [PATCH] dpdk: account for two VLAN tags in the mbuf size Some major drivers (ixgbe, i40e and ice) size their maximum frame for two VLAN tags (QinQ) in addition to the Ethernet header and CRC. This change moves Suricata to be in line with their behavior. Ticket: 6012 --- src/runmode-dpdk.c | 4 ++-- src/util-dpdk-common.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runmode-dpdk.c b/src/runmode-dpdk.c index b06c48f942..2b6d738b0a 100644 --- a/src/runmode-dpdk.c +++ b/src/runmode-dpdk.c @@ -1491,8 +1491,8 @@ static int DeviceConfigureQueues(DPDKIfaceConfig *iconf, const struct rte_eth_de goto cleanup; } - // +4 for VLAN header - uint16_t mtu_size = iconf->mtu + RTE_ETHER_CRC_LEN + RTE_ETHER_HDR_LEN + 4; + // two VLAN headers (QinQ), as accounted for by the NIC drivers + uint16_t mtu_size = iconf->mtu + RTE_ETHER_CRC_LEN + RTE_ETHER_HDR_LEN + 2 * RTE_VLAN_HLEN; uint16_t mbuf_size = ROUNDUP(mtu_size, 1024) + RTE_PKTMBUF_HEADROOM; uint32_t q_mp_cache_sz = iconf->mempool_cache_size_auto ? MempoolCacheSizeCalculate(iconf->queue_mempool_size) diff --git a/src/util-dpdk-common.h b/src/util-dpdk-common.h index 269ebc195c..bda8345ec4 100644 --- a/src/util-dpdk-common.h +++ b/src/util-dpdk-common.h @@ -112,6 +112,8 @@ #define RTE_MBUF_F_RX_L4_CKSUM_MASK PKT_RX_L4_CKSUM_MASK #define RTE_MBUF_F_RX_L4_CKSUM_GOOD PKT_RX_L4_CKSUM_GOOD #define RTE_MBUF_F_RX_L4_CKSUM_BAD PKT_RX_L4_CKSUM_BAD + +#define RTE_VLAN_HLEN 4 #endif #if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0)