dpdk: dpdk-input optimizations and fixes
- fix issue caused by assumption that ethertype starts at 0 - intoduce buffer templates to speed-up vlib_buffer_t metadata initialization - avoid check for multiseg buffers inside loop if multiseg is disabled - interleave prefetches to reduce load on L1 cache Change-Id: I3b76e6d3e1e15ed28f01625edb7fbe9f38112e03 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
@ -16,6 +16,10 @@ vppplugins_LTLIBRARIES += dpdk_plugin.la
|
||||
|
||||
dpdk_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--whole-archive,-l:libdpdk.a,--no-whole-archive,-lm,-ldl
|
||||
|
||||
# due to internal compiler error in GCC when compiling dpdk/device/node.c
|
||||
# debug sysmbols level reduced to 1. See GCC PR #79953 for details
|
||||
CFLAGS += -g1
|
||||
|
||||
dpdk_plugin_la_SOURCES = \
|
||||
dpdk/main.c \
|
||||
dpdk/buffer.c \
|
||||
|
@ -338,6 +338,9 @@ typedef struct
|
||||
/* per-thread recycle lists */
|
||||
u32 **recycle;
|
||||
|
||||
/* per-thread buffer templates */
|
||||
vlib_buffer_t *buffer_templates;
|
||||
|
||||
/* buffer flags template, configurable to enable/disable tcp / udp cksum */
|
||||
u32 buffer_flags_template;
|
||||
|
||||
|
@ -572,6 +572,21 @@ dpdk_lib_init (dpdk_main_t * dm)
|
||||
dm->buffer_flags_template &= ~(IP_BUFFER_L4_CHECKSUM_CORRECT
|
||||
| IP_BUFFER_L4_CHECKSUM_COMPUTED);
|
||||
|
||||
/* vlib_buffer_t template */
|
||||
vec_validate_aligned (dm->buffer_templates, tm->n_vlib_mains - 1,
|
||||
CLIB_CACHE_LINE_BYTES);
|
||||
for (i = 0; i < tm->n_vlib_mains; i++)
|
||||
{
|
||||
vlib_buffer_free_list_t *fl;
|
||||
vlib_buffer_t *bt = vec_elt_at_index (dm->buffer_templates, i);
|
||||
fl = vlib_buffer_get_free_list (vm,
|
||||
VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
|
||||
vlib_buffer_init_for_free_list (bt, fl);
|
||||
bt->flags = dm->buffer_flags_template;
|
||||
bt->current_data = -RTE_PKTMBUF_HEADROOM;
|
||||
vnet_buffer (bt)->sw_if_index[VLIB_TX] = (u32) ~ 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < nports; i++)
|
||||
{
|
||||
u8 addr[6];
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user