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/
Home Products Support Community News


[Xen-devel] [NET] gso: Fix reversed error test in netif_tx_trylock

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, Xen Development Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [NET] gso: Fix reversed error test in netif_tx_trylock
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Jul 2006 23:09:28 +1000
Delivery-date: Thu, 20 Jul 2006 06:10:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
Hi Keir:

Here is a bug fix that just got merged upstream that affects
the GSO patch as well.

[NET] gso: Fix reversed error test in netif_tx_trylock

Original changelog:

    [NET]: Fix reversed error test in netif_tx_trylock

    A non-zero return value indicates success from spin_trylock,
    not error.

    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff -r bbabdebc54ad patches/linux-
--- a/patches/linux-     Wed Jul 19 21:13:36 2006 +0100
+++ b/patches/linux-     Thu Jul 20 23:06:23 2006 +1000
@@ -837,7 +837,7 @@ index 93535f0..9269df7 100644
  /* compatibility with older code */
  #define SPARC_ETH_GSET                ETHTOOL_GSET
 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 7fda03d..9865736 100644
+index 7fda03d..f2fbeb7 100644
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
 @@ -230,7 +230,8 @@ enum netdev_state_t
@@ -927,10 +927,10 @@ index 7fda03d..9865736 100644
 +static inline int netif_tx_trylock(struct net_device *dev)
-+      int err = spin_trylock(&dev->_xmit_lock);
-+      if (!err)
++      int ok = spin_trylock(&dev->_xmit_lock);
++      if (likely(ok))
 +              dev->xmit_lock_owner = smp_processor_id();
-+      return err;
++      return ok;
 +static inline void netif_tx_unlock(struct net_device *dev)

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [NET] gso: Fix reversed error test in netif_tx_trylock, Herbert Xu <=