diff options
author | Amir Vadai <amirv@mellanox.co.il> | 2011-11-26 14:55:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-27 17:17:04 -0500 |
commit | c140d769c2b6d87148203a78aa0d72595a19b2de (patch) | |
tree | 626a1b069ce7d1f8f26abdb582ac264b336235de /drivers/net/ethernet | |
parent | 60d6fe99e4a507f77b63c090eb8aacb67e21687a (diff) |
net/mlx4_en: bug fix for the case of vlan id 0 and UP 0
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 807c2186548c..7e76862de355 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c | |||
@@ -566,7 +566,8 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk | |||
566 | inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc)); | 566 | inl->byte_count = cpu_to_be32(1 << 31 | (skb->len - spc)); |
567 | } | 567 | } |
568 | tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag); | 568 | tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag); |
569 | tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!(*vlan_tag); | 569 | tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * |
570 | (!!vlan_tx_tag_present(skb)); | ||
570 | tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f; | 571 | tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f; |
571 | } | 572 | } |
572 | 573 | ||
@@ -677,7 +678,8 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
677 | /* Prepare ctrl segement apart opcode+ownership, which depends on | 678 | /* Prepare ctrl segement apart opcode+ownership, which depends on |
678 | * whether LSO is used */ | 679 | * whether LSO is used */ |
679 | tx_desc->ctrl.vlan_tag = cpu_to_be16(vlan_tag); | 680 | tx_desc->ctrl.vlan_tag = cpu_to_be16(vlan_tag); |
680 | tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!vlan_tag; | 681 | tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * |
682 | !!vlan_tx_tag_present(skb); | ||
681 | tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f; | 683 | tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f; |
682 | tx_desc->ctrl.srcrb_flags = priv->ctrl_flags; | 684 | tx_desc->ctrl.srcrb_flags = priv->ctrl_flags; |
683 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 685 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |