From patchwork Wed Mar 25 00:53:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 46300 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 45B05214B0 for ; Wed, 25 Mar 2015 00:54:06 +0000 (UTC) Received: by lams18 with SMTP id s18sf1522856lam.2 for ; Tue, 24 Mar 2015 17:54:05 -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=eSiYqGtepuan9bMxmWLGo+C6x34w7q8WRfBZyF7WeWM=; b=dyGH5tsffG39Z5zhLJah+ezuPV8ETDCjxEyxjnjlacX1Exd9g4I5EF4rxLNWMmUzht wz5qJuuHMEmvqnpVNWRF2HFnUBfceijVUW3ca41Tcv0CDaa8TV+9rFyA7arGZadrTVHv UJAxxPYmBCIvc1SFQ8HvTYrTjKAI+fKPZH8qHbnxKEIr2INRmU3eRmGsU9HwGdUcFxxG dI/IGGZoQ+6WjXkl/JR/avH3XWXIqvEftGqJlVXhoVD4Ks5BaAVp/Eml5uWJQZfStUza 1RJhKowjrYCao+U7rNcixl4019NMoRfDHKLqae9ZQwjQAV7Oa3j66/aWPtfTttyVgMav fDUw== X-Gm-Message-State: ALoCoQk2Q6HGd7NN+5Bwp3jprzdD5iky0vUacPQjO7LjxTdoLz2QAKlb2sFek643pfcjyavowQX3 X-Received: by 10.112.170.38 with SMTP id aj6mr1196243lbc.4.1427244845213; Tue, 24 Mar 2015 17:54:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.67 with SMTP id o3ls29382laj.67.gmail; Tue, 24 Mar 2015 17:54:04 -0700 (PDT) X-Received: by 10.152.36.101 with SMTP id p5mr6252468laj.34.1427244844865; Tue, 24 Mar 2015 17:54:04 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id lc16si668945lbb.27.2015.03.24.17.54.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 17:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by laae1 with SMTP id e1so7715554laa.2 for ; Tue, 24 Mar 2015 17:54:04 -0700 (PDT) X-Received: by 10.112.46.74 with SMTP id t10mr5933154lbm.73.1427244844527; Tue, 24 Mar 2015 17:54:04 -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 k9csp1780713lbq; Tue, 24 Mar 2015 17:54:03 -0700 (PDT) X-Received: by 10.52.32.65 with SMTP id g1mr5834407vdi.24.1427244843155; Tue, 24 Mar 2015 17:54:03 -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 a3si1240967vdd.44.2015.03.24.17.53.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Mar 2015 17:54:03 -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 1YaZZZ-0003tG-Mj; Wed, 25 Mar 2015 00:53:29 +0000 Received: from mail-oi0-f41.google.com ([209.85.218.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YaZZU-0003tA-4Z for lng-odp@lists.linaro.org; Wed, 25 Mar 2015 00:53:24 +0000 Received: by oier21 with SMTP id r21so9035990oie.1 for ; Tue, 24 Mar 2015 17:53:18 -0700 (PDT) X-Received: by 10.60.123.40 with SMTP id lx8mr5441173oeb.15.1427244798811; Tue, 24 Mar 2015 17:53:18 -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 b195sm782479oih.7.2015.03.24.17.53.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Mar 2015 17:53:18 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 24 Mar 2015 19:53:14 -0500 Message-Id: <1427244794-9964-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 PATCH] api: pool/buffer/packet: user metadata API proposal 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.215.54 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 --- 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/buffer.h | 11 +++++++++++ include/odp/api/packet.h | 11 +++++++++++ include/odp/api/pool.h | 15 ++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h index 9ad08ea..98a66ee 100644 --- a/include/odp/api/buffer.h +++ b/include/odp/api/buffer.h @@ -145,6 +145,17 @@ void odp_buffer_print(odp_buffer_t buf); uint64_t odp_buffer_to_u64(odp_buffer_t hdl); /** + * Get address and size of user metadata associated with a buffer + * + * @param buf Buffer handle + * @param udata_size[out] Number of bytes of user metadata available + * at the returned address + * @return Address of the user metadata for this buffer + * or NULL if the buffer has no user metadata. + */ +void *odp_buffer_udata(odp_buffer_t buf, uint32_t *udata_size); + +/** * @} */ diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index a31c54d..eb392e4 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -193,6 +193,17 @@ uint32_t odp_packet_buf_len(odp_packet_t pkt); void *odp_packet_data(odp_packet_t pkt); /** + * 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 + * @return Address of the usermeta data for this buffer + * or NULL if the buffer has no user metadata. + */ +void *odp_packet_udata(odp_packet_t pkt, uint32_t *udata_size); + +/** * Packet segment data length * * Returns number of data bytes following the current data pointer diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index 241b98a..57f026c 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -85,6 +85,14 @@ typedef struct odp_pool_param_t { int type; /**< Pool type */ } odp_pool_param_t; +/** + * Pool options + * Used to communicate pool initialization options. + */ +typedef struct odp_pool_init_t { + uint32_t udata_size; /**< Size of user metadata in bytes */ +} odp_pool_init_t; + /** Packet pool*/ #define ODP_POOL_PACKET ODP_EVENT_PACKET /** Buffer pool */ @@ -109,13 +117,17 @@ typedef struct odp_pool_param_t { * * @param params Pool parameters. * + * @param init_params Pool initialization options. May be specified as NULL + * to indicate default options are to be used. + * * @return Handle of the created pool * @retval ODP_POOL_INVALID Pool could not be created */ odp_pool_t odp_pool_create(const char *name, odp_shm_t shm, - odp_pool_param_t *params); + odp_pool_param_t *params, + odp_pool_init_t *init_params); /** * Destroy a pool previously created by odp_pool_create() @@ -161,6 +173,7 @@ typedef struct odp_pool_info_t { ODP_SHM_INVALID if this pool is managed by ODP */ odp_pool_param_t params; /**< pool parameters */ + odp_pool_init_t init_params; /**< pool initialization parameters */ } odp_pool_info_t; /**