From patchwork Thu Mar 26 16:57:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 46373 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E08FA21584 for ; Thu, 26 Mar 2015 16:57:30 +0000 (UTC) Received: by lbbug6 with SMTP id ug6sf5830923lbb.3 for ; Thu, 26 Mar 2015 09:57:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Gw3yemYlGJmWfZihsGi4avdBYrFwfSfzaLikmHI3wdQ=; b=isz6SC/bMrXGWqiFUGUC4TjiStBlOULL1qSWeuyYWreTmbmbjQW0WSnMk49TfJXWP/ 46hk3HyUlJqKH9NjLXkdaHoC3JI27vIFNV8hRuv0tgDt8TtNv+jFIvE/cINGI7rqJlh8 Y9XC+wC8kbl2iOUGgyLVINx0ggy3ye0CXTV0YEEAHCXLvBkyHVbV3BdAJYkJdj0cABCH B88+W7ut2+5DXUmSZOtdTWrsC6TTgFavpeFBrdQAARRnPKixFgF/AEPyqzmHh/CH/A98 ulUI45UjoZzPtz5xpzq5t5RWCUY6JKZ2jh+WH1OUSZ9dlcarneBSnc+Zl0vCBFsW5VGQ QD8g== X-Gm-Message-State: ALoCoQkMdDfJ5HuBfT5ysRAJOv3xr91/zSBupSp5cDFIhitVqIw6BEnJxIrTx9HC66sEilvoRwa8 X-Received: by 10.112.166.164 with SMTP id zh4mr786181lbb.20.1427389049881; Thu, 26 Mar 2015 09:57:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.74 with SMTP id r10ls246552lag.55.gmail; Thu, 26 Mar 2015 09:57:29 -0700 (PDT) X-Received: by 10.152.198.170 with SMTP id jd10mr14079542lac.60.1427389049734; Thu, 26 Mar 2015 09:57:29 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id f2si1364779laa.142.2015.03.26.09.57.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 09:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcmq2 with SMTP id mq2so45666637lbc.0 for ; Thu, 26 Mar 2015 09:57:29 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr13860413lbb.76.1427389049430; Thu, 26 Mar 2015 09:57:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp734362lbq; Thu, 26 Mar 2015 09:57:28 -0700 (PDT) X-Received: by 10.52.230.199 with SMTP id ta7mr18189349vdc.92.1427389048061; Thu, 26 Mar 2015 09:57:28 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id xd12si7723225vdc.93.2015.03.26.09.57.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Mar 2015 09:57:28 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YbB5v-0001Jk-Ia; Thu, 26 Mar 2015 16:57:23 +0000 Received: from mail-oi0-f53.google.com ([209.85.218.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YbB5q-0001Jf-2B for lng-odp@lists.linaro.org; Thu, 26 Mar 2015 16:57:18 +0000 Received: by oifl3 with SMTP id l3so54579543oif.0 for ; Thu, 26 Mar 2015 09:57:12 -0700 (PDT) X-Received: by 10.60.52.115 with SMTP id s19mr12915997oeo.71.1427389031647; Thu, 26 Mar 2015 09:57:11 -0700 (PDT) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id b195sm4767451oih.7.2015.03.26.09.57.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 09:57:10 -0700 (PDT) From: Bill Fischofer To: petri.savoleinen@linaro.org Date: Thu, 26 Mar 2015 11:57:05 -0500 Message-Id: <1427389025-12507-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [RFC API-NEXT PATCHv3] api: packet/pool: proposed APIs for packet user metadata X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Bill Fischofer --- v3 changes: - Renamed odp_packet_user_metadata() to odp_packet_user_data() - Split addr/size return, adding odp_packet_user_data_size() - Moved udata_size to pkt structure within odp_pool_param_t v2 changes: - Moved udata_size to odp_pool_param_t - Renamed odp_packet_udata() to odp_packet_user_metadata() - Removed odp_buffer_udata(). User metadata is for packets only RFC for proposed minimal API set for user metadata support based on today's discussions. Note that all initialization and management of user metadata contents is the responsibility of the ODP application. ODP APIs that copy system metadata will also copy any associated user metadata as part of that operation, but ODP will otherwise ignore these bytes. include/odp/api/packet.h | 20 ++++++++++++++++++++ include/odp/api/pool.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index a31c54d..840e152 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -467,6 +467,26 @@ uint64_t odp_packet_user_u64(odp_packet_t pkt); void odp_packet_user_u64_set(odp_packet_t pkt, uint64_t ctx); /** + * Get address of user metadata associated with a packet + * + * @param pkt Packet handle + * + * @retval addr Address of the user metadata associated with pkt + * @retval NULL The packet has no user metadata. + */ +void *odp_packet_user_data(odp_packet_t pkt); + +/** + * Get size of user metadata associated with a packet + * + * @param pkt Packet handle + * + * @return Number of bytes of user metadata associated + * with pkt. + */ +uint32_t odp_packet_user_data_size(odp_packet_t pkt); + +/** * Layer 2 start pointer * * Returns pointer to the start of the layer 2 header. Optionally, outputs diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index 241b98a..0092132 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -76,6 +76,10 @@ typedef struct odp_pool_param_t { The maximum value is defined by ODP_CONFIG_PACKET_SEG_LEN_MAX. Use 0 for default. */ + uint32_t udata_size; /**< User metadata size in + bytes. Specify as 0 if no + user metadata is to be + associated with the pkt */ } pkt; struct { uint32_t num; /**< Number of timeouts in the pool */