diff options
author | Brett Creeley <brett.creeley@intel.com> | 2019-02-28 18:25:53 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-05-02 04:09:51 -0400 |
commit | 0c2561c81f5d089781f7cb24b8ce9e52ac716f61 (patch) | |
tree | 4b236b339f1f03350862746af6f47264f4080765 /drivers/net/ethernet/intel/ice/ice_main.c | |
parent | a92e1bb6ade7526f0c2b7b462516b1941e965504 (diff) |
ice: Use ice_for_each_q_vector macro where possible
There are many places in the code where we do the following:
for (i = 0; i < vsi->num_q_vectors; i++)
Instead use the macro mentioned in the commit title:
ice_for_each_q_vector(vsi, i)
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 8bdd311c1b4c..a32782be7f88 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c | |||
@@ -1338,7 +1338,7 @@ static int ice_vsi_ena_irq(struct ice_vsi *vsi) | |||
1338 | if (test_bit(ICE_FLAG_MSIX_ENA, pf->flags)) { | 1338 | if (test_bit(ICE_FLAG_MSIX_ENA, pf->flags)) { |
1339 | int i; | 1339 | int i; |
1340 | 1340 | ||
1341 | for (i = 0; i < vsi->num_q_vectors; i++) | 1341 | ice_for_each_q_vector(vsi, i) |
1342 | ice_irq_dynamic_ena(hw, vsi, vsi->q_vectors[i]); | 1342 | ice_irq_dynamic_ena(hw, vsi, vsi->q_vectors[i]); |
1343 | } | 1343 | } |
1344 | 1344 | ||
@@ -1705,7 +1705,7 @@ void ice_napi_del(struct ice_vsi *vsi) | |||
1705 | if (!vsi->netdev) | 1705 | if (!vsi->netdev) |
1706 | return; | 1706 | return; |
1707 | 1707 | ||
1708 | for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) | 1708 | ice_for_each_q_vector(vsi, v_idx) |
1709 | netif_napi_del(&vsi->q_vectors[v_idx]->napi); | 1709 | netif_napi_del(&vsi->q_vectors[v_idx]->napi); |
1710 | } | 1710 | } |
1711 | 1711 | ||
@@ -1724,7 +1724,7 @@ static void ice_napi_add(struct ice_vsi *vsi) | |||
1724 | if (!vsi->netdev) | 1724 | if (!vsi->netdev) |
1725 | return; | 1725 | return; |
1726 | 1726 | ||
1727 | for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) | 1727 | ice_for_each_q_vector(vsi, v_idx) |
1728 | netif_napi_add(vsi->netdev, &vsi->q_vectors[v_idx]->napi, | 1728 | netif_napi_add(vsi->netdev, &vsi->q_vectors[v_idx]->napi, |
1729 | ice_napi_poll, NAPI_POLL_WEIGHT); | 1729 | ice_napi_poll, NAPI_POLL_WEIGHT); |
1730 | } | 1730 | } |
@@ -2960,7 +2960,7 @@ static void ice_napi_enable_all(struct ice_vsi *vsi) | |||
2960 | if (!vsi->netdev) | 2960 | if (!vsi->netdev) |
2961 | return; | 2961 | return; |
2962 | 2962 | ||
2963 | for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) { | 2963 | ice_for_each_q_vector(vsi, q_idx) { |
2964 | struct ice_q_vector *q_vector = vsi->q_vectors[q_idx]; | 2964 | struct ice_q_vector *q_vector = vsi->q_vectors[q_idx]; |
2965 | 2965 | ||
2966 | if (q_vector->rx.ring || q_vector->tx.ring) | 2966 | if (q_vector->rx.ring || q_vector->tx.ring) |
@@ -3334,7 +3334,7 @@ static void ice_napi_disable_all(struct ice_vsi *vsi) | |||
3334 | if (!vsi->netdev) | 3334 | if (!vsi->netdev) |
3335 | return; | 3335 | return; |
3336 | 3336 | ||
3337 | for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) { | 3337 | ice_for_each_q_vector(vsi, q_idx) { |
3338 | struct ice_q_vector *q_vector = vsi->q_vectors[q_idx]; | 3338 | struct ice_q_vector *q_vector = vsi->q_vectors[q_idx]; |
3339 | 3339 | ||
3340 | if (q_vector->rx.ring || q_vector->tx.ring) | 3340 | if (q_vector->rx.ring || q_vector->tx.ring) |