From patchwork Thu Feb 15 20:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 128524 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2129059ljc; Thu, 15 Feb 2018 12:01:45 -0800 (PST) X-Google-Smtp-Source: AH8x224rMJs0ij7vxHkjj3sVy/iN8L3YBNmk+O2+EGqWpQki2Ga223M0S16Spu7ClW46nSS8p7r/ X-Received: by 10.129.158.145 with SMTP id v139mr2896914ywg.165.1518724905728; Thu, 15 Feb 2018 12:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518724905; cv=none; d=google.com; s=arc-20160816; b=Zh8qSvybM18HalCg8K7kEQZkuJHMajJFbkCfKxxufmJzkyQEF8BkUlpTy91WDXo0h+ j3E4twWUkYGy59WNYdckZqMrZ+UB/z0iTTF3RO84PKacHlfnK7XRaXypN3qs2d67QXFh +dkZhtXrerbXG4Mb96pm1rbGFIEtGU8SlefSv6txRiZd2ZY67hU2fRcWlwXc/a/HVBC8 ZeWyZGYrMoj7DvsmQbennPxT67VqKXqSyA42/F/Ws1Y7opSH/6aMtsjyeXdRofFVGdAo Y+FnxloaireSWq7yRPC2r31ieKsyWiT2jxY3jV2tSAm03/lNo1WE1m9ARMkY8amsxgvo hVjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=VUX3Ljo5WUCwSnU+C0mPdnVP2WxlOUM9tlPq6AWj/Gc=; b=IrD20ACCab49ntBHsg58RUUW1sFC3rHDoYKiY/m/QoIoQ9EAJ3Kv4cu9+GncqpQysg 5PsS4e6SS0Gtr3E3Prc885U2WbC1T8QuxqoBJmuykphXt/RwGIHdEHj0FMI5qyToQfuh /JFfNPg0Bqp/1n3RFLVCutrJfCUrPiPlqs7mvD03wcCjtCsuc2wZyl7pF8C/Trpcz6Bl ySDFBxehZ++IwUItM5DuK/0nPn8VURNBz4ymdbiY173EJ8xOaM1OVU7A+r8vqpZKhO4X uUVJttXbWDqYnt85oKksg3asNgQAZQrod2roflL21mozYtJvc+GNXsNGXbCZ84rnCNWO boNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p2si602620qte.30.2018.02.15.12.01.45; Thu, 15 Feb 2018 12:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5F7A66151E; Thu, 15 Feb 2018 20:01:45 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 EAC1C6173D; Thu, 15 Feb 2018 20:00:18 +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 D3BF36151E; Thu, 15 Feb 2018 20:00:15 +0000 (UTC) Received: from forward1j.cmail.yandex.net (forward1j.cmail.yandex.net [5.255.227.19]) by lists.linaro.org (Postfix) with ESMTPS id 1F00861506 for ; Thu, 15 Feb 2018 20:00:14 +0000 (UTC) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [IPv6:2a02:6b8:0:1402::15:6]) by forward1j.cmail.yandex.net (Yandex) with ESMTP id 6982420D05 for ; Thu, 15 Feb 2018 23:00:12 +0300 (MSK) Received: from smtp4p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4p.mail.yandex.net (Yandex) with ESMTP id 2A1DE6500F6C for ; Thu, 15 Feb 2018 23:00:11 +0300 (MSK) Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id x6ZxD9OcUs-0AKCsFCU; Thu, 15 Feb 2018 23:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 15 Feb 2018 23:00:08 +0300 Message-Id: <1518724808-28103-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518724808-28103-1-git-send-email-odpbot@yandex.ru> References: <1518724808-28103-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 486 Subject: [lng-odp] [PATCH API-NEXT v2 1/1] api: packet: add cautionary note regarding odp_packet_data() 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bill Fischofer Add additional documentation to note that odp_packet_data() only returns the starting address of the first packet segment, not the entire packet. Signed-off-by: Bill Fischofer --- /** Email created from pull request 486 (Bill-Fischofer-Linaro:pktdatadoc) ** https://github.com/Linaro/odp/pull/486 ** Patch: https://github.com/Linaro/odp/pull/486.patch ** Base sha: 4b1101adedf0941f6db34047cc06fde11fb06a34 ** Merge commit sha: 05ee3cc1ec0ef8a1e125aea0d19497c2a3a632e3 **/ include/odp/api/spec/packet.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 4be515c7b..1a3c5c8c3 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -395,11 +395,22 @@ uint32_t odp_packet_buf_len(odp_packet_t pkt); * User can adjust the data pointer with head_push/head_pull (does not modify * segmentation) and add_data/rem_data calls (may modify segmentation). * + * Note that the address returned by this routine is the starting address of + * the current first segment of the packet. For newly allocated packets the + * caller can be assured that this segment is at least the min_seg_len + * specified for the pool it was allocated from. For all other cases, the + * caller must take care that it does not attempt to address bytes that extend + * beyond the current segment length. Use the odp_packet_offset() or similar + * routines for addressing safety in the general case as these return the + * number of bytes that are valid along with the returned address. The + * odp_packet_seg_len() API can also be used to return the number of bytes + * valid from the current odp_packet_data() pointer. + * * @param pkt Packet handle * * @return Pointer to the packet data * - * @see odp_packet_l2_ptr(), odp_packet_seg_len() + * @see odp_packet_l2_ptr(), odp_packet_seg_len(), odp_packet_offset() */ void *odp_packet_data(odp_packet_t pkt);