Changeset 97d170d for lib/format_dag25.c


Ignore:
Timestamp:
01/15/15 13:57:47 (7 years ago)
Author:
Dan Collins <dan@…>
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:
d97778c
Parents:
4cc6e74 (diff), 21f3226 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'develop' of github.com:wanduow/libtrace into develop

Conflicts:

lib/format_dag25.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dag25.c

    rc66a465 r97d170d  
    161161         * structures. Most of the stuff above doesn't get used in parallel mode. */
    162162        struct dag_per_thread_t *per_thread;
     163
     164        uint8_t seeninterface[4];
    163165};
    164166
     
    241243        FORMAT_DATA->bottom = NULL;
    242244        FORMAT_DATA->top = NULL;
     245        memset(FORMAT_DATA->seeninterface, 0, sizeof(FORMAT_DATA->seeninterface));
    243246}
    244247
     
    290293        dag_close(dev->fd);
    291294        if (dev->dev_name)
    292         free(dev->dev_name);
     295                free(dev->dev_name);
    293296        free(dev);
    294297}
     
    575578
    576579        if (dag_attach_stream(FORMAT_DATA_OUT->device->fd,
    577                         FORMAT_DATA_OUT->dagstream, 0, 1048576) < 0) {
     580                        FORMAT_DATA_OUT->dagstream, 0, 4 * 1024 * 1024) < 0) {
    578581                trace_set_err_out(libtrace, errno, "Cannot attach DAG stream");
    579582                return -1;
     
    599602static int dag_start_input(libtrace_t *libtrace) {
    600603        struct timeval zero, nopoll;
    601         uint8_t *top, *bottom;
    602         uint8_t diff = 0;
     604        uint8_t *top, *bottom, *starttop;
     605        uint64_t diff = 0;
    603606        top = bottom = NULL;
    604607
     
    626629                                &nopoll);
    627630
     631        starttop = dag_advance_stream(FORMAT_DATA->device->fd,
     632                                        FORMAT_DATA->dagstream,
     633                                        &bottom);
     634
    628635        /* Should probably flush the memory hole now */
    629         do {
     636        while (starttop - bottom > 0) {
     637                bottom += (starttop - bottom);
    630638                top = dag_advance_stream(FORMAT_DATA->device->fd,
    631639                                        FORMAT_DATA->dagstream,
    632640                                        &bottom);
    633                 assert(top && bottom);
    634                 diff = top - bottom;
    635                 bottom -= diff;
    636         } while (diff != 0);
    637         FORMAT_DATA->top = NULL;
    638         FORMAT_DATA->bottom = NULL;
     641        }
     642        FORMAT_DATA->top = top;
     643        FORMAT_DATA->bottom = bottom;
    639644        FORMAT_DATA->processed = 0;
    640645        FORMAT_DATA->drops = 0;
     
    867872                        PERPKT_DATA(t)->drops += ntohs(erfptr->lctr);
    868873                } else {
    869                         printf("DROP!\n");
    870                         DATA(libtrace)->drops += ntohs(erfptr->lctr);
     874                        if (FORMAT_DATA->seeninterface[erfptr->flags.iface] == 0) {
     875                                FORMAT_DATA->seeninterface[erfptr->flags.iface] = 1;
     876                        } else {
     877                                FORMAT_DATA->drops += ntohs(erfptr->lctr);
     878                        }
    871879                }
    872880        }
Note: See TracChangeset for help on using the changeset viewer.