summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx4/en_main.c
diff options
context:
space:
mode:
authorIdo Shamay <idos@mellanox.com>2014-02-21 14:39:17 +0400
committerDavid S. Miller <davem@davemloft.net>2014-02-25 03:38:01 +0400
commit02512482321c531df4abf73943529f8b44d869e2 (patch)
tree1dbbc602d3e6222489417c83b91ed8c5b080dc8a /drivers/net/ethernet/mellanox/mlx4/en_main.c
parent7a4ddcd92ea72fdc54ebf671f3d3fcc8ba3a1ea8 (diff)
downloadlinux-02512482321c531df4abf73943529f8b44d869e2.tar.xz
net/mlx4: Set number of RX rings in a utility function
mlx4_en_add() is too long. Moving set number of RX rings to a utiltity function to improve readability and modulization of the code. Signed-off-by: Ido Shamay <idos@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_main.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_main.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
index d357bf5a4686..fa2f6e76f69b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
@@ -274,19 +274,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
mlx4_en_init_timestamp(mdev);
- mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) {
- if (!dev->caps.comp_pool) {
- mdev->profile.prof[i].rx_ring_num =
- rounddown_pow_of_two(max_t(int, MIN_RX_RINGS,
- min_t(int,
- dev->caps.num_comp_vectors,
- DEF_RX_RINGS)));
- } else {
- mdev->profile.prof[i].rx_ring_num = rounddown_pow_of_two(
- min_t(int, dev->caps.comp_pool/
- dev->caps.num_ports - 1 , MAX_MSIX_P_PORT - 1));
- }
- }
+ /* Set default number of RX rings*/
+ mlx4_en_set_num_rx_rings(mdev);
/* Create our own workqueue for reset/multicast tasks
* Note: we cannot use the shared workqueue because of deadlocks caused