Skip to content

Commit b04ad8a

Browse files
committed
dpdk - fix mbuf dataroom size
MTU is increased by eth header len. Fixes: dd3cd88
1 parent a4ab695 commit b04ad8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

input/dpdk/dpdkDevice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ rte_eth_conf DpdkDevice::createPortConfig()
163163
void DpdkDevice::initMemPools(uint16_t memPoolSize)
164164
{
165165
constexpr int MEMPOOL_CACHE_SIZE = 256;
166+
constexpr int VLAN_HDR_LEN = 4;
167+
const int max_packet_size = m_mtuSize + RTE_ETHER_HDR_LEN + VLAN_HDR_LEN;
166168

167169
m_memPools.reserve(m_rxQueueCount);
168170

@@ -174,7 +176,7 @@ void DpdkDevice::initMemPools(uint16_t memPoolSize)
174176
memPoolSize,
175177
MEMPOOL_CACHE_SIZE,
176178
0,
177-
std::max(m_mtuSize, (uint16_t)RTE_MBUF_DEFAULT_DATAROOM) + RTE_PKTMBUF_HEADROOM,
179+
std::max(max_packet_size, RTE_MBUF_DEFAULT_DATAROOM) + RTE_PKTMBUF_HEADROOM,
178180
rte_eth_dev_socket_id(m_portID));
179181
if (!memPool) {
180182
throw PluginError(

0 commit comments

Comments
 (0)