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: f5c1a236a2 ("fm10k: fix default mac/vlan in switch")

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
This commit is contained in:
Shaopeng He 2015-06-26 10:37:26 +08:00 committed by Thomas Monjalon
parent b91fe0f7ad
commit 0681a1424d

View File

@ -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;
}