lkml.org 
[lkml]   [2015]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1] mv643xx_eth: only account for work done in rxq_process in poll callback.
Nicolas Schichan <nschichan@freebox.fr> :
[...]
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 1c75829..52bc56b 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
[...]
> @@ -1050,7 +1049,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
> __netif_tx_lock_bh(nq);
>
> reclaimed = 0;
> - while (reclaimed < budget && txq->tx_desc_count > 0) {
> + while (txq->tx_desc_count > 0) {
> int tx_index;
> struct tx_desc *desc;
> u32 cmd_sts;

You may use a local 'int count = txq->tx_desc_count' variable then
perform a single update at the end of the locked section.
txq->tx_used_desc could be reworked in a similar way.

> @@ -1105,8 +1104,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
>
> __netif_tx_unlock_bh(nq);
>
> - if (reclaimed < budget)
> - mp->work_tx &= ~(1 << txq->index);
> + mp->work_tx &= ~(1 << txq->index);
>
> return reclaimed;
> }

work_tx is also updated in irq context. I'd rather see "clear_flag() then
reclaim()" than "reclaim() then clear_flag()" in a subsequent patch.

--
Ueimor


\
 
 \ /
  Last update: 2015-03-04 22:41    [W:0.063 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site