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:	Thu, 26 Jul 2007 14:38:09 -0700
From:	"Michael Chan" <mchan@...adcom.com>
To:	"David Miller" <davem@...emloft.net>
cc:	"netdev" <netdev@...r.kernel.org>, shemminger@...ux-foundation.org,
	jgarzik@...ox.com, hadi@...erus.ca, rusty@...tcorp.com.au
Subject: Re: [PATCH RFC]: napi_struct V4

On Thu, 2007-07-26 at 00:15 -0700, David Miller wrote:

> The netpoll code has to take that anyways in order to call
> into ->hard_start_xmit() to send out the packet it has
> pending, I'm leveraging that as a synchronization mechanism
> in the drivers because the locking options are limited
> given that netpoll can try to do this in any context whatsoever.
> 
> > There is a measurable difference in oprofile.  When passing small
> > packets, there's a non-trivial difference in throughput.
> 
> Then please help come up with an alternate scheme, because these
> NAPI changes fix real limitations and bugs in the current code
> and unless we fix netpoll too we can't move forward.
> 

I'm not very familiar with netpoll, but I am guessing that we need to
prevent concurrent calls to the TX cleanup code.  For maximum
flexibility, we should let ->poll_controller() handle the locking as the
driver knows what kind of locking is best.

If the driver wants a simple solution, it can do what you did in the
patch:  wrap the tx cleanup code with netif_tx_lock() and
netif_tx_unlock().

If a NAPI driver wants to be more clever, it can do something such as
this in tg3's poll_controller:

if (netif_rx_schedule_prep(dev, &tp->napi)) {
	tg3_tx(tp);
	netif_poll_enable(tp->napi);
}

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ