diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2022-08-30 13:29:06 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-08-31 09:15:31 +0000 |
commit | 89733a15ce329a69bb37ea91ceab7a50064ec0a0 (patch) | |
tree | ea817f63b00b8dedbb4ba1e300e13ecdb09de44d /src/vnet/devices/af_packet/node.c | |
parent | 36cb2f03ae4448332869ca1d43c88ed91609f45b (diff) |
devices: add support for polling mode
Type: improvement
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I8d84dc8b7f5c5e863c32838cfafc3d366e2a7e00
Diffstat (limited to 'src/vnet/devices/af_packet/node.c')
-rw-r--r-- | src/vnet/devices/af_packet/node.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c index 1fc061982c1..0e522c913ad 100644 --- a/src/vnet/devices/af_packet/node.c +++ b/src/vnet/devices/af_packet/node.c @@ -504,12 +504,15 @@ af_packet_device_input_fn (vlib_main_t *vm, vlib_node_runtime_t *node, done: - if ((((block_desc_t *) (block_start = rx_queue->rx_ring[block])) - ->hdr.bh1.block_status & - TP_STATUS_USER) != 0) - vlib_node_set_state (vm, node->node_index, VLIB_NODE_STATE_POLLING); - else - vlib_node_set_state (vm, node->node_index, VLIB_NODE_STATE_INTERRUPT); + if (apm->polling_count == 0) + { + if ((((block_desc_t *) (block_start = rx_queue->rx_ring[block])) + ->hdr.bh1.block_status & + TP_STATUS_USER) != 0) + vlib_node_set_state (vm, node->node_index, VLIB_NODE_STATE_POLLING); + else + vlib_node_set_state (vm, node->node_index, VLIB_NODE_STATE_INTERRUPT); + } vlib_error_count (vm, node->node_index, AF_PACKET_INPUT_ERROR_TOTAL_RECV_BLK, total); |