lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 4 Mar 2015 22:32:35 +0100
From:	Francois Romieu <romieu@...zoreil.com>
To:	Nicolas Schichan <nschichan@...ebox.fr>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] mv643xx_eth: only account for work done in
 rxq_process in poll callback.

Nicolas Schichan <nschichan@...ebox.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ