netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net-next 11/12] be2net: define macro for_all_tx_queues_on_eq()
Date: Mon, 1 Sep 2014 11:54:23 +0530	[thread overview]
Message-ID: <1409552664-15990-12-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1409552664-15990-1-git-send-email-sathya.perla@emulex.com>

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>
---
 drivers/net/ethernet/emulex/benet/be.h      |    4 ++++
 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 d952ca2..a9f239a 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;
 	for (i = eqo->idx, rxo = &adapter->rx_obj[i]; i < adapter->num_rx_qs;\
 		 i += adapter->num_evt_qs, rxo += adapter->num_evt_qs)
 
+#define for_all_tx_queues_on_eq(adapter, eqo, txo, i)			\
+	for (i = eqo->idx, txo = &adapter->tx_obj[i]; i < adapter->num_tx_qs;\
+		i += adapter->num_evt_qs, txo += adapter->num_evt_qs)
+
 #define is_mcc_eqo(eqo)			(eqo->idx == 0)
 #define mcc_eqo(adapter)		(&adapter->eq_obj[0])
 
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 53727ad..f3235d1 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)
 	struct be_adapter *adapter = eqo->adapter;
 	int max_work = 0, work, i, num_evts;
 	struct be_rx_obj *rxo;
+	struct be_tx_obj *txo;
 
 	num_evts = events_get(eqo);
 
-	/* Process all TXQs serviced by this EQ */
-	for (i = eqo->idx; i < adapter->num_tx_qs; i += adapter->num_evt_qs)
-		be_process_tx(adapter, &adapter->tx_obj[i], i);
+	for_all_tx_queues_on_eq(adapter, eqo, txo, i)
+		be_process_tx(adapter, txo, i);
 
 	if (be_lock_napi(eqo)) {
 		/* This loop will iterate twice for EQ0 in which
-- 
1.7.1

  parent reply	other threads:[~2014-09-01  6:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  6:24 [PATCH net-next 00/12] be2net: patch set Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 01/12] be2net: add a few log messages Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 02/12] be2net: shorten AMAP_GET/SET_BITS() macro calls Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 03/12] be2net: add a description for counter rx_input_fifo_overflow_drop Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 04/12] be2net: Add TX completion error statistics in ethtool Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 05/12] be2net: Add a dma_mapping_error counter " Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 06/12] be2net: fix log messages in lancer FW download path Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 07/12] be2net: remove unncessary gotos Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 08/12] be2net: define BE_MAX_MTU Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 09/12] be2net: make be_cmd_get_regs() return a status Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 10/12] be2net: get rid of TX budget Sathya Perla
2014-09-01  6:24 ` Sathya Perla [this message]
2014-09-01  6:24 ` [PATCH net-next 12/12] be2net: query max_tx_qs for BE3 super-nic profile from FW Sathya Perla
2014-09-01 13:10   ` Sergei Shtylyov
2014-09-02  4:08     ` Sathya Perla
2014-09-04 19:28       ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409552664-15990-12-git-send-email-sathya.perla@emulex.com \
    --to=sathya.perla@emulex.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).