]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4_en: Remove FCS bytes from packet length.
authorJoe Jin <joe.jin@oracle.com>
Thu, 15 Dec 2011 01:36:53 +0000 (09:36 +0800)
committerJoe Jin <joe.jin@oracle.com>
Thu, 15 Dec 2011 01:36:53 +0000 (09:36 +0800)
commit 4a5f4dd8595a3d3cdf75db7247b644ae37f5d460
Author: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date:   Mon Nov 14 14:25:36 2011 -0500

    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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/mlx4/en_rx.c
drivers/net/mlx4/mlx4_en.h

index 263c1544ce502c3d0f41c527a4b6a7c778e0cb87..635f710f200efa4d2cc6d3ac5c6f67418775493c 100644 (file)
@@ -581,6 +581,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
                 * Packet is OK - process it.
                 */
                length = be32_to_cpu(cqe->byte_cnt);
+               length -= ring->fcs_del;
                ring->bytes += length;
                ring->packets++;
 
@@ -813,8 +814,11 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn,
        context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma);
 
        /* Cancel FCS removal if FW allows */
-       if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP)
+       if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP) {
                context->param3 |= cpu_to_be32(1 << 29);
+               ring->fcs_del = ETH_FCS_LEN;
+       } else
+               ring->fcs_del = 0;
 
        err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, context, qp, state);
        if (err) {
index fca66165110ef95e8d4e57ac2be1157893696480..6e555c7cdce6d8c7b5b7ccd08d70ae34ddda7649 100644 (file)
@@ -272,6 +272,7 @@ struct mlx4_en_rx_ring {
        u32 prod;
        u32 cons;
        u32 buf_size;
+       u8  fcs_del;
        void *buf;
        void *rx_info;
        unsigned long bytes;