diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2009-06-01 19:24:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-02 05:29:06 -0400 |
commit | f813cad836ab14b764cfe76f42a3b50bb9677b30 (patch) | |
tree | ccaafb7bcaa72e737fb8939e0c556f2466bb0d7d /drivers/net/mlx4/en_netdev.c | |
parent | 3db36fb2c88d68ee28d20845d5bb805ea9a7f6d8 (diff) |
mlx4_en: multiqueue support
By default the driver opens 8 TX queues (defined by MLX4_EN_NUM_TX_RINGS).
If the driver is configured to support Per Priority Flow Control, we open
8 additional TX rings.
dev->real_num_tx_queues is always set to be MLX4_EN_NUM_TX_RINGS.
The mlx4_en_select_queue() function uses standard hashing (skb_tx_hash)
in case that PPFC is not supported or the skb contain a vlan tag,
otherwise the queue is selected according to vlan priority.
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.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 16a634ffbcdf..37e4d30cbf04 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -934,6 +934,7 @@ static const struct net_device_ops mlx4_netdev_ops = { | |||
934 | .ndo_open = mlx4_en_open, | 934 | .ndo_open = mlx4_en_open, |
935 | .ndo_stop = mlx4_en_close, | 935 | .ndo_stop = mlx4_en_close, |
936 | .ndo_start_xmit = mlx4_en_xmit, | 936 | .ndo_start_xmit = mlx4_en_xmit, |
937 | .ndo_select_queue = mlx4_en_select_queue, | ||
937 | .ndo_get_stats = mlx4_en_get_stats, | 938 | .ndo_get_stats = mlx4_en_get_stats, |
938 | .ndo_set_multicast_list = mlx4_en_set_multicast, | 939 | .ndo_set_multicast_list = mlx4_en_set_multicast, |
939 | .ndo_set_mac_address = mlx4_en_set_mac, | 940 | .ndo_set_mac_address = mlx4_en_set_mac, |
@@ -956,7 +957,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
956 | int i; | 957 | int i; |
957 | int err; | 958 | int err; |
958 | 959 | ||
959 | dev = alloc_etherdev(sizeof(struct mlx4_en_priv)); | 960 | dev = alloc_etherdev_mq(sizeof(struct mlx4_en_priv), prof->tx_ring_num); |
960 | if (dev == NULL) { | 961 | if (dev == NULL) { |
961 | mlx4_err(mdev, "Net device allocation failed\n"); | 962 | mlx4_err(mdev, "Net device allocation failed\n"); |
962 | return -ENOMEM; | 963 | return -ENOMEM; |
@@ -1018,14 +1019,12 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
1018 | } | 1019 | } |
1019 | priv->allocated = 1; | 1020 | priv->allocated = 1; |
1020 | 1021 | ||
1021 | /* Populate Tx priority mappings */ | ||
1022 | mlx4_en_set_prio_map(priv, priv->tx_prio_map, prof->tx_ring_num); | ||
1023 | |||
1024 | /* | 1022 | /* |
1025 | * Initialize netdev entry points | 1023 | * Initialize netdev entry points |
1026 | */ | 1024 | */ |
1027 | dev->netdev_ops = &mlx4_netdev_ops; | 1025 | dev->netdev_ops = &mlx4_netdev_ops; |
1028 | dev->watchdog_timeo = MLX4_EN_WATCHDOG_TIMEOUT; | 1026 | dev->watchdog_timeo = MLX4_EN_WATCHDOG_TIMEOUT; |
1027 | dev->real_num_tx_queues = MLX4_EN_NUM_TX_RINGS; | ||
1029 | 1028 | ||
1030 | SET_ETHTOOL_OPS(dev, &mlx4_en_ethtool_ops); | 1029 | SET_ETHTOOL_OPS(dev, &mlx4_en_ethtool_ops); |
1031 | 1030 | ||