diff options
author | 2016-03-24 17:17:47 +0100 | |
---|---|---|
committer | 2016-03-25 20:55:15 +0000 | |
commit | 19010202285445372c281faca6a9757fd0ed466c (patch) | |
tree | f39784f25f08bc6097669d1a28bd0ac25aae2d6f /vnet/vnet/unix/tuntap.c | |
parent | 46040a513bc32b0f4e9993fbd7f0fc4bc4e1c42c (diff) |
Use rte_mempool private data for storing vlib_buffer_t
Change-Id: If3fc88a35bc0b736376113a39667caea42802ea1
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet/vnet/unix/tuntap.c')
-rw-r--r-- | vnet/vnet/unix/tuntap.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/vnet/vnet/unix/tuntap.c b/vnet/vnet/unix/tuntap.c index 77c60fd6ee2..7ea0b70348d 100644 --- a/vnet/vnet/unix/tuntap.c +++ b/vnet/vnet/unix/tuntap.c @@ -200,12 +200,11 @@ tuntap_rx (vlib_main_t * vm, tuntap_main_t * tm = &tuntap_main; vlib_buffer_t * b; u32 bi; + const uword buffer_size = VLIB_BUFFER_DATA_SIZE; #if DPDK == 0 - const uword buffer_size = VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES; u32 free_list_index = VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX; #else dpdk_main_t * dm = &dpdk_main; - const uword buffer_size = MBUF_SIZE; u32 free_list_index = dm->vlib_buffer_free_list_index; #endif @@ -262,7 +261,7 @@ tuntap_rx (vlib_main_t * vm, #endif b = vlib_get_buffer (vm, tm->rx_buffers[i_rx]); #if DPDK == 1 - mb = (((struct rte_mbuf *)b)-1); + mb = rte_mbuf_from_vlib_buffer(b); #endif b->flags = 0; b->current_data = 0; @@ -445,12 +444,7 @@ tuntap_config (vlib_main_t * vm, unformat_input_t * input) u8 * name; int flags = IFF_TUN | IFF_NO_PI; int is_enabled = 0, is_ether = 0, have_normal_interface = 0; -#if DPDK == 0 - const uword buffer_size = VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES; -#else - const uword buffer_size = MBUF_SIZE; -#endif - + const uword buffer_size = VLIB_BUFFER_DATA_SIZE; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { |