[En-Nut-Discussion] Preview Fix 060626

Michael Jones Michael.e.Jones at web.de
Tue Jun 27 12:40:21 CEST 2006


Hello Harald,

You were correct with you feeling about the context switch.

The SMSC indeed overruns now. As there is no NutEventPostFromIrq(...) in the
interrupt handler for INT_RX_OVRN the event stalls and only the next event
timeout reactivates the Interrupts. I've added a NutEventPortFromIrq into
the INT_RX_OVRN handler and it now runs much steadier.

We will have to find a way to make the context switch fast again.

Cu,
Michael



-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Harald Kipp
Sent: Tuesday, June 27, 2006 11:25 AM
To: Ethernut User Chat (English)
Subject: RE: [En-Nut-Discussion] Preview Fix 060626

Michael,

At 00:43 27.06.2006 +0200, you wrote:

>With the old version (Henrik's and my patches) there are actually hardly
any
>signs that the board is being flooded with messages besides a minor 5%-10%
>drop in throughput. Whereas the new implementation completely breaks
>together till no TCP/IP packets are actually handled. Yet it immediately
>recovers when the packet flooding stops.

I had a similar "feeling". Not sure about the loop in NutThreadResume():

     /*
      * Process events that have been posted from interrupt context.
      */
     td = nutThreadList;
     while (td) {
         qhp = (NUTTHREADINFO **)(td->td_queue);
         if (qhp) {
             cnt = 0;
             for (;;) {
                 NutEnterCritical();
                 cnt += td->td_qpec;
                 td->td_qpec = 0;
                 tqp = *qhp;
                 NutExitCritical();
                 if (cnt == 0 || tqp == SIGNALED) {
                     break;
                 }
                 NutEventPostAsync((HANDLE *)qhp);
                 cnt--;
             }
         }
         td = td->td_next;
     }

>My suspicion is that the thread priority handling has somehow changed as
>e.g. the main thread shows no signs of slowing down.

This takes over the task that had been previously done in interrupt
context. It definitely increases the context switch time. My assumption
is, that the Ethernet receiver thread returns later than before, which
in turn may cause Ethernet controller overruns.

Harald

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion





More information about the En-Nut-Discussion mailing list