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/protocols_transport.c

    r9cc1266 ree58d0d  
    147147
    148148        if (packet->l4_header) {
     149                /*
    149150                void *link;
    150151                libtrace_linktype_t linktype;
     
    152153                if (!link)
    153154                        return NULL;
     155                */
    154156                *proto = packet->transport_proto;
    155                 *remaining -= (packet->l4_header - link);
     157                /* *remaining -= (packet->l4_header - link); */
     158                *remaining = packet->l4_remaining;
    156159                return packet->l4_header;
    157160        }
     
    185188        ((libtrace_packet_t *)packet)->transport_proto = *proto;
    186189        ((libtrace_packet_t *)packet)->l4_header = transport;
     190        ((libtrace_packet_t *)packet)->l4_remaining = *remaining;
    187191
    188192
Note: See TracChangeset for help on using the changeset viewer.