]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mlx4_en: don't use napi_synchronize inside mlx4_en_netpoll
authorChris Mason <clm@fb.com>
Tue, 15 Apr 2014 22:09:24 +0000 (18:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 May 2014 20:20:31 +0000 (13:20 -0700)
commit c98235cb8584a72e95786e17d695a8e5fafcd766 upstream.

The mlx4 driver is triggering schedules while atomic inside
mlx4_en_netpoll:

spin_lock_irqsave(&cq->lock, flags);
napi_synchronize(&cq->napi);
^^^^^ msleep here
mlx4_en_process_rx_cq(dev, cq, 0);
spin_unlock_irqrestore(&cq->lock, flags);

This was part of a patch by Alexander Guller from Mellanox in 2011,
but it still isn't upstream.

Signed-off-by: Chris Mason <clm@fb.com>
Acked-By: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx4/en_cq.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h

index 70e95324a97d350777ea8ccd93d0b041ab467e0e..c2cd8d31bcad5612395783e4d29e5141ac37ab6c 100644 (file)
@@ -66,7 +66,6 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
 
        cq->ring = ring;
        cq->is_tx = mode;
-       spin_lock_init(&cq->lock);
 
        /* Allocate HW buffers on provided NUMA node.
         * dev->numa_node is used in mtt range allocation flow.
index 84a96f70dfb51ea7cecf3c5f0e03daa90f52a880..2f83f3489fdb3bac96b3f6556a5f926a0a176c57 100644 (file)
@@ -1315,15 +1315,11 @@ static void mlx4_en_netpoll(struct net_device *dev)
 {
        struct mlx4_en_priv *priv = netdev_priv(dev);
        struct mlx4_en_cq *cq;
-       unsigned long flags;
        int i;
 
        for (i = 0; i < priv->rx_ring_num; i++) {
                cq = priv->rx_cq[i];
-               spin_lock_irqsave(&cq->lock, flags);
-               napi_synchronize(&cq->napi);
-               mlx4_en_process_rx_cq(dev, cq, 0);
-               spin_unlock_irqrestore(&cq->lock, flags);
+               napi_schedule(&cq->napi);
        }
 }
 #endif
index b57e8c87a34ea8723ae9316747a69a32386429ea..72db9bedd76507285ff4f8f1679761e5fa1d3251 100644 (file)
@@ -309,7 +309,6 @@ struct mlx4_en_cq {
        struct mlx4_cq          mcq;
        struct mlx4_hwq_resources wqres;
        int                     ring;
-       spinlock_t              lock;
        struct net_device      *dev;
        struct napi_struct      napi;
        int size;