Changeset 1bad1e2


Ignore:
Timestamp:
02/09/15 11:36:56 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
6fc1ae7
Parents:
c5ac872
Message:

Fix performance regression in ring: introduced with the libtrace_halt check
We were always making a call to poll, even when a packet was available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    r63af502 r1bad1e2  
    10781078        assert((((unsigned long) header) & (pagesize - 1)) == 0);
    10791079
    1080         while (1) {
     1080        /* TP_STATUS_USER means that we can read the frame.
     1081         * When a slot does not have this flag set, the frame is not
     1082         * ready for consumption.
     1083         */
     1084        while (!(header->tp_status & TP_STATUS_USER)) {
    10811085                pollset.fd = FORMAT(libtrace->format_data)->fd;
    10821086                pollset.events = POLLIN;
     
    10891093                        return -1;
    10901094                } else if (ret == 0) {
    1091                         /* Poll timed out - check if we should exit */
    1092                         if (libtrace_halt)
    1093                                 return 0;
    1094                         continue;
    1095                 }
    1096 
    1097                 /* TP_STATUS_USER means that we can use the frame.
    1098                  * When a slot does not have this flag set, the frame is not
    1099                  * ready for consumption.
    1100                  */
    1101                 if (header->tp_status & TP_STATUS_USER)
    1102                         break;
     1095                        /* Poll timed out - check if we should exit */
     1096                        if (libtrace_halt)
     1097                                return 0;
     1098                        continue;
     1099                }
    11031100        }
    11041101
Note: See TracChangeset for help on using the changeset viewer.