summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vnet/vnet/devices/af_packet/af_packet.c1
-rw-r--r--vnet/vnet/devices/af_packet/node.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/vnet/vnet/devices/af_packet/af_packet.c b/vnet/vnet/devices/af_packet/af_packet.c
index bbaabad2fd0..1b07e890c82 100644
--- a/vnet/vnet/devices/af_packet/af_packet.c
+++ b/vnet/vnet/devices/af_packet/af_packet.c
@@ -209,6 +209,7 @@ af_packet_create_if(vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set)
apif->rx_req = rx_req;
apif->tx_req = tx_req;
apif->host_if_name = host_if_name;
+ apif->per_interface_next_index = ~0;
{
unix_file_t template = {0};
diff --git a/vnet/vnet/devices/af_packet/node.c b/vnet/vnet/devices/af_packet/node.c
index efe0e1c2586..bc0ab8c6b83 100644
--- a/vnet/vnet/devices/af_packet/node.c
+++ b/vnet/vnet/devices/af_packet/node.c
@@ -140,6 +140,9 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
u32 min_bufs = apif->rx_req->tp_frame_size / n_buffer_bytes;
+ if (apif->per_interface_next_index != ~0)
+ next_index = apif->per_interface_next_index;
+
n_free_bufs = vec_len (apm->rx_buffers);
if (PREDICT_FALSE(n_free_bufs < VLIB_FRAME_SIZE))
{
@@ -153,7 +156,7 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
while ((tph->tp_status & TP_STATUS_USER) && (n_free_bufs > min_bufs))
{
vlib_buffer_t * b0, * first_b0 = 0;
- u32 next0 = AF_PACKET_INPUT_NEXT_ETHERNET_INPUT;
+ u32 next0 = next_index;
u32 n_left_to_next;
vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);