NULL,
};
+struct rte_mempool *mempools[RTE_MAX_NUMA_NODES];
+
struct fwd_config cur_fwd_config;
struct fwd_engine *cur_fwd_eng = &io_fwd_engine; /**< IO mode by default. */
uint32_t retry_enabled;
/*
* Configuration initialisation done once at init time.
*/
-static void
+static struct rte_mempool *
mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,
unsigned int socket_id)
{
} else if (verbose_level > 0) {
rte_mempool_dump(stdout, rte_mp);
}
+ return rte_mp;
}
/*
uint8_t i;
for (i = 0; i < num_sockets; i++)
- mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool,
- socket_ids[i]);
+ mempools[i] = mbuf_pool_create(mbuf_data_size,
+ nb_mbuf_per_pool,
+ socket_ids[i]);
} else {
if (socket_num == UMA_NO_CONFIG)
- mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, 0);
+ mempools[0] = mbuf_pool_create(mbuf_data_size,
+ nb_mbuf_per_pool, 0);
else
- mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool,
- socket_num);
+ mempools[socket_num] = mbuf_pool_create
+ (mbuf_data_size,
+ nb_mbuf_per_pool,
+ socket_num);
}
init_port_config();
struct rte_device *device;
portid_t pt_id;
int ret;
+ int i;
if (test_done == 0)
stop_packet_forwarding();
return;
}
}
+ for (i = 0 ; i < RTE_MAX_NUMA_NODES ; i++) {
+ if (mempools[i])
+ rte_mempool_free(mempools[i]);
+ }
printf("\nBye...\n");
}