netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, <netdev@vger.kernel.org>,
	<xen-devel@lists.xen.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [Xen-devel] [PATCH net v2 1/3] xen-netback: move NAPI add/remove calls
Date: Mon, 11 Aug 2014 14:14:16 +0100	[thread overview]
Message-ID: <53E8C1A8.4050302@citrix.com> (raw)
In-Reply-To: <53E8BE92.5070606@citrix.com>

On 11/08/14 14:01, David Vrabel wrote:
> On 11/08/14 13:49, Zoltan Kiss wrote:
>> On 11/08/14 13:35, David Vrabel wrote:
>>> On 08/08/14 17:37, Wei Liu wrote:
>>>> Originally napi_add was in init_queue and napi_del was in deinit_queue,
>>>> while kthreads were handled in _connect and _disconnect. Move napi_add
>>>> and napi_remove to _connect and _disconnect so that they reside togother
>>>> with kthread operations.
>>>>
>>>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>>>> Cc: Ian Campbell <ian.campbell@citrix.com>
>>>> Cc: Zoltan Kiss <zoltan.kiss@citrix.com>
>>>> ---
>>>>    drivers/net/xen-netback/interface.c |   12 ++++++++----
>>>>    1 file changed, 8 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/net/xen-netback/interface.c
>>>> b/drivers/net/xen-netback/interface.c
>>>> index 48a55cd..fdb4fca 100644
>>>> --- a/drivers/net/xen-netback/interface.c
>>>> +++ b/drivers/net/xen-netback/interface.c
>>>> @@ -528,9 +528,6 @@ int xenvif_init_queue(struct xenvif_queue *queue)
>>>>
>>>>        init_timer(&queue->rx_stalled);
>>>>
>>>> -    netif_napi_add(queue->vif->dev, &queue->napi, xenvif_poll,
>>>> -            XENVIF_NAPI_WEIGHT);
>>>> -
>>>>        return 0;
>>>>    }
>>>>
>>>> @@ -618,6 +615,9 @@ int xenvif_connect(struct xenvif_queue *queue,
>>>> unsigned long tx_ring_ref,
>>>>        wake_up_process(queue->task);
>>>>        wake_up_process(queue->dealloc_task);
>>>>
>>>> +    netif_napi_add(queue->vif->dev, &queue->napi, xenvif_poll,
>>>> +            XENVIF_NAPI_WEIGHT);
>>>> +
>>>>        return 0;
>>>>
>>>>    err_rx_unbind:
>>>> @@ -675,6 +675,11 @@ void xenvif_disconnect(struct xenvif *vif)
>>>>
>>>>        for (queue_index = 0; queue_index < num_queues; ++queue_index) {
>>>>            queue = &vif->queues[queue_index];
>>>> +        netif_napi_del(&queue->napi);
>>>> +    }
>>>
>>> Why have you added an additional loop over all the queues?  The ordering
>>> looks wrong as well.  I think you want
>>>
>>>     1. unbind from irqhandler
>>>     2. napi del
>>>     3. stop task
>>>     4. stop dealloc task
>>>     5. unmap frontend rings.
>> And that's how they are ordered.
>
> No, it isn't.  Did you mistakenly look at netfront which is correctly
> ordered already?
>
> You must unbind the irq handler before calling netif_napi_del() or an
> interrupt may occur and the handler may call napi_schedule() with a
> deleted instance.
I think xenvif_carrier_off (which call xenvif_down) does that. It is 
right before this new napi_del in xenvif_disconnect.

Zoli

  reply	other threads:[~2014-08-11 13:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 16:37 [PATCH net v2 0/3] xen-netback: synchronisation between core driver and netback Wei Liu
2014-08-08 16:37 ` [PATCH net v2 1/3] xen-netback: move NAPI add/remove calls Wei Liu
2014-08-08 16:49   ` Sergei Shtylyov
2014-08-08 16:52     ` Wei Liu
2014-08-11 12:35   ` [Xen-devel] " David Vrabel
2014-08-11 12:49     ` Zoltan Kiss
2014-08-11 13:01       ` David Vrabel
2014-08-11 13:14         ` Zoltan Kiss [this message]
2014-08-11 13:43           ` Wei Liu
2014-08-11 13:59             ` David Vrabel
2014-08-11 14:08               ` Wei Liu
2014-08-08 16:37 ` [PATCH net v2 2/3] xen-netback: don't stop dealloc kthread too early Wei Liu
2014-08-11 12:10   ` [Xen-devel] " David Vrabel
2014-08-11 13:48     ` Wei Liu
2014-08-11 13:58       ` David Vrabel
2014-08-11 14:13         ` Zoltan Kiss
2014-08-11 14:44           ` Wei Liu
2014-08-11 15:23             ` David Vrabel
2014-08-11 20:39               ` Wei Liu
2014-08-11 14:31         ` Wei Liu
2014-08-11 14:34           ` David Vrabel
2014-08-11 14:39             ` Wei Liu
2014-08-08 16:37 ` [PATCH net v2 3/3] xen-netback: remove loop waiting function Wei Liu

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=53E8C1A8.4050302@citrix.com \
    --to=zoltan.kiss@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).