WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen: netfront: fix declaration order

To: David Miller <davem@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xen: netfront: fix declaration order
From: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Date: Sun, 03 Apr 2011 13:07:19 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian.Campbell@xxxxxxxxxx, konrad.wilk@xxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, mirq-linux@xxxxxxxxxxxx, jeremy.fitzhardinge@xxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 03 Apr 2011 04:10:19 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=vzbhPI7MmbpeGYYrkEsr1c6tiBa4lx7mr3JP4k3MG6w=; b=ZBZM9nS5yKtJBRwLhJnUhw4e1VUgtV/88ToqMwccz8/enLe1BhYlaQpU/ak1QwYmkG We3aJIJckcFc1qbTxvgNCinQfcuzxgsICFP2VqICmW3lpCX/AOdtPdr3s8QjJgCZOQ2S D8+QwhFbrnqz6/mbVvWYI7C0dUU09k/MYy9Ug=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=wsOdXHD34z3tVysbaa+XU0UTlRsP+JPomoJ4eH0jpBArUPoTg/wxQ0ONMLwNQQ9DNm dybG0B1vyA7doL8Q5DLaUUziXMfo6oUeGrYwbz/8PocYie6oQkM7zRmEKRRzsUSAuqVg WULZOhVyp8E45t+41Cc0kyQRlgkK8LqKkRYt0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110401.205455.70198735.davem@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110331110136.03A1A13A6A@xxxxxxxxxxxx> <20110401.205455.70198735.davem@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Le vendredi 01 avril 2011 à 20:54 -0700, David Miller a écrit :
> From: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
> Date: Thu, 31 Mar 2011 13:01:35 +0200 (CEST)
> 
> > Not tested in any way. The original code for offload setting seems broken
> > as it resets the features on every netback reconnect.
> > 
> > This will set GSO_ROBUST at device creation time (earlier than connect 
> > time).
> > 
> > RX checksum offload is forced on - so advertise as it is.
> > 
> > Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
> 
> Applied.

Hmm... I had to apply following patch to make it actually compile.

Thanks

[PATCH] xen: netfront: fix declaration order

Must declare xennet_fix_features() and xennet_set_features() before
using them.

Signed-off-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Cc: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
---
 drivers/net/xen-netfront.c |   72 +++++++++++++++++------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index f6e7e27..0cfe4cc 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1140,6 +1140,42 @@ static void xennet_uninit(struct net_device *dev)
        gnttab_free_grant_references(np->gref_rx_head);
 }
 
+static u32 xennet_fix_features(struct net_device *dev, u32 features)
+{
+       struct netfront_info *np = netdev_priv(dev);
+       int val;
+
+       if (features & NETIF_F_SG) {
+               if (xenbus_scanf(XBT_NIL, np->xbdev->otherend, "feature-sg",
+                                "%d", &val) < 0)
+                       val = 0;
+
+               if (!val)
+                       features &= ~NETIF_F_SG;
+       }
+
+       if (features & NETIF_F_TSO) {
+               if (xenbus_scanf(XBT_NIL, np->xbdev->otherend,
+                                "feature-gso-tcpv4", "%d", &val) < 0)
+                       val = 0;
+
+               if (!val)
+                       features &= ~NETIF_F_TSO;
+       }
+
+       return features;
+}
+
+static int xennet_set_features(struct net_device *dev, u32 features)
+{
+       if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) {
+               netdev_info(dev, "Reducing MTU because no SG offload");
+               dev->mtu = ETH_DATA_LEN;
+       }
+
+       return 0;
+}
+
 static const struct net_device_ops xennet_netdev_ops = {
        .ndo_open            = xennet_open,
        .ndo_uninit          = xennet_uninit,
@@ -1513,42 +1549,6 @@ again:
        return err;
 }
 
-static u32 xennet_fix_features(struct net_device *dev, u32 features)
-{
-       struct netfront_info *np = netdev_priv(dev);
-       int val;
-
-       if (features & NETIF_F_SG) {
-               if (xenbus_scanf(XBT_NIL, np->xbdev->otherend, "feature-sg",
-                                "%d", &val) < 0)
-                       val = 0;
-
-               if (!val)
-                       features &= ~NETIF_F_SG;
-       }
-
-       if (features & NETIF_F_TSO) {
-               if (xenbus_scanf(XBT_NIL, np->xbdev->otherend,
-                                "feature-gso-tcpv4", "%d", &val) < 0)
-                       val = 0;
-
-               if (!val)
-                       features &= ~NETIF_F_TSO;
-       }
-
-       return features;
-}
-
-static int xennet_set_features(struct net_device *dev, u32 features)
-{
-       if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) {
-               netdev_info(dev, "Reducing MTU because no SG offload");
-               dev->mtu = ETH_DATA_LEN;
-       }
-
-       return 0;
-}
-
 static int xennet_connect(struct net_device *dev)
 {
        struct netfront_info *np = netdev_priv(dev);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel