From eae83d1fea70085624e9dd203bf2df0e859617b9 Mon Sep 17 00:00:00 2001 From: Saeed Mahameed Date: Wed, 27 Nov 2013 15:50:11 +0200 Subject: [PATCH] mlx4_vnic: always remove child macs in vnic_parent_update remove request Child macs are not removed in host admin vnics once the connection is lost with BX. This caused a loss of connectivity for child vnics in case of connection restored with the BX, since the BX is not aware of the old child macs. Solution is to always remove child macs when vnic_paren_update is called with remove request. Signed-off-by: Saeed Mahameed (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker --- drivers/net/ethernet/mellanox/mlx4_vnic/vnic_data_mac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4_vnic/vnic_data_mac.c b/drivers/net/ethernet/mellanox/mlx4_vnic/vnic_data_mac.c index 996d70dbbc80..b024db65784e 100644 --- a/drivers/net/ethernet/mellanox/mlx4_vnic/vnic_data_mac.c +++ b/drivers/net/ethernet/mellanox/mlx4_vnic/vnic_data_mac.c @@ -352,18 +352,19 @@ int vnic_parent_update(struct vnic_port *port, char *name, u16 vnic_id, vnic_dbg_mac(name, "checking parent %s for child %s (expect %s)\n", login->dev->name, name, parent_name); /* check if parent vnic has valid QPN and not being destroyed */ - if (!strcmp(login->dev->name, parent_name) && + if ((!strcmp(login->dev->name, parent_name) && test_bit(VNIC_STATE_LOGIN_PRECREATE_2, &login->fip_vnic->login_state) && - !login->fip_vnic->flush) { + !login->fip_vnic->flush) || (!strcmp(login->dev->name, parent_name) && remove)) { /* sync qp_base_num with parent */ if (qp_base_num_ptr) *qp_base_num_ptr = login->qp_base_num; /* update mac_tree and mace vnic_id */ + vnic_dbg_mac(name, "update child %s remove=%d\n", name, remove); write_lock_bh(&login->mac_rwlock); rc = vnic_mace_update(login, mac, vnic_id, remove); + vnic_child_update(login, mac, remove); write_unlock_bh(&login->mac_rwlock); - break; } } -- 2.50.1