Changeset ee58d0d for lib/trace.c


Ignore:
Timestamp:
08/12/11 14:22:16 (10 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, 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:
c29a0e0
Parents:
44028d4
Message:
  • Improved performance by caching more stuff, especially L2 headers and various "remaining" values - not much point caching something if you need to re-read the entire packet to calculate "remaining" still :)
  • Also improved performance of trace_get_layer2 by avoiding an effective double call of trace_get_packet_buffer
  • Fixed bug with payload length calculation if the packet has extra padding beyond what the IP len states
  • Improved (hopefully) performance when reading ERF traces by avoiding updating the drops counter if the loss counter was zero (should save an ntohs at least)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rb6664e8 ree58d0d  
    18221822void trace_clear_cache(libtrace_packet_t *packet) {
    18231823
     1824        packet->l2_header = NULL;
    18241825        packet->l3_header = NULL;
    18251826        packet->l4_header = NULL;
     1827        packet->link_type = 0;
    18261828        packet->l3_ethertype = 0;
    18271829        packet->transport_proto = 0;
    18281830        packet->capture_length = -1;
    18291831        packet->payload_length = -1;
     1832        packet->l2_remaining = 0;
     1833        packet->l3_remaining = 0;
     1834        packet->l4_remaining = 0;
    18301835
    18311836}
Note: See TracChangeset for help on using the changeset viewer.