xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: mirq-linux@rere.qmqm.pl, netdev@vger.kernel.org,
	jeremy.fitzhardinge@citrix.com, konrad.wilk@oracle.com,
	Ian.Campbell@citrix.com, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: [PATCH] xen: netfront: fix declaration order
Date: Sun, 03 Apr 2011 13:07:19 +0200	[thread overview]
Message-ID: <1301828839.2837.143.camel@edumazet-laptop> (raw)
In-Reply-To: <20110401.205455.70198735.davem@davemloft.net>

Le vendredi 01 avril 2011 à 20:54 -0700, David Miller a écrit :
> From: Michał Mirosław <mirq-linux@rere.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@rere.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@gmail.com>
Cc: Michał Mirosław <mirq-linux@rere.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);



  reply	other threads:[~2011-04-03 11:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 11:01 [PATCH RESEND] net: convert xen-netfront to hw_features Michał Mirosław
2011-03-31 11:13 ` Ian Campbell
2011-03-31 11:37   ` Michał Mirosław
2011-04-02  3:54 ` David Miller
2011-04-03 11:07   ` Eric Dumazet [this message]
2011-04-03 17:35     ` [PATCH] xen: netfront: fix declaration order Michał Mirosław
2011-04-04  0:24     ` David Miller
2011-04-04  9:55       ` [PATCH] xen: drop anti-dependency on X86_VISWS (Was: Re: [PATCH] xen: netfront: fix declaration order) Ian Campbell
2011-04-06 21:45         ` [PATCH] xen: drop anti-dependency on X86_VISWS David Miller
2011-04-07  6:58           ` Ian Campbell
2011-04-07 17:00             ` H. Peter Anvin
2011-04-08  6:46               ` Ian Campbell
2011-04-08 20:15                 ` H. Peter Anvin
2011-04-07 18:07             ` Jeremy Fitzhardinge
2011-04-08  6:38               ` Ian Campbell
2011-04-08 15:25                 ` Jeremy Fitzhardinge
2011-04-08 15:42                   ` Jan Beulich
2011-04-08 18:24                     ` Jeremy Fitzhardinge
2011-04-09 10:34                       ` Ian Campbell
2011-04-14  8:20                         ` Jeremy Fitzhardinge
2011-04-04 12:29   ` [PATCH RESEND] net: convert xen-netfront to hw_features Ian Campbell
2011-04-04 18:08     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301828839.2837.143.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=davem@davemloft.net \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).