network freeze

Joel Sherrill joel.sherrill at OARcorp.com
Mon Oct 7 13:20:43 UTC 2002



Mario Vieira wrote:
> 
> Hi,
> 
> I'm trying to test the latest netdemo example downloaded from oarcorp
> in rtems 4.5.0 also downloaded from oarcorp. I'm using the i960
> processor.
> 
> I run the netdemo program and the system freezes after sending 5 UDP
> packets. I see with a packet sniffer that after those 5 packets an ARP
> request is sent too.
> 
> It seems that the network stack is wait for the answer to that ARP.
> Shouldn't the stack give some error?

This sounds distinctly like a network driver problem.  On many NICs,
there is a set of buffers/descriptors on the chip itself that must
be recovered.  If you don't do it properly, it will run a few packets
(usually < 50) and fail.

Another possibility is that you have gotten a different type of
interrupt
and are not handshaking it correctly.

> Thanks in advance,
> Mário Vieira.
> 
> My network driver big picture (based in wd8003 driver from pc386 BSP)
> without sending anything to the network board:
> 
> void
> wd_txDaemon (void *arg)
> {
>         struct wd_softc *sc = (struct wd_softc *)arg;
>         struct ifnet *ifp = &sc->arpcom.ac_if;
>         struct mbuf *m;
>         rtems_event_set events;
> 
>         for (;;) {
>                 /*
>                  * Wait for packet
>                  */
>                 rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
> RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_NO_TIMEOUT, &events);
> 
>                 /*
>                  * Send packets till queue is empty
>                  */
>                 for (;;) {
>                         /*
>                          * Get the next mbuf chain to transmit.
>                          */
>                         IF_DEQUEUE(&ifp->if_snd, m);
>                         if (!m)
>                                 break;
>                         sendpacket (ifp, m);
>                 }
>                 ifp->if_flags &= ~IFF_OACTIVE;
>         }
> }
> 
> static void
> sendpacket (struct ifnet *ifp, struct mbuf *m)
> {
>         struct wd_softc *dp = ifp->if_softc;
>         struct mbuf *n;
>         unsigned int len, tport;
>         char *shp, txReady;
> 
>   len = 0;
> 
>   n = m;
> 
>   for (;;){
>     len += m->m_len;
> /*    memcpy(shp, (char *)m->m_data, m->m_len); */
>     shp += m->m_len ;
>     if ((m = m->m_next) == NULL)
>       break;
>   }
> 
>   m_freem(n);
> 
> }

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list