From patchwork Thu Jun 2 11:04:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi He X-Patchwork-Id: 69147 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp53418qgf; Thu, 2 Jun 2016 04:04:36 -0700 (PDT) X-Received: by 10.55.33.40 with SMTP id h40mr35038877qkh.148.1464865476422; Thu, 02 Jun 2016 04:04:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e189si37687790qkd.257.2016.06.02.04.04.35; Thu, 02 Jun 2016 04:04:36 -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 B46C161764; Thu, 2 Jun 2016 11:04:35 +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, 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 7608161714; Thu, 2 Jun 2016 11:04:31 +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 823746173A; Thu, 2 Jun 2016 11:04:29 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by lists.linaro.org (Postfix) with ESMTPS id C45936170A for ; Thu, 2 Jun 2016 11:04:28 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id um11so5122063pab.0 for ; Thu, 02 Jun 2016 04:04:28 -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; bh=QzjSWrClB4avORKoKULE7jwTo2s1eBComnZjd27u750=; b=k/6SNL+SW4wbYOSPlVrAuascB0nBTL90MyKYchQeRLRwN8UUbEfln+K8uWPEFGMk/A /ckZkWSyR+5W8wyzfGMVFvuXQrCGBm+DA5Va5cykRnRur6oYB0PPCqaplyv4o72Ls6X7 PMtRjumSUEkLfvgt+BbvM43KtDyNt9bxmwbSji5ri5HL86D8JJec1IWXBIbo63OgvcG1 0Gvfu9lCjDcqaEBPGXZl5qY2WZAopZTXvMZ+hKmYcMmspznSyzq1iHDUNS7NmMcg7Kwp QwzaZlQmZjVEbGQnJ/EMTCQ2HQ2urorWJPAMaSnuCm0hE/tTx65hwku1Ze3nOlzMhXui gFuw== X-Gm-Message-State: ALyK8tKq+hMfAB2KqEfA4nvCaAa63woWER/LPNI+foqmGNoFjD9ufSvoHAj/5RPbRxp040ZLbMk= X-Received: by 10.66.131.75 with SMTP id ok11mr4583799pab.87.1464865467972; Thu, 02 Jun 2016 04:04:27 -0700 (PDT) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id lg17sm69402351pab.36.2016.06.02.04.04.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jun 2016 04:04:27 -0700 (PDT) From: Yi He To: lng-odp@lists.linaro.org Date: Thu, 2 Jun 2016 11:04:14 +0000 Message-Id: <1464865456-29702-1-git-send-email-yi.he@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH 1/3] linux-generic: shared memory: fix the name composition in odp_shm_free 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Fix the name composition in odp_shm_free() as the same algorithm in odp_shm_reserve(), use IPC namespace if provided or process ID in default. Signed-off-by: Yi He --- platform/linux-generic/odp_shared_memory.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 568711a..f432cf9 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -179,9 +179,15 @@ int odp_shm_free(odp_shm_t shm) } if (block->flags & ODP_SHM_PROC || block->flags & _ODP_SHM_PROC_NOCREAT) { + int shm_ns_id; + + if (odp_global_data.ipc_ns) + shm_ns_id = odp_global_data.ipc_ns; + else + shm_ns_id = odp_global_data.main_pid; + snprintf(shm_devname, SHM_DEVNAME_MAXLEN, - SHM_DEVNAME_FORMAT, odp_global_data.main_pid, - block->name); + SHM_DEVNAME_FORMAT, shm_ns_id, block->name); ret = shm_unlink(shm_devname); if (0 != ret) { ODP_DBG("odp_shm_free: shm_unlink failed\n");