fm10k: Unlock mailbox on VLAN addition failures
[deliverable/linux.git] / drivers / net / ethernet / intel / fm10k / fm10k_netdev.c
index dcec000bdb689cf8be578248627f439103a21240..b57ea1c09a21aacec533a10547a20acf6616f995 100644 (file)
@@ -546,6 +546,10 @@ int fm10k_open(struct net_device *netdev)
        fm10k_request_glort_range(interface);
 
        /* Notify the stack of the actual queue counts */
+       err = netif_set_real_num_tx_queues(netdev,
+                                          interface->num_tx_queues);
+       if (err)
+               goto err_set_queues;
 
        err = netif_set_real_num_rx_queues(netdev,
                                           interface->num_rx_queues);
@@ -601,7 +605,7 @@ int fm10k_close(struct net_device *netdev)
 static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev)
 {
        struct fm10k_intfc *interface = netdev_priv(dev);
-       unsigned int r_idx = 0;
+       unsigned int r_idx = skb->queue_mapping;
        int err;
 
        if ((skb->protocol ==  htons(ETH_P_8021Q)) &&
@@ -781,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
        if (!(netdev->flags & IFF_PROMISC)) {
                err = hw->mac.ops.update_vlan(hw, vid, 0, set);
                if (err)
-                       return err;
+                       goto err_out;
        }
 
        /* update our base MAC address */
        err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr,
                                         vid, set, 0);
        if (err)
-               return err;
+               goto err_out;
 
        /* set vid prior to syncing/unsyncing the VLAN */
        interface->vid = vid + (set ? VLAN_N_VID : 0);
@@ -797,9 +801,10 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
        __dev_uc_unsync(netdev, fm10k_uc_vlan_unsync);
        __dev_mc_unsync(netdev, fm10k_mc_vlan_unsync);
 
+err_out:
        fm10k_mbx_unlock(interface);
 
-       return 0;
+       return err;
 }
 
 static int fm10k_vlan_rx_add_vid(struct net_device *netdev,
This page took 0.025509 seconds and 5 git commands to generate.