]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Merge branch 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_cmn.c
index eccb3d1b6abb748c14567d0efcdc28a405b64fb5..f619c4cac51f0f3a8a6631091c8e022de087a719 100644 (file)
@@ -1926,7 +1926,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb,
        }
 
        /* select a non-FCoE queue */
-       return fallback(dev, skb) % BNX2X_NUM_ETH_QUEUES(bp);
+       return fallback(dev, skb) % (BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos);
 }
 
 void bnx2x_set_num_queues(struct bnx2x *bp)
@@ -3883,15 +3883,26 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
                /* when transmitting in a vf, start bd must hold the ethertype
                 * for fw to enforce it
                 */
+               u16 vlan_tci = 0;
 #ifndef BNX2X_STOP_ON_ERROR
-               if (IS_VF(bp))
+               if (IS_VF(bp)) {
 #endif
-                       tx_start_bd->vlan_or_ethertype =
-                               cpu_to_le16(ntohs(eth->h_proto));
+                       /* Still need to consider inband vlan for enforced */
+                       if (__vlan_get_tag(skb, &vlan_tci)) {
+                               tx_start_bd->vlan_or_ethertype =
+                                       cpu_to_le16(ntohs(eth->h_proto));
+                       } else {
+                               tx_start_bd->bd_flags.as_bitfield |=
+                                       (X_ETH_INBAND_VLAN <<
+                                        ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT);
+                               tx_start_bd->vlan_or_ethertype =
+                                       cpu_to_le16(vlan_tci);
+                       }
 #ifndef BNX2X_STOP_ON_ERROR
-               else
+               } else {
                        /* used by FW for packet accounting */
                        tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod);
+               }
 #endif
        }