Re: [PATCH] xen: netfront: fix declaration order

2011-04-03 Thread David Miller
From: Eric Dumazet 
Date: Sun, 03 Apr 2011 13:07:19 +0200

> [PATCH] xen: netfront: fix declaration order
> 
> Must declare xennet_fix_features() and xennet_set_features() before
> using them.
> 
> Signed-off-by: Eric Dumazet 
> Cc: Michał Mirosław 

Ugh, it makes no sense that XEN won't make it into the x86_32
allmodconfig build.  Those dependencies in arch/x86/xen/Kconfig
are terrible.

For if it did, I would have caught this immediately.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization

Signed bit field; int have_hotplug_status_watch:1

2011-04-03 Thread Dr. David Alan Gilbert
Hi Ian,
   I've been going through some sparse scans of the kernel and
it threw up:

  CHECK   drivers/net/xen-netback/xenbus.c
drivers/net/xen-netback/xenbus.c:29:40: error: dubious one-bit signed bitfield

int have_hotplug_status_watch:1;

from your patch f942dc2552b8bfdee607be867b12a8971bb9cd85 

It does look like that should be an unsigned (given it's assigned
0 and 1)

Dave

-- 
 -Open up your eyes, open up your mind, open up your code ---   
/ Dr. David Alan Gilbert|   Running GNU/Linux   | Happy  \ 
\ gro.gilbert @ treblig.org |   | In Hex /
 \ _|_ http://www.treblig.org   |___/
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


Re: [PATCH] xen: netfront: fix declaration order

2011-04-03 Thread Michał Mirosław
On Sun, Apr 03, 2011 at 01:07:19PM +0200, Eric Dumazet wrote:
> Le vendredi 01 avril 2011 à 20:54 -0700, David Miller a écrit :
> > From: Michał Mirosław 
> > 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 
> > Applied.
> Hmm... I had to apply following patch to make it actually compile.

> [PATCH] xen: netfront: fix declaration order
> 
> Must declare xennet_fix_features() and xennet_set_features() before
> using them.

Hmm. Sorry for that. Looks like x86 allyesconfig doesn't include this
driver in the build. :/

There really needs to be something like CONFIG_LINT...

Best Regards,
Michał Mirosław

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[PATCH] xen: netfront: fix declaration order

2011-04-03 Thread Eric Dumazet
Le vendredi 01 avril 2011 à 20:54 -0700, David Miller a écrit :
> From: Michał Mirosław 
> 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 
> 
> 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 
Cc: Michał Mirosław 
---
 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);


___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization