From patchwork Sun Dec 3 01:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120433 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2865532qgn; Sat, 2 Dec 2017 17:02:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMY/HCxmSPFngrj712lFmGvy6h5Hx8RlG16vd8Rhwzlbtm1/IICTE1bl8mD7Sfj7Km4rKXdu X-Received: by 10.237.35.246 with SMTP id k51mr15482927qtc.163.1512262966845; Sat, 02 Dec 2017 17:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512262966; cv=none; d=google.com; s=arc-20160816; b=hXinDWaFNdkugWbHGw47cOz/Xfxx/O2dXQO4XqUpsGgo7DI3aiTBEECy/c+RIDdb8v EtGtTm3xoSTYnjsASW3Y+N4BiG7gZeG6GKwhexznsGnQiujTb4jptYisCH7SrjQOsTyP rjcX7gZwIr+Vuso/Gl/sOBzCiXsk1UsXYFKNoFMUzl+fb8Bsf5LOelr8VWBU9PGzi2IT 8oPSoM0Y2BWC8EQL6SsW7tva0xLMKNqnZyXHFn3mN9jtvnpchbYrPq6nS07CcXCXyotV ZE7DcCkNvPPt/I9jml5mXcd23NaY9Wz8c6swSRrfRcE/TM+snqPAJbid6JAB3nFZP0+V T2ZQ== 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=EuwkmpZuxt7nnZ3B7oFJbS0aTl6kqcExmtShInBv3e8=; b=kEvtQWJktX9H6WwnNsUWBYDWTH8evpH4iQ6p4bz7/JyJkR8HPU/ryq9QpypD6i2Xi3 2UdHnKA6xKa2IpaCdvZ8gRSr3NDKkIOnqenoDmJ82hPbr7VuiIRdo0RG9eSTdtY1Dfa+ UXJsLQThrFo8nfBb2sJ3BX659t9T7P4h3yAaJwxyryTvWzwLJrMchLB6Nv3qJhGBGILB cx8Yxwt+wOKmWhz6u7VEbDIQ9UcLwF2hBRKUPY6RQJ3pfotsT3y8SQivh7+I1eYroshI YqShgWSEUa2M719rNfOEdW/ir08PJirl1XfZzderqTzk0yXz+iz5riwCf0bTX5DyhBMC b87g== 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 e133si10071960qkb.232.2017.12.02.17.02.46; Sat, 02 Dec 2017 17:02:46 -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 2A0DE60985; Sun, 3 Dec 2017 01:02:46 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 AC67960791; Sun, 3 Dec 2017 01:01:25 +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 48B366094A; Sun, 3 Dec 2017 01:01:22 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 9BECA6079A for ; Sun, 3 Dec 2017 01:00:17 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 110392D82FBF for ; Sun, 3 Dec 2017 04:00:16 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QpSsgpDi1Z-09lGWXYm; Sun, 03 Dec 2017 04:00:10 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rRTmwan6So-09diH0dT; Sun, 03 Dec 2017 04:00:09 +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: Sun, 3 Dec 2017 04:00:03 +0300 Message-Id: <1512262805-15125-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512262805-15125-1-git-send-email-odpbot@yandex.ru> References: <1512262805-15125-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v1 4/6] linux-gen: pktio: support using DPDK lt 17.08 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: Dmitry Eremin-Solenikov Debian unstable ships with DPDK 16.11. Add support for building with this version. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 321 (lumag:dpdk-system-master) ** https://github.com/Linaro/odp/pull/321 ** Patch: https://github.com/Linaro/odp/pull/321.patch ** Base sha: 5329e5211c447b9b823149baf76112eedfeb07fb ** Merge commit sha: 527862cca98549d4fc5bd0f966d3609477b20443 **/ platform/linux-generic/pktio/dpdk.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 07671e62f..fa73cb93d 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -29,14 +29,27 @@ #include #include +#if __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wimplicit-fallthrough=0" +#endif #include +#if __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif #include #include #include #include +#include #include #include #include +#include + +#if RTE_VERSION < RTE_VERSION_NUM(17, 8, 0, 0) +#define rte_log_set_global_level rte_set_log_level +#endif #if ODP_DPDK_ZERO_COPY ODP_STATIC_ASSERT(CONFIG_PACKET_HEADROOM == RTE_PKTMBUF_HEADROOM, @@ -54,6 +67,7 @@ static int disable_pktio; /** !0 this pktio disabled, 0 enabled */ /* Has dpdk_pktio_init() been called */ static odp_bool_t dpdk_initialized; +#ifndef RTE_BUILD_SHARED_LIB #define MEMPOOL_OPS(hdl) \ extern void mp_hdlr_init_##hdl(void) @@ -77,6 +91,7 @@ void refer_constructors(void) mp_hdlr_init_ops_sp_mc(); mp_hdlr_init_ops_stack(); } +#endif /** * Calculate valid cache size for DPDK packet pool @@ -928,6 +943,11 @@ static int dpdk_close(pktio_entry_t *pktio_entry) rte_pktmbuf_free(pkt_dpdk->rx_cache[i].s.pkt[idx++]); } +#if RTE_VERSION < RTE_VERSION_NUM(17, 8, 0, 0) + if (pktio_entry->s.state != PKTIO_STATE_OPENED) + rte_eth_dev_close(pkt_dpdk->port_id); +#endif + return 0; } @@ -1064,14 +1084,16 @@ static void dpdk_mempool_free(struct rte_mempool *mp, void *arg ODP_UNUSED) static int dpdk_pktio_term(void) { - uint8_t port_id; - if (!dpdk_initialized) return 0; +#if RTE_VERSION >= RTE_VERSION_NUM(17, 8, 0, 0) + uint8_t port_id; + RTE_ETH_FOREACH_DEV(port_id) { rte_eth_dev_close(port_id); } +#endif if (!ODP_DPDK_ZERO_COPY) rte_mempool_walk(dpdk_mempool_free, NULL);