diff -Nur net.orig/bsd_tcpip/current/ChangeLog net/bsd_tcpip/current/ChangeLog --- net.orig/bsd_tcpip/current/ChangeLog Wed Jul 30 16:42:31 2003 +++ net/bsd_tcpip/current/ChangeLog Mon Aug 4 15:25:33 2003 @@ -1,3 +1,17 @@ +2003-08-04 Motoya Kurotsu + + * src/sys/kern/uipc_mbuf.c(m_mballoc): + Pass the parameter 'how' to cyg_net_mbuf_alloc as flags + so that this function can support non-blocking mode. + +2003-08-04 Motoya Kurotsu + + * src/sys/netinet/in_cksum.c: stats_in_cksum supported. + +2003-08-04 Motoya Kurotsu + + * src/ecos/support.c(show_net_stats): Prevent divided by zero. + 2003-07-25 Andrew Lunn * include/netinet/icmp_var.h diff -Nur net.orig/bsd_tcpip/current/src/ecos/support.c net/bsd_tcpip/current/src/ecos/support.c --- net.orig/bsd_tcpip/current/src/ecos/support.c Mon Jun 23 18:45:11 2003 +++ net/bsd_tcpip/current/src/ecos/support.c Mon Aug 4 14:22:59 2003 @@ -169,9 +169,12 @@ show_net_stats(struct net_stats *stats, const char *title) { int ave; - ave = stats->total_time / stats->count; diag_printf("%s:\n", title); diag_printf(" count: %6d", stats->count); + if(!stats->count) { + goto show_end; + } + ave = stats->total_time / stats->count; diag_printf(", min: "); show_ticks_in_us(stats->min_time); diag_printf(", max: "); @@ -180,6 +183,7 @@ show_ticks_in_us(stats->total_time); diag_printf(", ave: "); show_ticks_in_us(ave); +show_end: diag_printf("\n"); // Reset stats memset(stats, 0, sizeof(*stats)); diff -Nur net.orig/bsd_tcpip/current/src/sys/kern/uipc_mbuf.c net/bsd_tcpip/current/src/sys/kern/uipc_mbuf.c --- net.orig/bsd_tcpip/current/src/sys/kern/uipc_mbuf.c Tue May 21 07:25:02 2002 +++ net/bsd_tcpip/current/src/sys/kern/uipc_mbuf.c Mon Aug 4 15:14:13 2003 @@ -139,7 +139,7 @@ int i; for (i = 0; i < nmb; i++) { - p = (struct mbuf *)cyg_net_mbuf_alloc(0, 0); + p = (struct mbuf *)cyg_net_mbuf_alloc(0, how); if (p != (struct mbuf *)0) { ((struct mbuf *)p)->m_next = mmbfree; mmbfree = (struct mbuf *)p; diff -Nur net.orig/bsd_tcpip/current/src/sys/netinet/in_cksum.c net/bsd_tcpip/current/src/sys/netinet/in_cksum.c --- net.orig/bsd_tcpip/current/src/sys/netinet/in_cksum.c Wed Jul 31 23:02:18 2002 +++ net/bsd_tcpip/current/src/sys/netinet/in_cksum.c Mon Aug 4 14:21:30 2003 @@ -65,6 +65,10 @@ #include #include +#ifdef CYGDBG_NET_TIMING_STATS +struct net_stats stats_in_cksum; +#endif + /* * Checksum routine for Internet Protocol family headers * (Portable Alpha version). @@ -227,6 +231,8 @@ union q_util q_util; union l_util l_util; + START_STATS(); + for (; m && len; m = m->m_next) { if (m->m_len == 0) continue; @@ -243,6 +249,9 @@ len -= mlen; } REDUCE16; + + FINISH_STATS(stats_in_cksum); + return (~sum & 0xffff); } @@ -256,6 +265,8 @@ union q_util q_util; union l_util l_util; + START_STATS(); + len -= skip; for (; skip && m; m = m->m_next) { if (m->m_len > skip) { @@ -284,14 +295,20 @@ len -= mlen; } REDUCE16; + + FINISH_STATS(stats_in_cksum); + return (~sum & 0xffff); } u_int in_cksum_hdr(const struct ip *ip) { - u_int64_t sum = in_cksumdata((caddr_t) ip, sizeof(struct ip)); + u_int64_t sum; union q_util q_util; union l_util l_util; + START_STATS(); + sum = in_cksumdata((caddr_t) ip, sizeof(struct ip)); + FINISH_STATS(stats_in_cksum); REDUCE16; return (~sum & 0xffff); } diff -Nur net.orig/tcpip/current/ChangeLog net/tcpip/current/ChangeLog --- net.orig/tcpip/current/ChangeLog Mon Feb 24 23:31:58 2003 +++ net/tcpip/current/ChangeLog Mon Aug 4 15:26:01 2003 @@ -1,3 +1,12 @@ +2003-08-04 Motoya Kurotsu + + * src/sys/netinet/in_cksum.c: stats_in_cksum made + only when CYGDBG_NET_TIMING_STATS is defined. + +2003-08-04 Motoya Kurotsu + + * src/ecos/support.c(show_net_stats): Prevent divided by zero. + 2003-02-24 Jonathan Larmour * cdl/openbsd_net.cdl: Improve doc links. diff -Nur net.orig/tcpip/current/src/ecos/support.c net/tcpip/current/src/ecos/support.c --- net.orig/tcpip/current/src/ecos/support.c Wed Dec 4 02:22:47 2002 +++ net/tcpip/current/src/ecos/support.c Mon Aug 4 14:23:34 2003 @@ -141,9 +141,12 @@ show_net_stats(struct net_stats *stats, const char *title) { int ave; - ave = stats->total_time / stats->count; diag_printf("%s:\n", title); diag_printf(" count: %6d", stats->count); + if(!stats->count) { + goto show_end; + } + ave = stats->total_time / stats->count; diag_printf(", min: "); show_ticks_in_us(stats->min_time); diag_printf(", max: "); @@ -152,6 +155,7 @@ show_ticks_in_us(stats->total_time); diag_printf(", ave: "); show_ticks_in_us(ave); +show_end: diag_printf("\n"); // Reset stats memset(stats, 0, sizeof(*stats)); diff -Nur net.orig/tcpip/current/src/sys/netinet/in_cksum.c net/tcpip/current/src/sys/netinet/in_cksum.c --- net.orig/tcpip/current/src/sys/netinet/in_cksum.c Tue May 21 07:25:21 2002 +++ net/tcpip/current/src/sys/netinet/in_cksum.c Mon Aug 4 14:13:12 2003 @@ -75,7 +75,9 @@ #endif #include +#ifdef CYGDBG_NET_TIMING_STATS struct net_stats stats_in_cksum; +#endif /* * Checksum routine for Internet Protocol family headers (Portable Version).