From patchwork Mon Dec 11 16:00:06 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: 121425 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2978479qgn; Mon, 11 Dec 2017 08:06:45 -0800 (PST) X-Google-Smtp-Source: ACJfBosNLE46LvnnyzON01uxfYzHL22RRY2w480HVK4XgtBg1BY1oGRnzjRaDfBJgZsFli9GGlZb X-Received: by 10.55.91.70 with SMTP id p67mr1275453qkb.74.1513008405819; Mon, 11 Dec 2017 08:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513008405; cv=none; d=google.com; s=arc-20160816; b=VzYIsavRUHEFmkjOvMMObm2yYtWBTX6ymOHrWwQsSXyhqopNAgo2NzXcJYhTUaiwUa XFMMo2RMmBH6Dp1l2ye18CIy+sN19zhVSRK1PBulgyF+oVXmkdg7QjMNgPBELWO8IAEw KVZ5lye5lwzAjrs2X9V2llwyEIuIhYV+LfwR8hfJPtq/VyvevlZwOK03NZaa2iOd+XDf M1XJx8O7CxhrbU6FLUwJNZyuEif3aDjjM8PeFJ00mA9RJlWnq6TKynbYvUzxiWMQtDO+ hq/+AOQWWeDKUTcOlYeOjx6P9GjYMuc4OjknTHHu50z6ZNvlvDEG6irC3wqMCwPTM1wL d2Xw== 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=phomNCLpyS/LQqkpzsO1+gZjZNA2E8pO3UG3Gh+wJcw=; b=GLVfttF6WDeUTGjeW6xwGMdSBwtfPGMzvrc69XWFekluyJ2znAPwHyChH/z+Qcdb5Z pEhBnJh1VWbrq/5z17pslsGmFHUHw83sHxm5+epgTRA1c2gk4x/hGAFHBL2mV5Y9Qd1C fSFIryYnoBMPTvXofAVMSVDzszCie6FXtxT3i4W3tsZcZkz1XCK7mcijDVv3NpccYOnI ZyJ/OLLf8/m4yD+qBHcpZdmVtGOD41pUK8+/6NUVbVIFow8JitcvgGPeNJTjoSDg50uq yiqk+pe4OEy01R3fW/ck1bcKNkbXUq74PL0RR8a4MJc0Kzu6kxCkZiN3yEXyQd2oc5lP CuSw== 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 n128si311101qka.348.2017.12.11.08.06.45; Mon, 11 Dec 2017 08:06:45 -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 67B4A6096B; Mon, 11 Dec 2017 16:06:45 +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,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 7336C6097E; Mon, 11 Dec 2017 16:01:06 +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 2FA5560963; Mon, 11 Dec 2017 16:00:35 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id C8AEA60953 for ; Mon, 11 Dec 2017 16:00:18 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward104o.mail.yandex.net (Yandex) with ESMTP id AFC9B703EF7 for ; Mon, 11 Dec 2017 19:00:17 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 86VsYyehP4-0H1iZ5UT; Mon, 11 Dec 2017 19:00:17 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BifhbGdIDb-0HTOUh4r; Mon, 11 Dec 2017 19:00:17 +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: Mon, 11 Dec 2017 19:00:06 +0300 Message-Id: <1513008012-9231-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513008012-9231-1-git-send-email-odpbot@yandex.ru> References: <1513008012-9231-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 335 Subject: [lng-odp] [PATCH API-NEXT v1 8/14] 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 Reviewed-and-tested-by: Matias Elo --- /** Email created from pull request 335 (muvarov:devel/api-next_master_merge) ** https://github.com/Linaro/odp/pull/335 ** Patch: https://github.com/Linaro/odp/pull/335.patch ** Base sha: 630d8422564ebf4991b468cb38a29e9483fc2ec2 ** Merge commit sha: 2de2af9eca01b713e51c66fee7a5c7e535502f85 **/ 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..db2a8b0f2 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, 5, 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);