Changeset 5778738 for lib/format_dag24.c


Ignore:
Timestamp:
01/07/10 11:04:13 (12 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
4b6e1b2
Parents:
2d69532
Message:
  • Fixed major bug where we were sleeping whenever a packet did not match a specified BPF filter when reading from a DAG card, rather than immediately checking if there was another suitable packet available. This was causing libtrace to get massively behind in reading packets from the DAG card so the DAG buffer would overflow and packets would be dropped.
  • NOTE: the dag2.4 version of this fix has not been fully tested (or even compiled) because we upgraded the box that used to have the old DAG cards in
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dag24.c

    r1aa4bf7 r5778738  
    372372        int data;
    373373
    374         data = dag_available(trace);
    375         if (data > 0) {
     374        do {
     375                data = dag_available(trace);
     376
     377                if (data <= 0)
     378                        break;
     379
    376380                event.size = dag_read_packet(trace,packet);
    377381                //DATA(trace)->dag.diff -= event.size;
     
    380384                                event.type = TRACE_EVENT_PACKET;
    381385                        } else {
    382                                 event.type = TRACE_EVENT_SLEEP;
    383                                 event.seconds = 0.000001;
    384                                 return event;
     386                                /* Do not sleep - try to read another packet */
     387                                continue;
    385388                        }
    386389                } else {
     
    392395
    393396                return event;
    394         }
     397        } while (1);
     398
    395399        assert(data == 0);
    396400        event.type = TRACE_EVENT_SLEEP;
    397401        event.seconds = 0.0001;
    398         return event;
     402        event.size = 0;
     403        return event;
    399404}
    400405
Note: See TracChangeset for help on using the changeset viewer.