]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4_vnic: always remove child macs in vnic_parent_update remove request
authorSaeed Mahameed <saeedm@mellanox.com>
Wed, 27 Nov 2013 13:50:11 +0000 (15:50 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:14 +0000 (14:45 -0700)
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 <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/net/ethernet/mellanox/mlx4_vnic/vnic_data_mac.c

index 996d70dbbc8024f358e38588e5cca55cfd238206..b024db65784e8ab2fbfa281f2085a24dec61f761 100644 (file)
@@ -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;
                }
        }