提交 8c1a595c 编写于 作者: J Joe Damato 提交者: Tony Nguyen

i40e: Record number TXes cleaned during NAPI

Update i40e_clean_tx_irq to take an out parameter (tx_cleaned) which stores
the number TXs cleaned.

No XDP related TX code is touched. Care has been taken to avoid changing
the control flow of i40e_clean_tx_irq and i40e_napi_poll.
Signed-off-by: NJoe Damato <jdamato@fastly.com>
Acked-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: NSridhar Samudrala <sridhar.samudrala@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 6b85a4f3
...@@ -923,11 +923,13 @@ void i40e_detect_recover_hung(struct i40e_vsi *vsi) ...@@ -923,11 +923,13 @@ void i40e_detect_recover_hung(struct i40e_vsi *vsi)
* @vsi: the VSI we care about * @vsi: the VSI we care about
* @tx_ring: Tx ring to clean * @tx_ring: Tx ring to clean
* @napi_budget: Used to determine if we are in netpoll * @napi_budget: Used to determine if we are in netpoll
* @tx_cleaned: Out parameter set to the number of TXes cleaned
* *
* Returns true if there's any budget left (e.g. the clean is finished) * Returns true if there's any budget left (e.g. the clean is finished)
**/ **/
static bool i40e_clean_tx_irq(struct i40e_vsi *vsi, static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
struct i40e_ring *tx_ring, int napi_budget) struct i40e_ring *tx_ring, int napi_budget,
unsigned int *tx_cleaned)
{ {
int i = tx_ring->next_to_clean; int i = tx_ring->next_to_clean;
struct i40e_tx_buffer *tx_buf; struct i40e_tx_buffer *tx_buf;
...@@ -1048,6 +1050,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi, ...@@ -1048,6 +1050,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
} }
} }
*tx_cleaned = total_packets;
return !!budget; return !!budget;
} }
...@@ -2689,6 +2692,8 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) ...@@ -2689,6 +2692,8 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
container_of(napi, struct i40e_q_vector, napi); container_of(napi, struct i40e_q_vector, napi);
struct i40e_vsi *vsi = q_vector->vsi; struct i40e_vsi *vsi = q_vector->vsi;
struct i40e_ring *ring; struct i40e_ring *ring;
bool tx_clean_complete = true;
unsigned int tx_cleaned = 0;
bool clean_complete = true; bool clean_complete = true;
bool arm_wb = false; bool arm_wb = false;
int budget_per_ring; int budget_per_ring;
...@@ -2705,10 +2710,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) ...@@ -2705,10 +2710,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
i40e_for_each_ring(ring, q_vector->tx) { i40e_for_each_ring(ring, q_vector->tx) {
bool wd = ring->xsk_pool ? bool wd = ring->xsk_pool ?
i40e_clean_xdp_tx_irq(vsi, ring) : i40e_clean_xdp_tx_irq(vsi, ring) :
i40e_clean_tx_irq(vsi, ring, budget); i40e_clean_tx_irq(vsi, ring, budget, &tx_cleaned);
if (!wd) { if (!wd) {
clean_complete = false; clean_complete = tx_clean_complete = false;
continue; continue;
} }
arm_wb |= ring->arm_wb; arm_wb |= ring->arm_wb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册