From patchwork Tue Aug 1 15:00:09 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: 109182 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1616210qge; Tue, 1 Aug 2017 08:09:45 -0700 (PDT) X-Received: by 10.55.126.198 with SMTP id z189mr26501667qkc.299.1501600185537; Tue, 01 Aug 2017 08:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501600185; cv=none; d=google.com; s=arc-20160816; b=XR/gb74SVgVIswV4MwcV0vnXNzthw92SFPeEpLX/5Lgqw/DzmwFKAPNCJJLXoV5Q2+ 4cCRv+/FweJVF+FaAvgPXr0D/MMXm+F0CSibfG4i0veNhx7aBZCs3GmYi5o7jYXCD7aM tc1S26ciZfWmt/cjlCt1XpZ2dCcL9hX+dxvZyJjR4j4L8otyo5liZuMylKEjzNHeO2Na UmYYs416s8NKRkDaVZjD7/iZuSYjYFFe6SwYh+krr1rYJ6q9lJ8MG//993tgqKKnS1kT +ecVgZLgrTGHP2hL79MpQFQvU/df0jDndwAYeo3NxvbHPn6Ypt6Jg11GqjXZZCWGcn4v HMKA== 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=vLKdyg3JouiBY2tso1OJ9r5YZDt6ux2+NPPZOZNjpV0=; b=tMO+TOPWtBhM1eBr5PAJCQwPQKW4niRviibLVKYVzMpa81PrmIXFtx+5mw6KGGBEiq Egt/aadEcIBDFoO3govHHx1oVI58Lpo3LhSgdGATXXxfOR/0SuU3iggPnnkGTxHem0hD zDNhyDYHd19CaQFyIfX1Tdn3erHUVL4Vw1a0sDmqkufQgqIWbo8A7Dr4o1RIku8S52jV 4vjUyvHFginC3a7KM9NzDOXBCVThaZ1RSgsQ0K2AcUs2UfFhLoKmKDPPS4VwfCoBTpN1 Lly0XgSDbJhMrt8ZvbrgeFU9dD3Do8+/5QiA4iPiKCjQhqpe4xXoj4Pg145z2v7tJIV8 CvJQ== 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 v45si25720946qta.33.2017.08.01.08.09.45; Tue, 01 Aug 2017 08:09:45 -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 37291658CC; Tue, 1 Aug 2017 15:09:45 +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 7678665C35; Tue, 1 Aug 2017 15:03:12 +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 D10786486A; Tue, 1 Aug 2017 15:02:55 +0000 (UTC) Received: from forward5o.cmail.yandex.net (forward5o.cmail.yandex.net [37.9.109.249]) by lists.linaro.org (Postfix) with ESMTPS id B92876486A for ; Tue, 1 Aug 2017 15:00:38 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id A40C12124C for ; Tue, 1 Aug 2017 18:00:37 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 9EFB73EC11A4 for ; Tue, 1 Aug 2017 18:00:35 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tyzQTD0Qgu-0Zb859lf; Tue, 01 Aug 2017 18:00:35 +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: Tue, 1 Aug 2017 18:00:09 +0300 Message-Id: <1501599610-28388-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501599610-28388-1-git-send-email-odpbot@yandex.ru> References: <1501599610-28388-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 90 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 90 (Bill-Fischofer-Linaro:pktrefs) ** https://github.com/Linaro/odp/pull/90 ** Patch: https://github.com/Linaro/odp/pull/90.patch ** Base sha: bb0ca193f8c28036fdf8b3d6c8aa5d4f11980e6c ** Merge commit sha: dfef320840f96825686124135a6e509db80b7b82 **/ 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);