From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: jgross@suse.com, wei.liu2@citrix.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
vineethp@amazon.com, xen-devel@lists.xenproject.org,
paul.durrant@citrix.com
Subject: Re: [PATCH] xen-netfront: Delete rx_refill_timer in xennet_disconnect_backend()
Date: Tue, 31 Jan 2017 12:47:14 -0500 [thread overview]
Message-ID: <10b1d554-b395-88fa-eee3-a77754ad14bd@oracle.com> (raw)
In-Reply-To: <07a315d6-7c97-6d11-fa18-548000107c2f@oracle.com>
On 01/30/2017 02:31 PM, Boris Ostrovsky wrote:
> On 01/30/2017 02:06 PM, Eric Dumazet wrote:
>> On Mon, 2017-01-30 at 13:23 -0500, Boris Ostrovsky wrote:
>>
>>> We do netif_carrier_off() first thing in xennet_disconnect_backend() and
>>> the only place where the timer is rearmed is xennet_alloc_rx_buffers(),
>>> which is guarded by netif_carrier_ok() check.
>> Oh well, testing netif_carrier_ok() in packet processing fast path looks
>> unusual and a waste of cpu cycles. I've never seen that pattern before.
>>
>> If one day, we remove this netif_carrier_ok() test during a cleanup,
>> then the race window will open again.
>
> I don't know much about napi but I wonder whether I can indeed disable
> it in xennet_disconnect_backend(). I don't see how anything can happen
> after disconnect since it unmaps the rings. And then napi is re-enabled
> during reconnection in xennet_create_queues(). In which case am not sure
> there is any need for xennet_destroy_queues() as everything there could
> be folded into xennet_disconnect_backend().
While this does work, there was a reason why napi_disable() was not
called in xennet_disconnect_backend() and it is explained in commit
ce58725fec6e --- napi_disable() may sleep and that's why it is called in
xennet_destroy_queues().
OTOH, there is a napi_synchronize() call in xennet_destroy_queues().
Will destroying the timer after it guarantee that all preceding RX have
been completed? RX interrupt is disabled prior to napi_synchronize() so
presumably nothing new can be received.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-01-31 17:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 17:45 [PATCH] xen-netfront: Delete rx_refill_timer in xennet_disconnect_backend() Boris Ostrovsky
2017-01-30 18:07 ` Eric Dumazet
[not found] ` <1485799651.6360.101.camel@edumazet-glaptop3.roam.corp.google.com>
2017-01-30 18:23 ` Boris Ostrovsky
[not found] ` <40057d9d-c615-1a2b-63a2-ab717c29d659@oracle.com>
2017-01-30 19:06 ` Eric Dumazet
[not found] ` <1485803209.6360.111.camel@edumazet-glaptop3.roam.corp.google.com>
2017-01-30 19:31 ` Boris Ostrovsky
2017-01-31 17:47 ` Boris Ostrovsky [this message]
2017-02-01 23:29 ` Boris Ostrovsky
[not found] ` <223ebf32-ba8b-a6be-2331-0644f9d347a0@oracle.com>
2017-02-02 0:01 ` Eric Dumazet
2017-02-03 9:38 ` Juergen Gross
[not found] ` <bc3bf927-568e-043a-2785-16e6c3628359@suse.com>
2017-02-09 13:42 ` Boris Ostrovsky
2017-02-10 18:46 ` David Miller
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=10b1d554-b395-88fa-eee3-a77754ad14bd@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=eric.dumazet@gmail.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paul.durrant@citrix.com \
--cc=stable@vger.kernel.org \
--cc=vineethp@amazon.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).