X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fprog_guide%2Fmetrics_lib.rst;h=eca855d60185f57a8468ad990788e65f9ce13c12;hb=0b133c36ad7d5fdce852b060d69019d69d48a7cb;hp=5cbe17c9037a41ef62c8b67bf0fa8b2da61ce4b7;hpb=5630257fcc30397e7217139ec55da4f301f59fb7;p=dpdk.git diff --git a/doc/guides/prog_guide/metrics_lib.rst b/doc/guides/prog_guide/metrics_lib.rst index 5cbe17c903..eca855d601 100644 --- a/doc/guides/prog_guide/metrics_lib.rst +++ b/doc/guides/prog_guide/metrics_lib.rst @@ -25,7 +25,7 @@ individual device. Since the metrics library is self-contained, the only restriction on port numbers is that they are less than ``RTE_MAX_ETHPORTS`` - there is no requirement for the ports to actually exist. -Initialising the library +Initializing the library ------------------------ Before the library can be used, it has to be initialized by calling @@ -154,6 +154,20 @@ print out all metrics for a given port: } +Deinitialising the library +-------------------------- + +Once the library usage is done, it must be deinitialized by calling +``rte_metrics_deinit()`` which will free the shared memory reserved +during initialization. + +.. code-block:: c + + err = rte_metrics_deinit(void); + +If the return value is negative, it means deinitialization failed. +This function **must** be called from a primary process. + Bit-rate statistics library --------------------------- @@ -271,3 +285,12 @@ de-initialise the latency library. .. code-block:: c rte_latencystats_uninit(); + +Timestamp and latency calculation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Latency stats library marks the time in the timestamp field of the +mbuf for the ingress packets and sets the ``PKT_RX_TIMESTAMP`` flag of +``ol_flags`` for the mbuf to indicate the marked time as a valid one. +At the egress, the mbufs with the flag set are considered having valid +timestamp and are used for the latency calculation.