summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
b0a517b)
Problem:
When the bond subinterface is removed, it was observed that we lost the lacp
partner. Show hardware shows rx counter goes up, but show interface does not
for the slave interfaces.
Cause:
We reset the interface promiscuous mode when the bond subinterface is deleted.
This causes dpdk not to accept any packet. Leave the interface in promiscuous
mode fixes the problem.
Other fixes:
There are few places we use hw_if_index as if they are sw_if_index. But they
don't necessarily have the same value. As soon as a subinterface is created,
they start to diverge. The fix is to use the correct API for the hw_if_index
and sw_if_index.
Change-Id: I1e6b8bca0a4aae396d217a141271cbf968500c91
Signed-off-by: Steven <sluong@cisco.com>
slave_if_t *sif;
clib_error_t *error = 0;
u8 details = 0;
slave_if_t *sif;
clib_error_t *error = 0;
u8 details = 0;
- u32 hw_if_index, *sw_if_indices = 0;
- vnet_interface_main_t *im = &vnm->interface_main;
- vnet_sw_interface_t *sw;
+ u32 sw_if_index, *sw_if_indices = 0;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat
- (input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
+ (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index))
- sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
- sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
+ sif = bond_get_slave_by_sw_if_index (sw_if_index);
if (!sif)
{
error = clib_error_return (0, "interface is not enslaved");
if (!sif)
{
error = clib_error_return (0, "interface is not enslaved");
lacp_main_t *lm = &lacp_main;
u8 onoff = 0;
u8 input_found = 0;
lacp_main_t *lm = &lacp_main;
u8 onoff = 0;
u8 input_found = 0;
slave_if_t *sif;
vnet_main_t *vnm = vnet_get_main ();
slave_if_t *sif;
vnet_main_t *vnm = vnet_get_main ();
- vnet_interface_main_t *im = &vnm->interface_main;
- vnet_sw_interface_t *sw;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "%U",
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "%U",
- unformat_vnet_hw_interface, vnm, &hw_if_index))
+ unformat_vnet_sw_interface, vnm, &sw_if_index))
if (!input_found)
return clib_error_return (0, "must specify on or off");
if (!input_found)
return clib_error_return (0, "must specify on or off");
- sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
- sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
+ sif = bond_get_slave_by_sw_if_index (sw_if_index);
if (!sif)
return (clib_error_return (0, "Please enslave the interface first"));
sif->debug = onoff;
if (!sif)
return (clib_error_return (0, "Please enslave the interface first"));
sif->debug = onoff;
slave_if_t *sif;
vnet_sw_interface_t *sw;
vlib_main_t *vm = lm->vlib_main;
slave_if_t *sif;
vnet_sw_interface_t *sw;
vlib_main_t *vm = lm->vlib_main;
- vnet_interface_main_t *im = &vnm->interface_main;
- sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
+ sw = vnet_get_hw_sw_interface (vnm, hw_if_index);
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
if (sif)
{
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
if (sif)
{
bond_main_t *bm = &bond_main;
vnet_main_t *vnm = vnet_get_main ();
int i;
bond_main_t *bm = &bond_main;
vnet_main_t *vnm = vnet_get_main ();
int i;
- vnet_hw_interface_t *sif_hw, *bif_hw;
+ vnet_hw_interface_t *sif_hw;
sif_hw = vnet_get_sup_hw_interface (vnm, sif->sw_if_index);
sif_hw = vnet_get_sup_hw_interface (vnm, sif->sw_if_index);
- bif_hw = vnet_get_sup_hw_interface (vnm, bif->sw_if_index);
bif->port_number_bitmap =
clib_bitmap_set (bif->port_number_bitmap,
bif->port_number_bitmap =
clib_bitmap_set (bif->port_number_bitmap,
- if (bif_hw->l2_if_count)
- {
- ethernet_set_flags (vnm, sif_hw->hw_if_index, 0);
- /* Allow ip packets to go directly to ip4-input etc */
- ethernet_set_rx_redirect (vnm, sif_hw, 0);
- }
-
bond_disable_collecting_distributing (vm, sif);
/* Put back the old mac */
bond_disable_collecting_distributing (vm, sif);
/* Put back the old mac */
ethernet_set_rx_redirect (vnm, sif_hw, 1);
}
}
ethernet_set_rx_redirect (vnm, sif_hw, 1);
}
}
- else if ((bif_hw->l2_if_count == 0) && (l2_if_adjust == -1))
- {
- /* Just removed last L2 subinterface on this port */
- vec_foreach (sw_if_index, bif->slaves)
- {
- sif_hw = vnet_get_sup_hw_interface (vnm, *sw_if_index);
- ethernet_set_flags (vnm, sif_hw->hw_if_index, 0);
-
- /* Allow ip packets to go directly to ip4-input etc */
- ethernet_set_rx_redirect (vnm, sif_hw, 0);
- }
- }
slave_if_t *sif;
vnet_sw_interface_t *sw;
vlib_main_t *vm = bm->vlib_main;
slave_if_t *sif;
vnet_sw_interface_t *sw;
vlib_main_t *vm = bm->vlib_main;
- vnet_interface_main_t *im = &vnm->interface_main;
- sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
+ sw = vnet_get_hw_sw_interface (vnm, hw_if_index);
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
if (sif)
{
sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
if (sif)
{