X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_patch.c;h=5697fb6a8ae64c8ff9c9cc286627f38a15f4cd84;hb=38c619115;hp=e2d2a679662175e500a9457d2407692588884637;hpb=c3baf62702b7b9d339f10da48a55039e7ddc6bc9;p=vpp.git diff --git a/src/vnet/l2/l2_patch.c b/src/vnet/l2/l2_patch.c index e2d2a679662..5697fb6a8ae 100644 --- a/src/vnet/l2/l2_patch.c +++ b/src/vnet/l2/l2_patch.c @@ -14,7 +14,6 @@ */ #include #include -#include #include #include #include @@ -49,9 +48,13 @@ format_l2_patch_trace (u8 * s, va_list * args) return s; } +#ifndef CLIB_MARCH_VARIANT l2_patch_main_t l2_patch_main; +#else +extern l2_patch_main_t l2_patch_main; +#endif -static vlib_node_registration_t l2_patch_node; +extern vlib_node_registration_t l2_patch_node; #define foreach_l2_patch_error \ _(PATCHED, "L2 patch packets") \ @@ -204,7 +207,7 @@ VLIB_NODE_FN (l2_patch_node) (vlib_main_t * vm, } /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_patch_node, static) = { +VLIB_REGISTER_NODE (l2_patch_node) = { .name = "l2-patch", .vector_size = sizeof (u32), .format_trace = format_l2_patch_trace, @@ -266,15 +269,19 @@ vnet_l2_patch_add_del (u32 rx_sw_if_index, u32 tx_sw_if_index, int is_add) ETHERNET_INTERFACE_FLAG_ACCEPT_ALL); vnet_feature_enable_disable ("device-input", "l2-patch", - rxhi->hw_if_index, 1, 0, 0); + rxhi->sw_if_index, 1, 0, 0); + vnet_feature_enable_disable ("port-rx-eth", "l2-patch", + rxhi->sw_if_index, 1, 0, 0); } else { ethernet_set_flags (l2pm->vnet_main, rxhi->hw_if_index, - 0 /* disable promiscuous mode */ ); + /*ETHERNET_INTERFACE_FLAG_DEFAULT_L3 */ 0); vnet_feature_enable_disable ("device-input", "l2-patch", - rxhi->hw_if_index, 0, 0, 0); + rxhi->sw_if_index, 0, 0, 0); + vnet_feature_enable_disable ("port-rx-eth", "l2-patch", + rxhi->sw_if_index, 0, 0, 0); if (vec_len (l2pm->tx_next_by_rx_sw_if_index) > rx_sw_if_index) { l2pm->tx_next_by_rx_sw_if_index[rx_sw_if_index] = ~0;