aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2020-05-14 15:02:16 -0400
committerDave Wallace <dwallacelf@gmail.com>2020-06-11 14:44:11 +0000
commit93dd1da259fba344b4620a5241b74be5de8bd254 (patch)
treec318be5e0b072391b6e551ffd7a51777e334dbb9 /src
parenta37c63c6d841168cb59aa428f89a3effc5f9669e (diff)
l2: L2/L3 mode swicth cleanup and l2-patch fix
Cleanup L2/L3 mode switch to not redirect to/from ethernet-input node as it is no longer necessary. L2 patch should use sw_if_index for device feature enable/disable. Type: fix Signed-off-by: John Lo <loj@cisco.com> Change-Id: I0f24161d027b07c188fd1e05276146f94c075710 (cherry picked from commit f415a3b53a51b261d08cc3312c25f250d6bc1bd6)
Diffstat (limited to 'src')
-rw-r--r--src/vnet/bonding/cli.c11
-rw-r--r--src/vnet/bonding/device.c8
-rw-r--r--src/vnet/l2/l2_input.c22
-rw-r--r--src/vnet/l2/l2_patch.c6
4 files changed, 16 insertions, 31 deletions
diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c
index d9a6408206e..92a9ff067f6 100644
--- a/src/vnet/bonding/cli.c
+++ b/src/vnet/bonding/cli.c
@@ -727,12 +727,11 @@ bond_enslave (vlib_main_t * vm, bond_enslave_args_t * args)
bond_slave_add_del_mac_addrs (bif, sif->sw_if_index, 1 /* is_add */ );
if (bif_hw->l2_if_count)
- {
- ethernet_set_flags (vnm, sif_hw->hw_if_index,
- ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);
- /* ensure all packets go to ethernet-input */
- ethernet_set_rx_redirect (vnm, sif_hw, 1);
- }
+ ethernet_set_flags (vnm, sif_hw->hw_if_index,
+ ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);
+ else
+ ethernet_set_flags (vnm, sif_hw->hw_if_index,
+ /*ETHERNET_INTERFACE_FLAG_DEFAULT_L3 */ 0);
if (bif->mode == BOND_MODE_LACP)
{
diff --git a/src/vnet/bonding/device.c b/src/vnet/bonding/device.c
index 550321b3763..b3069fe0f13 100644
--- a/src/vnet/bonding/device.c
+++ b/src/vnet/bonding/device.c
@@ -99,9 +99,6 @@ bond_set_l2_mode_function (vnet_main_t * vnm,
sif_hw = vnet_get_sup_hw_interface (vnm, *sw_if_index);
ethernet_set_flags (vnm, sif_hw->hw_if_index,
ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);
-
- /* ensure all packets go to ethernet-input */
- ethernet_set_rx_redirect (vnm, sif_hw, 1);
}
}
else if ((bif_hw->l2_if_count == 0) && (l2_if_adjust == -1))
@@ -110,9 +107,8 @@ bond_set_l2_mode_function (vnet_main_t * vnm,
vec_foreach (sw_if_index, bif->slaves)
{
sif_hw = vnet_get_sup_hw_interface (vnm, *sw_if_index);
-
- /* Allow ip packets to go directly to ip4-input etc */
- ethernet_set_rx_redirect (vnm, sif_hw, 0);
+ ethernet_set_flags (vnm, sif_hw->hw_if_index,
+ /*ETHERNET_INTERFACE_FLAG_DEFAULT_L3 */ 0);
}
}
diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c
index 7b93fba20b1..8a7ab802175 100644
--- a/src/vnet/l2/l2_input.c
+++ b/src/vnet/l2/l2_input.c
@@ -800,9 +800,6 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */
config->feature_bitmap &=
~(L2INPUT_FEAT_LEARN | L2INPUT_FEAT_FWD | L2INPUT_FEAT_FLOOD);
shg = 0; /* not used in xconnect */
-
- /* Insure all packets go to ethernet-input */
- ethernet_set_rx_redirect (vnet_main, hi, 1);
}
/* set up split-horizon group and set output feature bit */
@@ -827,25 +824,18 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */
{
if ((hi->l2_if_count == 1) && (l2_if_adjust == 1))
{
- /* Just added first L2 interface on this port */
-
- /* Set promiscuous mode on the l2 interface */
+ /* Just added first L2 interface on this port
+ * Set promiscuous mode on the l2 interface */
ethernet_set_flags (vnet_main, hi->hw_if_index,
ETHERNET_INTERFACE_FLAG_ACCEPT_ALL);
-
- /* ensure all packets go to ethernet-input */
- ethernet_set_rx_redirect (vnet_main, hi, 1);
-
}
else if ((hi->l2_if_count == 0) && (l2_if_adjust == -1))
{
- /* Just removed only L2 subinterface on this port */
-
- /* Disable promiscuous mode on the l2 interface */
- ethernet_set_flags (vnet_main, hi->hw_if_index, 0);
+ /* Just removed only L2 subinterface on this port
+ * Disable promiscuous mode on the l2 interface */
+ ethernet_set_flags (vnet_main, hi->hw_if_index,
+ /*ETHERNET_INTERFACE_FLAG_DEFAULT_L3 */ 0);
- /* Allow ip packets to go directly to ip4-input etc */
- ethernet_set_rx_redirect (vnet_main, hi, 0);
}
}
diff --git a/src/vnet/l2/l2_patch.c b/src/vnet/l2/l2_patch.c
index fb8849dc261..618ae20536d 100644
--- a/src/vnet/l2/l2_patch.c
+++ b/src/vnet/l2/l2_patch.c
@@ -270,15 +270,15 @@ 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);
}
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);
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;