From patchwork Sat Apr 16 17:55:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65979 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp527881qge; Sat, 16 Apr 2016 10:55:50 -0700 (PDT) X-Received: by 10.55.117.10 with SMTP id q10mr33173031qkc.103.1460829350416; Sat, 16 Apr 2016 10:55:50 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 188si38893517qhj.38.2016.04.16.10.55.49; Sat, 16 Apr 2016 10:55: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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AD59D68786; Sat, 16 Apr 2016 17:55:49 +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_H2, 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 7DAE868780; Sat, 16 Apr 2016 17:55:44 +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 92A5B68780; Sat, 16 Apr 2016 17:55:41 +0000 (UTC) Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com [209.85.214.176]) by lists.linaro.org (Postfix) with ESMTPS id 7F5456877B for ; Sat, 16 Apr 2016 17:55:40 +0000 (UTC) Received: by mail-ob0-f176.google.com with SMTP id j9so79104464obd.3 for ; Sat, 16 Apr 2016 10:55:40 -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; bh=JvkJdQEyD/KXk88SZfr1aPTEXyBS0CMttNH9LK54UjI=; b=RaG2nlRaqupPBxsGKLAmK48c4W3iCwtiig53FLtKVptMYYSjkWWxXnlKSxBJF4omkO v1mp6bQ6E9jw91qVXLVD2GnfmkyEguzLBWoj1cEIvyGRQk4ZRlaEwK/vUVOQd95JYE3a KXw8a8n85DlKziHuZ9FBRED+LE2FzFjLyG16ZE9mGMJ8j5OjnhRBZyHuELXgSKz0ODjU W8jTtyYTk/veNb6nesytYNLqQfST21vwu3KcbpXnR0NPERlJUIZXBpxkiysALBdzc4Td zGnR35XrKWoA18LvhgO5XFHwIKm49piqWtMpIJt2D6G6XOujMiibgt5rextdseipB3IO gH1Q== X-Gm-Message-State: AOPr4FX1bGIOR5Rb61MtZEkMTyBB1jY4F8uteFWs1d9vaM5r37xPIcd9iy6Akoul3Ml1eHpTb8U= X-Received: by 10.182.2.6 with SMTP id 6mr7528964obq.26.1460829339983; Sat, 16 Apr 2016 10:55:39 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 10:55:39 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 16 Apr 2016 12:55:32 -0500 Message-Id: <1460829337-31120-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 1/6] api: pktio: add pktio index conversion API 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" Add the odp_pktio_index() API to enable applications to convert packet I/O handles to indices for managing user contexts and related associated data. Signed-off-by: Bill Fischofer Reviewed-by: Bogdan Pricope --- include/odp/api/spec/packet_io.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 466cab6..de5bc25 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -908,6 +908,16 @@ int odp_pktio_skip_set(odp_pktio_t pktio, uint32_t offset); int odp_pktio_headroom_set(odp_pktio_t pktio, uint32_t headroom); /** + * Get pktio interface index + * + * @param pktio Packet I/O handle + * + * @return Packet interface index (0..odp_config_pktio_entries()-1) + * @retval <0 On failure (e.g., handle not valid) + */ +int odp_pktio_index(odp_pktio_t pktio); + +/** * Get printable value for an odp_pktio_t * * @param pktio odp_pktio_t handle to be printed