netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: annie li <annie.li@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xen.org, netdev@vger.kernel.org,
	jbeulich@suse.com, ian.campbell@citrix.com,
	konrad.wilk@oracle.com, david.vrabel@citrix.com
Subject: Re: [PATCH net-next V3 2/3] xen-netfront: split event channels support for Xen frontend driver
Date: Wed, 22 May 2013 15:32:49 -0400	[thread overview]
Message-ID: <519D1D61.8030500@oracle.com> (raw)
In-Reply-To: <1369240487-18834-3-git-send-email-wei.liu2@citrix.com>


On 2013-5-22 12:34, Wei Liu wrote:
> [...]
>   
> -static irqreturn_t xennet_interrupt(int irq, void *dev_id)
> +static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id)
>   {
> -	struct net_device *dev = dev_id;
> -	struct netfront_info *np = netdev_priv(dev);
> +	struct netfront_info *np = dev_id;
> +	struct net_device *dev = np->netdev;
>   	unsigned long flags;
>   
>   	spin_lock_irqsave(&np->tx_lock, flags);
> +	xennet_tx_buf_gc(dev);
> +	spin_unlock_irqrestore(&np->tx_lock, flags);
>   
> -	if (likely(netif_carrier_ok(dev))) {
> -		xennet_tx_buf_gc(dev);
> -		/* Under tx_lock: protects access to rx shared-ring indexes. */
> -		if (RING_HAS_UNCONSUMED_RESPONSES(&np->rx))
> +	return IRQ_HANDLED;
> +}
> +
> +static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id)
> +{
> +	struct netfront_info *np = dev_id;
> +	struct net_device *dev = np->netdev;
> +
> +	if (likely(netif_carrier_ok(dev) &&
> +		   RING_HAS_UNCONSUMED_RESPONSES(&np->rx)))
>   			napi_schedule(&np->napi);
> -	}
>   
> -	spin_unlock_irqrestore(&np->tx_lock, flags);

Originally, netfront protects access to rx shared-ring with tx_lock, you 
remove this protection here. It is better to protect the ring access by 
a sperate rx_lock then.

Thanks
Annie

  reply	other threads:[~2013-05-22 19:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 16:34 [PATCH net-next 0/2 V3] Xen network: split event channels support Wei Liu
2013-05-22 16:34 ` [PATCH net-next V3 1/3] xen-netback: split event channels support for Xen backend driver Wei Liu
2013-06-24  9:48   ` Jan Beulich
2013-06-24 10:18     ` Wei Liu
2013-05-22 16:34 ` [PATCH net-next V3 2/3] xen-netfront: split event channels support for Xen frontend driver Wei Liu
2013-05-22 19:32   ` annie li [this message]
2013-05-22 20:20     ` [Xen-devel] " Wei Liu
2013-05-22 20:35       ` annie li
2013-05-22 20:38         ` Wei Liu
2013-05-23 13:46           ` Wei Liu
2013-05-23 14:14             ` annie li
2013-05-22 16:34 ` [PATCH net-next V3 3/3] xen: netif.h: document feature-split-event-channels Wei Liu
2013-05-24  1:41 ` [PATCH net-next 0/2 V3] Xen network: split event channels support 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=519D1D61.8030500@oracle.com \
    --to=annie.li@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.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).