Skip to content

Commit 6252c7e

Browse files
Shannon NelsonJeff Kirsher
authored andcommitted
i40e: reapply LAA after reset
The LAA is lost on a reset, so be sure to replay it when rebuilding the switch after any reset. Change-ID: I6e643f9a59dfd899b6cbdf84d93b4bc9c37bb949 Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 6c8ad1b commit 6252c7e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ struct i40e_mac_filter {
362362
bool is_vf; /* filter belongs to a VF */
363363
bool is_netdev; /* filter belongs to a netdev */
364364
bool changed; /* filter needs to be sync'd to the HW */
365+
bool is_laa; /* filter is a Locally Administered Address */
365366
};
366367

367368
struct i40e_veb {

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,8 +1344,8 @@ static int i40e_set_mac(struct net_device *netdev, void *p)
13441344
}
13451345
}
13461346

1347-
if (!i40e_find_mac(vsi, addr->sa_data, false, true)) {
1348-
1347+
f = i40e_find_mac(vsi, addr->sa_data, false, true);
1348+
if (!f) {
13491349
/* In order to be sure to not drop any packets, add the
13501350
* new address first then delete the old one.
13511351
*/
@@ -1360,6 +1360,7 @@ static int i40e_set_mac(struct net_device *netdev, void *p)
13601360
i40e_sync_vsi_filters(vsi);
13611361
}
13621362

1363+
f->is_laa = true;
13631364
if (!ether_addr_equal(netdev->dev_addr, addr->sa_data))
13641365
ether_addr_copy(netdev->dev_addr, addr->sa_data);
13651366

@@ -7378,6 +7379,12 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
73787379
list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
73797380
f->changed = true;
73807381
f_count++;
7382+
7383+
if (f->is_laa && vsi->type == I40E_VSI_MAIN) {
7384+
i40e_aq_mac_address_write(&vsi->back->hw,
7385+
I40E_AQC_WRITE_TYPE_LAA_WOL,
7386+
f->macaddr, NULL);
7387+
}
73817388
}
73827389
if (f_count) {
73837390
vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;

0 commit comments

Comments
 (0)