From patchwork Wed Jan 31 14:00:11 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: 126338 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp763977ljc; Wed, 31 Jan 2018 06:08:45 -0800 (PST) X-Google-Smtp-Source: AH8x224lTGOeTFS7H8dpxupfpHHAp53USUy5a0jEPm5m9qeJcCQysdKaoiqS/9WntYWrhNuuDuSO X-Received: by 10.55.138.134 with SMTP id m128mr49825446qkd.72.1517407725626; Wed, 31 Jan 2018 06:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517407725; cv=none; d=google.com; s=arc-20160816; b=ppUku7jB/Bcm8svvX6oFPSHtnZ6/CDbZYY3ZsxszIx2vySQ/mNX6MWWEK+WeyJK/SB iW+27tRCB4x5Bg25jGoXd9CbFX3jAY7fnbSKHxzfVTmwwcFL2h6lQRyL74AA3SO36c+i ZYVHjTgonU94bXbc6GFpKLO+Qwr4N4GnDlCtNer+qZxBgOOFajq8MASD43zz1ANAPQzE E7iG50pxDMz5XUxR1I3mOZKUJ5pUZEkGmlo5HWactCsrggCvXwdEzGVxsGwcrojOYf1Y cxUYgI4c0kHs9Pie1odlZOf7BzX+qz/JtftvHO2pFK7fqaC6juY5ZAF67l0c5yiFAGtY P4Fw== 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=/Z6rlnwtFrlt4pLdUYiJNywWvWgbydMUnbVbTSGddpI=; b=Wz7+x7gnzxBAJl9UEm9WY5zr56jElJMAm5mgFFr9/wQhiALxCNHOfTllNZ4MjABeNq zlDMG09m7gfc8p9tCCrq2x0G5jduEXltM9AS23+PNgSNDjQHFpLQ7VAtxlHqmc0LLaDY zSm5w/VsnIQF6p0qyv8QJZXkRxruBmFKXQ3bXyjWaffR/ZAaBJv8BX13LbHK5Z0adqNK BkR6PQvLf5xJ/sTf8JwCRDlehaUzQ4mEkdmJCZjBZCNjyyF0P+FNAygGxmXnFQwoy41h jhlhWJD/REU1d5KEZNZr+XXwihogRdPquQbrGy7stsAC2BR8oGuXoOwCC7Z0bMLVW/ae MKIg== 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 z2si147136qtd.400.2018.01.31.06.08.45; Wed, 31 Jan 2018 06:08: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 36C4D6181C; Wed, 31 Jan 2018 14:08: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, 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 3A17D617AA; Wed, 31 Jan 2018 14:01:13 +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 9D10C6176F; Wed, 31 Jan 2018 14:00:34 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id F3D8A61510 for ; Wed, 31 Jan 2018 14:00:21 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward102o.mail.yandex.net (Yandex) with ESMTP id C643A5A05796 for ; Wed, 31 Jan 2018 17:00:20 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 1gpaf6IpJM-0KniPnqK; Wed, 31 Jan 2018 17:00:20 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nmVaH0g7bK-0KV8pwaB; Wed, 31 Jan 2018 17:00:20 +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: Wed, 31 Jan 2018 17:00:11 +0300 Message-Id: <1517407211-19105-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407211-19105-1-git-send-email-odpbot@yandex.ru> References: <1517407211-19105-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 437 Subject: [lng-odp] [PATCH v2 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: 3c2134ecc18e4fd52cd526b5c067815ca73864cc **/ 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;