Changeset 809feccc in rtems


Ignore:
Timestamp:
Jan 25, 2001, 10:59:32 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
37535317
Parents:
c54152a2
Message:

2001-01-25 Eric Norum <eric.norum@…>

  • lib/tftpDriver.c: Reduce first timeout interval. This improves throughput on systems which are dropping packets. Only the first timeout is reduced. This keeps the number of extra packets down on networks that are very busy and dropping lots of packets.
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libnetworking/ChangeLog

    rc54152a2 r809feccc  
     12001-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
    192001-01-24      Sergei Organov <osv@javad.ru>
    210
  • c/src/exec/libnetworking/lib/tftpDriver.c

    rc54152a2 r809feccc  
    5050 * Default limits
    5151 */
    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
    5556
    5657/*
     
    306307 */
    307308static int
    308 getPacket (struct tftpStream *tp)
     309getPacket (struct tftpStream *tp, int retryCount)
    309310{
    310311    int len;
    311312    struct timeval tv;
    312313
    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    }
    315322    setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
    316323    for (;;) {
     
    548555     */
    549556    tp->firstReply = 1;
     557    retryCount = 0;
    550558    for (;;) {
    551559        /*
     
    583591         * Get reply
    584592         */
    585         len = getPacket (tp);
     593        len = getPacket (tp, retryCount);
    586594        if (len >= (int) sizeof tp->pkbuf.tftpACK) {
    587595            int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
     
    670678        retryCount = 0;
    671679        for (;;) {
    672             int len = getPacket (tp);
     680            int len = getPacket (tp, retryCount);
    673681            if (len >= (int)sizeof tp->pkbuf.tftpACK) {
    674682                int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
     
    716724                                        sizeof tp->farAddress) < 0)
    717725            return EIO;
    718         rlen = getPacket (tp);
     726        rlen = getPacket (tp, retryCount);
    719727        if (rlen >= (int)sizeof tp->pkbuf.tftpACK) {
    720728            int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
  • c/src/libnetworking/ChangeLog

    rc54152a2 r809feccc  
     12001-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
    192001-01-24      Sergei Organov <osv@javad.ru>
    210
  • c/src/libnetworking/lib/tftpDriver.c

    rc54152a2 r809feccc  
    5050 * Default limits
    5151 */
    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
    5556
    5657/*
     
    306307 */
    307308static int
    308 getPacket (struct tftpStream *tp)
     309getPacket (struct tftpStream *tp, int retryCount)
    309310{
    310311    int len;
    311312    struct timeval tv;
    312313
    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    }
    315322    setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
    316323    for (;;) {
     
    548555     */
    549556    tp->firstReply = 1;
     557    retryCount = 0;
    550558    for (;;) {
    551559        /*
     
    583591         * Get reply
    584592         */
    585         len = getPacket (tp);
     593        len = getPacket (tp, retryCount);
    586594        if (len >= (int) sizeof tp->pkbuf.tftpACK) {
    587595            int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
     
    670678        retryCount = 0;
    671679        for (;;) {
    672             int len = getPacket (tp);
     680            int len = getPacket (tp, retryCount);
    673681            if (len >= (int)sizeof tp->pkbuf.tftpACK) {
    674682                int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
     
    716724                                        sizeof tp->farAddress) < 0)
    717725            return EIO;
    718         rlen = getPacket (tp);
     726        rlen = getPacket (tp, retryCount);
    719727        if (rlen >= (int)sizeof tp->pkbuf.tftpACK) {
    720728            int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
  • cpukit/libnetworking/ChangeLog

    rc54152a2 r809feccc  
     12001-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
    192001-01-24      Sergei Organov <osv@javad.ru>
    210
  • cpukit/libnetworking/lib/tftpDriver.c

    rc54152a2 r809feccc  
    5050 * Default limits
    5151 */
    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
    5556
    5657/*
     
    306307 */
    307308static int
    308 getPacket (struct tftpStream *tp)
     309getPacket (struct tftpStream *tp, int retryCount)
    309310{
    310311    int len;
    311312    struct timeval tv;
    312313
    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    }
    315322    setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
    316323    for (;;) {
     
    548555     */
    549556    tp->firstReply = 1;
     557    retryCount = 0;
    550558    for (;;) {
    551559        /*
     
    583591         * Get reply
    584592         */
    585         len = getPacket (tp);
     593        len = getPacket (tp, retryCount);
    586594        if (len >= (int) sizeof tp->pkbuf.tftpACK) {
    587595            int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
     
    670678        retryCount = 0;
    671679        for (;;) {
    672             int len = getPacket (tp);
     680            int len = getPacket (tp, retryCount);
    673681            if (len >= (int)sizeof tp->pkbuf.tftpACK) {
    674682                int opcode = ntohs (tp->pkbuf.tftpDATA.opcode);
     
    716724                                        sizeof tp->farAddress) < 0)
    717725            return EIO;
    718         rlen = getPacket (tp);
     726        rlen = getPacket (tp, retryCount);
    719727        if (rlen >= (int)sizeof tp->pkbuf.tftpACK) {
    720728            int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
Note: See TracChangeset for help on using the changeset viewer.