Changeset 0277ab8 for lib/protocols_l3.c


Ignore:
Timestamp:
08/05/15 13:50:02 (5 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
d280f48
Parents:
84d137d
Message:

Completed improvement of trace_strip_packet()

  • Removed the trace_copy_packet() if the packet is not totally owned by libtrace. I think we can get away without it and we really don't want the performance hit when dealing with live captures.
  • Replaced call to trace_get_layer3 with the old header parsing code from the previous version of trace_strip_packet(). The overhead of calling trace_get_layer3 was outweighing the performance gain from the change in memmove strategy.
  • Removed ability to selectively strip VLAN or MPLS headers only -- this was not that useful and supporting it would make the code much more complex.
  • Updated trace_get_layer3 to use the cached layer 2 header if available rather than making a call to trace_get_layer2 and getting it from there. This saves us a bit of function call overhead.
  • Make sure we reset the layer 2 cached info if we shift the Ethernet header.
  • Strip PPPoE in addition to MPLS and VLAN.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_l3.c

    r7baa948 r0277ab8  
    245245        }
    246246
    247         link = trace_get_layer2(packet,&linktype,remaining);
     247        if (packet->l2_header) {
     248                link = packet->l2_header;
     249                linktype = packet->link_type;
     250                *remaining = packet->l2_remaining;
     251        } else {
     252                link = trace_get_layer2(packet,&linktype,remaining);
     253        }
    248254        iphdr = trace_get_payload_from_layer2(
    249255                        link,
Note: See TracChangeset for help on using the changeset viewer.