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
pull/16476/head
Lukas Sismis 1 month ago
parent e599557864
commit ba622f18c9

@ -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)

@ -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)

Loading…
Cancel
Save