mlx4_en: Cancel port_up check in transmit function
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>
Sat, 20 Jun 2009 22:15:52 +0000 (22:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jun 2009 02:18:05 +0000 (19:18 -0700)
When closing the port, we stop all transmit queues under the transmit
lock. It ensures that we will not attempt to transmit new packets after
the physical port was closed.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mlx4/en_netdev.c
drivers/net/mlx4/en_tx.c

index 20a34cb6392e0a34f19a5de45669de0b4d5f08cb..03a557cc3b7a18727f2a4f6f6df6821e027b67bf 100644 (file)
@@ -700,14 +700,14 @@ void mlx4_en_stop_port(struct net_device *dev)
                en_dbg(DRV, priv, "stop port called while port already down\n");
                return;
        }
-       netif_tx_stop_all_queues(dev);
 
        /* Synchronize with tx routine */
        netif_tx_lock_bh(dev);
-       priv->port_up = false;
+       netif_tx_stop_all_queues(dev);
        netif_tx_unlock_bh(dev);
 
        /* close port*/
+       priv->port_up = false;
        mlx4_CLOSE_PORT(mdev->dev, priv->port);
 
        /* Unregister Mac address for the port */
index e63132361a9454509a3aec6e1344f54b3daaefa3..99a6a36dc27ba36326a9871d63be25a668f726ee 100644 (file)
@@ -646,13 +646,6 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
                return NETDEV_TX_BUSY;
        }
 
-       /* Now that we know what Tx ring to use */
-       if (unlikely(!priv->port_up)) {
-               if (netif_msg_tx_err(priv))
-                       en_warn(priv, "xmit: port down!\n");
-               goto tx_drop;
-       }
-
        /* Track current inflight packets for performance analysis */
        AVG_PERF_COUNTER(priv->pstats.inflight_avg,
                         (u32) (ring->prod - ring->cons - 1));