summaryrefslogtreecommitdiffstats
path: root/src/plugins/af_xdp/input.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-11-25 10:41:26 +0100
committerDamjan Marion <dmarion@me.com>2021-01-21 13:22:40 +0000
commit426a306cc10559275b809d68f3045deb80f928cb (patch)
treead4e01dc101f172ccbbaa559386d89ff9c407a2e /src/plugins/af_xdp/input.c
parent692b52dca66770e48aae550efce7145c31b0a4f6 (diff)
af_xdp: update interrupt mode to new infra
Type: improvement Change-Id: Icb23af5f5e458a555f416cb0a829e84646b25dd9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/af_xdp/input.c')
-rw-r--r--src/plugins/af_xdp/input.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/plugins/af_xdp/input.c b/src/plugins/af_xdp/input.c
index 2cf121fb69d..65eee75cb92 100644
--- a/src/plugins/af_xdp/input.c
+++ b/src/plugins/af_xdp/input.c
@@ -21,6 +21,7 @@
#include <vlib/pci/pci.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/devices/devices.h>
+#include <vnet/interface/rx_queue_funcs.h>
#include "af_xdp.h"
#define foreach_af_xdp_input_error \
@@ -326,22 +327,22 @@ VLIB_NODE_FN (af_xdp_input_node) (vlib_main_t * vm,
{
u32 n_rx = 0;
af_xdp_main_t *am = &af_xdp_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_xdp_device_t *ad;
- ad = vec_elt_at_index (am->devices, dq->dev_instance);
- if ((ad->flags & AF_XDP_DEVICE_F_ADMIN_UP) == 0)
- continue;
- if (PREDICT_TRUE (ad->flags & AF_XDP_DEVICE_F_ZEROCOPY))
- n_rx += af_xdp_device_input_inline (vm, node, frame, ad, dq->queue_id,
- /* copy */ 0);
- else
- n_rx += af_xdp_device_input_inline (vm, node, frame, ad, dq->queue_id,
- /* copy */ 1);
- }
+ vnet_hw_if_rxq_poll_vector_t *p,
+ *pv = vnet_hw_if_get_rxq_poll_vector (vm, node);
+
+ vec_foreach (p, pv)
+ {
+ af_xdp_device_t *ad = vec_elt_at_index (am->devices, p->dev_instance);
+ if ((ad->flags & AF_XDP_DEVICE_F_ADMIN_UP) == 0)
+ continue;
+ if (PREDICT_TRUE (ad->flags & AF_XDP_DEVICE_F_ZEROCOPY))
+ n_rx += af_xdp_device_input_inline (vm, node, frame, ad, p->queue_id,
+ /* copy */ 0);
+ else
+ n_rx += af_xdp_device_input_inline (vm, node, frame, ad, p->queue_id,
+ /* copy */ 1);
+ }
+
return n_rx;
}