From patchwork Wed Dec 14 19:33:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 88058 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp372303qgi; Wed, 14 Dec 2016 11:33:36 -0800 (PST) X-Received: by 10.31.185.144 with SMTP id j138mr26717126vkf.102.1481744016821; Wed, 14 Dec 2016 11:33:36 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p72si16054347uap.235.2016.12.14.11.33.36; Wed, 14 Dec 2016 11:33:36 -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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1EE94634FD; Wed, 14 Dec 2016 19:33:36 +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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 ECFFD62B8B; Wed, 14 Dec 2016 19:33: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 3934762C25; Wed, 14 Dec 2016 19:33:31 +0000 (UTC) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by lists.linaro.org (Postfix) with ESMTPS id 5745161638 for ; Wed, 14 Dec 2016 19:33:30 +0000 (UTC) Received: by mail-wm0-f48.google.com with SMTP id g23so129414604wme.1 for ; Wed, 14 Dec 2016 11:33:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+RqBANJJFUjZCIDgdsXAU0zSe3JEQDkw0rS+WDILOpc=; b=YeR57NtnN7ICESOm1c/lxluthAyTQt8ZW34LCIVqyU1GoLL1znvc64pse0oA5xoK/D Iun43+6WvMzl0+cwjstsYhDbDMOXI7qp6bazzPXNwIEliJTsz1impbR80RY2yVD/2/EH nncTsqYa/iQ/wLoDJoaq2/RHn6DcAK3jcujNPKCzHUnSDru8Y83xTcEWLe0A5TRCCuFQ V4QMZp5O7qnqYQf+S7yyBgb5uDDHYCWvNEn0LZrqi2vV6UhPZmtL4UXCXd3kx0yc2C6J 37sNWUIkLWM8shc15NHnIAH/sl6Zq8WTqHeOCPWYLUy+sGTajauZFgAYPu+Q1L9x/qAp jU8w== X-Gm-Message-State: AKaTC01436uek+51FVXXLqnRaolmzhcXHMllZCLWd4TZwFNfN+Ao4aGtL/k6a5Xba+28ciUq/Ws= X-Received: by 10.25.201.78 with SMTP id z75mr8625370lff.33.1481744009360; Wed, 14 Dec 2016 11:33:29 -0800 (PST) Received: from localhost.localdomain (ppp91-77-165-188.pppoe.mtu-net.ru. [91.77.165.188]) by smtp.gmail.com with ESMTPSA id c78sm10965113lfc.39.2016.12.14.11.33.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Dec 2016 11:33:28 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 14 Dec 2016 22:33:13 +0300 Message-Id: <1481743993-20672-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 Subject: [lng-odp] [API-NEXT PATCH] linux-generic: ishm: set up len for block correctly 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" Size might be not passed to that function if is is read from file. But it has to be set to provide valid number in odp_shm_info(). Signed-off-by: Maxim Uvarov --- platform/linux-generic/_ishm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.1.250.gff4ea60 diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c index 449e357..b34c70e 100644 --- a/platform/linux-generic/_ishm.c +++ b/platform/linux-generic/_ishm.c @@ -803,7 +803,9 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, /* If a file descriptor is provided, get the real size and map: */ if (fd >= 0) { fstat(fd, &statbuf); - len = statbuf.st_size; + len = statbuf.st_size; + size = statbuf.st_size; + /* note that the huge page flag is meningless here as huge * page is determined by the provided file descriptor: */ addr = do_map(new_index, len, align, flags, EXTERNAL, &fd);