aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/node.c
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-12-18 16:29:45 +0100
committerDamjan Marion <dmarion@me.com>2021-01-22 09:06:15 +0000
commit85c1943e521a5c1289ee19d49d8e41012f8b7a99 (patch)
treed50aba5c637fcbe6a982ff655d9db013ad78cd6e /src/vnet/devices/af_packet/node.c
parent313380f9501ad36637d32dd9801a75c1b668fdc3 (diff)
devices: adapt af_packet to new rxq framework
Change-Id: If8077280cef501599f810ad9255efa2a5a451ced Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
Diffstat (limited to 'src/vnet/devices/af_packet/node.c')
-rw-r--r--src/vnet/devices/af_packet/node.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c
index 61d4ce2d1f5..d444b3b6eea 100644
--- a/src/vnet/devices/af_packet/node.c
+++ b/src/vnet/devices/af_packet/node.c
@@ -23,7 +23,7 @@
#include <vlib/unix/unix.h>
#include <vnet/ip/ip.h>
#include <vnet/ethernet/ethernet.h>
-#include <vnet/devices/devices.h>
+#include <vnet/interface/rx_queue_funcs.h>
#include <vnet/feature/feature.h>
#include <vnet/ethernet/packet.h>
@@ -352,16 +352,15 @@ VLIB_NODE_FN (af_packet_input_node) (vlib_main_t * vm,
{
u32 n_rx_packets = 0;
af_packet_main_t *apm = &af_packet_main;
- vnet_device_input_runtime_t *rt = (void *) node->runtime_data;
- vnet_device_and_queue_t *dq;
-
- foreach_device_and_queue (dq, rt->devices_and_queues)
- {
- af_packet_if_t *apif;
- apif = vec_elt_at_index (apm->interfaces, dq->dev_instance);
- if (apif->is_admin_up)
- n_rx_packets += af_packet_device_input_fn (vm, node, frame, apif);
- }
+ vnet_hw_if_rxq_poll_vector_t *pv;
+ pv = vnet_hw_if_get_rxq_poll_vector (vm, node);
+ for (int i = 0; i < vec_len (pv); i++)
+ {
+ af_packet_if_t *apif;
+ apif = vec_elt_at_index (apm->interfaces, pv[i].dev_instance);
+ if (apif->is_admin_up)
+ n_rx_packets += af_packet_device_input_fn (vm, node, frame, apif);
+ }
return n_rx_packets;
}