From patchwork Thu Jul 20 16:00:11 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: 108420 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2326504qge; Thu, 20 Jul 2017 09:09:11 -0700 (PDT) X-Received: by 10.200.59.74 with SMTP id r10mr5499799qtf.162.1500566951606; Thu, 20 Jul 2017 09:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500566951; cv=none; d=google.com; s=arc-20160816; b=uwTNaLz4oAQGri4diSggOiWO2loAXvTNlRitSMSi5AY3NEMq4CRsOgXWsheMh3eNT7 WeQxdONV2qhOpF00w5iqcOKPWxljUXHgyunGyg6Y2nL5von5M2r/qqII+O0mCP+nFYJ+ rH+jTGK5cGk/0gErHHqKYiOT19OUe8DZFIyLXmEkg8b3Xqy7YdgRiMYDDbObilcLmCK3 AhXP3tzZ9zAwTdOPO2igwLYxsMx2hHS4hx1cR2ZGhKxAJhnUTbhZkidq2gazpLpAnQ3e m+fJtXKhDeoGLDsGRScIjyol3U+FiVIDP5MlTEEsdFxcmoqYlAqZW2DZKvvQ3hrNjr/v e29A== 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=bDkNKz128DwGCGNcwG7YbCF9Uv4kYXRjrZ3VgSPDuH4=; b=PEDZ22t1emLKcbaU3iZ9g0rZH1sydcxac8KcmSB48QI7jcS0iCa2R3W+DNVWe+XaBk O1PtjJkRomhdiFLK/CYxsFA2nZZP27BL7T7qEkNapE2u8yTCiHMBHCJclSKtJszipzX7 BWwp13Wso7uua4Hf0rGP5weaTE4F+d9pwd9rSnxsNX6B1tC6xjElkEQcBIiciN54W0jv 7aAmWKh0N6e5A2gnDknxlL/iP+5iDAPS/NMMYTfOntcL4kf3WQTo/7gRRbZm/LEBb3M9 e+Q4J7vz86lq9WMQdA0UOp49TRwaNaFyB/NCCHB7rnTqaP6Zvxawc6Qd+p61tc5OIRqw 0xMw== 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 j64si2094508qte.160.2017.07.20.09.09.11; Thu, 20 Jul 2017 09:09:11 -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 2690462C5D; Thu, 20 Jul 2017 16:09:11 +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 8A6B860C5E; Thu, 20 Jul 2017 16:01:47 +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 EAF6B648CD; Thu, 20 Jul 2017 16:01:43 +0000 (UTC) Received: from forward4p.cmail.yandex.net (forward4p.cmail.yandex.net [77.88.31.19]) by lists.linaro.org (Postfix) with ESMTPS id A4B7B60C5D for ; Thu, 20 Jul 2017 16:00:33 +0000 (UTC) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::27]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id 9B44620CB9 for ; Thu, 20 Jul 2017 19:00:32 +0300 (MSK) Received: from smtp3o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id CBB082940C4D for ; Thu, 20 Jul 2017 19:00:30 +0300 (MSK) Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id txQerfwouq-0Uw8suUI; Thu, 20 Jul 2017 19:00:30 +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 19:00:11 +0300 Message-Id: <1500566412-25432-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500566412-25432-1-git-send-email-odpbot@yandex.ru> References: <1500566412-25432-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 82 Subject: [lng-odp] [PATCH v2 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. --- /** 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: 95ba4b394009d92c29c2e22f0776e90bb4c6edec ** Merge commit sha: 4acd003a2f96f087e72d534b79cd701c1b74214f **/ 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);