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);