diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2021-11-09 17:44:10 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-12-03 13:12:13 +0000 |
commit | 0d05c0d214ffd326e531bea58f3c971bb9a58252 (patch) | |
tree | bacf7eacaac10a3c62c583f1a508156a778c4ae2 /src/vnet/interface/tx_queue_funcs.h | |
parent | 5d5f85f5e4003476fb6d9a0ccd6ad58ad90e5138 (diff) |
interface: add multi tx-queues support for new tx infra
Type: feature
Change-Id: I231f782b3c56dc2b10321e4569ac7acdad1c11da
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/interface/tx_queue_funcs.h')
-rw-r--r-- | src/vnet/interface/tx_queue_funcs.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vnet/interface/tx_queue_funcs.h b/src/vnet/interface/tx_queue_funcs.h index 22956a4eb9b..8fcf7c336a8 100644 --- a/src/vnet/interface/tx_queue_funcs.h +++ b/src/vnet/interface/tx_queue_funcs.h @@ -27,3 +27,20 @@ vnet_hw_if_get_tx_queue (vnet_main_t *vnm, u32 queue_index) return 0; return pool_elt_at_index (im->hw_if_tx_queues, queue_index); } + +static_always_inline int +vnet_hw_if_txq_cmp_cli_api (vnet_hw_if_tx_queue_t **a, + vnet_hw_if_tx_queue_t **b) +{ + if (*a == *b) + return 0; + + if (a[0]->hw_if_index != b[0]->hw_if_index) + return 2 * (a[0]->hw_if_index > b[0]->hw_if_index) - 1; + + if (a[0]->queue_id != b[0]->queue_id) + return 2 * (a[0]->queue_id > b[0]->queue_id) - 1; + + ASSERT (0); + return ~0; +} |