From: Wenzhuo Lu Date: Tue, 2 May 2017 08:34:59 +0000 (+0800) Subject: net/ixgbe: fix default MAC setting X-Git-Tag: spdx-start~3277 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c53e2c6f9253365f544df87014989e267274155c;p=dpdk.git net/ixgbe: fix default MAC setting Pool 0 is not PF, it's VF 0. So the MAC is set for VF 0 but not PF. The code introduced a weird issue. In the scenario PF + VF, when only starting PF, the default PF MAC address is working. But after starting a VF, the default PF MAC address becomes the VF's address. Use the pool which is not occupied by VFs for PF to fix it. Fixes: 8164fe82846b ("ixgbe: add default mac address modifier") Cc: stable@dpdk.org Signed-off-by: Wenzhuo Lu --- diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 006203c42a..b17c8b1098 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4659,9 +4659,11 @@ ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index) static void ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) { + struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev); + ixgbe_remove_rar(dev, 0); - ixgbe_add_rar(dev, addr, 0, 0); + ixgbe_add_rar(dev, addr, 0, pci_dev->max_vfs); } static bool