summaryrefslogtreecommitdiffstats
path: root/src/plugins/rdma/input.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-03-02 17:36:30 +0100
committerDamjan Marion <damarion@cisco.com>2020-03-02 19:27:31 +0100
commita3188febc0bc690f2dc09e67ac68ad41000dd46c (patch)
tree392f97fa3b0766a6a4a58fc5be8085571d7f1bb6 /src/plugins/rdma/input.c
parent516e4ed668705bdf0fc138f29275db8c152d19f5 (diff)
rdma: use per-thread buffer template
Type: improvement Change-Id: Ie6f2c79e0a769f70eab079c75a500b9308dd51e6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/rdma/input.c')
-rw-r--r--src/plugins/rdma/input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/rdma/input.c b/src/plugins/rdma/input.c
index 95909f4c251..8f3bdb773e0 100644
--- a/src/plugins/rdma/input.c
+++ b/src/plugins/rdma/input.c
@@ -269,7 +269,10 @@ static_always_inline uword
rdma_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame, rdma_device_t * rd, u16 qid)
{
+ rdma_main_t *rm = &rdma_main;
vnet_main_t *vnm = vnet_get_main ();
+ rdma_per_thread_data_t *ptd = vec_elt_at_index (rm->per_thread_data,
+ vm->thread_index);
rdma_rxq_t *rxq = vec_elt_at_index (rd->rxqs, qid);
struct ibv_wc wc[VLIB_FRAME_SIZE];
vlib_buffer_t bt;
@@ -290,13 +293,9 @@ rdma_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
}
/* init buffer template */
- clib_memset_u64 (&bt, 0,
- STRUCT_OFFSET_OF (vlib_buffer_t,
- template_end) / sizeof (u64));
+ vlib_buffer_copy_template (&bt, &ptd->buffer_template);
vnet_buffer (&bt)->sw_if_index[VLIB_RX] = rd->sw_if_index;
- vnet_buffer (&bt)->sw_if_index[VLIB_TX] = ~0;
bt.buffer_pool_index = rd->pool;
- bt.ref_count = 1;
/* update buffer template for input feature arcs if any */
next_index = rd->per_interface_next_index;