Changeset 809feccc in rtems
- Timestamp:
- 01/25/01 22:59:32 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 37535317
- Parents:
- c54152a2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libnetworking/ChangeLog
rc54152a2 r809feccc 1 2001-01-25 Eric Norum <eric.norum@usask.ca> 2 3 * lib/tftpDriver.c: Reduce first timeout interval. This 4 improves throughput on systems which are dropping packets. 5 Only the first timeout is reduced. This keeps the number 6 of extra packets down on networks that are very busy and 7 dropping lots of packets. 8 1 9 2001-01-24 Sergei Organov <osv@javad.ru> 2 10 -
c/src/exec/libnetworking/lib/tftpDriver.c
rc54152a2 r809feccc 50 50 * Default limits 51 51 */ 52 #define PACKET_REPLY_MILLISECONDS 6000 53 #define OPEN_RETRY_LIMIT 10 54 #define IO_RETRY_LIMIT 10 52 #define PACKET_FIRST_TIMEOUT_MILLISECONDS 400 53 #define PACKET_TIMEOUT_MILLISECONDS 6000 54 #define OPEN_RETRY_LIMIT 10 55 #define IO_RETRY_LIMIT 10 55 56 56 57 /* … … 306 307 */ 307 308 static int 308 getPacket (struct tftpStream *tp )309 getPacket (struct tftpStream *tp, int retryCount) 309 310 { 310 311 int len; 311 312 struct timeval tv; 312 313 313 tv.tv_sec = PACKET_REPLY_MILLISECONDS / 1000; 314 tv.tv_usec = (PACKET_REPLY_MILLISECONDS % 1000) * 1000; 314 if (retryCount == 0) { 315 tv.tv_sec = PACKET_FIRST_TIMEOUT_MILLISECONDS / 1000; 316 tv.tv_usec = (PACKET_FIRST_TIMEOUT_MILLISECONDS % 1000) * 1000; 317 } 318 else { 319 tv.tv_sec = PACKET_TIMEOUT_MILLISECONDS / 1000; 320 tv.tv_usec = (PACKET_TIMEOUT_MILLISECONDS % 1000) * 1000; 321 } 315 322 setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv); 316 323 for (;;) { … … 548 555 */ 549 556 tp->firstReply = 1; 557 retryCount = 0; 550 558 for (;;) { 551 559 /* … … 583 591 * Get reply 584 592 */ 585 len = getPacket (tp );593 len = getPacket (tp, retryCount); 586 594 if (len >= (int) sizeof tp->pkbuf.tftpACK) { 587 595 int opcode = ntohs (tp->pkbuf.tftpDATA.opcode); … … 670 678 retryCount = 0; 671 679 for (;;) { 672 int len = getPacket (tp );680 int len = getPacket (tp, retryCount); 673 681 if (len >= (int)sizeof tp->pkbuf.tftpACK) { 674 682 int opcode = ntohs (tp->pkbuf.tftpDATA.opcode); … … 716 724 sizeof tp->farAddress) < 0) 717 725 return EIO; 718 rlen = getPacket (tp );726 rlen = getPacket (tp, retryCount); 719 727 if (rlen >= (int)sizeof tp->pkbuf.tftpACK) { 720 728 int opcode = ntohs (tp->pkbuf.tftpACK.opcode); -
c/src/libnetworking/ChangeLog
rc54152a2 r809feccc 1 2001-01-25 Eric Norum <eric.norum@usask.ca> 2 3 * lib/tftpDriver.c: Reduce first timeout interval. This 4 improves throughput on systems which are dropping packets. 5 Only the first timeout is reduced. This keeps the number 6 of extra packets down on networks that are very busy and 7 dropping lots of packets. 8 1 9 2001-01-24 Sergei Organov <osv@javad.ru> 2 10 -
c/src/libnetworking/lib/tftpDriver.c
rc54152a2 r809feccc 50 50 * Default limits 51 51 */ 52 #define PACKET_REPLY_MILLISECONDS 6000 53 #define OPEN_RETRY_LIMIT 10 54 #define IO_RETRY_LIMIT 10 52 #define PACKET_FIRST_TIMEOUT_MILLISECONDS 400 53 #define PACKET_TIMEOUT_MILLISECONDS 6000 54 #define OPEN_RETRY_LIMIT 10 55 #define IO_RETRY_LIMIT 10 55 56 56 57 /* … … 306 307 */ 307 308 static int 308 getPacket (struct tftpStream *tp )309 getPacket (struct tftpStream *tp, int retryCount) 309 310 { 310 311 int len; 311 312 struct timeval tv; 312 313 313 tv.tv_sec = PACKET_REPLY_MILLISECONDS / 1000; 314 tv.tv_usec = (PACKET_REPLY_MILLISECONDS % 1000) * 1000; 314 if (retryCount == 0) { 315 tv.tv_sec = PACKET_FIRST_TIMEOUT_MILLISECONDS / 1000; 316 tv.tv_usec = (PACKET_FIRST_TIMEOUT_MILLISECONDS % 1000) * 1000; 317 } 318 else { 319 tv.tv_sec = PACKET_TIMEOUT_MILLISECONDS / 1000; 320 tv.tv_usec = (PACKET_TIMEOUT_MILLISECONDS % 1000) * 1000; 321 } 315 322 setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv); 316 323 for (;;) { … … 548 555 */ 549 556 tp->firstReply = 1; 557 retryCount = 0; 550 558 for (;;) { 551 559 /* … … 583 591 * Get reply 584 592 */ 585 len = getPacket (tp );593 len = getPacket (tp, retryCount); 586 594 if (len >= (int) sizeof tp->pkbuf.tftpACK) { 587 595 int opcode = ntohs (tp->pkbuf.tftpDATA.opcode); … … 670 678 retryCount = 0; 671 679 for (;;) { 672 int len = getPacket (tp );680 int len = getPacket (tp, retryCount); 673 681 if (len >= (int)sizeof tp->pkbuf.tftpACK) { 674 682 int opcode = ntohs (tp->pkbuf.tftpDATA.opcode); … … 716 724 sizeof tp->farAddress) < 0) 717 725 return EIO; 718 rlen = getPacket (tp );726 rlen = getPacket (tp, retryCount); 719 727 if (rlen >= (int)sizeof tp->pkbuf.tftpACK) { 720 728 int opcode = ntohs (tp->pkbuf.tftpACK.opcode); -
cpukit/libnetworking/ChangeLog
rc54152a2 r809feccc 1 2001-01-25 Eric Norum <eric.norum@usask.ca> 2 3 * lib/tftpDriver.c: Reduce first timeout interval. This 4 improves throughput on systems which are dropping packets. 5 Only the first timeout is reduced. This keeps the number 6 of extra packets down on networks that are very busy and 7 dropping lots of packets. 8 1 9 2001-01-24 Sergei Organov <osv@javad.ru> 2 10 -
cpukit/libnetworking/lib/tftpDriver.c
rc54152a2 r809feccc 50 50 * Default limits 51 51 */ 52 #define PACKET_REPLY_MILLISECONDS 6000 53 #define OPEN_RETRY_LIMIT 10 54 #define IO_RETRY_LIMIT 10 52 #define PACKET_FIRST_TIMEOUT_MILLISECONDS 400 53 #define PACKET_TIMEOUT_MILLISECONDS 6000 54 #define OPEN_RETRY_LIMIT 10 55 #define IO_RETRY_LIMIT 10 55 56 56 57 /* … … 306 307 */ 307 308 static int 308 getPacket (struct tftpStream *tp )309 getPacket (struct tftpStream *tp, int retryCount) 309 310 { 310 311 int len; 311 312 struct timeval tv; 312 313 313 tv.tv_sec = PACKET_REPLY_MILLISECONDS / 1000; 314 tv.tv_usec = (PACKET_REPLY_MILLISECONDS % 1000) * 1000; 314 if (retryCount == 0) { 315 tv.tv_sec = PACKET_FIRST_TIMEOUT_MILLISECONDS / 1000; 316 tv.tv_usec = (PACKET_FIRST_TIMEOUT_MILLISECONDS % 1000) * 1000; 317 } 318 else { 319 tv.tv_sec = PACKET_TIMEOUT_MILLISECONDS / 1000; 320 tv.tv_usec = (PACKET_TIMEOUT_MILLISECONDS % 1000) * 1000; 321 } 315 322 setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv); 316 323 for (;;) { … … 548 555 */ 549 556 tp->firstReply = 1; 557 retryCount = 0; 550 558 for (;;) { 551 559 /* … … 583 591 * Get reply 584 592 */ 585 len = getPacket (tp );593 len = getPacket (tp, retryCount); 586 594 if (len >= (int) sizeof tp->pkbuf.tftpACK) { 587 595 int opcode = ntohs (tp->pkbuf.tftpDATA.opcode); … … 670 678 retryCount = 0; 671 679 for (;;) { 672 int len = getPacket (tp );680 int len = getPacket (tp, retryCount); 673 681 if (len >= (int)sizeof tp->pkbuf.tftpACK) { 674 682 int opcode = ntohs (tp->pkbuf.tftpDATA.opcode); … … 716 724 sizeof tp->farAddress) < 0) 717 725 return EIO; 718 rlen = getPacket (tp );726 rlen = getPacket (tp, retryCount); 719 727 if (rlen >= (int)sizeof tp->pkbuf.tftpACK) { 720 728 int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
Note: See TracChangeset
for help on using the changeset viewer.