aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/en_netdev.c
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2011-03-22 18:37:52 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-23 15:24:18 -0400
commit1fb9876e9bf895ea4127ff17180f1b2ab37771b6 (patch)
tree4d26408ec346531ee99e01c0c397c73e782cacef /drivers/net/mlx4/en_netdev.c
parent0b7ca5a928e2271bbc225e9e1ac1f22e9fbee54f (diff)
mlx4_en: using new mlx4 interrupt scheme
Each RX ring will have its own interrupt vector, and TX rings will share one (we mostly use polling for TX completions). The vectors are assigned first time device is opened, and its name includes the interface name and ring number. Signed-off-by: Markuze Alex <markuze@mellanox.co.il> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4/en_netdev.c')
-rw-r--r--drivers/net/mlx4/en_netdev.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 5727bf5ad452..f6ed315b4b89 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -557,6 +557,7 @@ int mlx4_en_start_port(struct net_device *dev)
557 int err = 0; 557 int err = 0;
558 int i; 558 int i;
559 int j; 559 int j;
560 char name[32];
560 561
561 if (priv->port_up) { 562 if (priv->port_up) {
562 en_dbg(DRV, priv, "start port called while port already up\n"); 563 en_dbg(DRV, priv, "start port called while port already up\n");
@@ -601,10 +602,19 @@ int mlx4_en_start_port(struct net_device *dev)
601 goto cq_err; 602 goto cq_err;
602 } 603 }
603 604
605 if (mdev->dev->caps.comp_pool && !priv->tx_vector) {
606 sprintf(name , "%s-tx", priv->dev->name);
607 if (mlx4_assign_eq(mdev->dev , name, &priv->tx_vector)) {
608 mlx4_warn(mdev, "Failed Assigning an EQ to "
609 "%s_tx ,Falling back to legacy "
610 "EQ's\n", priv->dev->name);
611 }
612 }
604 /* Configure tx cq's and rings */ 613 /* Configure tx cq's and rings */
605 for (i = 0; i < priv->tx_ring_num; i++) { 614 for (i = 0; i < priv->tx_ring_num; i++) {
606 /* Configure cq */ 615 /* Configure cq */
607 cq = &priv->tx_cq[i]; 616 cq = &priv->tx_cq[i];
617 cq->vector = priv->tx_vector;
608 err = mlx4_en_activate_cq(priv, cq); 618 err = mlx4_en_activate_cq(priv, cq);
609 if (err) { 619 if (err) {
610 en_err(priv, "Failed allocating Tx CQ\n"); 620 en_err(priv, "Failed allocating Tx CQ\n");
@@ -819,7 +829,7 @@ static int mlx4_en_close(struct net_device *dev)
819 return 0; 829 return 0;
820} 830}
821 831
822void mlx4_en_free_resources(struct mlx4_en_priv *priv) 832void mlx4_en_free_resources(struct mlx4_en_priv *priv, bool reserve_vectors)
823{ 833{
824 int i; 834 int i;
825 835
@@ -827,14 +837,14 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv)
827 if (priv->tx_ring[i].tx_info) 837 if (priv->tx_ring[i].tx_info)
828 mlx4_en_destroy_tx_ring(priv, &priv->tx_ring[i]); 838 mlx4_en_destroy_tx_ring(priv, &priv->tx_ring[i]);
829 if (priv->tx_cq[i].buf) 839 if (priv->tx_cq[i].buf)
830 mlx4_en_destroy_cq(priv, &priv->tx_cq[i]); 840 mlx4_en_destroy_cq(priv, &priv->tx_cq[i], reserve_vectors);
831 } 841 }
832 842
833 for (i = 0; i < priv->rx_ring_num; i++) { 843 for (i = 0; i < priv->rx_ring_num; i++) {
834 if (priv->rx_ring[i].rx_info) 844 if (priv->rx_ring[i].rx_info)
835 mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]); 845 mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]);
836 if (priv->rx_cq[i].buf) 846 if (priv->rx_cq[i].buf)
837 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); 847 mlx4_en_destroy_cq(priv, &priv->rx_cq[i], reserve_vectors);
838 } 848 }
839} 849}
840 850
@@ -896,7 +906,7 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
896 mdev->pndev[priv->port] = NULL; 906 mdev->pndev[priv->port] = NULL;
897 mutex_unlock(&mdev->state_lock); 907 mutex_unlock(&mdev->state_lock);
898 908
899 mlx4_en_free_resources(priv); 909 mlx4_en_free_resources(priv, false);
900 free_netdev(dev); 910 free_netdev(dev);
901} 911}
902 912