diff options
author | Damjan Marion <damarion@cisco.com> | 2017-07-10 15:06:17 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-07-10 19:35:57 +0000 |
commit | 04a7f05e91e919f51eaecaee476435484076655b (patch) | |
tree | b7cbd12430c4a16b6289300b5b604835791bd780 /src/vnet | |
parent | 28160f38488743b8cee0a7bd62b432a9dd8f4bfd (diff) |
vlib: store buffer memory information in the buffer_main
Currently, buffer index is calculated as a offset to the physmem
region shifted by log2_cacheline size.
When DPDK is used we "hack" physmem data with information taken from
dpdk mempool. This makes physmem code not usable with DPDK.
This change makes buffer memory start and size independent of physmem
basically allowing physmem to be used when DPDK plugin is loaded.
Change-Id: Ieb399d398f147583b9baab467152a352d58c9c31
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/pg/input.c | 6 | ||||
-rw-r--r-- | src/vnet/pg/stream.c | 2 | ||||
-rw-r--r-- | src/vnet/replication.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c index 597ae060045..c3738a6a2aa 100644 --- a/src/vnet/pg/input.c +++ b/src/vnet/pg/input.c @@ -1214,7 +1214,7 @@ pg_stream_fill_helper (pg_main_t * pg, * Historically, the pg maintained its own free lists and * device drivers tx paths would return pkts. */ - if (vm->buffer_main->extern_buffer_mgmt == 0 && + if (vm->buffer_main->callbacks_registered == 0 && !(s->flags & PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE)) f->buffer_init_function = pg_buffer_init; f->buffer_init_function_opaque = @@ -1238,7 +1238,7 @@ pg_stream_fill_helper (pg_main_t * pg, n_alloc = n_allocated; /* Reinitialize buffers */ - if (vm->buffer_main->extern_buffer_mgmt == 0 || CLIB_DEBUG > 0 + if (vm->buffer_main->callbacks_registered == 0 || CLIB_DEBUG > 0 || (s->flags & PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE)) init_buffers_inline (vm, s, @@ -1246,7 +1246,7 @@ pg_stream_fill_helper (pg_main_t * pg, n_alloc, (bi - s->buffer_indices) * s->buffer_bytes /* data offset */ , s->buffer_bytes, /* set_data */ - vm->buffer_main->extern_buffer_mgmt != 0 + vm->buffer_main->callbacks_registered != 0 || (s->flags & PG_STREAM_FLAGS_DISABLE_BUFFER_RECYCLE) != 0); if (next_buffers) diff --git a/src/vnet/pg/stream.c b/src/vnet/pg/stream.c index 05d820a3807..a540b32bba4 100644 --- a/src/vnet/pg/stream.c +++ b/src/vnet/pg/stream.c @@ -438,7 +438,7 @@ pg_stream_add (pg_main_t * pg, pg_stream_t * s_init) pg_buffer_index_t *bi; int n; - if (vm->buffer_main->extern_buffer_mgmt) + if (vm->buffer_main->callbacks_registered) s->buffer_bytes = VLIB_BUFFER_DATA_SIZE; if (!s->buffer_bytes) diff --git a/src/vnet/replication.c b/src/vnet/replication.c index 233a8c2f100..1c6f28d2493 100644 --- a/src/vnet/replication.c +++ b/src/vnet/replication.c @@ -214,7 +214,7 @@ replication_recycle_callback (vlib_main_t * vm, vlib_buffer_free_list_t * fl) b0->flags |= VLIB_BUFFER_IS_RECYCLED; #if (CLIB_DEBUG > 0) - if (vm->buffer_main->extern_buffer_mgmt == 0) + if (vm->buffer_main->callbacks_registered == 0) vlib_buffer_set_known_state (vm, bi0, VLIB_BUFFER_KNOWN_ALLOCATED); #endif |