[PATCH] staging: Enhance cpu load-balance octeon ethernet driver

From: EUNBONG SONG
Date: Wed Apr 10 2013 - 06:16:51 EST



Currently, CPU for RX napi handler is scheduled when backlog packet count is greater than budget * cores_in_use.
If more cpus are used for RX napi handler, there is low possibility backlog packet count is greater than budget * cores_in_use.
This patch makes CPU for RX napi handler is scheduled when backlog packet count is greater than budget.
I tested with patch and the result is more cpu is scheduled in traffic congestion situation.

Signed-off-by: EunBong Song <eunb.song@xxxxxxxxxxx>
---
drivers/staging/octeon/ethernet-rx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 34afc16..13f9eae 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -300,7 +300,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
int cores_in_use = core_state.baseline_cores - atomic_read(&core_state.available_cores);
counts.u64 = cvmx_read_csr(CVMX_POW_WQ_INT_CNTX(pow_receive_group));
backlog = counts.s.iq_cnt + counts.s.ds_cnt;
- if (backlog > budget * cores_in_use && napi != NULL)
+ if (backlog > budget && napi != NULL)
cvm_oct_enable_one_cpu();
}

--
1.7.0.4
?移»®&Þ~º&¶¬–+-깁負¥Šw®왢쎉喝méb욎dz받–)í끾èw*jgП¨¶‰šŽ듶¢j/곴äz받–듺2듷솳鈺Ú&¢)傘«a뛴®G«앶h®æj:+v돣Šwè녪¥>W슧違iÛaxPjØm¶Ÿÿà -»+껠dš_