From patchwork Thu Apr 7 21:21:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65339 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp309834lbl; Thu, 7 Apr 2016 14:22:11 -0700 (PDT) X-Received: by 10.107.17.168 with SMTP id 40mr5372328ior.101.1460064130940; Thu, 07 Apr 2016 14:22:10 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id hj7si1333918igc.101.2016.04.07.14.22.10; Thu, 07 Apr 2016 14:22:10 -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 0CDC2619D4; Thu, 7 Apr 2016 21:22:10 +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 D7A6B6170E; Thu, 7 Apr 2016 21:22:06 +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 56D706164F; Thu, 7 Apr 2016 21:22:04 +0000 (UTC) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by lists.linaro.org (Postfix) with ESMTPS id 3ED1F6164F for ; Thu, 7 Apr 2016 21:22:03 +0000 (UTC) Received: by mail-ob0-f178.google.com with SMTP id bg3so61210787obb.1 for ; Thu, 07 Apr 2016 14:22:03 -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=25QNQC4qlHTVt5qfAR6sIRDsc6cfDg8RiwWTyR8+k1w=; b=Hok2gpe3rXlZecje+xu3TEoMJUO0c91xm4vWiyl2fQIB14sD3tsXfwIEevmHjRUdNG t5wVt73dWXBRZhSNeY5wH9erK5y7SE6JgTVWG0TPXse+WnDK6VaN8qRLz1EOZHciIHSG 9GkQIy6YATyoitXs6jPDYbIvrWPN7Gxq/9amiYR1ejK2woeLp3T8mrt8ZzanlP5R/Z9N cr0yyD6dfPG5fy30XcKnjchFM+DhStXG+631ISRFLZdsdsmF7hS9M5Msv7+r8pEHb6jt j06Zu2UYUu59dwy6w0R5Y2EECq/erqaaXUSDXk0sAxXB2WQrX7nFxwGGnGUUbBZxfEp2 mCRg== X-Gm-Message-State: AD7BkJKuzilnJmtgz7ZKZ+1H0dOk9LyNM6Q+YmUxfuixxjfr6Pi2pkl4SLtCabq3FXuSWSohfsk= X-Received: by 10.182.22.137 with SMTP id d9mr2770123obf.83.1460064122748; Thu, 07 Apr 2016 14:22:02 -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 s1sm3096649obt.26.2016.04.07.14.22.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Apr 2016 14:22:02 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 7 Apr 2016 16:21:57 -0500 Message-Id: <1460064119-21282-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 1/3] api: pktio: add user context support for interfaces 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 APIs odp_pktio_context() and odp_pktio_context_set() to permit applications to associate contexts with PktIO interfaces. Suggested-by: Bogdan Pricope Signed-off-by: Bill Fischofer Reviewed-by: Bogdan Pricope --- include/odp/api/spec/packet_io.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 466cab6..4880432 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -908,6 +908,27 @@ 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 user context pointer + * + * @param pktio Pktio handle + * + * @return Pointer to the pktio user context + * @retval NULL on failure + */ +void *odp_pktio_context(odp_pktio_t pktio); + +/** + * Set pktio user context pointer + * + * @param pktio Pktio handle + * @param context Address of the pktio context + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_pktio_context_set(odp_pktio_t pktio, void *context); + +/** * Get printable value for an odp_pktio_t * * @param pktio odp_pktio_t handle to be printed