2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netdev-dpdk: add DPDK pdump capability

This commit provides the ability to 'listen' on DPDK ports and save
packets to a pcap file with a DPDK app that uses the librte_pdump
library. One such app is the 'pdump' app that can be found in the DPDK
'app' directory. Instructions on how to use this can be found in
INSTALL.DPDK-ADVANCED.md

Pdump capability in OVS with DPDK will only be initialised if the
CONFIG_RTE_LIBRTE_PMD_PCAP=y and CONFIG_RTE_LIBRTE_PDUMP=y options are
set in DPDK. libpcap is required if the above configuration is used.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
Ciara Loftus
2016-08-10 15:28:27 +01:00
committed by Daniele Di Proietto
parent 2b220d1768
commit 4b88d6787d
4 changed files with 79 additions and 2 deletions

View File

@@ -57,6 +57,9 @@
#include "rte_config.h"
#include "rte_mbuf.h"
#include "rte_meter.h"
#ifdef DPDK_PDUMP
#include "rte_pdump.h"
#endif
#include "rte_virtio_net.h"
VLOG_DEFINE_THIS_MODULE(dpdk);
@@ -3412,6 +3415,22 @@ dpdk_init__(const struct smap *ovs_other_config)
dpdk_vhost_class_init();
#ifdef DPDK_PDUMP
VLOG_INFO("DPDK pdump packet capture enabled");
err = rte_pdump_init(ovs_rundir());
if (err) {
VLOG_INFO("Error initialising DPDK pdump");
rte_pdump_uninit();
} else {
char *server_socket_path;
server_socket_path = xasprintf("%s/%s", ovs_rundir(),
"pdump_server_socket");
fatal_signal_add_file_to_unlink(server_socket_path);
free(server_socket_path);
}
#endif
/* Finally, register the dpdk classes */
netdev_dpdk_register();
}