From: Shaopeng He Date: Fri, 26 Jun 2015 02:37:26 +0000 (+0800) Subject: fm10k: fix error when adding default vlan X-Git-Tag: spdx-start~8787 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0681a1424dea5d081e312d781813c81645f407cd;p=dpdk.git fm10k: fix error when adding default vlan The default MAC address is read from hardware and copied to Device Ethernet Link address array in the device initialization phase, which bypasses fm10k MAC address number check mechanism, and will cause an error message when adding default VLAN: "MAC address number not match" Fix it by moving default MAC address registration to device initialize phase. Fixes: f5c1a236a218 ("fm10k: fix default mac/vlan in switch") Signed-off-by: Shaopeng He Acked-by: Michael Qiu --- diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index f12d0c8e72..2a412ab623 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -790,14 +790,10 @@ fm10k_dev_start(struct rte_eth_dev *dev) } } - if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) { - /* Update default vlan */ + /* Update default vlan */ + if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) fm10k_vlan_filter_set(dev, hw->mac.default_vid, true); - /* Add default mac/vlan filter to PF/Switch manager */ - fm10k_MAC_filter_set(dev, hw->mac.addr, true); - } - return 0; } @@ -2152,6 +2148,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) fm10k_mbx_unlock(hw); + /* Add default mac address */ + fm10k_MAC_filter_set(dev, hw->mac.addr, true); return 0; }