From patchwork Wed Jan 31 14:00:01 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: 126333 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp755242ljc; Wed, 31 Jan 2018 06:00:40 -0800 (PST) X-Google-Smtp-Source: AH8x224FqoibvZ9c4Ms3Yj3rEgp5HANCNnFG5cKbZB0UB8UMAU7IGDIzbXDmwp+IGb8JPeUhugW4 X-Received: by 10.233.230.67 with SMTP id x3mr13212369qkl.202.1517407240678; Wed, 31 Jan 2018 06:00:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517407240; cv=none; d=google.com; s=arc-20160816; b=wKFFMrUXvFGZ7CjYWSAsdhwC6vwWQFIYkn/mZGsiRItsBNNRSrVeuWMLraOPPynH9I aJTV/dgZ/I3PxJB9eiz8hdOfzZVWE8W2tLwjw79rzv4i9TW0TG/j/1Wz2dv2LwLLeRDj me6wfYQfNAJlEMC67JZv0aCwI8S6NoCddwjtUkcoj7q20oIvngkpcUoxMY0pMpMDAuot ORXqI46qmWw4ePsSC8SR2GY0P+xMttSwFbz83covaxw2UGI+rTHYi4COVv2neUs8jdGD LfsnUvDr3O53VIStlygvvjum0rWANMLcTEopuD4H3wVhCcPxhiBW05ldX8gdDR2pvYm2 fdww== 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=GZu2VpHLMaMBAKFFWY/Ef19XNB+1uexS6KfdrpEBIbI=; b=a5JLaFPSYWd/pxJbsf2tx8WabadRB3TajEUNDjqvJVTCxfVNdPgwiP+NoxGG+UZuDN QQjS4bcwGTPLMucOxVEpXTZ5pw5m+vVl851AU+5HvoNUxSbGIhqgvxkSHyc96jo7kTOG ktHHkdDQEreWu4yGqYcAD/fOdJjOWtenPNp1whqSLHLfTRRUOS7OA9/kCazblfB176bK QDgERsmd6OQ5+IYVkX/DDwgPCqq3uOZNAnTqAzqGIHEX+gmpMpdnoVCtfWU98zR+FQ0m /VCwv+CxBMLTg3fjfdq7fHO5i1b+haGWRm6iKtGEDX0rSUvf7urxC3deHvfIEAdBvPXl PQ6Q== 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 o56si4787382qto.84.2018.01.31.06.00.39; Wed, 31 Jan 2018 06:00:40 -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 29A5461794; Wed, 31 Jan 2018 14:00:39 +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 3DA22608EC; Wed, 31 Jan 2018 14:00:25 +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 5C89360C56; Wed, 31 Jan 2018 14:00:17 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id ABBC360872 for ; Wed, 31 Jan 2018 14:00:14 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 32B282A25464 for ; Wed, 31 Jan 2018 17:00:13 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ROHoIzoH4n-0DOup0Bm; Wed, 31 Jan 2018 17:00:13 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nmVaH0g7bK-0CVuoDRk; Wed, 31 Jan 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: Wed, 31 Jan 2018 17:00:01 +0300 Message-Id: <1517407211-19105-2-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 1/11] linux-gen: packet: use inlined flow hash and ts set 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 Use inlined version of flow hash set function. Also changed API to use inlined timestamp function, so that the same function is not implemented twice. 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_packet_internal.h | 7 +++++++ platform/linux-generic/odp_packet.c | 6 ++---- platform/linux-generic/pktio/dpdk.c | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 01e0cae17..32e41d7f5 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -331,6 +331,13 @@ static inline int packet_hdr_has_ipv6(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->p.input_flags.ipv6; } +static inline void packet_set_flow_hash(odp_packet_hdr_t *pkt_hdr, + uint32_t flow_hash) +{ + pkt_hdr->flow_hash = flow_hash; + pkt_hdr->p.input_flags.flow_hash = 1; +} + static inline void packet_set_ts(odp_packet_hdr_t *pkt_hdr, odp_time_t *ts) { if (ts != NULL) { diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index a4cd05f62..8d6185987 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1352,16 +1352,14 @@ void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - pkt_hdr->flow_hash = flow_hash; - pkt_hdr->p.input_flags.flow_hash = 1; + packet_set_flow_hash(pkt_hdr, flow_hash); } void odp_packet_ts_set(odp_packet_t pkt, odp_time_t timestamp) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - pkt_hdr->timestamp = timestamp; - pkt_hdr->p.input_flags.timestamp = 1; + packet_set_ts(pkt_hdr, ×tamp); } /* diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 6fd4b1924..4ae72e10a 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -483,7 +483,7 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, pktio_entry->s.config.parser.layer); if (mbuf->ol_flags & PKT_RX_RSS_HASH) - odp_packet_flow_hash_set(pkt, mbuf->hash.rss); + packet_set_flow_hash(pkt_hdr, mbuf->hash.rss); packet_set_ts(pkt_hdr, ts); @@ -723,7 +723,7 @@ static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, pktio_entry->s.config.parser.layer); if (mbuf->ol_flags & PKT_RX_RSS_HASH) - odp_packet_flow_hash_set(pkt, mbuf->hash.rss); + packet_set_flow_hash(pkt_hdr, mbuf->hash.rss); packet_set_ts(pkt_hdr, ts);