netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH v3 6/6] net: sh_eth: use NAPI
Date: Wed, 16 May 2012 11:14:17 +0900	[thread overview]
Message-ID: <4FB30D79.7060101@renesas.com> (raw)
In-Reply-To: <20120515.130552.119728053706080493.davem@davemloft.net>

2012/05/16 2:05, David Miller wrote:
> From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
> Date: Tue, 15 May 2012 18:46:25 +0900
> 
>> 2012/05/15 14:07, David Miller wrote:
>>> From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
>>> Date: Tue, 15 May 2012 13:47:44 +0900
>>>
>>>> 2012/05/15 7:50, David Miller wrote:
>>>>> You need strict synchronization between your TX queueing and TX
>>>>> liberation flows.  So that queue stop and wake are only performed
>>>>> at the correct moment.
>>>>
>>>> I will add netif_queue_stopped() in the sh_eth_poll().
>>>
>>> That doesn't fix the bug.  What if someone transmits a packet and
>>> fills the TX queue between the netif_queue_stopped() test and the
>>> call to netif_wake_queue()?
>>>
>>> Adding another test doesn't create the necessary synchronization.
>>>
>>
>> Thank you for the reply again.
>> I will modify the code as the following. Is it correct?
>>
>> 	if (txfree_num) {
>> 		netif_tx_lock(ndev);
>> 		if (netif_queue_stopped(ndev))
>> 			netif_wake_queue(ndev);
>> 		netif_tx_unlock(ndev);
>> 	}
> 
> Yes, and then you don't need that private lock in the start_xmit()
> method at all, since that method runs with the tx_lock held.
> 

Thank you for the reply. I will also modify the start_xmit().

Best regards,
Yoshihiro Shimoda

      parent reply	other threads:[~2012-05-16  2:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14  6:47 [PATCH v3 6/6] net: sh_eth: use NAPI Shimoda, Yoshihiro
2012-05-14 22:50 ` David Miller
2012-05-15  4:47   ` Shimoda, Yoshihiro
2012-05-15  5:07     ` David Miller
2012-05-15  9:46       ` Shimoda, Yoshihiro
2012-05-15 13:43         ` Francois Romieu
2012-05-15 17:05         ` David Miller
2012-05-15 18:29           ` Francois Romieu
2012-05-16  2:24             ` Shimoda, Yoshihiro
2012-05-16  2:14           ` Shimoda, Yoshihiro [this message]

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=4FB30D79.7060101@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=davem@davemloft.net \
    --cc=linux-sh@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).