[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1301828839.2837.143.camel@edumazet-laptop>
Date: Sun, 03 Apr 2011 13:07:19 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: mirq-linux@...e.qmqm.pl, netdev@...r.kernel.org,
jeremy.fitzhardinge@...rix.com, konrad.wilk@...cle.com,
Ian.Campbell@...rix.com, xen-devel@...ts.xensource.com,
virtualization@...ts.linux-foundation.org
Subject: [PATCH] xen: netfront: fix declaration order
Le vendredi 01 avril 2011 à 20:54 -0700, David Miller a écrit :
> From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> 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@...e.qmqm.pl>
>
> 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@...il.com>
Cc: Michał Mirosław <mirq-linux@...e.qmqm.pl>
---
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);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists