From 122f336ffde6d3fc74acc6861322328d778d3232 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Wed, 16 Nov 2016 11:03:51 +0200 Subject: Fix trex-267 - allocation of ARP packets from wrong memory socket Signed-off-by: Ido Barnea --- src/bp_sim.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/bp_sim.h') diff --git a/src/bp_sim.h b/src/bp_sim.h index c292103b..0cf77437 100755 --- a/src/bp_sim.h +++ b/src/bp_sim.h @@ -1205,12 +1205,13 @@ public: /* for simulation */ static void free_pools(); - static inline rte_mbuf_t * pktmbuf_alloc_small(socket_id_t socket){ return ( m_mem_pool[socket].pktmbuf_alloc_small() ); } - + static inline rte_mbuf_t * pktmbuf_alloc_small_by_port(uint8_t port_id) { + return ( m_mem_pool[m_socket.port_to_socket(port_id)].pktmbuf_alloc_small() ); + } /** * try to allocate small buffers too @@ -1228,6 +1229,13 @@ public: return (m_mem_pool[socket].pktmbuf_alloc(size)); } + static inline rte_mbuf_t * pktmbuf_alloc_by_port(uint8_t port_id, uint16_t size){ + socket_id_t socket = m_socket.port_to_socket(port_id); + if (size