aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Yu <michael.a.yu@nokia-sbell.com>2019-08-30 00:50:16 +0800
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-28 20:20:42 +0000
commit61b1d46db0068a35c1ac51b93019dbe8122129ac (patch)
treeab9be0a026f1644da2b1bfe255ef10b0c53bb1cb
parenta2c0637129f0c642a4d55df297bb353243ca7a49 (diff)
devices: fix issue of per_interface_next_index
Per interface, next hop graph node can be customized with vnet_hw_interface_rx_redirect_to_node function, but it doesn't work well for af-packet type interface. In current implementation, with function af_packet_set_interface_next_node invoked next hop graph node index can be set to apif->per_interface_next_index, but it's not set to next0 properly for packet processing in af_packet_device_input_fn. Type: fix Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com> Change-Id: I8e132ddd1c3c01b6f476de78546d4a9389b3ff87 Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com> (cherry picked from commit 90b34ed67a516c4391ad353ba431f8419b582d50)
-rw-r--r--src/vnet/devices/af_packet/node.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c
index 3c91c981618..85f3e0118cf 100644
--- a/src/vnet/devices/af_packet/node.c
+++ b/src/vnet/devices/af_packet/node.c
@@ -195,9 +195,6 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
u32 n_buffer_bytes = vlib_buffer_get_default_data_size (vm);
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[thread_index]);
if (PREDICT_FALSE (n_free_bufs < VLIB_FRAME_SIZE))
{
@@ -302,6 +299,10 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
else
{
next0 = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
+
+ if (PREDICT_FALSE (apif->per_interface_next_index != ~0))
+ next0 = apif->per_interface_next_index;
+
/* redirect if feature path enabled */
vnet_feature_start_device_input_x1 (apif->sw_if_index, &next0,
first_b0);