diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2011-11-14 14:25:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-14 14:25:36 -0500 |
commit | 4a5f4dd8595a3d3cdf75db7247b644ae37f5d460 (patch) | |
tree | 4e5b274198f3a745a6388e6da043e6b5725315a4 /drivers/net | |
parent | 06236ac3726f15124839cf16a9e2730a852dad9b (diff) |
mlx4_en: Remove FCS bytes from packet length.
When HW doesn't remove FCS bytes they are reported in the completion
byte count, we don't need to take them to skb.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_rx.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index b89c36dbf5b3..c2df6c358603 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -581,6 +581,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
581 | * Packet is OK - process it. | 581 | * Packet is OK - process it. |
582 | */ | 582 | */ |
583 | length = be32_to_cpu(cqe->byte_cnt); | 583 | length = be32_to_cpu(cqe->byte_cnt); |
584 | length -= ring->fcs_del; | ||
584 | ring->bytes += length; | 585 | ring->bytes += length; |
585 | ring->packets++; | 586 | ring->packets++; |
586 | 587 | ||
@@ -813,8 +814,11 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn, | |||
813 | context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma); | 814 | context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma); |
814 | 815 | ||
815 | /* Cancel FCS removal if FW allows */ | 816 | /* Cancel FCS removal if FW allows */ |
816 | if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP) | 817 | if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP) { |
817 | context->param3 |= cpu_to_be32(1 << 29); | 818 | context->param3 |= cpu_to_be32(1 << 29); |
819 | ring->fcs_del = ETH_FCS_LEN; | ||
820 | } else | ||
821 | ring->fcs_del = 0; | ||
818 | 822 | ||
819 | err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, context, qp, state); | 823 | err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, context, qp, state); |
820 | if (err) { | 824 | if (err) { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 8fda331c65df..207b5add3ca8 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -272,6 +272,7 @@ struct mlx4_en_rx_ring { | |||
272 | u32 prod; | 272 | u32 prod; |
273 | u32 cons; | 273 | u32 cons; |
274 | u32 buf_size; | 274 | u32 buf_size; |
275 | u8 fcs_del; | ||
275 | void *buf; | 276 | void *buf; |
276 | void *rx_info; | 277 | void *rx_info; |
277 | unsigned long bytes; | 278 | unsigned long bytes; |