aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2015-12-16 19:31:59 +0100
committerDamjan Marion <damarion@cisco.com>2015-12-16 19:32:05 +0100
commitdb2c6c6eee9a08083af3f9dc778b63416e214ea4 (patch)
tree84cde81ba4a2746195f7681e5895e0dbec96512e /vnet
parentfa1a6a4dd3af06523bf3cd53b4b21e7f32edec9a (diff)
Don't send more than one mapping req in l2output node
Change-Id: I4205613818d664abb94b62a33e1353b87d5b1c7d Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/interface.h4
-rw-r--r--vnet/vnet/l2/l2_output.c16
2 files changed, 17 insertions, 3 deletions
diff --git a/vnet/vnet/interface.h b/vnet/vnet/interface.h
index f441f9e1027..1ddd259a0b4 100644
--- a/vnet/vnet/interface.h
+++ b/vnet/vnet/interface.h
@@ -263,6 +263,10 @@ typedef struct vnet_hw_interface_t {
VNET_HW_INTERFACE_FLAG_SPEED_40G | \
VNET_HW_INTERFACE_FLAG_SPEED_100G)
+ /* l2output node flags */
+#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_SHIFT 9
+#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED (1 << 9)
+
/* Hardware address as vector. Zero (e.g. zero-length vector) if no
address for this class (e.g. PPP). */
u8 * hw_address;
diff --git a/vnet/vnet/l2/l2_output.c b/vnet/vnet/l2/l2_output.c
index a5424866db1..02862138928 100644
--- a/vnet/vnet/l2/l2_output.c
+++ b/vnet/vnet/l2/l2_output.c
@@ -477,17 +477,27 @@ u32 l2output_create_output_node_mapping (
#if DPDK > 0
uword cpu_number;
+ hw0 = vnet_get_sup_hw_interface (vnet_main, sw_if_index);
+
cpu_number = os_get_cpu_number();
if (cpu_number)
{
+ u32 oldflags;
+ vlib_node_t *error_drop_node;
+
+ error_drop_node = vlib_get_node_by_name (vlib_main, (u8 *) "error-drop");
+ oldflags = __sync_fetch_and_or(&hw0->flags,
+ VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED);
+
+ if ((oldflags & VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED) )
+ return error_drop_node->index;
+
output_node_mapping_send_rpc (node_index, sw_if_index);
- return 0;
+ return error_drop_node->index;
}
#endif
- hw0 = vnet_get_sup_hw_interface (vnet_main, sw_if_index);
-
// dynamically create graph node arc
next = vlib_node_add_next (vlib_main,
node_index,