dpdkstat: enable a plugin for DPDK stats
authorMaryam Tahhan <maryam.tahhan@intel.com>
Mon, 28 Mar 2016 11:26:03 +0000 (12:26 +0100)
committerKim Jones <kim-marie.jones@intel.com>
Thu, 28 Jul 2016 11:06:53 +0000 (12:06 +0100)
commit8a7ec0cfb7aaab52e53fbb21cdc887cee4cccd6d
tree91385fbd54e44a689c7834ef097aa3500eb6e1f7
parent3bfaa620f1a7f6653abccad7cb580b4fa2952f2f
dpdkstat: enable a plugin for DPDK stats

This patch enables support to retrieve statistics for DPDK
interfaces. An overview of the threading is as follows:
1. collectd init() or read() calls dpdk_helper_spawn() to retrieve
   the required size of xstats to allocate.
   1.1. DPDK counts ports, stats and length, writing them to
        shared-memory (SHM).
   1.2. DPDK helper (secondary) process quits, allowing cleanup of
        the shared memory.
2. collectd resizes shared-memory to size of stats as provided by
   DPDK.
3. collectd respawns the DPDK helper.
   3.1. Helper blocks on a semaphore until told to read the stats
        from DPDK and write them to SHM.
4. collectd dispatches statistics
   4.1. Thread blocks on semaphore until stats are available.
This threading model is required to allow the plugin to detect when
the DPDK primary process/application has been killed/reset, and to avoid
the plugin from stopping another DPDK primary process from starting.
Some extra housekeeping is in place to ensure collectd is never
stalled by using sem_timedwait() with a timeout. If collectd dies, the
helper process will automatically quit after a timeout, as it detects
its ppid has changed.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
README
configure.ac
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod
src/dpdkstat.c [new file with mode: 0644]
src/types.db