From patchwork Fri Apr 15 07:21:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 65872 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1026400qge; Fri, 15 Apr 2016 00:22:01 -0700 (PDT) X-Received: by 10.55.72.148 with SMTP id v142mr23787115qka.102.1460704921563; Fri, 15 Apr 2016 00:22:01 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u80si11612961qka.78.2016.04.15.00.22.00; Fri, 15 Apr 2016 00:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id C3EB26752E; Fri, 15 Apr 2016 07:22:00 +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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 99DBD6745B; Fri, 15 Apr 2016 07:21:23 +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 0BB6467349; Fri, 15 Apr 2016 07:21:18 +0000 (UTC) Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by lists.linaro.org (Postfix) with ESMTPS id F0E646200C for ; Fri, 15 Apr 2016 07:21:16 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd001.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u3F7LFCK027054 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Apr 2016 07:21:15 GMT Received: from 10.144.19.15 ([10.144.104.112]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u3F7LEvR001646 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 15 Apr 2016 09:21:15 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Fri, 15 Apr 2016 10:21:04 +0300 Message-Id: <1460704874-21163-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460704874-21163-1-git-send-email-matias.elo@nokia.com> References: <1460704874-21163-1-git-send-email-matias.elo@nokia.com> X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 3162 X-purgate-ID: 151667::1460704875-00001B3D-DAF711F6/0/0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 01/11] linux-generic: packet: move flow_hash present flag to correct location 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Move flow_hash present flag to the same location as all the other packet input and protocol flags. Signed-off-by: Matias Elo --- platform/linux-generic/include/odp_packet_internal.h | 3 ++- platform/linux-generic/odp_packet.c | 2 +- platform/linux-generic/odp_packet_flags.c | 4 ++-- platform/linux-generic/pktio/dpdk.c | 6 ++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 92b770f..0084d14 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -41,6 +41,8 @@ typedef union { uint32_t parsed_l2:1; /**< L2 parsed */ uint32_t parsed_all:1;/**< Parsing complete */ + uint32_t flow_hash:1; /**< Flow hash present */ + uint32_t l2:1; /**< known L2 protocol present */ uint32_t l3:1; /**< known L3 protocol present */ uint32_t l4:1; /**< known L4 protocol present */ @@ -149,7 +151,6 @@ typedef struct { odp_pktio_t input; - uint32_t has_hash:1; /**< Flow hash present */ uint32_t flow_hash; /**< Flow hash value */ odp_crypto_generic_op_result_t op_result; /**< Result for crypto */ diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 2c44316..829fbb5 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -448,7 +448,7 @@ void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); pkt_hdr->flow_hash = flow_hash; - pkt_hdr->has_hash = 1; + pkt_hdr->input_flags.flow_hash = 1; } int odp_packet_is_segmented(odp_packet_t pkt) diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index ecaa3a3..5d93f57 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -176,7 +176,7 @@ int odp_packet_has_flow_hash(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - return pkt_hdr->has_hash; + return pkt_hdr->input_flags.flow_hash; } odp_packet_color_t odp_packet_color(odp_packet_t pkt) @@ -335,5 +335,5 @@ void odp_packet_has_flow_hash_clr(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - pkt_hdr->has_hash = 0; + pkt_hdr->input_flags.flow_hash = 0; } diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 4aff57c..0e57d90 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -701,10 +701,8 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, pkt_hdr->input = pktio_entry->s.handle; - if (mbuf->ol_flags & PKT_RX_RSS_HASH) { - pkt_hdr->has_hash = 1; - pkt_hdr->flow_hash = mbuf->hash.rss; - } + if (mbuf->ol_flags & PKT_RX_RSS_HASH) + odp_packet_flow_hash_set(pkt, mbuf->hash.rss); pkt_table[nb_pkts++] = pkt; }