From patchwork Tue Jan 16 13:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124664 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1004901lje; Tue, 16 Jan 2018 05:00:43 -0800 (PST) X-Google-Smtp-Source: ACJfBov/+XaPwqkp/EzU+yO4ecTQrCfxw2yaxp43A4CHRo45UtaWRi/plVCf2DiS+QCGVJUT185o X-Received: by 10.200.33.195 with SMTP id 3mr20231604qtz.102.1516107643149; Tue, 16 Jan 2018 05:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516107643; cv=none; d=google.com; s=arc-20160816; b=kpjKrzR3fgxiGMrmRhskxMCfF7EPr666B1FmFNcUciiEspaiJ35n2ErCgUN0j3A5qA pyEzB/ObYHYtuKsEm77Zj6JhAia338Yzt3XagwvOctLjO2yLfGUxK4LLq8Zcd9looxAq uf+TsH2BTBmZwEQS44ZuAZ64wd+9g1mTA4smdQis6YCjNikbXZBWCZaRqZGs+K1fOWTM k5uSDYnSyZSWo+U3kM4AFrnFOTe64T6sGQfC2SIsRuRngA2s1DRBjPm2qDhYRs+UYxKM TITjIG3KUhgtuvTVN0PC0uwA1Yk+3eAA8cw8W2QuUS5JiEoYg6T09V+c75auBLAzUaij NLBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=cA+v9JFRE6SwEvlbpEUxqPekaihFKz63gHyn3hru/1Q=; b=tq3KPoHUuiYWVEtOLhRUdOKp0balIIBXwxbFk+pzdcXlrqadtX9f3SMtGfBbEyhyEl oMH5d6yTFQ6A8d/uUN6NzyL0DEMMyBe1obNB/Q1bw2sG0K0olh+b/fBcNm07cxMfn1xU aY5mUK61n8qKN5j2EhLD3ujv/BMBcBNHnkYnzLo7yNsQtuRRho7HXr6r9PcfzOMfDNMc gWEFgEQ2f9aSknD62sCPbruZR6Vr+jUa8LWFQTIUefhW2P88z66er7jvetfoJgNEYBBc tx3ciC2eWERUUZy8yvE+Dp1ek+OxIKV+2ai0q4ewoVLJoMidKx8mm0tn5BJbmrP6IuAH yvKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id n39si632186qtc.319.2018.01.16.05.00.41; Tue, 16 Jan 2018 05:00:43 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 507B36175F; Tue, 16 Jan 2018 13:00:41 +0000 (UTC) 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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 D7E5E60883; Tue, 16 Jan 2018 13:00:21 +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 5742F6099A; Tue, 16 Jan 2018 13:00:14 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id D50AD60883 for ; Tue, 16 Jan 2018 13:00:12 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 0AEE72182AB4 for ; Tue, 16 Jan 2018 16:00:11 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id b9bSKjnvT1-0AnudCfL; Tue, 16 Jan 2018 16:00:10 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BsuArJnZwA-0A6qS0xu; Tue, 16 Jan 2018 16:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 16 Jan 2018 16:00:08 +0300 Message-Id: <1516107608-12646-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516107608-12646-1-git-send-email-odpbot@yandex.ru> References: <1516107608-12646-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 394 Subject: [lng-odp] [PATCH CATERPILLAR v1 1/1] pktio: honor config.h settings 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Josep Puigdemont It's not enough to chech if a macro is defined to enable or disable a pktio, we also need to check if it is set to 1 as per its description. Signed-off-by: Josep Puigdemont --- /** Email created from pull request 394 (joseppc:check-macro-value) ** https://github.com/Linaro/odp/pull/394 ** Patch: https://github.com/Linaro/odp/pull/394.patch ** Base sha: 4d17f8ae64aba0e6f24877be30f86ae5880cef7e ** Merge commit sha: 33b93a8a6df7810422c61b2c5f0eb58d1388b980 **/ .../linux-generic/include/odp_packet_internal.h | 2 +- platform/linux-generic/pktio/dpdk.c | 2 +- platform/linux-generic/pktio/dpdk.h | 2 +- platform/linux-generic/pktio/ipc.c | 2 +- platform/linux-generic/pktio/netmap.c | 2 +- platform/linux-generic/pktio/socket.c | 2 +- platform/linux-generic/pktio/socket_mmap.c | 2 +- platform/linux-generic/pktio/subsystem.c | 28 +++++++++++----------- platform/linux-generic/pktio/tap.c | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index fed562aa3..72ba6ac18 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -145,7 +145,7 @@ typedef struct { /* Result for crypto packet op */ odp_crypto_packet_result_t crypto_op_result; -#ifdef ODP_PKTIO_DPDK +#if defined(ODP_PKTIO_DPDK) && ODP_PKTIO_DPDK == 1 /* Type of extra data */ uint8_t extra_type; /* Extra space for packet descriptors. E.g. DPDK mbuf */ diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 7d39bb1bc..3f716ab10 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -6,7 +6,7 @@ #include "config.h" -#ifdef ODP_PKTIO_DPDK +#if defined(ODP_PKTIO_DPDK) && ODP_PKTIO_DPDK == 1 #include diff --git a/platform/linux-generic/pktio/dpdk.h b/platform/linux-generic/pktio/dpdk.h index 7495b5965..d4e8cf064 100644 --- a/platform/linux-generic/pktio/dpdk.h +++ b/platform/linux-generic/pktio/dpdk.h @@ -13,7 +13,7 @@ #include -#ifdef ODP_PKTIO_DPDK +#if defined(ODP_PKTIO_DPDK) && ODP_PKTIO_DPDK == 1 #include #include diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 9d928c72a..4ca7d64ec 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -6,7 +6,7 @@ #include "config.h" -#ifdef ODP_PKTIO_IPC +#if defined(ODP_PKTIO_IPC) && ODP_PKTIO_IPC == 1 #include #include diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 2631c816d..fc17da076 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -6,7 +6,7 @@ #include "config.h" -#ifdef ODP_NETMAP +#if defined(ODP_NETMAP) && ODP_NETMAP == 1 #include diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 320de973c..6c98bc60c 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -7,7 +7,7 @@ #include "config.h" -#ifdef ODP_PKTIO_SOCKET +#if defined(ODP_PKTIO_SOCKET) && ODP_PKTIO_SOCKET == 1 #include diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 26d0a2957..1e49d5b28 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -7,7 +7,7 @@ #include "config.h" -#ifdef ODP_PKTIO_SOCKET_MMAP +#if defined(ODP_PKTIO_SOCKET_MMAP) && ODP_PKTIO_SOCKET_MMAP == 1 #include diff --git a/platform/linux-generic/pktio/subsystem.c b/platform/linux-generic/pktio/subsystem.c index a3b36c144..e00206efc 100644 --- a/platform/linux-generic/pktio/subsystem.c +++ b/platform/linux-generic/pktio/subsystem.c @@ -22,26 +22,26 @@ ODP_SUBSYSTEM_FOREACH_TEMPLATE(pktio_ops, term_global, ODP_ABORT) /* Temporary variable to enable link modules, * will remove in Makefile scheme changes. */ -#ifdef ODP_PKTIO_DPDK +#if defined(ODP_PKTIO_DPDK) && ODP_PKTIO_DPDK == 1 extern int enable_link_dpdk_pktio_ops; #endif -#ifdef ODP_PKTIO_IPC +#if defined(ODP_PKTIO_IPC) && ODP_PKTIO_IPC == 1 extern int enable_link_ipc_pktio_ops; #endif extern int enable_link_loopback_pktio_ops; -#ifdef ODP_NETMAP +#if defined(ODP_NETMAP) && ODP_NETMAP == 1 extern int enable_link_netmap_pktio_ops; #endif -#ifdef HAVE_PCAP +#if defined(HAVE_PCAP) && HAVE_PCAP == 1 extern int enable_link_pcap_pktio_ops; #endif -#ifdef ODP_PKTIO_SOCKET +#if defined(ODP_PKTIO_SOCKET) && ODP_PKTIO_SOCKET == 1 extern int enable_link_socket_pktio_ops; #endif -#ifdef ODP_PKTIO_SOCKET_MMAP +#if defined(ODP_PKTIO_SOCKET_MMAP) && ODP_PKTIO_SOCKET_MMAP == 1 extern int enable_link_socket_mmap_pktio_ops; #endif -#ifdef ODP_PKTIO_TAP +#if defined(ODP_PKTIO_TAP) && ODP_PKTIO_TAP == 1 extern int enable_link_tap_pktio_ops; #endif @@ -51,26 +51,26 @@ ODP_SUBSYSTEM_CONSTRUCTOR(pktio_ops) /* Further initialization per subsystem */ -#ifdef ODP_PKTIO_DPDK +#if defined(ODP_PKTIO_DPDK) && ODP_PKTIO_DPDK == 1 enable_link_dpdk_pktio_ops = 1; #endif -#ifdef ODP_PKTIO_IPC +#if defined(ODP_PKTIO_IPC) && ODP_PKTIO_IPC == 1 enable_link_ipc_pktio_ops = 1; #endif enable_link_loopback_pktio_ops = 1; -#ifdef ODP_NETMAP +#if defined(ODP_NETMAP) && ODP_NETMAP == 1 enable_link_netmap_pktio_ops = 1; #endif -#ifdef HAVE_PCAP +#if defined(HAVE_PCAP) && HAVE_PCAP == 1 enable_link_pcap_pktio_ops = 1; #endif -#ifdef ODP_PKTIO_SOCKET +#if defined(ODP_PKTIO_SOCKET) && ODP_PKTIO_SOCKET == 1 enable_link_socket_pktio_ops = 1; #endif -#ifdef ODP_PKTIO_SOCKET_MMAP +#if defined(ODP_PKTIO_SOCKET_MMAP) && ODP_PKTIO_SOCKET_MMAP == 1 enable_link_socket_mmap_pktio_ops = 1; #endif -#ifdef ODP_PKTIO_TAP +#if defined(ODP_PKTIO_TAP) && ODP_PKTIO_TAP == 1 enable_link_tap_pktio_ops = 1; #endif } diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index bb404d914..81eaffef4 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -6,7 +6,7 @@ #include "config.h" -#ifdef ODP_PKTIO_TAP +#if defined(ODP_PKTIO_TAP) && ODP_PKTIO_TAP == 1 /** * @file