Skip to content

Commit 0f079d2

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Use __dev_uc_sync and __dev_uc_unsync for unicast addresses
This change replaces the ixgbe_write_uc_addr_list call in ixgbe_set_rx_mode with a call to __dev_uc_sync instead. This works much better with the MAC addr list code that was already in place and solves an issue in which you couldn't remove an FDB address without having to reset the port. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Darin Miller <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent c9f53e6 commit 0f079d2

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,6 +4212,25 @@ static int ixgbe_write_uc_addr_list(struct net_device *netdev, int vfn)
42124212
return count;
42134213
}
42144214

4215+
static int ixgbe_uc_sync(struct net_device *netdev, const unsigned char *addr)
4216+
{
4217+
struct ixgbe_adapter *adapter = netdev_priv(netdev);
4218+
int ret;
4219+
4220+
ret = ixgbe_add_mac_filter(adapter, addr, VMDQ_P(0));
4221+
4222+
return min_t(int, ret, 0);
4223+
}
4224+
4225+
static int ixgbe_uc_unsync(struct net_device *netdev, const unsigned char *addr)
4226+
{
4227+
struct ixgbe_adapter *adapter = netdev_priv(netdev);
4228+
4229+
ixgbe_del_mac_filter(adapter, addr, VMDQ_P(0));
4230+
4231+
return 0;
4232+
}
4233+
42154234
/**
42164235
* ixgbe_set_rx_mode - Unicast, Multicast and Promiscuous mode set
42174236
* @netdev: network interface device structure
@@ -4267,8 +4286,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
42674286
* sufficient space to store all the addresses then enable
42684287
* unicast promiscuous mode
42694288
*/
4270-
count = ixgbe_write_uc_addr_list(netdev, VMDQ_P(0));
4271-
if (count < 0) {
4289+
if (__dev_uc_sync(netdev, ixgbe_uc_sync, ixgbe_uc_unsync)) {
42724290
fctrl |= IXGBE_FCTRL_UPE;
42734291
vmolr |= IXGBE_VMOLR_ROPE;
42744292
}
@@ -5106,8 +5124,12 @@ void ixgbe_reset(struct ixgbe_adapter *adapter)
51065124
}
51075125

51085126
clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
5109-
/* do not flush user set addresses */
5127+
5128+
/* flush entries out of MAC table */
51105129
ixgbe_flush_sw_mac_table(adapter);
5130+
__dev_uc_unsync(netdev, NULL);
5131+
5132+
/* do not flush user set addresses */
51115133
ixgbe_mac_set_default_filter(adapter);
51125134

51135135
/* update SAN MAC vmdq pool selection */

0 commit comments

Comments
 (0)