From patchwork Sat Apr 16 17:55:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65980 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp527994qge; Sat, 16 Apr 2016 10:56:20 -0700 (PDT) X-Received: by 10.140.248.8 with SMTP id t8mr34354226qhc.50.1460829380559; Sat, 16 Apr 2016 10:56:20 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l185si16820783qke.121.2016.04.16.10.56.20; Sat, 16 Apr 2016 10:56:20 -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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0DFD168782; Sat, 16 Apr 2016 17:56:20 +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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 CCDC268783; Sat, 16 Apr 2016 17:55:45 +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 3EBBB68780; Sat, 16 Apr 2016 17:55:42 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by lists.linaro.org (Postfix) with ESMTPS id 4BE036877E for ; Sat, 16 Apr 2016 17:55:41 +0000 (UTC) Received: by mail-ob0-f181.google.com with SMTP id bg3so79152516obb.1 for ; Sat, 16 Apr 2016 10:55:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cRPjn/rINGYLWcq+aqi4mYIUvDihuW03ZG8/+T2BHLI=; b=e1cjj1uZbzdxmFz67dcQGkDmmPmN/B4IZ6iCdmYL2ho7Hobj4WRLsuAf8iqg7g6O/q jaE0c5LG0EZc23JnnNakA+zF7o/UymMF018bwQZ9MKu0sTobzSzqnJFK93cwEEF2Q56w 4F1ugo0k3CwMj5fISPk2sAd+uUS4inRlV091IsEvrVOi7A0TBpR7avcmw0sXUC7MfaNn iuaR8g+z5dJ1dWyYC9Usw1fI5oYvGItngZr3bt4t1GUbMfitWDwiISlNOfJuew7E5sFL LIWZHvdJ3arnsId00dtOnhV3/Lfvey4CB6ewF18ZsAAv5jvrI+gFm5nAWx9oL3r8ODhU 1Ggg== X-Gm-Message-State: AOPr4FXZ1M3GIEW1jKhC2hHXqC3pBlpV/DAywuBSypoUyRD0m7FbFZhVi4XFjjHJuAaeAFdkz5A= X-Received: by 10.182.233.100 with SMTP id tv4mr10752966obc.34.1460829340870; Sat, 16 Apr 2016 10:55:40 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id k125sm16528743oia.21.2016.04.16.10.55.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 10:55:40 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 16 Apr 2016 12:55:33 -0500 Message-Id: <1460829337-31120-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460829337-31120-1-git-send-email-bill.fischofer@linaro.org> References: <1460829337-31120-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 2/6] linux-generic: pktio: implement pktio index conversion function 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bill Fischofer Reviewed-by: Bogdan Pricope --- platform/linux-generic/odp_packet_io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 574f987..472efc6 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -921,6 +921,16 @@ int odp_pktio_info(odp_pktio_t id, odp_pktio_info_t *info) return 0; } +int odp_pktio_index(odp_pktio_t pktio) +{ + pktio_entry_t *entry = get_pktio_entry(pktio); + + if (!entry || is_free(entry)) + return -1; + + return pktio_to_id(pktio); +} + void odp_pktio_print(odp_pktio_t id) { pktio_entry_t *entry;