Changeset 6f43f5c for lib


Ignore:
Timestamp:
11/14/18 10:45:49 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
89609d0
Parents:
0bb8d49
git-author:
Shane Alcock <salcock@…> (10/24/18 14:42:47)
git-committer:
Shane Alcock <salcock@…> (11/14/18 10:45:49)
Message:

Force burst size to be 1 for ring: parallel inputs

We only read one packet at a time anyway, so by fixing the
burst size to 1 we can avoid a whole bunch of pointless
looping over items in an array of packets which are never
used (i.e. checking if they are valid packet structures
etc.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_ring.c

    rebed638 r6f43f5c  
    320320#ifdef HAVE_PACKET_FANOUT
    321321static int linuxring_pstart_input(libtrace_t *libtrace) {
     322        /* Only because our pread is hard-coded to only do one
     323         * packet at a time anyway */
     324        libtrace->config.burst_size = 1;
    322325        return linuxcommon_pstart_input(libtrace, linuxring_start_input_stream);
    323326}
     
    609612                                   UNUSED size_t nb_packets) {
    610613        /* For now just read one packet */
     614        /* If we change this to actually read nb_packets, make sure
     615         * we remove the burst_size override in linuxring_pstart_input()
     616         */
    611617        packets[0]->error = linuxring_read_stream(libtrace, packets[0],
    612618                                                  t->format_data, &t->messages);
Note: See TracChangeset for help on using the changeset viewer.