From patchwork Wed Mar 25 18:03:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 46328 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5623021584 for ; Wed, 25 Mar 2015 18:04:43 +0000 (UTC) Received: by wibdy1 with SMTP id dy1sf92966wib.3 for ; Wed, 25 Mar 2015 11:04:42 -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: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=DtYR+D2KEQtLVimooZ39td9IuhUmw3X3VgokRUNX4p0=; b=df9kVjbOoCJ1slyeFtlkhjZqv5Ph1/UdlhWbeeKFW28d8s3AIjrxLk7bO9Sh5JqChQ RkDld7gEPWUaxgkxc3LJa6amQsoKJ+nGLfQ7cxXh8FwcrmHvw99ztNsQsqdcKw10K5+k 9GoNzw38AVfMpJUftKY7LxyM+oAo9sNVELQkT/SvF1QiQjtLn+hAA/950AeBgzB26oxe ikczAqNWgE3D3tb3EDOO0jdoHPOprK+okKGhDLMUEKEL8UrEW4lcH82sFS/8HVhzd/no H9r5nZQAqcXuUINkjsMHvWcgJ5mXqNCx3o5+Ge3xVwLzpjvRJWLBdaYOHvAF0RjN0qDB 1lEw== X-Gm-Message-State: ALoCoQkT0Aowc9HjCmvZgCx2mwKsUje771Kv6KPeRGshkDWoD1CgsLXYHdp8GFIVwN4bj3wqfNHL X-Received: by 10.194.95.67 with SMTP id di3mr2392696wjb.0.1427306682602; Wed, 25 Mar 2015 11:04:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.104 with SMTP id r8ls128312lar.48.gmail; Wed, 25 Mar 2015 11:04:42 -0700 (PDT) X-Received: by 10.112.210.230 with SMTP id mx6mr9761997lbc.64.1427306682295; Wed, 25 Mar 2015 11:04:42 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id cv3si2569391lbb.138.2015.03.25.11.04.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 11:04:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbcmq2 with SMTP id mq2so23743654lbc.0 for ; Wed, 25 Mar 2015 11:04:42 -0700 (PDT) X-Received: by 10.112.235.227 with SMTP id up3mr182379lbc.86.1427306682196; Wed, 25 Mar 2015 11:04:42 -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 k9csp120437lbq; Wed, 25 Mar 2015 11:04:41 -0700 (PDT) X-Received: by 10.52.166.12 with SMTP id zc12mr10871948vdb.74.1427306680268; Wed, 25 Mar 2015 11:04:40 -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 ac5si4092924vdd.84.2015.03.25.11.04.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Mar 2015 11:04:40 -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 1Yapew-0001uB-Em; Wed, 25 Mar 2015 18:04:06 +0000 Received: from mail-oi0-f42.google.com ([209.85.218.42]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Yapeq-0001u4-Qf for lng-odp@lists.linaro.org; Wed, 25 Mar 2015 18:04:00 +0000 Received: by oier21 with SMTP id r21so28574774oie.1 for ; Wed, 25 Mar 2015 11:03:55 -0700 (PDT) X-Received: by 10.202.218.135 with SMTP id r129mr8209109oig.26.1427306635454; Wed, 25 Mar 2015 11:03:55 -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 d143sm2504152oib.26.2015.03.25.11.03.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Mar 2015 11:03:54 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 25 Mar 2015 13:03:49 -0500 Message-Id: <1427306629-28828-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [RFC API-NEXT PATCHv2] api: pool/packet: proposed user metadata APIs 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.174 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 --- 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 | 12 ++++++++++++ include/odp/api/pool.h | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) -- 2.1.0 diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index a31c54d..28182cc 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -467,6 +467,18 @@ 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 and size of user metadata associated with a packet + * + * @param pkt Packet handle + * @param udata_size[out] Number of bytes of user metadata available + * at the returned address. If supplied address + * is NULL on input, no size is returned. + * @return Address of the usermeta data for this packet + * or NULL if the packet has no user metadata. + */ +void *odp_packet_user_metadata(odp_packet_t pkt, uint32_t *udata_size); + +/** * 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..47a50fe 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -82,7 +82,9 @@ typedef struct odp_pool_param_t { } tmo; }; - int type; /**< Pool type */ + int type; /**< Pool type */ + int udata_size; /**< User metadata size in bytes. Applicable only + for type ODP_POOL_PACKET, ignored otherwise */ } odp_pool_param_t; /** Packet pool*/