From: Saeed Mahameed Date: Wed, 27 Nov 2013 13:50:11 +0000 (+0200) Subject: mlx4_vnic: always remove child macs in vnic_parent_update remove request X-Git-Tag: v4.1.12-92~293^2~1^2~59 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=eae83d1fea70085624e9dd203bf2df0e859617b9;p=users%2Fjedix%2Flinux-maple.git 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 --- 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 996d70dbbc802..b024db65784e8 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; } }