<div dir="ltr"><div><div><div><div><div><div>Hi, all,<br><br></div>I'm currently working on adding a network device driver to rtems. The source tree was grabbed on July, 2014. It's still not working properly right now. But I have some questions about the network stack code. <br><br></div>I added printf function in if_etheresubr.c in the directory cpukit/libnetworking/net/ as the following:<br>int<br>ether_output(struct ifnet *ifp, struct mbuf *m,<br>    struct sockaddr *dst, struct rtentry *rt0)<br>{<br>    short type;<br>    int s, error = 0;<br>    u_char  edst[6];<br>    register struct rtentry *rt;<br>    struct mbuf *mcopy = (struct mbuf *)0;<br>    register struct ether_header *eh;<br>    int len = m->m_pkthdr.len;<br>    struct arpcom *ac = (struct arpcom *)ifp;<br>#ifdef NETATALK<br>    struct at_ifaddr *aa;<br>#endif /* NETATALK */<br><br>    if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))<br>        senderr(ENETDOWN);<br>    printk("ether_output: length = %d, if_flags = 0x%08x\n", len, ifp->if_flags);<br>========================================<br><br></div>And I got the following messages when I ping the RTEMS system on ARM:<br>=======================================================<br>ip_output 0, length = 84, MTU = 1500<br>ether_output: length = 84, if_flags = 0x00000847<br>ether_output: length = 28, if_flags = 0x00000847<br>if_ethersubr.c: m_len = 28, leading space = 68<br>if_ethersubr.c: MSIZE = 128, MLEN = 104<br>if_ethersubr.c: m_len = 42<br>=======================================================<br><br></div>During this period of time, there are only two kinds of packets, one is PING(echo reply), the other is ARP; the one with 84 bytes is PING, and the one with 28 is ARP, both will be added 14 bytes of Ethernet header later, and makes them 98 bytes and 42 bytes.<br><br></div>Here, ether_output() was called twice when a PING is sent from IP layer. Is it normal? I didn't get PING reply from this board. And I just want to make sure if ether_output being called twice normal or not, so that I can decide which way to go. <br><br></div>Thanks in advance.<br><br><br><div><div><div><div><div><div><div><div><div><div>Albert<br></div></div></div></div></div></div></div></div></div></div></div>