From patchwork Sat Jul 29 14:04:25 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: 108943 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp1638139obm; Sat, 29 Jul 2017 07:08:50 -0700 (PDT) X-Received: by 10.237.61.16 with SMTP id g16mr14321238qtf.60.1501337330665; Sat, 29 Jul 2017 07:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501337330; cv=none; d=google.com; s=arc-20160816; b=SGy0YIkvjaMTn3OeWZTI4ZFanf7nAKeXiV16fkvLlBhoo13g51GcoVeMcGpfJdoZby iH+x1V6cVCbTDxj2LJTvMlZzF6u8LEQ9zPaMMQYFtXuOQQB36FuOeXb8pmrWL9rgwU/3 Mw4sDAsfI2kBaQIQVkR3AjR07E9zH0O/fPQIIfG3drrN6U4br0SHPUpURydW/EvdQ4so hDcM0sKio0lJQduANpsaRZ8bp+S/o582u1Qsyc3tISEZ9ETd9+ytVKwb6P4CndDrULem XgDdR20LOyhqgSwcxj/UJUbJgHMlN24a6oJ9lHaIXBYhP9q/uiQDAzX+07SGE9vLzAUX tx0w== 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=ta8lYC+7z5DTgdvuacPtGylOlwVx+ozrAgHeGO5PLnE=; b=0eu/OUeJxnqowFMZ3kx1L7Dwr8e6r5idbhYV2F2KbldEGkMFW/yjgSk6sfCWWWJVcr Qzs8ALAJg3NzaiWKqa//e0D5ORDQ72o4dIHIex62cysc8ht+kfg9uppCQqDpSCBT781l qj+Ak3RTeuYRwEM4qb9PDVdmz4yGHSJKWOS2IbY/WA1+OOtuziUGWcX0vawZzDY6wbIO XyuOxKeFt4I5LJYMjQLDI7udHNUbjmyIp74SIWplYg1EmJhq8UyvZi9Xkhe71Xt29Y4z 2FqF+X6VhRrHNv9pkDSg0BbVQhkjExxEbmno6B8laRO4Y+QnftMDrGNY49RSVnQW/Shc g8Nw== 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 n66si19173375qkf.365.2017.07.29.07.08.50; Sat, 29 Jul 2017 07:08:50 -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 4CDCF622F0; Sat, 29 Jul 2017 14:08:50 +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 6F00765CE3; Sat, 29 Jul 2017 14:05:27 +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 24475622F0; Sat, 29 Jul 2017 14:05:09 +0000 (UTC) Received: from forward3j.cmail.yandex.net (forward3j.cmail.yandex.net [5.255.227.21]) by lists.linaro.org (Postfix) with ESMTPS id 51A1262CF0 for ; Sat, 29 Jul 2017 14:04:39 +0000 (UTC) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [77.88.29.85]) by forward3j.cmail.yandex.net (Yandex) with ESMTP id 5648C20BB6 for ; Sat, 29 Jul 2017 17:04:38 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id 0A8191A800A2 for ; Sat, 29 Jul 2017 17:04:37 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jNuvJAvdk4-4bd8WtHG; Sat, 29 Jul 2017 17:04:37 +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: Sat, 29 Jul 2017 17:04:25 +0300 Message-Id: <1501337066-32268-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501337066-32268-1-git-send-email-odpbot@yandex.ru> References: <1501337066-32268-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 90 Subject: [lng-odp] [PATCH v1 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 90 (Bill-Fischofer-Linaro:pktrefs) ** https://github.com/Linaro/odp/pull/90 ** Patch: https://github.com/Linaro/odp/pull/90.patch ** Base sha: 79336f5eaee25168a5e4ad7fc0aee07395d4ca1f ** Merge commit sha: 7572a3f8658171fac22a3770b32be6795a1861a8 **/ 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);