From patchwork Mon Jul 31 22:00:23 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: 109070 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp726209qge; Mon, 31 Jul 2017 15:19:21 -0700 (PDT) X-Received: by 10.200.46.118 with SMTP id s51mr23212861qta.48.1501539561568; Mon, 31 Jul 2017 15:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501539561; cv=none; d=google.com; s=arc-20160816; b=mODe2FiVhPOy28Mcf40rnmdGxru6I5fBBRRj9v5wwoAMfulL7MQMX4L/juHSDKZwOn x+gqhRIyh7HPeuIhrXzQKIPTkKt/0HGjniDbUIVGWOm5bw+oyuynZUiNojWiPQPEtzqg DeUApK9cV4AdwSlFBIGIH6yRATbUtGYu39D+vnR9ChYax0jLGRzTVKNDQEd1XnTYH458 LhLQ+9neuZMHl47EldT3DWLjt2V2w73ksYySXD8wGEgT1zdoZGEyG7qHJb5OmKsVbACb WlZGS8axA+6MMXBOHqem36qe0BGxpffbtnGbt4q//3l0Eh/if7HOFvwlnsQEjYS3e4sQ D3tw== 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=KxYUF6Rb13asV214vKmdy+JUfWuUkQeb/S6W6QZREO0=; b=U+kW0GMU6+Qaj9NPyRHe+cspDMyq/2oZiGGWCZdht7cAiBua88SP1/MvQf8LNadFJa xApc2KHCPZyYyDkSzX1UAz3K934XXEMqHqsedvb+PgX0FqOsLNZxZs51U6qTq+zgU8wf D8zNuHUTzQd97I5ZHmdBC6VueBidle0DwqYeRGrCkk9MMPenPkOxPHviM+G4v9uRQewl kFSfATrHDEn4iPri1bPpo6xnAlZZBh/kQyKWRQxEssPN7wVpJOX3uWtAkeoaLbkCssct AoL4tbHAL+TGU4N7x6QP3L3aj1XXr927LPtWLmKKwPYh3Z9nP7QFhR66zqcxahMud/h8 neDQ== 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 n188si3606602qkb.219.2017.07.31.15.19.21; Mon, 31 Jul 2017 15:19:21 -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 449BD65C8D; Mon, 31 Jul 2017 22:19:21 +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 353F365D0F; Mon, 31 Jul 2017 22:03:13 +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 611CE607C7; Mon, 31 Jul 2017 22:03:00 +0000 (UTC) Received: from forward3h.cmail.yandex.net (forward3h.cmail.yandex.net [87.250.230.18]) by lists.linaro.org (Postfix) with ESMTPS id 51587607C7 for ; Mon, 31 Jul 2017 22:00:43 +0000 (UTC) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [77.88.29.86]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id 040F3210D1 for ; Tue, 1 Aug 2017 01:00:42 +0300 (MSK) Received: from smtp3p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3p.mail.yandex.net (Yandex) with ESMTP id C662613201AB for ; Tue, 1 Aug 2017 01:00:41 +0300 (MSK) Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 8MoJZRxH9x-0eUiJ4G9; Tue, 01 Aug 2017 01:00:40 +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 01:00:23 +0300 Message-Id: <1501538424-20959-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501538424-20959-1-git-send-email-odpbot@yandex.ru> References: <1501538424-20959-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 90 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. 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: 10ef82e6d4db8c02dd5caa2e97172688e829b90c ** Merge commit sha: 36402847eb872b26f40a3047205b0f38d2d3ba21 **/ 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);