From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: Zoltan Kiss <zoltan.kiss@citrix•com>,
Wei Liu <wei.liu2@citrix•com>,
Ian Campbell <Ian.Campbell@citrix•com>
Cc: David Vrabel <david.vrabel@citrix•com>,
netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
xen-devel@lists•xenproject.org
Subject: Re: [PATCH net-next] xen-netback: Fix vif->disable handling
Date: Thu, 07 Aug 2014 00:31:32 +0400 [thread overview]
Message-ID: <53E290A4.1020900@cogentembedded.com> (raw)
In-Reply-To: <1407353598-14185-1-git-send-email-zoltan.kiss@citrix.com>
Hello.
On 08/06/2014 11:33 PM, Zoltan Kiss wrote:
> In the patch called "xen-netback: Turn off the carrier if the guest is not able
> to receive" new branches were introduced to this if statement, risking that a
> queue with non-zero id can reenable the disabled interface.
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix•com>
> Signed-off-by: David Vrabel <david.vrabel@citrix•com>
> Cc: netdev@vger•kernel.org
> Cc: linux-kernel@vger•kernel.org
> Cc: xen-devel@lists•xenproject.org
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index aa20933..f84516f 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -2027,7 +2027,13 @@ int xenvif_kthread_guest_rx(void *data)
> */
> if (unlikely(queue->vif->disabled && queue->id == 0))
> xenvif_carrier_off(queue->vif);
> - else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
> + else if (unlikely(queue->vif->disabled)) {
Perhaps it's time to fix the coding style and add {} around the first arm
of the *if* statement?
> + /* kthread_stop() would be called upon this thread soon,
> + * be a bit proactive
> + */
> + skb_queue_purge(&queue->rx_queue);
> + queue->rx_last_skb_slots = 0;
> + } else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
> &queue->status))) {
> xenvif_rx_purge_event(queue);
> } else if (!netif_carrier_ok(queue->vif->dev)) {
WBR, Sergei
next prev parent reply other threads:[~2014-08-06 20:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 19:33 [PATCH net-next] xen-netback: Fix vif->disable handling Zoltan Kiss
2014-08-06 20:31 ` Sergei Shtylyov [this message]
2014-08-06 21:08 ` 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=53E290A4.1020900@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded$(echo .)com \
--cc=Ian.Campbell@citrix$(echo .)com \
--cc=david.vrabel@citrix$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=wei.liu2@citrix$(echo .)com \
--cc=xen-devel@lists$(echo .)xenproject.org \
--cc=zoltan.kiss@citrix$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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