<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.5770.91">
<TITLE>Re: network freeze</TITLE>
</HEAD>
<BODY dir=ltr>
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">Hi,<?xml:namespace prefix = o ns
= "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">Thanks for your
help.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">My last experience with the
network driver was made with interrups disabled. Nothing is received
and<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">nothing is transmited. I wanted
to test if there was something wrong with the estruture of the driver in the
transmission process. I expected that when we run out of buffers some error
<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">message will come
up.<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">Best regards,</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">Mário Vieira</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><o:p></o:p> </P></DIV>
<DIV> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT size=2>-----Mensagem original----- <BR><B>De:</B> Joel Sherrill
[mailto:joel.sherrill@OARcorp.com] <BR><B>Enviada:</B> seg 07-10-2002 14:20
<BR><B>Para:</B> Mario Vieira <BR><B>Cc:</B> rtems-users@OARcorp.com
<BR><B>Assunto:</B> Re: network freeze<BR><BR></FONT></DIV><BR><BR>
<P><FONT size=2>Mario Vieira wrote:<BR>><BR>> Hi,<BR>><BR>> I'm
trying to test the latest netdemo example downloaded from oarcorp<BR>> in
rtems 4.5.0 also downloaded from oarcorp. I'm using the i960<BR>>
processor.<BR>><BR>> I run the netdemo program and the system freezes
after sending 5 UDP<BR>> packets. I see with a packet sniffer that after
those 5 packets an ARP<BR>> request is sent too.<BR>><BR>> It seems
that the network stack is wait for the answer to that ARP.<BR>> Shouldn't
the stack give some error?<BR><BR>This sounds distinctly like a network driver
problem. On many NICs,<BR>there is a set of buffers/descriptors on the
chip itself that must<BR>be recovered. If you don't do it properly, it
will run a few packets<BR>(usually < 50) and fail.<BR><BR>Another
possibility is that you have gotten a different type of<BR>interrupt<BR>and
are not handshaking it correctly.<BR><BR>> Thanks in advance,<BR>> Mário
Vieira.<BR>><BR>> My network driver big picture (based in wd8003 driver
from pc386 BSP)<BR>> without sending anything to the network
board:<BR>><BR>> void<BR>> wd_txDaemon (void *arg)<BR>>
{<BR>> struct wd_softc *sc
= (struct wd_softc
*)arg;<BR>> struct ifnet
*ifp =
&sc->arpcom.ac_if;<BR>>
struct mbuf *m;<BR>>
rtems_event_set
events;<BR>><BR>> for
(;;)
{<BR>>
/*<BR>>
* Wait for
packet<BR>>
*/<BR>>
rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,<BR>> RTEMS_EVENT_ANY |
RTEMS_WAIT, RTEMS_NO_TIMEOUT,
&events);<BR>><BR>>
/*<BR>>
* Send packets till queue is
empty<BR>>
*/<BR>>
for (;;)
{<BR>>
/*<BR>>
* Get the next mbuf chain to
transmit.<BR>>
*/<BR>>
IF_DEQUEUE(&ifp->if_snd,
m);<BR>>
if
(!m)<BR>>
break;<BR>>
sendpacket (ifp,
m);<BR>>
}<BR>>
ifp->if_flags &=
~IFF_OACTIVE;<BR>>
}<BR>> }<BR>><BR>> static void<BR>> sendpacket (struct ifnet *ifp,
struct mbuf *m)<BR>>
{<BR>> struct wd_softc *dp
= ifp->if_softc;<BR>>
struct mbuf *n;<BR>>
unsigned int len,
tport;<BR>> char *shp,
txReady;<BR>><BR>> len = 0;<BR>><BR>> n =
m;<BR>><BR>> for (;;){<BR>> len
+= m->m_len;<BR>> /* memcpy(shp, (char *)m->m_data,
m->m_len); */<BR>> shp += m->m_len
;<BR>> if ((m = m->m_next) ==
NULL)<BR>> break;<BR>>
}<BR>><BR>> m_freem(n);<BR>><BR>> }<BR><BR>--<BR>Joel
Sherrill,
Ph.D.
Director of Research &
Development<BR>joel@OARcorp.com
On-Line Applications Research<BR>Ask me about RTEMS: a free RTOS
Huntsville AL 35805<BR> Support
Available
(256) 722-9985<BR></FONT></P></BLOCKQUOTE>
</BODY>
</HTML>