Herbert Xu
2006-Jul-20 13:09 UTC
[Xen-devel] [NET] gso: Fix reversed error test in netif_tx_trylock
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@gondor.apana.org.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> 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) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel