Skip to content

Commit df1cddb

Browse files
committed
ixgbe: dynamically size mem pools for rx queues
so it doesn't break when you tune the queue sizes
1 parent 2cf9fcb commit df1cddb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/driver/ixgbe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ static void start_rx_queue(struct ixgbe_device* dev, int queue_id) {
6262
// is the default MTU of 1518
6363
// this has to be fixed if jumbo frames are to be supported
6464
// mempool should be >= the number of rx and tx descriptors for a forwarding application
65-
queue->mempool = memory_allocate_mempool(4096, 2048);
65+
uint32_t mempool_size = NUM_RX_QUEUE_ENTRIES + NUM_TX_QUEUE_ENTRIES;
66+
queue->mempool = memory_allocate_mempool(mempool_size < 4096 ? 4096 : mempool_size, 2048);
6667
if (queue->num_entries & (queue->num_entries - 1)) {
6768
error("number of queue entries must be a power of 2");
6869
}

0 commit comments

Comments
 (0)