net/mlx4_en: bug fix for the case of vlan id 0 and UP 0
authorAmir Vadai <amirv@mellanox.co.il>
Sat, 26 Nov 2011 19:55:23 +0000 (19:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Nov 2011 22:17:04 +0000 (17:17 -0500)
When using vlan 0 and UP 0, vlan header wasn't placed.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_tx.c

index 807c2186548c7a2c55106f36d10290cb61feaba2..7e76862de3559f4e6a951ad12452aa9ec10e05fb 100644 (file)
@@ -566,7 +566,8 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
                inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc));
        }
        tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag);
-       tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!(*vlan_tag);
+       tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN *
+               (!!vlan_tx_tag_present(skb));
        tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
 }
 
@@ -677,7 +678,8 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Prepare ctrl segement apart opcode+ownership, which depends on
         * whether LSO is used */
        tx_desc->ctrl.vlan_tag = cpu_to_be16(vlan_tag);
-       tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!vlan_tag;
+       tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN *
+               !!vlan_tx_tag_present(skb);
        tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
        tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
        if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {