public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RE : [ECOS] possible fix for eth_drv_recv blocking DSR
@ 2005-06-29 10:47 Arnaud Chataignier
  2005-06-29 11:13 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaud Chataignier @ 2005-06-29 10:47 UTC (permalink / raw)
  To: 'Hook, James', ecos-discuss

James,

As you had no answer and I know it, I will try to help.

There should be no DSR in an Ethernet driver device. Your ISR should
only ask for a DSR call. The DSR is handled in the IO ethernet part, not
in the device driver.

The IO ethernet DSR only triggers the execution of the Network alarm
thread, which then calls your ethernet driver 'deliver' function. Your
deliver function is thus called from a thread, and there is no interrupt
lock/unlock to be done in cyg_splx and spl_any.

Regards,
Arnaud.

-----Message d'origine-----
De : ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] De la part de Hook,
James
Envoyé : vendredi 24 juin 2005 19:35
À : ecos-discuss@sources.redhat.com
Objet : [ECOS] possible fix for eth_drv_recv blocking DSR


I mask Ethernet driver interrupts at the top of spl_any(), and unmask
Ethernet driver interrupts at the bottom of cyg_splx().  This prevents a
DSR from executing while the splx_mutex is owned by another thread. This
solution assumes that the only time a DSR will be delayed by the
scheduler is if the thread that was interrupted had locked the scheduler
for some reason.  The FreeBSD stack threads do not lock the scheduler so
the interrupt mask and mutex acquire operations in spl_any should be
atomic.  Is this a correct assumption to make?  I am worried that a
FreeBSD thread will mask the Ethernet driver interrupts while a DSR is
pending, and then the DSR will preempt the FreeBSD thread causing a race
condition.  If the ECOS scheduler guarantees that a DSR will execute
immediately after its ISR, then this should not be a problem.  Is this
the case?

Thanks,
James Hook



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] RE : [ECOS] possible fix for eth_drv_recv blocking DSR
  2005-06-29 10:47 [ECOS] RE : [ECOS] possible fix for eth_drv_recv blocking DSR Arnaud Chataignier
@ 2005-06-29 11:13 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2005-06-29 11:13 UTC (permalink / raw)
  To: Arnaud Chataignier; +Cc: 'Hook, James', ecos-discuss

On Wed, Jun 29, 2005 at 12:46:43PM +0200, Arnaud Chataignier wrote:
> James,
> 
> As you had no answer and I know it, I will try to help.
> 
> There should be no DSR in an Ethernet driver device. Your ISR should
> only ask for a DSR call. The DSR is handled in the IO ethernet part, not
> in the device driver.
> 
> The IO ethernet DSR only triggers the execution of the Network alarm
> thread, which then calls your ethernet driver 'deliver' function. Your
> deliver function is thus called from a thread, and there is no interrupt
> lock/unlock to be done in cyg_splx and spl_any.

I think the problem stems from a conflict in the documentation.

packages/io/eth/current/doc/driver_doc says you should be doing it
from the DSR. The sgml documentation says something different and
describes what you say.

The sgml documentation is correct. I will remove the driver_doc which
is now old and wrong.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-29 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-29 10:47 [ECOS] RE : [ECOS] possible fix for eth_drv_recv blocking DSR Arnaud Chataignier
2005-06-29 11:13 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).