aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/avf
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/avf')
-rw-r--r--src/plugins/avf/avf.h1
-rw-r--r--src/plugins/avf/device.c6
-rw-r--r--src/plugins/avf/input.c5
3 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index 518c7d8329a..b79a22b073f 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -102,6 +102,7 @@ typedef struct
u32 *bufs;
u16 n_enqueued;
u8 int_mode;
+ u8 buffer_pool_index;
} avf_rxq_t;
typedef struct
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index f73e5d372d2..039a8203edb 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -229,6 +229,9 @@ avf_rxq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 rxq_size)
2 * CLIB_CACHE_LINE_BYTES,
ad->numa_node);
+ rxq->buffer_pool_index =
+ vlib_buffer_pool_get_default_for_numa (vm, ad->numa_node);
+
if (rxq->descs == 0)
return vlib_physmem_last_error (vm);
@@ -239,7 +242,8 @@ avf_rxq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 rxq_size)
vec_validate_aligned (rxq->bufs, rxq->size, CLIB_CACHE_LINE_BYTES);
rxq->qrx_tail = ad->bar0 + AVF_QRX_TAIL (qid);
- n_alloc = vlib_buffer_alloc (vm, rxq->bufs, rxq->size - 8);
+ n_alloc = vlib_buffer_alloc_from_pool (vm, rxq->bufs, rxq->size - 8,
+ rxq->buffer_pool_index);
if (n_alloc == 0)
return clib_error_return (0, "buffer allocation error");
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c
index fc884ce39f6..beb5c052423 100644
--- a/src/plugins/avf/input.c
+++ b/src/plugins/avf/input.c
@@ -72,7 +72,9 @@ avf_rxq_refill (vlib_main_t * vm, vlib_node_runtime_t * node, avf_rxq_t * rxq,
slot = (rxq->next - n_refill - 1) & mask;
n_refill &= ~7; /* round to 8 */
- n_alloc = vlib_buffer_alloc_to_ring (vm, rxq->bufs, slot, size, n_refill);
+ n_alloc =
+ vlib_buffer_alloc_to_ring_from_pool (vm, rxq->bufs, slot, size, n_refill,
+ rxq->buffer_pool_index);
if (PREDICT_FALSE (n_alloc != n_refill))
{
@@ -368,6 +370,7 @@ no_more_desc:
vnet_buffer (bt)->sw_if_index[VLIB_RX] = ad->sw_if_index;
vnet_buffer (bt)->sw_if_index[VLIB_TX] = ~0;
+ bt->buffer_pool_index = rxq->buffer_pool_index;
if (n_tail_desc)
n_rx_bytes = avf_process_rx_burst (vm, node, ptd, n_rx_packets, 1);