From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-ft5.fr.colt.net (smtp-ft5.fr.colt.net [213.41.78.197]) by dpdk.org (Postfix) with ESMTP id CB6D2AE9A for ; Mon, 12 May 2014 16:11:02 +0200 (CEST) Received: from smtp-ex3.fr.colt.net (smtp-ex3.fr.colt.net [213.41.78.196]) by smtp-ft5.fr.colt.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id s4CEBAdv001565 for ; Mon, 12 May 2014 16:11:10 +0200 Received: from 33.106-14-84.ripe.coltfrance.com ([84.14.106.33] helo=proxy.6wind.com) by smtp-ex3.fr.colt.net with esmtp (Exim) (envelope-from ) id 1Wjqwf-000551-1r for ; Mon, 12 May 2014 16:11:09 +0200 Received: from 6wind.com (unknown [10.16.0.189]) by proxy.6wind.com (Postfix) with SMTP id 93712282B6; Mon, 12 May 2014 16:11:08 +0200 (CEST) Received: by 6wind.com (sSMTP sendmail emulation); Mon, 12 May 2014 16:11:07 +0200 From: Ivan Boule To: dev@dpdk.org Date: Mon, 12 May 2014 16:11:06 +0200 Message-Id: <1399903866-21902-1-git-send-email-ivan.boule@6wind.com> X-Mailer: git-send-email 1.7.10.4 X-ACL-Warn: 1/1 recipients OK. Subject: [dpdk-dev] [PATCH 2/5] ixgbe: avoid adding twice the permanent MAC address of a VF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 14:11:03 -0000 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 --- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 365cb11..69bb117 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -3097,6 +3097,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; -- 1.7.10.4