lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <47B5B73F.9050904@cosmosbay.com>
Date:	Fri, 15 Feb 2008 17:01:03 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Marin Mitov <mitov@...p.bas.bg>
Cc:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: Is netif_tx_lock() SMP PREEMPT safe?

Marin Mitov a écrit :
> Hi all,
>
> As in: include/linux/netdevice.h (kernel-2.6.24.2) one finds:
>
> static inline void __netif_tx_lock(struct net_device *dev, int cpu)
> {
>         spin_lock(&dev->_xmit_lock);
>         dev->xmit_lock_owner = cpu;
> }
>
> static inline void netif_tx_lock(struct net_device *dev)
> {
>         __netif_tx_lock(dev, smp_processor_id());
> }
>
> Does netif_tx_lock(struct net_device *dev) expands into:
>
> cpu = smp_processor_id(); 
> <preempt & shift to another cpu (bogus)>
> spin_lock(&dev->_xmit_lock);
> dev->xmit_lock_owner = cpu; /* cpu is not the lock owner */
>
> Or to:
>
> spin_lock(&dev->_xmit_lock);
> dev->xmit_lock_owner = smp_processor_id();
>
> which is correct?
>
>   
Hi Marin

This expands to the first version, but netif_tx_lock() is allways called 
with preemption disabled.

(Or checks in smp_processor_id() would just trigger)


Eric
(Cced netdev for network related stuff)





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ