From: Francois Romieu <romieu@fr.zoreil.com>
To: Nicolas Schichan <nschichan@freebox.fr>
Cc: "David S. Miller" <davem@davemloft.net>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] mv643xx_eth: only account for work done in rxq_process in poll callback.
Date: Wed, 4 Mar 2015 22:32:35 +0100 [thread overview]
Message-ID: <20150304213235.GA20596@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <1425492124-5033-1-git-send-email-nschichan@freebox.fr>
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
next prev parent reply other threads:[~2015-03-04 21:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 18:02 Nicolas Schichan
2015-03-04 21:32 ` Francois Romieu [this message]
2015-03-06 16:28 ` Nicolas Schichan
2015-03-06 21:49 ` Francois Romieu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150304213235.GA20596@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nschichan@freebox.fr \
--cc=sebastian.hesselbarth@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®