From patchwork Thu Feb 22 14:00:06 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: 129247 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp626854lja; Thu, 22 Feb 2018 06:01:18 -0800 (PST) X-Google-Smtp-Source: AH8x225j6hC4j3gTNiCQKrJuO/riHnMvu0i1q5qW/YjlVTgj0aSYbo5hoibYr0j588Eknb5Uyn/n X-Received: by 2002:a25:c2c3:: with SMTP id s186-v6mr4573582ybf.205.1519308078110; Thu, 22 Feb 2018 06:01:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519308078; cv=none; d=google.com; s=arc-20160816; b=yL2cSXgj7FSd28PoViQDImWF+3boqielj3feJnAg2nGZF6Mng+mGrzmmY17kvJgXuG HR+FX0lJOjNv7B7oHrql2nF+VVyL5reDZtxvXPHVWjhVLQbJKvCzeusDWYbkdA7xqgtd Qnsu6i5UlfSotPttZBHGl8b2nXL1PffUOih/flsM5KY4htj/IDD641q++tWXFXtIVEUw mTnvR0Nn1HYHJujdw1Q9q0wRm/FwJOFPclAVCQODYCPvXBw1iyWiOvs/hrb5EZLKgcKL 9BWFaKQ+bM8X/YQeP3XLrds4Ci9E+deaFvZIFInqUmcj4JM5W+Nn2ecGLu0DqGioUi3j hUFg== 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=BG8zIQ06vNUlWt7y/ht+Bjo5Rkk2f3zFgt3e0Dt6pvg=; b=d8Lb+iRhiWWxcFZz4CVF2WrXZm01NEZp8xrUVtLjLJvGXjO/QPE34h616oUH+NfVM0 9GScjTHpCitpf9yGXg6gPaey5eA0XKB1Awfn9hRnoEfIFk1wPGWwcAq4A51QBqB8NzvJ x4DR8200/XHT8jfx7m6LiHxwQ5UcqRkxlQeDhxrsIqoYu3aUmrAtkYBOytlKUXrccybD j3VX3o/ZxWuJ2iIFNW+ejq0bxN0n8rup9XfDrcXKh28jo5ZE2Fp+iGUGnApHdXrA9eqa +wo69PDLVa7X26kYuDbna8MTeQV+POKdBp4SoUe58ztezPlMnbd7QTs0iTOZOFpZueAq PMlA== 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 q37si124412qtj.451.2018.02.22.06.01.17; Thu, 22 Feb 2018 06:01:18 -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 BCBA46171D; Thu, 22 Feb 2018 14:01:17 +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, RCVD_IN_MSPIKE_H2 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 191BE60743; Thu, 22 Feb 2018 14:00:28 +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 9605661724; Thu, 22 Feb 2018 14:00:18 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 4A348616E4 for ; Thu, 22 Feb 2018 14:00:13 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 0392C40849D6 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 mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ns6dm8Nrh1-0BdKcpGd; Thu, 22 Feb 2018 17:00:11 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IAwM2n92hm-0BY4bEcC; Thu, 22 Feb 2018 17:00:11 +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:06 +0300 Message-Id: <1519308009-12837-2-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 1/4] api: packet: improve segmented packet documentation 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 Improve documentation text to be more explicit that packets may be segmented. 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 | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 079a1ae1b..746f6fbf7 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -401,30 +401,39 @@ uint32_t odp_packet_buf_len(odp_packet_t pkt); /** * Packet data pointer * - * Returns the current packet data pointer. When a packet is received - * from packet input, this points to the first byte of the received - * packet. Packet level offsets are calculated relative to this position. + * Returns pointer to the first byte of packet data. When packet is segmented, + * only a portion of packet data follows the pointer. When unsure, use e.g. + * odp_packet_seg_len() to check the data length following the pointer. Packet + * level offsets are calculated relative to this position. * - * User can adjust the data pointer with head_push/head_pull (does not modify - * segmentation) and add_data/rem_data calls (may modify segmentation). + * When a packet is received from packet input, this points to the first byte + * of the received packet. Pool configuration parameters may be used to ensure + * that the first packet segment contains all/most of the data relevant to the + * application. + * + * User can adjust the data pointer with e.g. push_head/pull_head (does not + * modify segmentation) and extend_head/trunc_head (may modify segmentation) + * calls. * * @param pkt Packet handle * * @return Pointer to the packet data * - * @see odp_packet_l2_ptr(), odp_packet_seg_len() + * @see odp_packet_seg_len(), odp_packet_push_head(), odp_packet_extend_head() */ void *odp_packet_data(odp_packet_t pkt); /** - * Packet segment data length + * Packet data length following the data pointer * - * Returns number of data bytes following the current data pointer - * (odp_packet_data()) location in the segment. + * Returns number of data bytes (in the segment) following the current data + * pointer position. When unsure, use this function to check how many bytes + * can be accessed linearly after data pointer (odp_packet_data()). This + * equals to odp_packet_len() for single segment packets. * * @param pkt Packet handle * - * @return Segment data length in bytes (pointed by odp_packet_data()) + * @return Segment data length in bytes following odp_packet_data() * * @see odp_packet_data() */ @@ -433,11 +442,14 @@ uint32_t odp_packet_seg_len(odp_packet_t pkt); /** * Packet data length * - * Returns sum of data lengths over all packet segments. + * Returns total data length over all packet segments. This equals the sum of + * segment level data lengths (odp_packet_seg_data_len()). * * @param pkt Packet handle * * @return Packet data length + * + * @see odp_packet_seg_len(), odp_packet_data(), odp_packet_seg_data_len() */ uint32_t odp_packet_len(odp_packet_t pkt); 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 * From patchwork Thu Feb 22 14: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: 129249 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp629435lja; Thu, 22 Feb 2018 06:03:04 -0800 (PST) X-Google-Smtp-Source: AH8x225xzxe+JJRqjCyGNsM1z0pWdkKlulviaU5TjZmn+cmjTf6pPCxb0oJguAl3TtOmoQdkHl6F X-Received: by 10.200.65.205 with SMTP id o13mr10623364qtm.43.1519308184313; Thu, 22 Feb 2018 06:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519308184; cv=none; d=google.com; s=arc-20160816; b=F+ePgVdAvlfuoxCkhXd1w7jU2lUsHfyf/sXUMDcVkAiRspgWbEoJja3wRughO1rBtZ IuAzEvBDToyILPAoE8eMYAX+7Vkm6jkToWQ+d9VaBjzxCpQNPwvpJaUmlWFaDkDRIE0u L7IUo++/D9QVixG4ncPeq9ieelkmMJFVjXIxx57KrqbAAjMc7ylY+6IqRkKYJH0bjgWD wPoGCTLxHKqg5n4RMHGBYu5s/b0EMS7H5IjHhJcsZS9N+yh0Cj+hlkfPx6EyvGE1MigD 2sYhLg04T++fVWeUnS1s+x31BTN7GOu6n+QPoiMo5VV/6Nd8HRykITUxj5b538bP/Dur 1LFQ== 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=AyJYxmQ1J5MIJvoY/DvD4I/qmA8SHVHM3ZIZHU9Op10=; b=F0ab49LDtYHWf0lh1VT1zgKPDNFXtlwkSxw1iWdtPr4jm6K9HkZMI/V85A1AXadQTS FuaFTZY8CfEedq4TuJWj/ji9EMmmsrso9anP1KWqHsx4s+8zqzByRxWjEXqdo98nXaSw DP5s3E0SgQArP3Uqn1NvGfAj5eDXKKoAZ51Xf8vEqYWuIO5yItXduTw8szoygunwHURi XtVQ7a2+LjcgtjDeBU8HE5cxcmR7kCiExhzjcSu7tXVdzyEhkmUduvLa3jO/7VSb5ZM6 g9FNEli5zR6/a09gKDp3uZ9s5nPYn/Irdl2iP0fd7u6ci0q9ke3rN0CD0Z6heUtnvio4 Przw== 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 k24si134054qtk.333.2018.02.22.06.03.03; Thu, 22 Feb 2018 06:03:04 -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 E0C74617B7; Thu, 22 Feb 2018 14:03:03 +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, RCVD_IN_MSPIKE_H2 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 EC8A36082D; Thu, 22 Feb 2018 14:00:43 +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 9059961741; Thu, 22 Feb 2018 14:00:22 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id E15886171F for ; Thu, 22 Feb 2018 14:00:14 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 68588705658 for ; Thu, 22 Feb 2018 17:00:13 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Y8mnS1TDkO-0DIaDv1E; Thu, 22 Feb 2018 17:00:13 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IAwM2n92hm-0CYauZCG; 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:08 +0300 Message-Id: <1519308009-12837-4-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 3/4] linux-gen: packet: implement packet_data_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 Implement the new combined packet data and seg_len function. 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 **/ platform/linux-generic/include/odp/api/plat/packet_inlines.h | 7 +++++++ platform/linux-generic/include/odp/api/plat/packet_inlines_api.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h index b6b493363..ae90ec5bf 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -63,6 +63,13 @@ static inline uint32_t _odp_packet_seg_len(odp_packet_t pkt) return _odp_pkt_get(pkt, uint32_t, seg_len); } +static inline void *_odp_packet_data_seg_len(odp_packet_t pkt, + uint32_t *seg_len) +{ + *seg_len = _odp_packet_seg_len(pkt); + return _odp_packet_data(pkt); +} + static inline uint32_t _odp_packet_len(odp_packet_t pkt) { return _odp_pkt_get(pkt, uint32_t, frame_len); diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h b/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h index d0f3adc12..76210e005 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h @@ -23,6 +23,11 @@ _ODP_INLINE uint32_t odp_packet_seg_len(odp_packet_t pkt) return _odp_packet_seg_len(pkt); } +_ODP_INLINE void *odp_packet_data_seg_len(odp_packet_t pkt, uint32_t *seg_len) +{ + return _odp_packet_data_seg_len(pkt, seg_len); +} + _ODP_INLINE uint32_t odp_packet_len(odp_packet_t pkt) { return _odp_packet_len(pkt); From patchwork Thu Feb 22 14:00:09 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: 129250 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp633890lja; Thu, 22 Feb 2018 06:06:45 -0800 (PST) X-Google-Smtp-Source: AH8x224Qi5NCWiC9OBKBfqe7b2mcHWUB73nmtdm+SWrizLtRu2rIyv8utiY319EkTcty19uRmO9b X-Received: by 10.200.81.215 with SMTP id d23mr10615920qtn.272.1519308405177; Thu, 22 Feb 2018 06:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519308405; cv=none; d=google.com; s=arc-20160816; b=NKvJXvVq6ESdeKj6NBZwHTML/CRNzWh0IHEchwxhkMsVFD6b6GuhHzP2PKxNObJ15w k8Et92ZCv9WtceX+DAWcLUVXZt/MEdsJs6GvdOcf+dQYwVLB/IyZ5Nkeh3B0y/goZUj9 nl8eThLODO/OSgvvWRiFIWkX3inh9S7TsdGxPddKljbwNsISRwD90IDGigAUZXe0KjrS MZL5ON7jLatTXESd9G+lFb5yr4MaAPZsD6fPQo+futio64wCixMR483NkBIZhoEeQEGM 8qxU6vh/fhq7wQdsuV9YUO6dKw+pj84TrzWzkEi73BKvO1k9Dv3khkH2YT2uiPSFIKeB Ywww== 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=ot+i3OXs4NnUMXO2l3SF2mymy/I9WNuAjlowGtYmdDI=; b=XuK/oA/A/OHD0D985mPcl0ML4CSBwlDe7j5K8WOJJ6tMTruLT4NHs6hw9ZK1m7rpTe G6qy941XhNNFUtxz4mOhny4MALyF0QJ+eB3JjwQAsQPW9feMFSa1d6vytLjG7ufo/Tdg BKn9H/W9qgqkQ7NLmdhvvfP9Eb9vKveLaHUOJAUpZWBMk7gc9S3X+hXiEg7L1EeQ6BXl VpVisbFXkl6rrxU15Ae1h/aaJhP9IUDgAi3YX0JN+vG1Q/tx5kVsDRgS3Kyt+9esZnjM tc0kPmcSZRzmJLvJ0wySoZXPSlrCSE6t7ly3ZEUYMlwp1N++lA5BmDQg2R45wOzLnWbC k8WQ== 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 k41si140626qta.252.2018.02.22.06.06.44; Thu, 22 Feb 2018 06:06: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 CF579617B2; Thu, 22 Feb 2018 14:06:44 +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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 3B63E6177E; Thu, 22 Feb 2018 14:01:41 +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 242E56173A; Thu, 22 Feb 2018 14:01:23 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 9D3556171F for ; Thu, 22 Feb 2018 14:00:23 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 13FDF560306D for ; Thu, 22 Feb 2018 17:00:14 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VYLh01sGDU-0DauEnKh; Thu, 22 Feb 2018 17:00:14 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IAwM2n92hm-0DYWHQOg; Thu, 22 Feb 2018 17:00:13 +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:09 +0300 Message-Id: <1519308009-12837-5-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 4/4] validation: packet: test packet_data_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 Test the new combined packet data and seg_len function. 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 **/ test/validation/api/packet/packet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index f829d0cb1..78a14800c 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -604,7 +604,8 @@ void packet_test_basic_metadata(void) void packet_test_length(void) { odp_packet_t pkt = test_packet; - uint32_t buf_len, headroom, tailroom; + uint32_t buf_len, headroom, tailroom, seg_len; + void *data; odp_pool_capability_t capa; CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); @@ -612,8 +613,13 @@ void packet_test_length(void) buf_len = odp_packet_buf_len(pkt); headroom = odp_packet_headroom(pkt); tailroom = odp_packet_tailroom(pkt); + data = odp_packet_data(pkt); + CU_ASSERT(data != NULL); CU_ASSERT(odp_packet_len(pkt) == packet_len); + CU_ASSERT(odp_packet_seg_len(pkt) <= packet_len); + CU_ASSERT(odp_packet_data_seg_len(pkt, &seg_len) == data); + CU_ASSERT(seg_len == odp_packet_seg_len(pkt)); CU_ASSERT(headroom >= capa.pkt.min_headroom); CU_ASSERT(tailroom >= capa.pkt.min_tailroom);