From: Ivan Boule Date: Mon, 12 May 2014 14:11:06 +0000 (+0200) Subject: ixgbevf: avoid adding twice the permanent mac address X-Git-Tag: spdx-start~10789 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7bfd68a27422913c4126d042d72fc8a5f18db105;p=dpdk.git ixgbevf: avoid adding twice the permanent mac address During the initialization of a VF device, the rte_eth_dev_start() function indirectly invokes the PMD "mac_addr_add" function with the permanent MAC address assigned to the device. In the case of 82599 VFs, this operation leads to exhausting the very limited set of PF resources used to store VF MAC addresses. To address this issue, do nothing in the function ixgbevf_add_mac_addr() if the added MAC address is equal to the permanent MAC address of the VF. Signed-off-by: Ivan Boule Acked-by: Thomas Monjalon --- diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 9291a8e23a..cf7914d200 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -3096,6 +3096,13 @@ ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr, struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); int diag; + /* + * On a 82599 VF, adding again the same MAC addr is not an idempotent + * operation. Trap this case to avoid exhausting the [very limited] + * set of PF resources used to store VF MAC addresses. + */ + if (memcmp(hw->mac.perm_addr, mac_addr, sizeof(struct ether_addr)) == 0) + return; diag = ixgbevf_set_uc_addr_vf(hw, 2, mac_addr->addr_bytes); if (diag == 0) return;