[ovs-dev] [PATCH dpdk-latest v2] dpdk: Migrate to the new pdump API.
Ilya Maximets
i.maximets at ovn.org
Thu Oct 31 13:15:32 UTC 2019
DPDK commit 660098d61f57 ("pdump: use generic multi-process channel")
switched pdump to use generic DPDK IPC instead of sockets.
Old API was deprecated and removed. Updating OVS code accordingly.
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
Version 2:
* Removed unneeded deinitialization on error.
* Docs updated.
Documentation/topics/dpdk/pdump.rst | 9 ++-------
lib/dpdk.c | 11 +----------
2 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/Documentation/topics/dpdk/pdump.rst b/Documentation/topics/dpdk/pdump.rst
index 7bd1d3e9f..26acff45e 100644
--- a/Documentation/topics/dpdk/pdump.rst
+++ b/Documentation/topics/dpdk/pdump.rst
@@ -41,8 +41,7 @@ To use pdump, simply launch OVS as usual, then navigate to the ``app/pdump``
directory in DPDK, ``make`` the application and run like so::
$ sudo ./build/app/dpdk-pdump -- \
- --pdump port=0,queue=0,rx-dev=/tmp/pkts.pcap \
- --server-socket-path=/usr/local/var/run/openvswitch
+ --pdump port=0,queue=0,rx-dev=/tmp/pkts.pcap
The above command captures traffic received on queue 0 of port 0 and stores it
in ``/tmp/pkts.pcap``. Other combinations of port numbers, queues numbers and
@@ -50,11 +49,7 @@ pcap locations are of course also available to use. For example, to capture all
packets that traverse port 0 in a single pcap file::
$ sudo ./build/app/dpdk-pdump -- \
- --pdump 'port=0,queue=*,rx-dev=/tmp/pkts.pcap,tx-dev=/tmp/pkts.pcap' \
- --server-socket-path=/usr/local/var/run/openvswitch
-
-``server-socket-path`` must be set to the value of ``ovs_rundir()`` which
-typically resolves to ``/usr/local/var/run/openvswitch``.
+ --pdump 'port=0,queue=*,rx-dev=/tmp/pkts.pcap,tx-dev=/tmp/pkts.pcap'
Many tools are available to view the contents of the pcap file. Once example is
tcpdump. Issue the following command to view the contents of ``pkts.pcap``::
diff --git a/lib/dpdk.c b/lib/dpdk.c
index f90cda75a..748f63d31 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -27,7 +27,6 @@
#include <rte_memzone.h>
#include <rte_version.h>
#ifdef DPDK_PDUMP
-#include <rte_mempool.h>
#include <rte_pdump.h>
#endif
@@ -434,17 +433,9 @@ dpdk_init__(const struct smap *ovs_other_config)
#ifdef DPDK_PDUMP
VLOG_INFO("DPDK pdump packet capture enabled");
- err = rte_pdump_init(ovs_rundir());
+ err = rte_pdump_init();
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
--
2.17.1
More information about the dev
mailing list