From patchwork Thu Feb 22 14:00:07 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: 129248 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp628249lja; Thu, 22 Feb 2018 06:02:11 -0800 (PST) X-Google-Smtp-Source: AH8x225WZgFJEmQAkDOTdj9DtBzoz1xVoprZL+oLUruC28rEtj01cv5NWdg8sGgV0QSTNO3Ecd0X X-Received: by 10.200.34.237 with SMTP id g42mr10547093qta.93.1519308131623; Thu, 22 Feb 2018 06:02:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519308131; cv=none; d=google.com; s=arc-20160816; b=WMcGkSf4OA+jo/SvCS/ldQPEDwvUP39xwe7i8kF+WOf/K0PIlWrUQiWr8gmyGt4PUw 7p/qTcaHUXj/F2YPfNyBGSGfYNB4+Dm5OPMRhIZXruBrGhIzamoJn1BEPqS+k8Kbwspi ejQ1q5flHiBoH7XlIg4y5HS76Kg+r92RoLrxrOZ5VC1Ft5peSQOZxSFd9PC7iME5E/yp EzNLPkWmgyJmguGnGXvNnjpdKqonRzx0Xdi+cuEd/qxHKDrekHgPTqM/n6kZKXXafkIb gtgAMaJCyl3JbXaSfhJ0PwqqjP5y67YvhDKNdpOJAmI1UG2M0Os4KHT+HKDTn2u+u8My vjyQ== 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=xawX9bYlhCzFdsJgKeEw/lScUOvDPLRlIdd9xl8j/Bo=; b=axSc+tHTQaAWjBfxldOsQkcyDUEHwb0I9qt9+IoXLoVeS+VsuiSuJK7AcgnHkrSctW /Byj/gd/h+Der80RilOSeb0rNNP68l8eNYD4PKo06On9tqPYo/8swTCkEI84fPeCPJ6I 3RT/8En1Iadd6LSzyrJelr3cFOVR1lBXHdVrrmtsyZ1NISRMVSdrsXQtIg2CMln7sLkt 8neiN+JJqgz64SRjsfRMf+hlRwUajdTMGvJJTmGDp6OozAbyPjYew5FPFaZD0JohvX+4 daxyNniVGf3hpm0YTxTMEKbuao7mKA5eis6VmFjoej09Etj2qsAvLYi4aMclkRbhRZeE h5+Q== 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 d58si146145qte.298.2018.02.22.06.02.10; Thu, 22 Feb 2018 06:02:11 -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 D98846179A; Thu, 22 Feb 2018 14:02: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,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 9A61060719; Thu, 22 Feb 2018 14:00:33 +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 87D1561741; Thu, 22 Feb 2018 14:00:21 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 93BD46171D for ; Thu, 22 Feb 2018 14:00:14 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 901497814E4 for ; Thu, 22 Feb 2018 17:00:12 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NuGwqRgzEq-0CkeVFO5; Thu, 22 Feb 2018 17:00:12 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IAwM2n92hm-0CYWmxGX; Thu, 22 Feb 2018 17:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 17:00:07 +0300 Message-Id: <1519308009-12837-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519308009-12837-1-git-send-email-odpbot@yandex.ru> References: <1519308009-12837-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 497 Subject: [lng-odp] [PATCH API-NEXT v1 2/4] api: packet: add combined packet data and seg len 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: Petri Savolainen Packet data pointer and segment length used often. Combine two calls into one call. One call performs better in ABI compatible mode than two calls. Signed-off-by: Petri Savolainen --- /** Email created from pull request 497 (psavol:next-packet-data-doc) ** https://github.com/Linaro/odp/pull/497 ** Patch: https://github.com/Linaro/odp/pull/497.patch ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88 ** Merge commit sha: d1c9a3d36dfe9e38ecfe7d4a52bebe13d0c01098 **/ include/odp/api/spec/packet.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 746f6fbf7..e1f2f2218 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -439,6 +439,22 @@ void *odp_packet_data(odp_packet_t pkt); */ uint32_t odp_packet_seg_len(odp_packet_t pkt); +/** + * Packet data pointer with segment length + * + * Returns both data pointer and number of data bytes (in the segment) + * following it. This is equivalent to calling odp_packet_data() and + * odp_packet_seg_len(). + * + * @param pkt Packet handle + * @param[out] seg_len Pointer to output segment length + * + * @return Pointer to the packet data + * + * @see odp_packet_data(), odp_packet_seg_len() + */ +void *odp_packet_data_seg_len(odp_packet_t pkt, uint32_t *seg_len); + /** * Packet data length *