aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@emulex.com>2014-09-02 00:26:55 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-02 15:46:00 -0400
commitc8f64615fb8372844f25199c2aa3c7565e1e9e60 (patch)
treec89aa25f5fdb5349e79c5665cdd88b095cb254fa
parentc5f156def02bffe41bb6c931302c074d00465354 (diff)
be2net: get rid of TX budget
Enforcing a budget on the TX completion processing in NAPI doesn't benefit performance in anyway. Just get rid of it. Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h2
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c30
2 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 5ccfce7d616d..d952ca2c0678 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -114,7 +114,6 @@ static inline char *nic_name(struct pci_dev *pdev)
114#define MAX_ROCE_EQS 5 114#define MAX_ROCE_EQS 5
115#define MAX_MSIX_VECTORS 32 115#define MAX_MSIX_VECTORS 32
116#define MIN_MSIX_VECTORS 1 116#define MIN_MSIX_VECTORS 1
117#define BE_TX_BUDGET 256
118#define BE_NAPI_WEIGHT 64 117#define BE_NAPI_WEIGHT 64
119#define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ 118#define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */
120#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) 119#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST)
@@ -200,7 +199,6 @@ struct be_eq_obj {
200 199
201 u8 idx; /* array index */ 200 u8 idx; /* array index */
202 u8 msix_idx; 201 u8 msix_idx;
203 u16 tx_budget;
204 u16 spurious_intr; 202 u16 spurious_intr;
205 struct napi_struct napi; 203 struct napi_struct napi;
206 struct be_adapter *adapter; 204 struct be_adapter *adapter;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index fe007ea4a01c..b31b0f0789db 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2143,7 +2143,6 @@ static int be_evt_queues_create(struct be_adapter *adapter)
2143 napi_hash_add(&eqo->napi); 2143 napi_hash_add(&eqo->napi);
2144 aic = &adapter->aic_obj[i]; 2144 aic = &adapter->aic_obj[i];
2145 eqo->adapter = adapter; 2145 eqo->adapter = adapter;
2146 eqo->tx_budget = BE_TX_BUDGET;
2147 eqo->idx = i; 2146 eqo->idx = i;
2148 aic->max_eqd = BE_MAX_EQD; 2147 aic->max_eqd = BE_MAX_EQD;
2149 aic->enable = true; 2148 aic->enable = true;
@@ -2459,20 +2458,19 @@ static inline void lancer_update_tx_err(struct be_tx_obj *txo, u32 status)
2459 } 2458 }
2460} 2459}
2461 2460
2462static bool be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo, 2461static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
2463 int budget, int idx) 2462 int idx)
2464{ 2463{
2465 struct be_eth_tx_compl *txcp; 2464 struct be_eth_tx_compl *txcp;
2466 int num_wrbs = 0, work_done; 2465 int num_wrbs = 0, work_done = 0;
2467 u32 compl_status; 2466 u32 compl_status;
2467 u16 last_idx;
2468
2469 while ((txcp = be_tx_compl_get(&txo->cq))) {
2470 last_idx = GET_TX_COMPL_BITS(wrb_index, txcp);
2471 num_wrbs += be_tx_compl_process(adapter, txo, last_idx);
2472 work_done++;
2468 2473
2469 for (work_done = 0; work_done < budget; work_done++) {
2470 txcp = be_tx_compl_get(&txo->cq);
2471 if (!txcp)
2472 break;
2473 num_wrbs += be_tx_compl_process(adapter, txo,
2474 GET_TX_COMPL_BITS(wrb_index,
2475 txcp));
2476 compl_status = GET_TX_COMPL_BITS(status, txcp); 2474 compl_status = GET_TX_COMPL_BITS(status, txcp);
2477 if (compl_status) { 2475 if (compl_status) {
2478 if (lancer_chip(adapter)) 2476 if (lancer_chip(adapter))
@@ -2497,7 +2495,6 @@ static bool be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
2497 tx_stats(txo)->tx_compl += work_done; 2495 tx_stats(txo)->tx_compl += work_done;
2498 u64_stats_update_end(&tx_stats(txo)->sync_compl); 2496 u64_stats_update_end(&tx_stats(txo)->sync_compl);
2499 } 2497 }
2500 return (work_done < budget); /* Done */
2501} 2498}
2502 2499
2503int be_poll(struct napi_struct *napi, int budget) 2500int be_poll(struct napi_struct *napi, int budget)
@@ -2506,17 +2503,12 @@ int be_poll(struct napi_struct *napi, int budget)
2506 struct be_adapter *adapter = eqo->adapter; 2503 struct be_adapter *adapter = eqo->adapter;
2507 int max_work = 0, work, i, num_evts; 2504 int max_work = 0, work, i, num_evts;
2508 struct be_rx_obj *rxo; 2505 struct be_rx_obj *rxo;
2509 bool tx_done;
2510 2506
2511 num_evts = events_get(eqo); 2507 num_evts = events_get(eqo);
2512 2508
2513 /* Process all TXQs serviced by this EQ */ 2509 /* Process all TXQs serviced by this EQ */
2514 for (i = eqo->idx; i < adapter->num_tx_qs; i += adapter->num_evt_qs) { 2510 for (i = eqo->idx; i < adapter->num_tx_qs; i += adapter->num_evt_qs)
2515 tx_done = be_process_tx(adapter, &adapter->tx_obj[i], 2511 be_process_tx(adapter, &adapter->tx_obj[i], i);
2516 eqo->tx_budget, i);
2517 if (!tx_done)
2518 max_work = budget;
2519 }
2520 2512
2521 if (be_lock_napi(eqo)) { 2513 if (be_lock_napi(eqo)) {
2522 /* This loop will iterate twice for EQ0 in which 2514 /* This loop will iterate twice for EQ0 in which