aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-05-19 11:18:20 +0200
committerDamjan Marion <dmarion@me.com>2021-05-19 13:26:53 +0000
commitfbb02c432dbadd4e2faf0a378ac012972c4bed98 (patch)
tree750f5346b68683e9b70d1a5763371baf93906fff /src/vnet
parent6ab29d4193abeb03e2c988564fb6d22585565524 (diff)
interface: shared tx queue support
Type: improvement Change-Id: I6bb7b6d6bd63b044952ab981be5b0673144c9834 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/interface.h1
-rw-r--r--src/vnet/interface/runtime.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index f65b653c5d4..a761b04aff8 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -630,6 +630,7 @@ typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
vnet_hw_if_tx_frame_t frame;
+ u32 n_threads;
} vnet_hw_if_output_node_runtime_t;
/* Hardware-interface. This corresponds to a physical wire
diff --git a/src/vnet/interface/runtime.c b/src/vnet/interface/runtime.c
index f93bb1c0ea0..e899d7ab9c8 100644
--- a/src/vnet/interface/runtime.c
+++ b/src/vnet/interface/runtime.c
@@ -180,22 +180,24 @@ vnet_hw_if_update_runtime_data (vnet_main_t *vnm, u32 hw_if_index)
u32 thread_index;
u32 queue_index = hi->tx_queue_indices[i];
vnet_hw_if_tx_queue_t *txq = vnet_hw_if_get_tx_queue (vnm, queue_index);
+ uword n_threads = clib_bitmap_count_set_bits (txq->threads);
clib_bitmap_foreach (thread_index, txq->threads)
{
vnet_hw_if_output_node_runtime_t *rt;
rt = vec_elt_at_index (new_out_runtimes, thread_index);
if ((rt->frame.queue_id != txq->queue_id) ||
- (rt->frame.shared_queue != txq->shared_queue))
+ (rt->n_threads != n_threads))
{
log_debug ("tx queue data changed for interface %v, thread %u "
- "(queue_id %u -> %u, shared_queue %u -> %u)",
+ "(queue_id %u -> %u, n_threads %u -> %u)",
hi->name, thread_index, rt->frame.queue_id,
- txq->queue_id, rt->frame.shared_queue,
- txq->shared_queue);
+ txq->queue_id, rt->n_threads, n_threads);
something_changed_on_tx = 1;
rt->frame.queue_id = txq->queue_id;
rt->frame.shared_queue = txq->shared_queue;
+ rt->frame.shared_queue = n_threads > 1 ? 1 : 0;
+ rt->n_threads = n_threads;
}
}
}