diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2014-09-02 00:26:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-02 15:46:00 -0400 |
commit | a4906ea0a5fe6dba89d3809f1e0e97b4d55ef4b7 (patch) | |
tree | c49d7c0d87d263a921bc698733d582ddcee384fa /drivers/net/ethernet/emulex | |
parent | c8f64615fb8372844f25199c2aa3c7565e1e9e60 (diff) |
be2net: define macro for_all_tx_queues_on_eq()
Replace the for() loop that traverses all the TX queues on an EQ
with the macro for_all_tx_queues_on_eq(). With this expalnatory
name, the one line comment is not required anymore.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index d952ca2c0678..a9f239adc3e3 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -621,6 +621,10 @@ extern const struct ethtool_ops be_ethtool_ops; | |||
621 | for (i = eqo->idx, rxo = &adapter->rx_obj[i]; i < adapter->num_rx_qs;\ | 621 | for (i = eqo->idx, rxo = &adapter->rx_obj[i]; i < adapter->num_rx_qs;\ |
622 | i += adapter->num_evt_qs, rxo += adapter->num_evt_qs) | 622 | i += adapter->num_evt_qs, rxo += adapter->num_evt_qs) |
623 | 623 | ||
624 | #define for_all_tx_queues_on_eq(adapter, eqo, txo, i) \ | ||
625 | for (i = eqo->idx, txo = &adapter->tx_obj[i]; i < adapter->num_tx_qs;\ | ||
626 | i += adapter->num_evt_qs, txo += adapter->num_evt_qs) | ||
627 | |||
624 | #define is_mcc_eqo(eqo) (eqo->idx == 0) | 628 | #define is_mcc_eqo(eqo) (eqo->idx == 0) |
625 | #define mcc_eqo(adapter) (&adapter->eq_obj[0]) | 629 | #define mcc_eqo(adapter) (&adapter->eq_obj[0]) |
626 | 630 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index b31b0f0789db..1b1fbbfcf3ad 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -2503,12 +2503,12 @@ int be_poll(struct napi_struct *napi, int budget) | |||
2503 | struct be_adapter *adapter = eqo->adapter; | 2503 | struct be_adapter *adapter = eqo->adapter; |
2504 | int max_work = 0, work, i, num_evts; | 2504 | int max_work = 0, work, i, num_evts; |
2505 | struct be_rx_obj *rxo; | 2505 | struct be_rx_obj *rxo; |
2506 | struct be_tx_obj *txo; | ||
2506 | 2507 | ||
2507 | num_evts = events_get(eqo); | 2508 | num_evts = events_get(eqo); |
2508 | 2509 | ||
2509 | /* Process all TXQs serviced by this EQ */ | 2510 | for_all_tx_queues_on_eq(adapter, eqo, txo, i) |
2510 | for (i = eqo->idx; i < adapter->num_tx_qs; i += adapter->num_evt_qs) | 2511 | be_process_tx(adapter, txo, i); |
2511 | be_process_tx(adapter, &adapter->tx_obj[i], i); | ||
2512 | 2512 | ||
2513 | if (be_lock_napi(eqo)) { | 2513 | if (be_lock_napi(eqo)) { |
2514 | /* This loop will iterate twice for EQ0 in which | 2514 | /* This loop will iterate twice for EQ0 in which |