Skip to content

Commit

Permalink
add more comments and print more debug info on create mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Aitov committed Oct 11, 2023
1 parent 216dba5 commit 3a91105
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dataplane/controlplane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,8 +1415,16 @@ void cControlPlane::waitAllWorkers()

eResult cControlPlane::initMempool()
{
unsigned int elements_count = CONFIG_YADECAP_MBUFS_COUNT +
dataPlane->getConfigValue(eConfigType::fragmentation_size) +
dataPlane->getConfigValue(eConfigType::master_mempool_size) +
4 * CONFIG_YADECAP_PORTS_SIZE * CONFIG_YADECAP_MBUFS_BURST_SIZE +
4 * dataPlane->ports.size() * dataPlane->getConfigValue(eConfigType::kernel_interface_queue_size);

YADECAP_LOG_DEBUG("elements_count: %u\n", elements_count);

mempool = rte_mempool_create("cp",
CONFIG_YADECAP_MBUFS_COUNT + dataPlane->getConfigValue(eConfigType::fragmentation_size) + dataPlane->getConfigValue(eConfigType::master_mempool_size) + 4 * CONFIG_YADECAP_PORTS_SIZE * CONFIG_YADECAP_MBUFS_BURST_SIZE + 4 * dataPlane->ports.size() * dataPlane->getConfigValue(eConfigType::kernel_interface_queue_size),
elements_count,
CONFIG_YADECAP_MBUF_SIZE,
0,
sizeof(struct rte_pktmbuf_pool_private),
Expand Down
20 changes: 20 additions & 0 deletions dataplane/dataplane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,26 @@ eResult cDataPlane::initWorkers()
if (symmetric_mode)
{
/// symmetric mode. add more rx queues
///
/// before
/// rx_queue_id -> core_id
/// 0 -> 1
/// 1 -> 2
/// 2 -> 3
/// 3 -> n/s
/// 4 -> n/s
/// 5 -> n/s
/// 6 -> n/s
///
/// after
/// rx_queue_id -> core_id
/// 0 -> 1
/// 1 -> 2
/// 2 -> 3
/// 3 -> 1
/// 4 -> 2
/// 5 -> 3
/// 6 -> 1

uint16_t workers_count = rx_queues.size();
uint16_t rx_queue_id = rx_queues.find(coreId)->second + workers_count;
Expand Down

0 comments on commit 3a91105

Please sign in to comment.