File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ void DpdkDevice::configurePort()
127127 if (rte_eth_dev_configure (m_portID, m_rxQueueCount, m_txQueueCount, &portConfig)) {
128128 throw PluginError (" DpdkDevice::configurePort() has failed. Unable to configure interface" );
129129 }
130+ if (rte_eth_dev_set_mtu (m_portID, m_mtuSize)) {
131+ throw PluginError (" DpdkDevice::configurePort() has failed. Unable to set MTU (rte_eth_dev_set_mtu)" );
132+ }
130133}
131134
132135rte_eth_conf DpdkDevice::createPortConfig ()
@@ -163,6 +166,8 @@ rte_eth_conf DpdkDevice::createPortConfig()
163166void DpdkDevice::initMemPools (uint16_t memPoolSize)
164167{
165168 constexpr int MEMPOOL_CACHE_SIZE = 256 ;
169+ constexpr int VLAN_HDR_LEN = 4 ;
170+ const int max_packet_size = m_mtuSize + RTE_ETHER_HDR_LEN + VLAN_HDR_LEN;
166171
167172 m_memPools.reserve (m_rxQueueCount);
168173
@@ -174,7 +179,7 @@ void DpdkDevice::initMemPools(uint16_t memPoolSize)
174179 memPoolSize,
175180 MEMPOOL_CACHE_SIZE,
176181 0 ,
177- std::max (m_mtuSize, ( uint16_t ) RTE_MBUF_DEFAULT_DATAROOM) + RTE_PKTMBUF_HEADROOM,
182+ std::max (max_packet_size, RTE_MBUF_DEFAULT_DATAROOM) + RTE_PKTMBUF_HEADROOM,
178183 rte_eth_dev_socket_id (m_portID));
179184 if (!memPool) {
180185 throw PluginError (
You can’t perform that action at this time.
0 commit comments