[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH net-next V3 2/3] xen-netfront: split event channels support for Xen frontend driver




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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.