From patchwork Wed Feb 17 07:42:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 62091 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2128909lbl; Tue, 16 Feb 2016 23:44:30 -0800 (PST) X-Received: by 10.140.96.84 with SMTP id j78mr72234qge.93.1455695070201; Tue, 16 Feb 2016 23:44:30 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y83si99022qka.43.2016.02.16.23.44.29; Tue, 16 Feb 2016 23:44:30 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C0B04617EA; Wed, 17 Feb 2016 07:44:29 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=FHS20RDN; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 016DC6679E; Wed, 17 Feb 2016 07:43:26 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 97A9A617B8; Wed, 17 Feb 2016 07:43:13 +0000 (UTC) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id D8DFB617D4 for ; Wed, 17 Feb 2016 07:42:45 +0000 (UTC) Received: by mail-lf0-f44.google.com with SMTP id m1so5196330lfg.0 for ; Tue, 16 Feb 2016 23:42:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eTaZjgHAl1EygMk7CVtwULoMyMk2i+Muhs5D1Q3kvFw=; b=FHS20RDNkZEYJ3hAM4Nm8QtodgD29uIR3sMeVo2rdAXDJX63o47rtsbaCSLJQYLy9o BagUrp6grkfbu2vrh/Ggt+uxHkmBUvHxMYKfbIkmRd6svxvyd4a0teO6CVlyriUThpop pTL3Y85OmOAehTQFJFxLJBrKfFzDYET1MAbus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eTaZjgHAl1EygMk7CVtwULoMyMk2i+Muhs5D1Q3kvFw=; b=JnvhEhYS9U7Vf6GL6asO6XhwT8TFz4DlUuAeQDRrumGDORxDYhrtamXGYWdDDgxRc0 2gT+mziDBWY7Sbbr9N9O87AWRE9QWZ7LI2PCD3yNGi/THcsmPLdYu2lGYbrTT2Ok7TD+ BhJM6CvL4TvuRa/n17OWOTXFOcTsV7Or/+hkOCT8QRrAxqmNCir/oIGnO6Ibb+S+XysF vxJ9Mst90SqaNsKzdq5CI8TSJwEci6Gcii/Ob/vmBe0LPjIPNsd2I3ysYQIgshHVfZzP DI/EuVXsltcXYSg1bLcz4IiM+PZqs7R4rqo/FZHeW3FwlWHxzTskEZOBeShoIdE37n2z zx6A== X-Gm-Message-State: AG10YOTpvOiOyvn/OiqA9HoPPEToiPbnEHP5pBI/WCfHyjd2vJUbm7TGFTj3NaY3/NGQlFH7saY= X-Received: by 10.25.213.134 with SMTP id m128mr36642lfg.87.1455694964815; Tue, 16 Feb 2016 23:42:44 -0800 (PST) Received: from localhost.localdomain (ppp91-76-173-134.pppoe.mtu-net.ru. [91.76.173.134]) by smtp.gmail.com with ESMTPSA id jm8sm17009lbc.12.2016.02.16.23.42.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Feb 2016 23:42:44 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 17 Feb 2016 10:42:38 +0300 Message-Id: <1455694959-14305-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 In-Reply-To: <1455694959-14305-1-git-send-email-maxim.uvarov@linaro.org> References: <1455694959-14305-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 1/2] linux-generic: pktio: add option to enable and disable ipc pktio X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" With more options to enable/disable features it's more easy to isolate and debug problem if any. For now I have suspitious that in CI make check runs in parallel with other make checks which share the same pool memory. I.e. one process can corrupt memory for other process. Moving IPC to option it will be easy to debug that. Signed-off-by: Maxim Uvarov --- configure.ac | 3 ++- platform/linux-generic/m4/configure.m4 | 1 + platform/linux-generic/m4/odp_ipc.m4 | 29 +++++++++++++++++++++++++++++ platform/linux-generic/odp_pool.c | 4 ++++ platform/linux-generic/pktio/io_ops.c | 2 ++ platform/linux-generic/test/Makefile.am | 7 +++++-- 6 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 platform/linux-generic/m4/odp_ipc.m4 diff --git a/configure.ac b/configure.ac index 257f8c3..200d565 100644 --- a/configure.ac +++ b/configure.ac @@ -85,6 +85,7 @@ AC_SUBST([platform_with_platform_test], ["platform/${with_platform}/test"]) # Prepare default values for platform specific optional features ########################################################################## netmap_support=no +pktio_ipc_support=no ########################################################################## # Run platform specific checks and settings @@ -102,7 +103,7 @@ fi ########################################################################## AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ]) AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes]) - +AM_CONDITIONAL([pktio_ipc_support], [test $pktio_ipc_support = yes]) AC_ARG_WITH([sdk-install-path], AC_HELP_STRING([--with-sdk-install-path=DIR path to external libs and headers], diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 2ac4799..b8c1c52 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -21,6 +21,7 @@ m4_include([platform/linux-generic/m4/odp_openssl.m4]) m4_include([platform/linux-generic/m4/odp_netmap.m4]) m4_include([platform/linux-generic/m4/odp_dpdk.m4]) m4_include([platform/linux-generic/m4/odp_pcap.m4]) +m4_include([platform/linux-generic/m4/odp_ipc.m4]) AC_CONFIG_FILES([platform/linux-generic/Makefile platform/linux-generic/test/Makefile diff --git a/platform/linux-generic/m4/odp_ipc.m4 b/platform/linux-generic/m4/odp_ipc.m4 new file mode 100644 index 0000000..30f869d --- /dev/null +++ b/platform/linux-generic/m4/odp_ipc.m4 @@ -0,0 +1,29 @@ +########################################################################## +# Enable IPC pktio support +########################################################################## +AC_ARG_ENABLE([pktio_ipc_support], + [ --enable-pktio_ipc-support include ipc IO support], + [if test x$enableval = xyes; then + pktio_ipc_support=yes + fi]) + +########################################################################## +# Save and set temporary compilation flags +########################################################################## +OLD_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" + +########################################################################## +# Check for IPC pktio availability +########################################################################## +if test x$pktio_ipc_support = xyes +then + ODP_CFLAGS="$ODP_CFLAGS -DODP_PKTIO_IPC" +else + pktio_ipc_support=no +fi + +########################################################################## +# Restore old saved variables +########################################################################## +CPPFLAGS=$OLD_CPPFLAGS diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 78ccc0f..9eaa0c8 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -421,7 +421,11 @@ odp_pool_t _pool_create(const char *name, odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) { +#ifdef ODP_PKTIO_IPC return _pool_create(name, params, ODP_SHM_PROC); +#else + return _pool_create(name, params, 0); +#endif } odp_pool_t odp_pool_lookup(const char *name) diff --git a/platform/linux-generic/pktio/io_ops.c b/platform/linux-generic/pktio/io_ops.c index 15aa160..5824785 100644 --- a/platform/linux-generic/pktio/io_ops.c +++ b/platform/linux-generic/pktio/io_ops.c @@ -21,7 +21,9 @@ const pktio_if_ops_t * const pktio_if_ops[] = { #ifdef HAVE_PCAP &pcap_pktio_ops, #endif +#ifdef ODP_PKTIO_IPC &ipc_pktio_ops, +#endif &tap_pktio_ops, &sock_mmap_pktio_ops, &sock_mmsg_pktio_ops, diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am index 1011437..09ace38 100644 --- a/platform/linux-generic/test/Makefile.am +++ b/platform/linux-generic/test/Makefile.am @@ -1,12 +1,11 @@ include $(top_srcdir)/test/Makefile.inc TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation -ODP_MODULES = pktio pktio_ipc ring +ODP_MODULES = pktio ring if test_vald TESTS = pktio/pktio_run \ pktio/pktio_run_tap \ - pktio_ipc/pktio_ipc_run \ ring/ringtest$(EXEEXT) \ ${top_builddir}/test/validation/atomic/atomic_main$(EXEEXT) \ ${top_builddir}/test/validation/barrier/barrier_main$(EXEEXT) \ @@ -38,6 +37,10 @@ SUBDIRS = $(ODP_MODULES) if HAVE_PCAP TESTS += pktio/pktio_run_pcap endif +if pktio_ipc_support +TESTS += pktio_ipc/pktio_ipc_run +SUBDIRS += pktio_ipc +endif endif dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER)