From patchwork Thu Jul 20 18:00:06 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: 108432 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2451034qge; Thu, 20 Jul 2017 11:07:35 -0700 (PDT) X-Received: by 10.237.32.141 with SMTP id 13mr6574251qtb.41.1500574055845; Thu, 20 Jul 2017 11:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500574055; cv=none; d=google.com; s=arc-20160816; b=AiT+/bqex7zwaUACyrYvZ81SdAVymQ83AkuCLS+sOcOaq/6wGNnadAcBQiGehhGmEX unMx3QqFIlOR5wOrJ7yfngX8N2Vj3HHsdaNoVlZzCdqKuLlerkLCChHML7+ZTGqXB3fP 6SWN2+4pU8vLa+hsN9N2VrU79ZV1oHV4V8iB59prKeR54jtBkSR1EH9C8bwBWj8XYHTu 40k9Jy/q2lttnUXBPRRBxp7zr/B3pYJK7s2c1pAH+O9sweHfyAHjPdvQFSmjDrrublCm uJOi9LyjMGuODYXfcmI3/6+OC9pGhcS5Q72+xw+qDao+GEhgGm6WCe/Szjo/I67YFdm2 6IIg== 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=8Tt19deuuIApu7KJMbNapNHD9p5LLSLGXGhr6bkQVQ8=; b=Thz7ivGkRlr1hzpVwrsA2uHVOayTxjp3Mk14JUqht89xqy+jRXYawwPCgUPGJyt6+Z jW6GZdpMvA4WhsnjOtugBCrjjg7I3PNjoHzM7GQmNU4A3ZFSz9IhvZnpb2/ETwzjGck8 FtNpQqImGTWGA80eOb5DcBIZATU89HJROtu+HYp+gUfx20Gm9HOPCHUWh7VzsU7O4N+5 8wEKTbDgYPFWGwN0maAX93Wv2z59tzQxNE3ZJT+XHl/AbxpSJSgtdUH1CIUdpVCK4ciH zrNhmimA0lEt9YMkYseVpYecUF4TOPnelkDm+pLZdJWp1D+e1SuKypBS8tZe2Zx5L7rf O/5g== 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 m4si2330895qtf.195.2017.07.20.11.07.35; Thu, 20 Jul 2017 11:07:35 -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 74835636AA; Thu, 20 Jul 2017 18:07: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,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 728E360CE2; Thu, 20 Jul 2017 18:01:08 +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 3C795644EA; Thu, 20 Jul 2017 18:01:04 +0000 (UTC) Received: from forward4h.cmail.yandex.net (forward4h.cmail.yandex.net [87.250.230.101]) by lists.linaro.org (Postfix) with ESMTPS id C6A9160CB2 for ; Thu, 20 Jul 2017 18:00:21 +0000 (UTC) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [95.108.252.166]) by forward4h.cmail.yandex.net (Yandex) with ESMTP id 58A3820DCD for ; Thu, 20 Jul 2017 21:00:20 +0300 (MSK) Received: from smtp4p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4p.mail.yandex.net (Yandex) with ESMTP id 339436501177 for ; Thu, 20 Jul 2017 21:00:19 +0300 (MSK) Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id a46hdQ3693-0JaGQTJD; Thu, 20 Jul 2017 21:00:19 +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 21:00:06 +0300 Message-Id: <1500573607-18783-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500573607-18783-1-git-send-email-odpbot@yandex.ru> References: <1500573607-18783-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 82 Subject: [lng-odp] [PATCH v3 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: 95ba4b394009d92c29c2e22f0776e90bb4c6edec ** Merge commit sha: 01d093d362af5a52e079c622a99ae3495f68b64c **/ 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);