CNDP VPP Plugin #34
Replies: 1 comment 1 reply
-
By default, VPP allocates a buffer pool per NUMA node. See here.
I don't think we're only using a single mempool. Here's why... We configure the umem using buffer_mem_start/size, which is eventually used for the XDP_UMEM_REG setsockopt(). This makes it so all the AF_XDP sockets we create can reference any buffer belonging to any pool, regardless of the pool the buffer was originally allocated, since the buffer_mem area is used for all buffer pools. We do want to allocate buffers from a NUMA co-located pool, and hope we get lucky and the packets received on a device attached to a node are transmitted on a device also attached to the same node. In case we don't get lucky, the packet may need to be transmitted on a device attached to a different node. If the buffer was allocated from pool[0] and needs to transmit on a device that had a umem which is only valid for buffers from pool[1], I think the packet would need to be copied into a new buffer from pool[1]. Looking at lib/core/xskdev.:__get_mbuf_addr_tx_unaligned() we do
Which means if we had a buffer from pool[0], the address would be like, 0x1000, but the umem start address for pool[1] might be like 0x20000, which would result in a very large addr. Moral of the story is that packets cannot be reliably transmitted across AF_XDP sockets that do not use the same umem. |
Beta Was this translation helpful? Give feedback.
-
Ho Folks I've noticed that cndp_buf_alloc tries to allocate buffers from a numa co-located buffer pool
However, the umem setup for each device isn't pool specific:
And the same with the umem configuration setup
I think either the allocation should be modified to not allocate buffers from a specific pool unless you are using a umem address that is being configured for that cd for that exact pool or the umems should be configured appropriately to match the right pools...
In the vlib_main_t struct you can access the available buffer pools from the buffer_main parameter: https://github.com/FDio/vpp/blob/39fdefdc90abeaa142e4056bd40ff3e89dc689ab/src/vlib/buffer.h.
so maybe setting the umem address to the right pool from the start is more appropriate using something like:
I think it's also worth investigating how many pools VPP allocates by default and what happens when the number of AF_XDP queues increases dramatically using only 1 of the available mempools... there may be performance impacts
Beta Was this translation helpful? Give feedback.
All reactions