From patchwork Tue Jan 30 16: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: 126276 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3495892ljd; Tue, 30 Jan 2018 08:12:33 -0800 (PST) X-Google-Smtp-Source: AH8x2256HCy6fAq+yjLN9rLhyT8X6Rn1XNHrF9g32oVynCp1StMdYF0UxQml8sb2cQ93RscoUYwa X-Received: by 10.55.7.2 with SMTP id 2mr27676155qkh.244.1517328753211; Tue, 30 Jan 2018 08:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517328753; cv=none; d=google.com; s=arc-20160816; b=ikmRHyW8QALKBNk2Ne9ZfEgyLkvtet6vNbO9E6LnboHk8qRR4bcAED5FVOtJIueqxa 7Ji2RtMxL7RKXNrFaxyebD5rOdQSwSjYspNzKW80qm1A7s/yN9qUmY5IqshndsvYAzoE AFj4KciQGXkVrnlCHvGdglangV0gm9R9XV4bRIRXr0SodUpSNjp4n2KUOZLt+DjG6Peb A3IEpFEpGwG1gPYJt93KETOOHcrH3S8SBj4g6//bY1aBTu62iKf1SrBDt3dznKZZavpP BGpDT7Yksg7a2CikLO1VspK/uGWNNYd3uTlgP/WzWzP7OE2ZSLI07Ck5uR9vjuEhQEtw +hDw== 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=6sfYmBdOcJLXGbJEmxkTWap9yGD+vbofksnWNNcwQ8g=; b=wiaz6Xc+Tt7rWb8YnkRn+GpsOQw9G6afzDL5q2j7SW02uK8OoCUqeq9WJ3pD43MaUA y9/k7I73UX4OgDHEyuF830rSXcmCEqsW5f9Yu5UwwY4GmshSpn/CYPOyAMlfiByX9nYM onZQlZjmJdY4qxYkY3ugmvlMBfZ20/j4piIzi75dK85Sl2XoxqsMlZB7yuYm+7BIU86J c+jkPcgs5X0huj1COB/C1jm+W6AVcDlx6yRog1wkWJji5qgcsNseoTFmiFbEEysZk+gA 322LrgDCgBO7MIeuwa41xd+hqQeu8UlQEBXhp39+y7tJg0DcbgC/2HULQgXt8VVn3YKQ iMHw== 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 w33si827938qtj.345.2018.01.30.08.12.32; Tue, 30 Jan 2018 08:12:33 -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 DB41061807; Tue, 30 Jan 2018 16:12:32 +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 AFDB661780; Tue, 30 Jan 2018 16:01:29 +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 80973616E3; Tue, 30 Jan 2018 16:00:37 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id B931F6077E for ; Tue, 30 Jan 2018 16:00:23 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward100o.mail.yandex.net (Yandex) with ESMTP id B81622A224E5 for ; Tue, 30 Jan 2018 19:00:18 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NizUsJP8DF-0IGikoYd; Tue, 30 Jan 2018 19:00:18 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Nz8CQ597Mi-0IRusqat; Tue, 30 Jan 2018 19:00:18 +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: Tue, 30 Jan 2018 19:00:09 +0300 Message-Id: <1517328009-16379-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517328009-16379-1-git-send-email-odpbot@yandex.ru> References: <1517328009-16379-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 437 Subject: [lng-odp] [PATCH v1 11/11] linux-gen: packet: inline packet input index function 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 Inline packet input interface index function which may be used frequently. Signed-off-by: Petri Savolainen --- /** Email created from pull request 437 (psavol:master-packet-optim) ** https://github.com/Linaro/odp/pull/437 ** Patch: https://github.com/Linaro/odp/pull/437.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: ab7875c186fe80cfe103c5be5634b0eda312aed4 **/ platform/linux-generic/include/odp/api/plat/packet_inlines.h | 8 ++++++++ platform/linux-generic/include/odp/api/plat/packet_inlines_api.h | 5 +++++ platform/linux-generic/odp_packet.c | 5 ----- 3 files changed, 13 insertions(+), 5 deletions(-) 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 dc7d464f2..0704abb2f 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -22,6 +22,7 @@ #include #include +#include #include @@ -89,6 +90,13 @@ static inline odp_pktio_t _odp_packet_input(odp_packet_t pkt) return _odp_pkt_get(pkt, odp_pktio_t, input); } +static inline int _odp_packet_input_index(odp_packet_t pkt) +{ + odp_pktio_t pktio = _odp_packet_input(pkt); + + return _odp_pktio_index(pktio); +} + static inline int _odp_packet_num_segs(odp_packet_t pkt) { return _odp_pkt_get(pkt, uint8_t, segcount); 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 95adec66f..c451c4d6c 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 @@ -48,6 +48,11 @@ _ODP_INLINE odp_pktio_t odp_packet_input(odp_packet_t pkt) return _odp_packet_input(pkt); } +_ODP_INLINE int odp_packet_input_index(odp_packet_t pkt) +{ + return _odp_packet_input_index(pkt); +} + _ODP_INLINE int odp_packet_num_segs(odp_packet_t pkt) { return _odp_packet_num_segs(pkt); diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 1909bae25..9c3be1bcc 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1269,11 +1269,6 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, uint32_t *len, * */ -int odp_packet_input_index(odp_packet_t pkt) -{ - return _odp_pktio_index(packet_hdr(pkt)->input); -} - void odp_packet_user_ptr_set(odp_packet_t pkt, const void *ctx) { packet_hdr(pkt)->buf_hdr.buf_cctx = ctx;