Changeset 5e3f16c for lib/format_dpdk.c


Ignore:
Timestamp:
12/05/16 19:04:41 (5 years ago)
Author:
Richard Sanger <rsanger@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
adb2c4c, cff1819, f8613e4
Parents:
8ccb8536
Message:

Fix for issue #39 - ring and int pstop() fails on older kernels when using threads

The problem here is that on old kernels without PACKET_FANOUT support
(added in v3.1) will only include the single threaded versions of int
and ring. When used with multiple threads the libtrace API will
fallback to using read rather than pread which does not check message
queues.

To fix this issue, in any format without pread support:

  • We check for new messages with each loop around read_packet as we fill the burst
  • Within read_packet we update the halt to include the pausing state
  • Use a seperate lock to the main lock when reading a burst of packets, otherwise trace_ppause has to wait for a burst to read.

This is not 100% perfect as a single packet might still need to be received
before a generic message can be received.
A proper fix in the future would be to move all format internals purely to the
parallel API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    rc94f107 r5e3f16c  
    21072107                if (mesg && libtrace_message_queue_count(mesg) > 0)
    21082108                        return READ_MESSAGE;
    2109                 if (libtrace_halt)
    2110                         return READ_EOF;
     2109                if ((nb_rx=is_halted(libtrace)) != -1)
     2110                        return nb_rx;
    21112111                /* Wait a while, polling on memory degrades performance
    21122112                 * This relieves the pressure on memory allowing the NIC to DMA */
Note: See TracChangeset for help on using the changeset viewer.