From patchwork Mon Nov 11 18:52:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1193073 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Bg4V72Xvz9sVD for ; Tue, 12 Nov 2019 05:53:13 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4D822E1F; Mon, 11 Nov 2019 18:53:11 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D0E72DD1 for ; Mon, 11 Nov 2019 18:53:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C31D1102 for ; Mon, 11 Nov 2019 18:53:08 +0000 (UTC) X-Originating-IP: 90.177.210.238 Received: from localhost.localdomain (238.210.broadband10.iol.cz [90.177.210.238]) (Authenticated sender: i.maximets@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 8A0C640008; Mon, 11 Nov 2019 18:53:04 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org, Ian Stokes Date: Mon, 11 Nov 2019 19:52:56 +0100 Message-Id: <20191111185256.25690-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Flavio Leitner , Ilya Maximets , David Marchand Subject: [ovs-dev] [PATCH] dpdk: Deprecate pdump support. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The conventional way for packet dumping in OVS is to use ovs-tcpdump that works via traffic mirroring. DPDK pdump could probably be used for some lower level debugging, but it is not commonly used for various reasons. There are lots of limitations for using this functionality in practice. Most of them connected with running secondary pdump process and memory layout issues like requirement to disable ASLR in kernel. More details are available in DPDK guide: https://doc.dpdk.org/guides/prog_guide/multi_proc_support.html#multi-process-limitations Beside the functional limitations it's also hard to use this functionality correctly. User must be sure that OVS and pdump utility are running on different CPU cores, which is hard because non-PMD threads could float over available CPU cores. This or any other misconfiguration will likely lead to crash of the pdump utility or/and OVS. Another problem is that the user must actually have this special pdump utility in a system and it might be not available in distributions. This change disables pdump support by default introducing special configuration option '--enable-dpdk-pdump'. Deprecation warnings will be shown to users on configuration and in runtime. Claiming to completely remove this functionality from OVS in one of the next releases. Signed-off-by: Ilya Maximets Acked-by: Aaron Conole Acked-by: Flavio Leitner Acked-by: David Marchand --- Version 1: * No changes since RFC. * Added ACK from Aaron. .travis/linux-build.sh | 4 +++- Documentation/topics/dpdk/pdump.rst | 8 +++++++- NEWS | 4 ++++ acinclude.m4 | 24 ++++++++++++++++++------ lib/dpdk.c | 2 ++ 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 69260181b..4e74973a3 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -124,7 +124,7 @@ function install_dpdk() sed -i '/CONFIG_RTE_EAL_IGB_UIO=y/s/=y/=n/' build/.config sed -i '/CONFIG_RTE_KNI_KMOD=y/s/=y/=n/' build/.config - # Enable pdump. This will enable building of the relevant OVS code. + # Enable pdump support in DPDK. sed -i '/CONFIG_RTE_LIBRTE_PMD_PCAP=n/s/=n/=y/' build/.config sed -i '/CONFIG_RTE_LIBRTE_PDUMP=n/s/=n/=y/' build/.config @@ -168,6 +168,8 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then DPDK_VER="18.11.2" fi install_dpdk $DPDK_VER + # Enable pdump support in OVS. + EXTRA_OPTS="${EXTRA_OPTS} --enable-dpdk-pdump" if [ "$CC" = "clang" ]; then # Disregard cast alignment errors until DPDK is fixed CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-cast-align" diff --git a/Documentation/topics/dpdk/pdump.rst b/Documentation/topics/dpdk/pdump.rst index 7bd1d3e9f..b4d8aa8e9 100644 --- a/Documentation/topics/dpdk/pdump.rst +++ b/Documentation/topics/dpdk/pdump.rst @@ -27,10 +27,16 @@ pdump .. versionadded:: 2.6.0 +.. warning:: + + DPDK pdump support is deprecated in OVS and will be removed in next + releases. + pdump allows you to listen on DPDK ports and view the traffic that is passing on them. To use this utility, one must have libpcap installed on the system. Furthermore, DPDK must be built with ``CONFIG_RTE_LIBRTE_PDUMP=y`` and -``CONFIG_RTE_LIBRTE_PMD_PCAP=y``. +``CONFIG_RTE_LIBRTE_PMD_PCAP=y``. OVS should be built with +``--enable-dpdk-pdump`` configuration option. .. warning:: diff --git a/NEWS b/NEWS index 88b818948..0d65d5a7f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ Post-v2.12.0 if supported by libbpf. * Add option to enable, disable and query TCP sequence checking in conntrack. + - DPDK: + * DPDK pdump packet capture support disabled by default. New configure + option '--enable-dpdk-pdump' to enable it. + * DPDK pdump support is deprecated and will be removed in next releases. v2.12.0 - 03 Sep 2019 --------------------- diff --git a/acinclude.m4 b/acinclude.m4 index fc6157ac8..542637ac8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -357,12 +357,24 @@ AC_DEFUN([OVS_CHECK_DPDK], [ AC_DEFINE([VHOST_NUMA], [1], [NUMA Aware vHost support detected in DPDK.]) ], [], [[#include ]]) - AC_CHECK_DECL([RTE_LIBRTE_PMD_PCAP], [ - OVS_FIND_DEPENDENCY([pcap_dump], [pcap], [libpcap]) - AC_CHECK_DECL([RTE_LIBRTE_PDUMP], [ - AC_DEFINE([DPDK_PDUMP], [1], [DPDK pdump enabled in OVS.]) - ], [], [[#include ]]) - ], [], [[#include ]]) + AC_MSG_CHECKING([whether DPDK pdump support is enabled]) + AC_ARG_ENABLE( + [dpdk-pdump], + [AC_HELP_STRING([--enable-dpdk-pdump], + [Enable DPDK pdump packet capture support])], + [AC_MSG_RESULT([yes]) + AC_MSG_WARN([DPDK pdump is deprecated, consider using ovs-tcpdump instead]) + AC_CHECK_DECL([RTE_LIBRTE_PMD_PCAP], [ + OVS_FIND_DEPENDENCY([pcap_dump], [pcap], [libpcap]) + AC_CHECK_DECL([RTE_LIBRTE_PDUMP], [ + AC_DEFINE([DPDK_PDUMP], [1], [DPDK pdump enabled in OVS.]) + ], [ + AC_MSG_ERROR([RTE_LIBRTE_PDUMP is not defined in rte_config.h]) + ], [[#include ]]) + ], [ + AC_MSG_ERROR([RTE_LIBRTE_PMD_PCAP is not defined in rte_config.h]) + ], [[#include ]])], + [AC_MSG_RESULT([no])]) AC_CHECK_DECL([RTE_LIBRTE_MLX5_PMD], [dnl found OVS_FIND_DEPENDENCY([mnl_attr_put], [mnl], [libmnl]) diff --git a/lib/dpdk.c b/lib/dpdk.c index f90cda75a..21dd47e80 100644 --- a/lib/dpdk.c +++ b/lib/dpdk.c @@ -434,6 +434,8 @@ dpdk_init__(const struct smap *ovs_other_config) #ifdef DPDK_PDUMP VLOG_INFO("DPDK pdump packet capture enabled"); + VLOG_WARN("DPDK pdump support is deprecated and " + "will be removed in next OVS releases."); err = rte_pdump_init(ovs_rundir()); if (err) { VLOG_INFO("Error initialising DPDK pdump");