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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 16 Sep 2007 12:28:42 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	hadi@...erus.ca
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH|[NET]: migrate HARD_TX_LOCK to header file

From: jamal <hadi@...erus.ca>
Date: Sun, 16 Sep 2007 11:48:45 -0400

> I wanted to get rid of the extrenous cpu arguement and ended moving this
> to the header files since it looks common enough an operation that could
> be used elsewhere.
> It is a trivial change - i could resend with leaving it in dev.c and
> just getting rid of the cpu arguement.

The only reason the cpu argument is superfluous is because
we don't provide a way to pass it on down to netif_tx_lock().

So instead netif_tx_lock() recomputes that value in this case which is
extra unnecessary work.

I would instead suggest, in netdevice.h:

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());
}

And make the HARD_TX_LOCK() call __netif_tx_lock() and pass in
the already computed 'cpu' parameter.

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists