aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-09-18 13:56:53 -0700
committerEric W. Biederman <ebiederm@xmission.com>2011-04-09 06:22:01 -0700
commit8bec15812b861d5e6a91e373ca898f4b2b95db9c (patch)
tree8e3de8701d04c6dd78a2897f7f13940da7179560
parent4361f3b6658d8603819406821041c35f776dc2e4 (diff)
downloadsyslinux-devel-syslinux-lwip-checkpoint4.tar.gz
syslinux-devel-syslinux-lwip-checkpoint4.tar.xz
syslinux-devel-syslinux-lwip-checkpoint4.zip
lwip: show stats when displaying speedtest resultssyslinux-lwip-checkpoint4
Performance seems to be heavily inversely correlated with packet loss... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/fs/pxe/pxe.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index 0beebb04..62ab0740 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -999,6 +999,24 @@ static void udp_init(void)
}
#endif
+static void undi_clear_stats(void)
+{
+ static __lowmem t_PXENV_UNDI_CLEAR_STATISTICS clear;
+
+ pxe_call(PXENV_UNDI_CLEAR_STATISTICS, &clear);
+}
+
+static void undi_stats(void)
+{
+ static __lowmem t_PXENV_UNDI_GET_STATISTICS stats;
+
+ pxe_call(PXENV_UNDI_GET_STATISTICS, &stats);
+
+ printf("UNDI: Xmit %u Rcv %u CRC %u Resource %u\n",
+ stats.XmtGoodFrames, stats.RcvGoodFrames,
+ stats.RcvCRCErrors, stats.RcvResourceErrors);
+}
+
static void lwip_test(void)
{
err_t err;
@@ -1007,6 +1025,7 @@ static void lwip_test(void)
char header_buf[512];
int header_len;
static const char host_str[] = "www3.kernel.org";
+ static const char path_str[] = "/pub/linux/kernel/v2.6/linux-2.6.31.tar.gz";
struct netbuf *buf;
mstime_t t0, t1;
size_t bytes, x_bytes;
@@ -1025,7 +1044,9 @@ static void lwip_test(void)
((uint8_t *)&ip)[3],
err);
- for (i = 1; i < 20; i++) {
+ for (i = 1; i < 10; i++) {
+ undi_clear_stats();
+
conn = netconn_new(NETCONN_TCP);
err = netconn_connect(conn, &ip, 80);
if (err) {
@@ -1034,10 +1055,10 @@ static void lwip_test(void)
}
header_len = snprintf(header_buf, sizeof header_buf,
- "GET /pub/linux/kernel/v2.6/linux-2.6.31.tar.gz HTTP/1.0\r\n"
+ "GET %s HTTP/1.0\r\n"
"Host: %s\r\n"
"\r\n",
- host_str);
+ path_str, host_str);
err = netconn_write(conn, header_buf, header_len, NETCONN_NOCOPY);
if (err)
@@ -1090,6 +1111,7 @@ static void lwip_test(void)
printf("Done: %zu bytes in %u ms (%u.%03u Mbps)\n",
bytes, ms, kbits_per_sec/1000, kbits_per_sec%1000);
+ undi_stats();
netconn_disconnect(conn);
}