diff options
author | David Vrabel <david.vrabel@citrix.com> | 2014-10-22 09:08:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-25 14:15:20 -0400 |
commit | bc96f648df1bbc2729abbb84513cf4f64273a1f1 (patch) | |
tree | ad8044147004ba38641bc727bf3b0f866c2e05ac /drivers/net | |
parent | 5345c1d417c1b0caf46fd2766d16bb4357a347d8 (diff) |
xen-netback: make feature-rx-notify mandatory
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/xen-netback/common.h | 5 | ||||
-rw-r--r-- | drivers/net/xen-netback/interface.c | 12 | ||||
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 13 |
3 files changed, 5 insertions, 25 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index d4eb8d2e9cb7..93ca77c129c3 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -228,9 +228,6 @@ struct xenvif { | |||
228 | u8 ip_csum:1; | 228 | u8 ip_csum:1; |
229 | u8 ipv6_csum:1; | 229 | u8 ipv6_csum:1; |
230 | 230 | ||
231 | /* Internal feature information. */ | ||
232 | u8 can_queue:1; /* can queue packets for receiver? */ | ||
233 | |||
234 | /* Is this interface disabled? True when backend discovers | 231 | /* Is this interface disabled? True when backend discovers |
235 | * frontend is rogue. | 232 | * frontend is rogue. |
236 | */ | 233 | */ |
@@ -272,8 +269,6 @@ void xenvif_xenbus_fini(void); | |||
272 | 269 | ||
273 | int xenvif_schedulable(struct xenvif *vif); | 270 | int xenvif_schedulable(struct xenvif *vif); |
274 | 271 | ||
275 | int xenvif_must_stop_queue(struct xenvif_queue *queue); | ||
276 | |||
277 | int xenvif_queue_stopped(struct xenvif_queue *queue); | 272 | int xenvif_queue_stopped(struct xenvif_queue *queue); |
278 | void xenvif_wake_queue(struct xenvif_queue *queue); | 273 | void xenvif_wake_queue(struct xenvif_queue *queue); |
279 | 274 | ||
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index f379689dde30..c6759b1ec18d 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -60,16 +60,6 @@ void xenvif_skb_zerocopy_complete(struct xenvif_queue *queue) | |||
60 | atomic_dec(&queue->inflight_packets); | 60 | atomic_dec(&queue->inflight_packets); |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline void xenvif_stop_queue(struct xenvif_queue *queue) | ||
64 | { | ||
65 | struct net_device *dev = queue->vif->dev; | ||
66 | |||
67 | if (!queue->vif->can_queue) | ||
68 | return; | ||
69 | |||
70 | netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id)); | ||
71 | } | ||
72 | |||
73 | int xenvif_schedulable(struct xenvif *vif) | 63 | int xenvif_schedulable(struct xenvif *vif) |
74 | { | 64 | { |
75 | return netif_running(vif->dev) && | 65 | return netif_running(vif->dev) && |
@@ -209,7 +199,7 @@ static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
209 | if (!xenvif_rx_ring_slots_available(queue, min_slots_needed)) { | 199 | if (!xenvif_rx_ring_slots_available(queue, min_slots_needed)) { |
210 | queue->rx_stalled.function = xenvif_rx_stalled; | 200 | queue->rx_stalled.function = xenvif_rx_stalled; |
211 | queue->rx_stalled.data = (unsigned long)queue; | 201 | queue->rx_stalled.data = (unsigned long)queue; |
212 | xenvif_stop_queue(queue); | 202 | netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id)); |
213 | mod_timer(&queue->rx_stalled, | 203 | mod_timer(&queue->rx_stalled, |
214 | jiffies + rx_drain_timeout_jiffies); | 204 | jiffies + rx_drain_timeout_jiffies); |
215 | } | 205 | } |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 8079c31ac5e6..9060857c9022 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -873,15 +873,10 @@ static int read_xenbus_vif_flags(struct backend_info *be) | |||
873 | if (!rx_copy) | 873 | if (!rx_copy) |
874 | return -EOPNOTSUPP; | 874 | return -EOPNOTSUPP; |
875 | 875 | ||
876 | if (vif->dev->tx_queue_len != 0) { | 876 | if (xenbus_scanf(XBT_NIL, dev->otherend, |
877 | if (xenbus_scanf(XBT_NIL, dev->otherend, | 877 | "feature-rx-notify", "%d", &val) < 0 || val == 0) { |
878 | "feature-rx-notify", "%d", &val) < 0) | 878 | xenbus_dev_fatal(dev, -EINVAL, "feature-rx-notify is mandatory"); |
879 | val = 0; | 879 | return -EINVAL; |
880 | if (val) | ||
881 | vif->can_queue = 1; | ||
882 | else | ||
883 | /* Must be non-zero for pfifo_fast to work. */ | ||
884 | vif->dev->tx_queue_len = 1; | ||
885 | } | 880 | } |
886 | 881 | ||
887 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg", | 882 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg", |