From patchwork Thu Jul 20 20:00:33 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: 108449 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2567431qge; Thu, 20 Jul 2017 13:09:02 -0700 (PDT) X-Received: by 10.237.39.97 with SMTP id n88mr6502165qtd.78.1500581342709; Thu, 20 Jul 2017 13:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500581342; cv=none; d=google.com; s=arc-20160816; b=PZQlZOvJkMCtsyZ5s/AO0c8iK8qB/o0PGIjSxPBTfQ5M65VfK8GTy3yw0MSAwxMeXE 2d5lkyJfkSyvrtSuAArPyg4h2wogLlE/okOA9dREt8MgC9+yZMXkhlCi2UDKVmS4chkq plCCWWeUoEj7LnhMCZ8GC/0pLzexNL0m923Uy5zSXRpLl6L49TR94HyEpS6nnm1YxZ/E ko3I4KILsDRicQ2q1obKZhL1mUJG6/77ygeRo4HISir+009BG6t7h9x7y69s9ggSFq4z IQ0eZcChwQisCx8N9ObjpZchSLof5HVmyghPP7he+PMMCizG3qzugExAXS4WTQCERkHI kLPQ== 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=8wxHzhn84VmBmF5PKlUAHqT+NdGpF9Ad5hk5RejpfTw=; b=b+u9gE39rCWgPoOXJOwPbcYxoFab6zHvRXl4KDME0tPqVpVT8Mxh64/77uzK8z33jG 5ty6M9IQ8Pp7cfXSJEKGVnlWYXBMcyVRtd6eF9+bR+YEf89E2rpCPPrbEcZsjcmpyQPM Yg3rMoZU0eRYXquiXk9LIZoGkdevzWO0vlIEwYt4R+bcS+TBq/oCOxOTH8PVuqmgHehI jHWFkOY06FOHui1e4lFvFwG4JGp2/hdQm/4lLZsaUikOAuPVzyMT/iAc9nVcMi+Amkyg 5HMpBWMxpTUO168709ePOmWoXf8OUUI9uXfmbNlCb1ixGb2l4Z7Rzc+6U+7bnmHcF/Jd BdXA== 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 r75si2494166qka.506.2017.07.20.13.09.01; Thu, 20 Jul 2017 13:09:02 -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 CBA0965BC0; Thu, 20 Jul 2017 20:09:01 +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 078F0644E8; Thu, 20 Jul 2017 20:02:59 +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 AC72C65BE0; Thu, 20 Jul 2017 20:02:54 +0000 (UTC) Received: from forward2m.cmail.yandex.net (forward2m.cmail.yandex.net [5.255.216.20]) by lists.linaro.org (Postfix) with ESMTPS id AB797644FC for ; Thu, 20 Jul 2017 20:00:49 +0000 (UTC) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::15:6]) by forward2m.cmail.yandex.net (Yandex) with ESMTP id 60F05214EF for ; Thu, 20 Jul 2017 23:00:48 +0300 (MSK) Received: from smtp4j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4j.mail.yandex.net (Yandex) with ESMTP id 309413241060 for ; Thu, 20 Jul 2017 23:00:47 +0300 (MSK) Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 0hzMV06TG7-0lE8KUVB; Thu, 20 Jul 2017 23:00:47 +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:33 +0300 Message-Id: <1500580834-26476-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500580834-26476-1-git-send-email-odpbot@yandex.ru> References: <1500580834-26476-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 82 Subject: [lng-odp] [PATCH v4 9/10] linux-generic: ipc: cannot share references across ipc 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: Bill Fischofer When attempting to send a reference via IPC, make a copy of the packet as reference sharing is only supported within a single ODP instance. Signed-off-by: Bill Fischofer --- /** Email created from pull request 82 (Bill-Fischofer-Linaro:pktrefs) ** https://github.com/Linaro/odp/pull/82 ** Patch: https://github.com/Linaro/odp/pull/82.patch ** Base sha: 3eeb249a4774f12d2d16ca349a591654eae620ae ** Merge commit sha: f6e0d4b8b10f1803fb4513254c404df31e3f9f3f **/ platform/linux-generic/pktio/ipc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index bc7d7564..8c7db84e 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -592,7 +592,9 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, _ipc_free_ring_packets(pktio_entry, pktio_entry->s.ipc.tx.free); - /* Copy packets to shm shared pool if they are in different */ + /* Copy packets to shm shared pool if they are in different + * pool, or if they are references (we can't share across IPC). + */ for (i = 0; i < len; i++) { odp_packet_t pkt = pkt_table[i]; pool_t *ipc_pool = pool_entry_from_hdl(pktio_entry->s.ipc.pool); @@ -602,7 +604,8 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, pkt_hdr = odp_packet_hdr(pkt); pool = pkt_hdr->buf_hdr.pool_ptr; - if (pool->pool_idx != ipc_pool->pool_idx) { + if (pool->pool_idx != ipc_pool->pool_idx || + odp_packet_has_ref(pkt)) { odp_packet_t newpkt; newpkt = odp_packet_copy(pkt, pktio_entry->s.ipc.pool);