xen-netback: make feature-rx-notify mandatory
authorDavid Vrabel <david.vrabel@citrix.com>
Wed, 22 Oct 2014 13:08:53 +0000 (14:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Oct 2014 18:15:20 +0000 (14:15 -0400)
Frontends that do not provide feature-rx-notify may stall because
netback depends on the notification from frontend to wake the guest Rx
thread (even if can_queue is false).

This could be fixed but feature-rx-notify was introduced in 2006 and I
am not aware of any frontends that do not implement this.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netback/common.h
drivers/net/xen-netback/interface.c
drivers/net/xen-netback/xenbus.c

index d4eb8d2e9cb7f7f2bc0b3816dd788e6eb01c7927..93ca77c129c35be85f62d2b4a3cca6d6892539a3 100644 (file)
@@ -228,9 +228,6 @@ struct xenvif {
        u8 ip_csum:1;
        u8 ipv6_csum:1;
 
-       /* Internal feature information. */
-       u8 can_queue:1;     /* can queue packets for receiver? */
-
        /* Is this interface disabled? True when backend discovers
         * frontend is rogue.
         */
@@ -272,8 +269,6 @@ void xenvif_xenbus_fini(void);
 
 int xenvif_schedulable(struct xenvif *vif);
 
-int xenvif_must_stop_queue(struct xenvif_queue *queue);
-
 int xenvif_queue_stopped(struct xenvif_queue *queue);
 void xenvif_wake_queue(struct xenvif_queue *queue);
 
index f379689dde309b7bf63eb511ef7f28a827f71fc5..c6759b1ec18d440ac892f28078e63199693d73aa 100644 (file)
@@ -60,16 +60,6 @@ void xenvif_skb_zerocopy_complete(struct xenvif_queue *queue)
        atomic_dec(&queue->inflight_packets);
 }
 
-static inline void xenvif_stop_queue(struct xenvif_queue *queue)
-{
-       struct net_device *dev = queue->vif->dev;
-
-       if (!queue->vif->can_queue)
-               return;
-
-       netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id));
-}
-
 int xenvif_schedulable(struct xenvif *vif)
 {
        return netif_running(vif->dev) &&
@@ -209,7 +199,7 @@ static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (!xenvif_rx_ring_slots_available(queue, min_slots_needed)) {
                queue->rx_stalled.function = xenvif_rx_stalled;
                queue->rx_stalled.data = (unsigned long)queue;
-               xenvif_stop_queue(queue);
+               netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id));
                mod_timer(&queue->rx_stalled,
                          jiffies + rx_drain_timeout_jiffies);
        }
index 8079c31ac5e64372fe978405c8faa72981998320..9060857c90228c51e32d3f1cece27d5e63f1e0a8 100644 (file)
@@ -873,15 +873,10 @@ static int read_xenbus_vif_flags(struct backend_info *be)
        if (!rx_copy)
                return -EOPNOTSUPP;
 
-       if (vif->dev->tx_queue_len != 0) {
-               if (xenbus_scanf(XBT_NIL, dev->otherend,
-                                "feature-rx-notify", "%d", &val) < 0)
-                       val = 0;
-               if (val)
-                       vif->can_queue = 1;
-               else
-                       /* Must be non-zero for pfifo_fast to work. */
-                       vif->dev->tx_queue_len = 1;
+       if (xenbus_scanf(XBT_NIL, dev->otherend,
+                        "feature-rx-notify", "%d", &val) < 0 || val == 0) {
+               xenbus_dev_fatal(dev, -EINVAL, "feature-rx-notify is mandatory");
+               return -EINVAL;
        }
 
        if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg",