diff options
Diffstat (limited to 'vnet/vnet/devices/netmap/node.c')
-rw-r--r-- | vnet/vnet/devices/netmap/node.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/vnet/vnet/devices/netmap/node.c b/vnet/vnet/devices/netmap/node.c index 9378dfd95bb..4a79fe0f979 100644 --- a/vnet/vnet/devices/netmap/node.c +++ b/vnet/vnet/devices/netmap/node.c @@ -210,13 +210,17 @@ netmap_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, VLIB_BUFFER_TRACE_TRAJECTORY_INIT(first_b0); if (PREDICT_FALSE(n_trace > 0)) { - netmap_input_trace_t *tr; - vlib_trace_buffer (vm, node, next0, first_b0, /* follow_chain */ 0); - vlib_set_trace_count (vm, node, --n_trace); - tr = vlib_add_trace (vm, node, first_b0, sizeof (*tr)); - tr->next_index = next0; - tr->hw_if_index = nif->hw_if_index; - memcpy (&tr->slot, slot, sizeof (struct netmap_slot)); + if (PREDICT_TRUE(first_b0 != 0)) + { + netmap_input_trace_t *tr; + vlib_trace_buffer (vm, node, next0, first_b0, + /* follow_chain */ 0); + vlib_set_trace_count (vm, node, --n_trace); + tr = vlib_add_trace (vm, node, first_b0, sizeof (*tr)); + tr->next_index = next0; + tr->hw_if_index = nif->hw_if_index; + memcpy (&tr->slot, slot, sizeof (struct netmap_slot)); + } } /* enque and take next packet */ vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, |