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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52272426.2040504@synopsys.com>
Date:	Wed, 4 Sep 2013 17:44:30 +0530
From:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
To:	Francois Romieu <romieu@...zoreil.com>
CC:	Alexey Brodkin <Alexey.Brodkin@...opsys.com>,
	<netdev@...r.kernel.org>,
	Andy Shevchenko <andy.shevchenko@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	<linux-kernel@...r.kernel.org>
Subject: Query about TX BD Reclaim in Napi poll path (was Re: [PATCH v3] ethernet/arc/arc_emac
 - Add new driver)

Hi Francois,

Resurrecting an old thread.

On 06/14/2013 03:49 AM, Francois Romieu wrote:
>> +static irqreturn_t arc_emac_intr(int irq, void *dev_instance)
>> > +{
>> > +	struct net_device *ndev = dev_instance;
>> > +	struct arc_emac_priv *priv = netdev_priv(ndev);
>> > +	struct net_device_stats *stats = &priv->stats;
>> > +	unsigned int status;
>> > +
>> > +	status = arc_reg_get(priv, R_STATUS);
>> > +	status &= ~MDIO_MASK;
>> > +
>> > +	/* Reset all flags except "MDIO complete"*/
>> > +	arc_reg_set(priv, R_STATUS, status);
>> > +
>> > +	if (status & RXINT_MASK) {
>> > +		if (likely(napi_schedule_prep(&priv->napi))) {
>> > +			arc_reg_clr(priv, R_ENABLE, RXINT_MASK);
>> > +			__napi_schedule(&priv->napi);
>> > +		}
>> > +	}
>> > +
>> > +	if (status & TXINT_MASK) {
> You may consider moving everything into the napi poll handler.

I has to revisit this now-mainlined driver recently for fixing a bug. Per your
suggestion above, the TX BD reclaim was moved from interrupt context to NAPI
context. I was wondering if that is the right thing to do (I'm not a networking
expert but have worked on this driver heavily before it was mainlined by Alexey).

In case of large burst transfers by networking stack (say a large file copy over
NFS) will it not delay the TX BD reclaim possibly dropping more packets. Ofcourse
doing this requires enabling Tx interrupts which adds to overall cost from a
system perspective, but assuming the controller can coalesce the Tx interrupts,
will it not be better.

I did a quick hack to move the TX reclaim in intr path and it seems to be doing
slightly better than the current code - so the advantages are not sky high, but I
want to understand the implications nevertheless.

TIA,
-Vineet
--
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