From patchwork Tue Jul 4 22:00:03 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: 107029 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp57328qge; Tue, 4 Jul 2017 15:01:54 -0700 (PDT) X-Received: by 10.55.40.140 with SMTP id o12mr48105717qko.50.1499205714578; Tue, 04 Jul 2017 15:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499205714; cv=none; d=google.com; s=arc-20160816; b=HOZfwUCINWm3nBfLT0x0P/2DVx7M4tXV9Jwk7Kh6WnK0UESH3pR6ZuBQx9qO/hkc+K zxXAOxTi3OfjxMq9wPwZgsf8j9Fi5KP0om/v5Bh+P/GY8wu3H8UxJ0qirQqJhGlxLdDo DnHHwnOXV84vIU0Ki2t4E11TuSeDwMY0e9a5RpABmMxBspVvkRXzLKCT00xssHTFUE6M YUBxUFBkR3et2F7IwyP8F7EN2JCX6ijqmOVGROVRdtVmBobl071KlJbGsEqKKkedqUuh JMx0bCrEMTQnTUrCighmwSt/jZkJFag9Xn+Wef74+kJkyNqX3kCSLxy4AR/V8jKhfS9t 3IwQ== 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=oVypHjVCeMkh7WHfMJ5A64W1b1qwt0hAdwoN0Ev35rc=; b=ncAyEeOfW40Qgo3Vq8S6QIf74TqSy3xoLlDjJRrbUDTrlHuuqpjPbjY0SFC1rix+r0 3uXjtf+KImaDu5wUwd4oza8Q8chSjCkXd+822ZKR4h09k66M7wgZUM1GVDNpMUkRWF6C GT17LCTIOZXQJeBJChuW+nX9pAI+WunIfNXxE1/wpOPm0UbbU6P7o8+FZBlMDyRG5tlC YtWrnUrzSzwkTmjcyFp/EyIPiCXIlpIJ+6UutwAs1SzKZZtNItVZ7W3wqdCV3mI3sZH0 /P+TyxJK6aevC+QiRiJet5yl26fggHfJm57UlYlyTwOJszyXpCkR76WsfWCUB7G/aw19 /JYg== 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 v82si18225926qka.338.2017.07.04.15.01.52; Tue, 04 Jul 2017 15:01:54 -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 CB8D160C1E; Tue, 4 Jul 2017 22:01:52 +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 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 48A6E60C16; Tue, 4 Jul 2017 22:00:24 +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 7478960C06; Tue, 4 Jul 2017 22:00:17 +0000 (UTC) Received: from forward5o.cmail.yandex.net (forward5o.cmail.yandex.net [37.9.109.249]) by lists.linaro.org (Postfix) with ESMTPS id DEE106018A for ; Tue, 4 Jul 2017 22:00:15 +0000 (UTC) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:7]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id 6080820BF0 for ; Wed, 5 Jul 2017 01:00:14 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id 865171A8003E for ; Wed, 5 Jul 2017 01:00:13 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id b3wfOILtJj-0CPS5m9O; Wed, 05 Jul 2017 01:00:12 +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: Wed, 5 Jul 2017 01:00:03 +0300 Message-Id: <1499205607-30786-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499205607-30786-1-git-send-email-odpbot@yandex.ru> References: <1499205607-30786-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 67 Subject: [lng-odp] [PATCH v1 3/7] linux-gen: pktio: ipc: rx: push back not processed packets 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: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 67 (muvarov:master_ipc_fixes) ** https://github.com/Linaro/odp/pull/67 ** Patch: https://github.com/Linaro/odp/pull/67.patch ** Base sha: ceeab69f3af67701adb524c7b9757d19cefb1110 ** Merge commit sha: 6f88e14c89b861d66bb7043b22f9b299b1f73ddf **/ platform/linux-generic/pktio/ipc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 7a054962..6b631098 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -498,12 +498,24 @@ static int ipc_pktio_recv_lockless(pktio_entry_t *pktio_entry, pkt_table[i] = pkt; } + /* put back to rx ring dequed but not processed packets*/ + if (pkts != i) { + r_p = pktio_entry->s.ipc.rx.recv; + ipcbufs_p = (void *)&offsets[i]; + pkts_ring = _ring_mp_enqueue_burst(r_p, ipcbufs_p, pkts - i); + if (pkts_ring != (pkts - i)) + ODP_ERR("bug to enqueue packets\n"); + } + + /*num of actually received packets*/ + pkts = i; + /* Now tell other process that we no longer need that buffers.*/ r_p = pktio_entry->s.ipc.rx.free; repeat: pkts_ring = _ring_mp_enqueue_burst(r_p, ipcbufs_p, pkts); - if (odp_unlikely(pkts < 0)) + if (odp_unlikely(pkts_ring < 0)) ODP_ABORT("ipc: odp_ring_mp_enqueue_bulk r_p fail\n"); if (odp_unlikely(pkts != pkts_ring)) { IPC_ODP_DBG("odp_ring_full: %d, odp_ring_count %d,"