[ovs-dev] [PATCH v3] dpdk: Migrate to the new pdump API.

Ilya Maximets i.maximets at ovn.org
Mon Nov 11 17:25:34 UTC 2019


Sorry, I missed the 'dpdk-latest' tag.

On 11.11.2019 16:01, Ilya Maximets wrote:
> 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 3:
>   * Added note about XDG_RUNTIME_DIR.
> 
> Version 2:
>   * Removed unneeded deinitialization on error.
>   * Docs updated.
> 
>  Documentation/topics/dpdk/pdump.rst | 13 +++++++------
>  lib/dpdk.c                          | 11 +----------
>  2 files changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/Documentation/topics/dpdk/pdump.rst b/Documentation/topics/dpdk/pdump.rst
> index 7bd1d3e9f..affd98371 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,13 @@ 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
> +        --pdump 'port=0,queue=*,rx-dev=/tmp/pkts.pcap,tx-dev=/tmp/pkts.pcap'
>  
> -``server-socket-path`` must be set to the value of ``ovs_rundir()`` which
> -typically resolves to ``/usr/local/var/run/openvswitch``.
> +.. note::
> +
> +   ``XDG_RUNTIME_DIR`` environment variable might need to be adjusted to
> +   OVS runtime directory (``/var/run/openvswitch`` in most cases) for
> +   ``dpdk-pdump`` utility if OVS started by non-root user.
>  
>  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
>  
> 


More information about the dev mailing list