Skip to content

Commit ba789fb

Browse files
dmertmananguy11
authored andcommitted
ice: support non-standard teardown of bond interface
Code for supporting removal of the PF driver (NETDEV_UNREGISTER) events for both when the bond has the primary interface as active and when failed over to thew secondary interface. Reviewed-by: Daniel Machon <daniel.machon@microchip.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 1e0f988 commit ba789fb

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

drivers/net/ethernet/intel/ice/ice_lag.c

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,15 +1190,16 @@ static void ice_lag_changeupper_event(struct ice_lag *lag, void *ptr)
11901190
if (!primary_lag && lag->primary)
11911191
primary_lag = lag;
11921192

1193-
if (primary_lag) {
1194-
if (!lag->primary) {
1195-
ice_lag_set_swid(0, lag, false);
1196-
} else {
1193+
if (!lag->primary) {
1194+
ice_lag_set_swid(0, lag, false);
1195+
} else {
1196+
if (primary_lag && lag->primary) {
11971197
ice_lag_primary_swid(lag, false);
11981198
ice_lag_del_prune_list(primary_lag, lag->pf);
11991199
}
1200-
ice_lag_cfg_cp_fltr(lag, false);
12011200
}
1201+
/* remove filter for control packets */
1202+
ice_lag_cfg_cp_fltr(lag, false);
12021203
}
12031204
}
12041205

@@ -1401,6 +1402,38 @@ ice_lag_chk_comp(struct ice_lag *lag, void *ptr)
14011402
static void
14021403
ice_lag_unregister(struct ice_lag *lag, struct net_device *event_netdev)
14031404
{
1405+
struct ice_netdev_priv *np;
1406+
struct ice_pf *event_pf;
1407+
struct ice_lag *p_lag;
1408+
1409+
p_lag = ice_lag_find_primary(lag);
1410+
np = netdev_priv(event_netdev);
1411+
event_pf = np->vsi->back;
1412+
1413+
if (p_lag) {
1414+
if (p_lag->active_port != p_lag->pf->hw.port_info->lport &&
1415+
p_lag->active_port != ICE_LAG_INVALID_PORT) {
1416+
struct ice_hw *active_hw;
1417+
1418+
active_hw = ice_lag_find_hw_by_lport(lag,
1419+
p_lag->active_port);
1420+
if (active_hw)
1421+
ice_lag_reclaim_vf_nodes(p_lag, active_hw);
1422+
lag->active_port = ICE_LAG_INVALID_PORT;
1423+
}
1424+
}
1425+
1426+
/* primary processing for primary */
1427+
if (lag->primary && lag->netdev == event_netdev)
1428+
ice_lag_primary_swid(lag, false);
1429+
1430+
/* primary processing for secondary */
1431+
if (lag->primary && lag->netdev != event_netdev)
1432+
ice_lag_del_prune_list(lag, event_pf);
1433+
1434+
/* secondary processing for secondary */
1435+
if (!lag->primary && lag->netdev == event_netdev)
1436+
ice_lag_set_swid(0, lag, false);
14041437
}
14051438

14061439
/**
@@ -1470,8 +1503,8 @@ static void ice_lag_process_event(struct work_struct *work)
14701503
case NETDEV_UNREGISTER:
14711504
if (ice_is_feature_supported(pf, ICE_F_SRIOV_LAG)) {
14721505
netdev = lag_work->info.bonding_info.info.dev;
1473-
if (netdev == lag_work->lag->netdev &&
1474-
lag_work->lag->bonded)
1506+
if ((netdev == lag_work->lag->netdev ||
1507+
lag_work->lag->primary) && lag_work->lag->bonded)
14751508
ice_lag_unregister(lag_work->lag, netdev);
14761509
}
14771510
break;

0 commit comments

Comments
 (0)