xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Hahn <hahn@univention.de>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Erik Damrose <Damrose@univention.de>,
	Ian Campbell <ian.campbell@citrix.com>,
	Zoltan Kiss <zoltan.kiss@citrix.com>
Subject: Re: RFH: Kernel OOPS in xen_netbk_rx_action / xenvif_gop_skb
Date: Mon, 23 Jun 2014 16:56:02 +0200	[thread overview]
Message-ID: <53A84002.5050402@univention.de> (raw)
In-Reply-To: <20140619141252.GO20819@zion.uk.xensource.com>

Hello Wei Liu,

On 19.06.2014 16:12, Wei Liu wrote:
> On Wed, Jun 18, 2014 at 06:48:31PM +0200, Philipp Hahn wrote:
...
>> 5. then xen-netback continues processing the pending requests and tries
...
> I think your analysis makes sense. Netback does have it's internal queue
> and kthread can certainly be scheduled away. There doesn't seem to be a
> synchronisation point between a vif getting disconnet and internal queue
> gets processed. I attach a quick hack. If it does work to a degree then
> we can try to work out a proper fix.

Your quick hack seems to have solved the problem: The network survived
the week-end, but we had to change the VMs as one of them was required
last weekend. We're currently re-checking that the bug still occurs with
the old kernel but the new set of VMs.

>>>> There's one more patch that you can pick up from 3.10.y tree. I doubt it
>>>> will make much difference though.
>>
>> Which patch are you referring to?
> 
> You can have a look at 3.10.y tree for all the patches between your
> current version and the latest stable version.

Thanks, I'll have a look.

> ---8<---
> From d2f428a93e6e296bc5f55e16f44ac1ad63a951a8 Mon Sep 17 00:00:00 2001
> From: Wei Liu <wei.liu2@citrix.com>
> Date: Thu, 19 Jun 2014 15:07:47 +0100
> Subject: [PATCH] quick hack
> 
> ---
>  drivers/net/xen-netback/common.h    |    1 +
>  drivers/net/xen-netback/interface.c |    1 +
>  drivers/net/xen-netback/netback.c   |    8 ++++++++
>  3 files changed, 10 insertions(+)
> 
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index f2faa77..9239824 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -66,6 +66,7 @@ struct xenvif {
>  	/* The shared rings and indexes. */
>  	struct xen_netif_tx_back_ring tx;
>  	struct xen_netif_rx_back_ring rx;
> +	bool mapped;
>  
>  	/* Frontend feature information. */
>  	u8 can_sg:1;
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index 540a796..5f11763 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -271,6 +271,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
>  	vif->dev = dev;
>  	INIT_LIST_HEAD(&vif->schedule_list);
>  	INIT_LIST_HEAD(&vif->notify_list);
> +	vif->mapped = false;
>  
>  	vif->credit_bytes = vif->remaining_credit = ~0UL;
>  	vif->credit_usec  = 0UL;
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 36efb41..f4f3693 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -720,6 +720,11 @@ static void xen_netbk_rx_action(struct xen_netbk *netbk)
>  		vif = netdev_priv(skb->dev);
>  		nr_frags = skb_shinfo(skb)->nr_frags;
>  
> +		if (!vif->mapped) {
> +			dev_kfree_skb(skb);
> +			continue;
> +		}
> +
>  		sco = (struct skb_cb_overlay *)skb->cb;
>  		sco->meta_slots_used = netbk_gop_skb(skb, &npo);
>  
> @@ -1864,6 +1869,8 @@ static int xen_netbk_kthread(void *data)
>  
>  void xen_netbk_unmap_frontend_rings(struct xenvif *vif)
>  {
> +	vif->mapped = false;
> +
>  	if (vif->tx.sring)
>  		xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(vif),
>  					vif->tx.sring);
> @@ -1899,6 +1906,7 @@ int xen_netbk_map_frontend_rings(struct xenvif *vif,
>  	BACK_RING_INIT(&vif->rx, rxs, PAGE_SIZE);
>  
>  	vif->rx_req_cons_peek = 0;
> +	vif->mapped = true;
>  
>  	return 0;
>  
> 

  parent reply	other threads:[~2014-06-23 14:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06 10:26 RFH: Kernel OOPS in xen_netbk_rx_action / xenvif_gop_skb Philipp Hahn
2014-06-06 10:58 ` Wei Liu
2014-06-06 22:12   ` Philipp Hahn
2014-06-18 16:48     ` Philipp Hahn
2014-06-19 14:12       ` Wei Liu
2014-06-19 14:35         ` David Vrabel
2014-06-19 14:41           ` Wei Liu
2014-06-23 14:56         ` Philipp Hahn [this message]
2014-06-27  8:42           ` Philipp Hahn
2014-06-27 17:48             ` Philipp Hahn
2014-06-27 18:24               ` Philipp Hahn
2014-07-02  7:45                 ` [PATCH] " Philipp Hahn
2014-07-10 12:41                   ` Wei Liu
     [not found]                   ` <20140710124122.GA2381@zion.uk.xensource.com>
2014-07-11  9:41                     ` Philipp Hahn
     [not found]                     ` <53BFB142.7050201@univention.de>
2014-07-11  9:53                       ` Wei Liu
2014-07-11 10:32                       ` Wei Liu
     [not found]                       ` <20140711103236.GB12584@zion.uk.xensource.com>
2014-07-11 11:02                         ` Philipp Hahn
     [not found]                         ` <53BFC43A.4080709@univention.de>
2014-07-11 11:16                           ` 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=53A84002.5050402@univention.de \
    --to=hahn@univention.de \
    --cc=Damrose@univention.de \
    --cc=ian.campbell@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zoltan.kiss@citrix.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;
as well as URLs for NNTP newsgroup(s).