- Timestamp:
- 12/15/16 17:06:24 (4 years ago)
- 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:
- 4edb310, ceba2b2, e47ab4d
- Parents:
- f8613e4
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_linux_ring.c
r5e3f16c r47c4490 447 447 #ifdef HAVE_NETPACKET_PACKET_H 448 448 #define LIBTRACE_MIN(a,b) ((a)<(b) ? (a) : (b)) 449 /* We use TP_STATUS_LIBTRACE to ensure we don't loop back on ourself 450 * and read the same packet twice if an old packet has not yet been freed */ 451 #define TP_STATUS_LIBTRACE 0xFFFFFFFF 452 449 453 inline static int linuxring_read_stream(libtrace_t *libtrace, 450 454 libtrace_packet_t *packet, … … 470 474 * ready for consumption. 471 475 */ 472 while (!(header->tp_status & TP_STATUS_USER)) { 476 while (!(header->tp_status & TP_STATUS_USER) || 477 header->tp_status == TP_STATUS_LIBTRACE) { 478 if ((ret=is_halted(libtrace)) != -1) 479 return ret; 473 480 pollset[0].fd = stream->fd; 474 481 pollset[0].events = POLLIN; … … 509 516 } 510 517 } else { 511 /* Poll timed out - check if we should exit */ 512 if ((ret=is_halted(libtrace)) != -1) 513 return ret; 518 /* Poll timed out - check if we should exit on next loop */ 514 519 continue; 515 520 } … … 518 523 packet->buffer = header; 519 524 packet->trace = libtrace; 525 header->tp_status = TP_STATUS_LIBTRACE; 520 526 521 527 /* If a snaplen was configured, automatically truncate the packet to … … 574 580 /* Fetch the current frame */ 575 581 header = GET_CURRENT_BUFFER(FORMAT_DATA_FIRST); 576 if (header->tp_status & TP_STATUS_USER) { 582 if (header->tp_status & TP_STATUS_USER && 583 header->tp_status != TP_STATUS_LIBTRACE) { 577 584 /* We have a frame waiting */ 578 585 event.size = trace_read_packet(libtrace, packet); -
lib/trace_parallel.c
r5e3f16c r47c4490 1733 1733 if (libtrace->perpkt_thread_count > 1) 1734 1734 libtrace->pread = trace_pread_packet_first_in_first_served; 1735 /* Don't wait for a burst of packets if the format is 1736 * live as this could block ring based formats and 1737 * introduces delay. */ 1738 if (libtrace->format->info.live) { 1739 libtrace->config.burst_size = 1; 1740 } 1735 1741 else 1736 1742 /* Use standard read_packet */
Note: See TracChangeset
for help on using the changeset viewer.