From patchwork Wed Oct 19 15:29:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 78284 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp311449qge; Wed, 19 Oct 2016 08:36:48 -0700 (PDT) X-Received: by 10.200.34.6 with SMTP id o6mr7087225qto.88.1476891408491; Wed, 19 Oct 2016 08:36:48 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m23si24669907qtc.142.2016.10.19.08.36.47; Wed, 19 Oct 2016 08:36:48 -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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8AC5561700; Wed, 19 Oct 2016 15:36:47 +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 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 4CC9C616FE; Wed, 19 Oct 2016 15:31:07 +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 3E374616FF; Wed, 19 Oct 2016 15:30:15 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 8D2AC61700 for ; Wed, 19 Oct 2016 15:30:08 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id b81so29758468lfe.1 for ; Wed, 19 Oct 2016 08:30:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CTLP2IB//zNwHxyrW7rzNZk29dUbCgAiSdI4Akv/vxs=; b=VhwtdgPd+MhedQKdXGz5KTxA3vGPOEpwWtmRAqW3C2l3vjNKZ40rrR5J1X6Bg5KnPo eABLfhDNtwSoZtNrYB2c59n0ju6DM6oDOGVFrRU9XF1zcQ/HfvF5ST7zAV7jJCUIdasn lWGcmARbWP7ZmLoI073Q3jz6IlM/mt01DFPZL5MAVRPZ5+Eyl1NIIpJ4UF9Y+8LQtA2E XhtoB+6vUHKRymOACqD3s4szMAnkNj1Z8m8MB2DFhaOZ9IHYEeyjpq7ipNj2ps5qdpuf HfHdrRVRO2Rw79ke6aZkBIdBz5i3Od8YApuLI5KAb1YDLpvdS3VO3hdf9/X0IE81M8PC sDjA== X-Gm-Message-State: AA6/9Rlq1AjDHlc4kJT+SibM1vfSSUDFJNdl/Zk35+pCu7H5qnI+3tYMcWBt4hECgGJ9g7mVaNg= X-Received: by 10.25.28.197 with SMTP id c188mr3826232lfc.81.1476891006415; Wed, 19 Oct 2016 08:30:06 -0700 (PDT) Received: from localhost.localdomain (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id w65sm10805536lff.16.2016.10.19.08.30.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Oct 2016 08:30:05 -0700 (PDT) From: Christophe Milard To: mike.holmes@linaro.org, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Wed, 19 Oct 2016 17:29:43 +0200 Message-Id: <1476890991-4693-9-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476890991-4693-1-git-send-email-christophe.milard@linaro.org> References: <1476890991-4693-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 08/16] linux-gen: shm: new ODP_SHM_LOCK flag implementation 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" The flag locks the allocated memory (prevent swapping) The patch just exposes the _ODP_ISHM_LOCK flag of the internal memory allocator, ishm. Signed-off-by: Christophe Milard --- platform/linux-generic/odp_shared_memory.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 0513047..30ef9d9 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -44,6 +44,7 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, /* set internal ishm flags according to API flags: */ flgs |= (flags & ODP_SHM_PROC) ? _ODP_ISHM_LINK : 0; flgs |= (flags & ODP_SHM_SINGLE_VA) ? _ODP_ISHM_SINGLE_VA : 0; + flgs |= (flags & ODP_SHM_LOCK) ? _ODP_ISHM_LOCK : 0; block_index = _odp_ishm_reserve(name, size, -1, align, flgs, flags); if (block_index >= 0)