From: Herbert Xu Subject: [NET] gso: Fix reversed error test in netif_tx_trylock Date: Thu, 20 Jul 2006 23:09:28 +1000 Message-ID: <20060720130928.GA16128@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Xen Development Mailing List List-Id: xen-devel@lists.xenproject.org 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 Signed-off-by: Herbert Xu Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff -r bbabdebc54ad patches/linux-2.6.16.13/net-gso.patch --- a/patches/linux-2.6.16.13/net-gso.patch Wed Jul 19 21:13:36 2006 +0100 +++ b/patches/linux-2.6.16.13/net-gso.patch 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)