]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/xen-netback/xenbus.c
Merge tag 'omap-for-v3.20/dt-pt1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / net / xen-netback / xenbus.c
index fab0d4b42f58fca511dc447b62ea91607732ba81..794204e34fba4fb74d1c21f2fef0837ef340feaa 100644 (file)
@@ -404,6 +404,7 @@ static int backend_create_xenvif(struct backend_info *be)
        int err;
        long handle;
        struct xenbus_device *dev = be->dev;
+       struct xenvif *vif;
 
        if (be->vif != NULL)
                return 0;
@@ -414,13 +415,13 @@ static int backend_create_xenvif(struct backend_info *be)
                return (err < 0) ? err : -EINVAL;
        }
 
-       be->vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle);
-       if (IS_ERR(be->vif)) {
-               err = PTR_ERR(be->vif);
-               be->vif = NULL;
+       vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle);
+       if (IS_ERR(vif)) {
+               err = PTR_ERR(vif);
                xenbus_dev_fatal(dev, err, "creating interface");
                return err;
        }
+       be->vif = vif;
 
        kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
        return 0;
@@ -736,6 +737,7 @@ static void connect(struct backend_info *be)
                }
 
                queue->remaining_credit = credit_bytes;
+               queue->credit_usec = credit_usec;
 
                err = connect_rings(be, queue);
                if (err) {
@@ -886,9 +888,15 @@ static int read_xenbus_vif_flags(struct backend_info *be)
                return -EOPNOTSUPP;
 
        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;
+                        "feature-rx-notify", "%d", &val) < 0)
+               val = 0;
+       if (!val) {
+               /* - Reduce drain timeout to poll more frequently for
+                *   Rx requests.
+                * - Disable Rx stall detection.
+                */
+               be->vif->drain_timeout = msecs_to_jiffies(30);
+               be->vif->stall_timeout = 0;
        }
 
        if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg",