nat: Include platform specific headers on FreeBSD
[vpp.git] / src / plugins / mdata / mdata_doc.rst
1 Buffer metadata change tracker
2 ==============================
3
4 Introduction
5 ------------
6
7 The mdata plugin uses the vlib main loop “before” performance counter
8 hook to snapshoot buffer metadata before calling the node dispatch
9 function. Similarly, the plugin uses the main loop “after” hook to
10 compare a vectors’ worth of buffer metadata after the fact.
11
12 The comparison function is a simple octet-by-octet A != B check. We
13 accumulate changed octets per-node across the entire run, using a single
14 spinlock-protected accumulator.
15
16 The “show buffer metadata” command produces a report of all fields whose
17 values are changed by nodes visited during a given run.
18
19 Since many fields in the vnet_buffer_opaque_t are union members, it may
20 appear that a certain node changes numerous fields. The entire point of
21 the exercise is to warn developers that if a packet visits node N, data
22 placed into opaque union field F *will* be affected.
23
24 One should never assume much about buffer metadata immutability across
25 arbitrary subgraphs. This tool generates accurate reports, to the extent
26 that one exercises the required subgraph trajectories.