From patchwork Tue Jan 30 15:59:59 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: 126266 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3484608ljd; Tue, 30 Jan 2018 08:00:37 -0800 (PST) X-Google-Smtp-Source: AH8x226Y80xTWYlPy0M/3EBY5SYHmcqFIlVA+hwk7Bm7PkFVYPz8QMYy8gvIzChuVF5E+zQ+0LsJ X-Received: by 10.129.183.8 with SMTP id v8mr20325935ywh.68.1517328037026; Tue, 30 Jan 2018 08:00:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517328037; cv=none; d=google.com; s=arc-20160816; b=X6YyWb+Ckk/MiiYcwiew1jFAJS3Tw02JhtFPzjkOgRMFbq81y0xWXwUX/aJ3FK+sOz YJABrJ99U/iAIR6by7luik5R4ymZeJMomZW8wMeTdlk4rt30oP0rc3pKDWV7/WlGY18i edAPcSMRaECR8Ymz3Foen13bnNydGwc9ig+HzkHikaFkqzjjkndOTaFpg9y62TsZEq4x j4ZFlnWhPNc7M6SgWy/z+XtZSbgRk+sVA5Lzx9STv5I1qIsctQVN0AsQsF8ueKB589HP EN413knASMw456dy+IQm1kMufdVe7nibHg27kMAbu1NiD36WzapDZkWQL5ktNXkwYVBR 10gw== 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=6CWwJlXk//Uh2ypzXYhgCxq7M8lwlyieHz3Yl9TT9u8=; b=RpvY2pOIcE8/vC8+F2D92MRYQmbs8IMXEJxS5oSy5L/hMVi0z5pDsvg5bmlFOIuiF9 rdIjG2cCXi2+ZNkqkisUx8VIROde2jAlXZjZZKzpY9+hBF5pdR9u0mMORXSJ53AT6czT Ak4qrBN+C0sINnnMvAju8HBylx0HkTvy7YX+0lEClrqqZwkVUVcMLDUsKHvVkTTCig6d 16EI+tYkCLM4SMEwmDLMPLkW1EI+Rvyj81P/c3KOOsEuAjRa/2ryJw45oSlld9yPgYXV bkXVnNtkNVXEkMe1wLw8mg+Sk35VrcsvOqDgf1s16u1erOnlWIyb2cTqaX/Nn6kWzNNB u6NQ== 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 s65si121149qks.124.2018.01.30.08.00.36; Tue, 30 Jan 2018 08:00:36 -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 981D161704; Tue, 30 Jan 2018 16:00:36 +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 5525061508; Tue, 30 Jan 2018 16:00:24 +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 292516104E; Tue, 30 Jan 2018 16:00:16 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id BCAC960A6E for ; Tue, 30 Jan 2018 16:00:13 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 1FE9C182C99 for ; Tue, 30 Jan 2018 19:00:12 +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 wI4360CiMR-0CnuO3OY; Tue, 30 Jan 2018 19:00:12 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Nz8CQ597Mi-0BRC6GuA; Tue, 30 Jan 2018 19: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: Tue, 30 Jan 2018 18:59:59 +0300 Message-Id: <1517328009-16379-2-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 1/11] linux-gen: packet: use inlined flow hash 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: ab7875c186fe80cfe103c5be5634b0eda312aed4 **/ 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);