From patchwork Thu Jul 20 20:00:15 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: 108439 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2558827qge; Thu, 20 Jul 2017 13:01:16 -0700 (PDT) X-Received: by 10.55.54.17 with SMTP id d17mr4939811qka.301.1500580876895; Thu, 20 Jul 2017 13:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500580876; cv=none; d=google.com; s=arc-20160816; b=kUEhiEMXfHyjLdjgNsDal6vKzcrl8SbJfAnYmFgfcdKIcm+RExvxiobaVKIqoburIl NX3sFkw8LLwXaDtcEVR+3snYZ3ulmJl+svrgbUwaSAlZDbUHKkisoc6DDheS4hsjkE6c cL5fmuNqRe+g3jRMDy1EIUJqwnCp85KZLfKc0PISOAb7MG49GV8QwvsRr6a398tEUDqJ kFLxDDzB2xWgU3wHztN3z0vBubud6c3HxN5MOV92oeE3P6lusIJGldFMbfHPE9lU9RMe vprcQV8htl6V3N6sRnf5Q9JJAjed2hegtUP8G3omzn8pqD7T8ZfbT4DFehuXph9zUjwO 2SoQ== 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=d4PlQWTSOjNm4lzimECLWfXPaeY0PKwwBuO1ViZSioY=; b=kc5UmJjEPyemVR7kD/ZzK9K+aiSW2naxxehNFcs/8cYDSzoGuaMLqzwLzBB6ZaisZR rt2i6YHsEj6086V8jRUbViC4n1cEbe+/dpVO/Da0e0IIFUb9pVxQWyb2fYZ2fBdkrckE x4izhsWKO+Fi6EvXP6qno+7N7DLnOQdvCsz0zyQnKJqGcYmktCG0IytFgMeR05A2gl0V nYUDr92dqnJdI33KufOv06wG8+IaCPuXfxDIxeFnk1VE60zz9pRBGA5I6PYv4AKqcZvo K1rxlVy3k8KVtX56FXSv8F93hjLrV9HHesNZXuYr/3f5ztMG3xGGCC8Duabw9JR/IWYy e44Q== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w194si2452127qka.445.2017.07.20.13.01.16; Thu, 20 Jul 2017 13:01:16 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 78E6565BB7; Thu, 20 Jul 2017 20:01:16 +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 CB7D1609D2; Thu, 20 Jul 2017 20:00:32 +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 9B420644E6; Thu, 20 Jul 2017 20:00:26 +0000 (UTC) Received: from forward4p.cmail.yandex.net (forward4p.cmail.yandex.net [77.88.31.19]) by lists.linaro.org (Postfix) with ESMTPS id 0732B644DA for ; Thu, 20 Jul 2017 20:00:23 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [IPv6:2a02:6b8:0:801::ac]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id 0103B20BB8 for ; Thu, 20 Jul 2017 23:00:20 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id C9D383EC1062 for ; Thu, 20 Jul 2017 23:00:19 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id McormhNb31-0ID0AB5K; Thu, 20 Jul 2017 23:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 20 Jul 2017 23:00:15 +0300 Message-Id: <1500580816-25415-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500580816-25415-1-git-send-email-odpbot@yandex.ru> References: <1500580816-25415-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 83 Subject: [lng-odp] [PATCH v1 1/2] linux-gen: ishm fix defining directory for shm files 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: Maxim Uvarov Code missed getenv() return code check and did not use value of env variable to change default derection. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 83 (muvarov:master_shm_dir_fix) ** https://github.com/Linaro/odp/pull/83 ** Patch: https://github.com/Linaro/odp/pull/83.patch ** Base sha: 95ba4b394009d92c29c2e22f0776e90bb4c6edec ** Merge commit sha: a7d94443cbc414cd68dc576b3e3757f65aa9b789 **/ platform/linux-generic/_ishm.c | 15 +++++++++++---- platform/linux-generic/include/odp_internal.h | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c index cde2dbc3..892e889b 100644 --- a/platform/linux-generic/_ishm.c +++ b/platform/linux-generic/_ishm.c @@ -1442,9 +1442,15 @@ int _odp_ishm_init_global(void) odp_global_data.main_pid = getpid(); odp_global_data.shm_dir = getenv("ODP_SHM_DIR"); - odp_global_data.shm_dir = - calloc(1, sizeof(ISHM_FILENAME_NORMAL_PAGE_DIR)); - sprintf(odp_global_data.shm_dir, "%s", ISHM_FILENAME_NORMAL_PAGE_DIR); + if (odp_global_data.shm_dir) { + odp_global_data.shm_dir_from_env = 1; + } else { + odp_global_data.shm_dir = + calloc(1, sizeof(ISHM_FILENAME_NORMAL_PAGE_DIR)); + sprintf(odp_global_data.shm_dir, "%s", + ISHM_FILENAME_NORMAL_PAGE_DIR); + odp_global_data.shm_dir_from_env = 0; + } ODP_DBG("ishm: using dir %s\n", odp_global_data.shm_dir); @@ -1661,7 +1667,8 @@ int _odp_ishm_term_global(void) if (_odp_ishmphy_unbook_va()) ret |= -1; - free(odp_global_data.shm_dir); + if (!odp_global_data.shm_dir_from_env) + free(odp_global_data.shm_dir); return ret; } diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index dd3374b7..ec17b199 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -43,6 +43,7 @@ typedef struct { struct odp_global_data_s { char *shm_dir; /*< directory for odp mmaped files */ + int shm_dir_from_env; /*< overload default with env */ pid_t main_pid; char uid[UID_MAXLEN]; odp_log_func_t log_fn; From patchwork Thu Jul 20 20:00:16 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: 108438 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2558251qge; Thu, 20 Jul 2017 13:00:52 -0700 (PDT) X-Received: by 10.55.163.3 with SMTP id m3mr6322420qke.118.1500580851995; Thu, 20 Jul 2017 13:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500580851; cv=none; d=google.com; s=arc-20160816; b=d3+9Cj7GdZbjwvA3UL/BDhO/b2rz39CjfoMZAbWAtBI809TFuZGHAS0AoY913dSPKI Tod61J7wx+6+q4FXxYmykTubrGWBi0Esw3nk9tAi6K4T9KMaRqy4JWytQZ0pG9ZozpBU Jr3Z0kHB3cQsye8kELioMwN7Mzf+Y5k97MhzfwfUR7cYD3JJi+RoAUnaktUecyHb6Gxf nuRm442GECUKdRj/8gfJJJNVXTLjImK60Ow96x5CZuIbItwYPpIdsPwTFyYl1kPzSAAr RFi18zyB1vMKZJgeyHufzViRL9zBeQMiTocOvMFc/JNgUGFF3xUBDZ/a3Flwlu/cL3d6 YfyQ== 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=Yzu1N/u1tARYl5dsrRtVugYqeDYXM/YeaTJSnSAIDN4=; b=ok8ZY5tUaCU3dN4sVc2ktW2c6uAj0mwssCVM2wkuMmqDVfTPzgr8ZAisQBrIuDvxGB 1uiPuJLZkKiTj3cN+DMgtmnfeepx+EDY0mSz46UnXXaQSVWazkz2uJfzbkfIqq9W1c7P Uhq2UOdlQ9s4Rp9Clo0qAOPEW+h+aGQOGcf1abSZUucPLI2p9ohNYhVaEvFdFQLt8s2G TXpL0ejNh1cH9fpC8VD/hfSjFZa+oSoDDXksIvxTpTRjHL0UOqD9M0rMwhsJv1JPyKlw OuNcPDRTPjmF4BM5afi0pOUKRnyG8yvEbyYKNsXR5bImCxAX+ykTpbJlg4Hnl7tB+dpY p0WA== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m4si2490472qtf.195.2017.07.20.13.00.51; Thu, 20 Jul 2017 13:00:51 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id AB751648D3; Thu, 20 Jul 2017 20:00:51 +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 70BF9609A6; Thu, 20 Jul 2017 20:00:29 +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 921BA644E5; Thu, 20 Jul 2017 20:00:25 +0000 (UTC) Received: from forward2j.cmail.yandex.net (forward2j.cmail.yandex.net [5.255.227.20]) by lists.linaro.org (Postfix) with ESMTPS id D2801644D1 for ; Thu, 20 Jul 2017 20:00:22 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [IPv6:2a02:6b8:0:801::ac]) by forward2j.cmail.yandex.net (Yandex) with ESMTP id 70EA0206DA for ; Thu, 20 Jul 2017 23:00:21 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 213783EC1035 for ; Thu, 20 Jul 2017 23:00:20 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id McormhNb31-0KDCFwdA; Thu, 20 Jul 2017 23:00:20 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 20 Jul 2017 23:00:16 +0300 Message-Id: <1500580816-25415-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500580816-25415-1-git-send-email-odpbot@yandex.ru> References: <1500580816-25415-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 83 Subject: [lng-odp] [PATCH v1 2/2] helper: add missing pool param inits 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: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 83 (muvarov:master_shm_dir_fix) ** https://github.com/Linaro/odp/pull/83 ** Patch: https://github.com/Linaro/odp/pull/83.patch ** Base sha: 95ba4b394009d92c29c2e22f0776e90bb4c6edec ** Merge commit sha: a7d94443cbc414cd68dc576b3e3757f65aa9b789 **/ helper/cuckootable.c | 1 + helper/iplookuptable.c | 1 + 2 files changed, 2 insertions(+) diff --git a/helper/cuckootable.c b/helper/cuckootable.c index 0d46300e..32800911 100644 --- a/helper/cuckootable.c +++ b/helper/cuckootable.c @@ -240,6 +240,7 @@ odph_cuckoo_table_create( if (pool != ODP_POOL_INVALID) odp_pool_destroy(pool); + odp_pool_param_init(¶m); param.type = ODP_POOL_BUFFER; param.buf.size = kv_entry_size; param.buf.align = ODP_CACHE_LINE_SIZE; diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c index 37d31e36..ac7d0587 100644 --- a/helper/iplookuptable.c +++ b/helper/iplookuptable.c @@ -192,6 +192,7 @@ cache_alloc_new_pool( uint32_t size = 0, num = 0; /* Create new pool (new free buffers). */ + odp_pool_param_init(¶m); param.type = ODP_POOL_BUFFER; param.buf.align = ODP_CACHE_LINE_SIZE; if (type == CACHE_TYPE_SUBTREE) {