net/mlx4_en: Initialize RFS filters lock and list in init_netdev
authorAmir Vadai <amirv@mellanox.com>
Thu, 24 Jan 2013 01:54:19 +0000 (01:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2013 05:14:28 +0000 (00:14 -0500)
filters_lock might have been used while it was re-initialized.
Moved filters_lock and filters_list initialization to init_netdev instead of
alloc_resources which is called every time the device is configured.

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

index 805e24233b1be77bc9fb1e78203dee31585d6027..9c42812d2f6b79472374059e634922206f7bf9fa 100644 (file)
@@ -1454,9 +1454,6 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
        priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->rx_ring_num);
        if (!priv->dev->rx_cpu_rmap)
                goto err;
-
-       INIT_LIST_HEAD(&priv->filters);
-       spin_lock_init(&priv->filters_lock);
 #endif
 
        return 0;
@@ -1651,6 +1648,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
        if (err)
                goto out;
 
+#ifdef CONFIG_RFS_ACCEL
+       INIT_LIST_HEAD(&priv->filters);
+       spin_lock_init(&priv->filters_lock);
+#endif
+
        /* Allocate page for receive rings */
        err = mlx4_alloc_hwq_res(mdev->dev, &priv->res,
                                MLX4_EN_PAGE_SIZE, MLX4_EN_PAGE_SIZE);