Skip to content

Commit bb861c1

Browse files
sassmannanguy11
authored andcommitted
iavf: remove INITIAL_MAC_SET to allow gARP to work properly
IAVF_FLAG_INITIAL_MAC_SET prevents waiting on iavf_is_mac_set_handled() the first time the MAC is set. This breaks gratuitous ARP because the MAC address has not been updated yet when the gARP packet is sent out. Current behaviour: $ echo 1 > /sys/class/net/ens4f0/device/sriov_numvfs iavf 0000:88:02.0: MAC address: ee:04:19:14:ec:ea $ ip addr add 192.168.1.1/24 dev ens4f0v0 $ ip link set dev ens4f0v0 up $ echo 1 > /proc/sys/net/ipv4/conf/ens4f0v0/arp_notify $ ip link set ens4f0v0 addr 00:11:22:33:44:55 07:23:41.676611 ee:04:19:14:ec:ea > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.1 tell 192.168.1.1, length 28 With IAVF_FLAG_INITIAL_MAC_SET removed: $ echo 1 > /sys/class/net/ens4f0/device/sriov_numvfs iavf 0000:88:02.0: MAC address: 3e:8a:16:a2:37:6d $ ip addr add 192.168.1.1/24 dev ens4f0v0 $ ip link set dev ens4f0v0 up $ echo 1 > /proc/sys/net/ipv4/conf/ens4f0v0/arp_notify $ ip link set ens4f0v0 addr 00:11:22:33:44:55 07:28:01.836608 00:11:22:33:44:55 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 192.168.1.1 tell 192.168.1.1, length 28 Fixes: 35a2443 ("iavf: Add waiting for response from PF in set mac") Signed-off-by: Stefan Assmann <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 08f1c14 commit bb861c1

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ struct iavf_adapter {
298298
#define IAVF_FLAG_QUEUES_DISABLED BIT(17)
299299
#define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18)
300300
#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20)
301-
#define IAVF_FLAG_INITIAL_MAC_SET BIT(23)
302301
/* duplicates for common code */
303302
#define IAVF_FLAG_DCB_ENABLED 0
304303
/* flags for admin queue service task */

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,12 +1087,6 @@ static int iavf_set_mac(struct net_device *netdev, void *p)
10871087
if (ret)
10881088
return ret;
10891089

1090-
/* If this is an initial set MAC during VF spawn do not wait */
1091-
if (adapter->flags & IAVF_FLAG_INITIAL_MAC_SET) {
1092-
adapter->flags &= ~IAVF_FLAG_INITIAL_MAC_SET;
1093-
return 0;
1094-
}
1095-
10961090
ret = wait_event_interruptible_timeout(adapter->vc_waitqueue,
10971091
iavf_is_mac_set_handled(netdev, addr->sa_data),
10981092
msecs_to_jiffies(2500));
@@ -2605,8 +2599,6 @@ static void iavf_init_config_adapter(struct iavf_adapter *adapter)
26052599
ether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);
26062600
}
26072601

2608-
adapter->flags |= IAVF_FLAG_INITIAL_MAC_SET;
2609-
26102602
adapter->tx_desc_count = IAVF_DEFAULT_TXD;
26112603
adapter->rx_desc_count = IAVF_DEFAULT_RXD;
26122604
err = iavf_init_interrupt_scheme(adapter);

0 commit comments

Comments
 (0)