mlx4_en: Controlling FCS header removal
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>
Tue, 18 Oct 2011 01:50:42 +0000 (01:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Oct 2011 07:42:26 +0000 (03:42 -0400)
Canceling FCS removal where FW allows for better alignment
of incoming data.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/mellanox/mlx4/fw.c
include/linux/mlx4/device.h

index 46a0df9..c47d737 100644 (file)
@@ -806,6 +806,10 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn,
                                qpn, ring->cqn, context);
        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)
+               context->param3 |= cpu_to_be32(1 << 29);
+
        err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, context, qp, state);
        if (err) {
                mlx4_qp_remove(mdev->dev, qp);
index 7eb8ba8..ed452dd 100644 (file)
@@ -101,6 +101,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
                [25] = "Router support",
                [30] = "IBoE support",
                [32] = "Unicast loopback support",
+               [34] = "FCS header control",
                [38] = "Wake On LAN support",
                [40] = "UDP RSS support",
                [41] = "Unicast VEP steering support",
index 53ef894..2366f94 100644 (file)
@@ -75,6 +75,7 @@ enum {
        MLX4_DEV_CAP_FLAG_UD_MCAST      = 1LL << 21,
        MLX4_DEV_CAP_FLAG_IBOE          = 1LL << 30,
        MLX4_DEV_CAP_FLAG_UC_LOOPBACK   = 1LL << 32,
+       MLX4_DEV_CAP_FLAG_FCS_KEEP      = 1LL << 34,
        MLX4_DEV_CAP_FLAG_WOL           = 1LL << 38,
        MLX4_DEV_CAP_FLAG_UDP_RSS       = 1LL << 40,
        MLX4_DEV_CAP_FLAG_VEP_UC_STEER  = 1LL << 41,