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  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:	Tue, 24 Jul 2007 14:47:19 +1000
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, shemminger@...ux-foundation.org,
	jgarzik@...ox.com, jamal <hadi@...erus.ca>
Subject: Re: [PATCH RFX]: napi_struct V3

On Mon, 2007-07-23 at 21:07 -0700, David Miller wrote:
> Another area of consternation are drivers that were using
> netif_rx_reschedule(), as that interface was removed because it
> doesn't fit well with the caller managing the dev->quota et al.  I
> left race conditions in the drivers that were using that interface,
> but they should still basically work nonetheless.

Hmm, virtio does this, if the implementation returns false from
->restart.  But it's basically a bandaid for things like lguest which
don't check irq status on irq enable, hence is subject to the race.

But AFAICT netif_rx_reschedule() is implementable in a driver anyway.
What am I missing?

static void resched_me(struct work_struct *work)
{
	struct foo *foo = container_of(work, struct foo, work);

	irq_disable();
	netif_rx_schedule(foo->dev);
	irq_enable();
}

struct foo {
	...;
	struct napi_struct napi;
	struct work_struct rescheduler;
};

int foo_poll(struct napi_struct *napi, int budget)
{
...
	enable_rx_interrupts();
	netif_rx_complete(napi);

	/* Broken interrupts, so we have race after enabling. */
	if (unlikely(ring_has_new_packet(dev)))
		schedule_work(&foo->rescheduler);
	return used;
}

Cheers,
Rusty.

-
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