fm10k: allow creation of vlan interfaces even while down
Subsystems (2)
PATCH 1/2 fm10k: allow creation of vlan interfaces even while down
We re-sync upon going up, so there is little reason to worry about not syncing immediately with switch. This prevents an error that occurs if you add a vlan interface while down.
Signed-off-by Jacob Keller <[email protected]>
--- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +6 -0
@@ -779,6 +779,12 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)if (!set && vid == hw->mac.default_vid)return 0 ; +/* Do not throw an error if the interface is down. We will sync once +* we come up +*/ +if (test_bit (__FM10K_DOWN, &interface->state)) +return 0 ; +fm10k_mbx_lock (interface);/* only need to update the VLAN if not in promiscuous mode */
Signature · 1 line
2.4.3
PATCH 2/2 fm10k: don't store sw_vid at reset
If we store the sw_vid at reset of PF, then we accidentally prevent the VF from receiving the message to update its default VID. This only occurs if the VF is created before the PF has come up, which is the standard way of creating VFs when using the module parameter.
This fixes an issue where we request the incorrect MAC/VLAN combinations, and prevents us from accidentally reporting some frames as vlan tagged.
Signed-off-by Jacob Keller <[email protected]>
--- drivers/net/ethernet/intel/fm10k/fm10k_iov.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/fm10k/fm10k_iov.c +0 -3
@@ -228,9 +228,6 @@ int fm10k_iov_resume(struct pci_dev *pdev) hw->iov.ops.set_lport (hw, vf_info, i,FM10K_VF_FLAG_MULTI_CAPABLE ); -/* assign our default vid to the VF following reset */ - vf_info->sw_vid = hw->mac.default_vid; -/* mailbox is disconnected so we don't send a message */ hw->iov.ops.assign_default_mac_vlan (hw, vf_info);
Signature · 1 line
2.4.3