From patchwork Wed Apr 20 06:20:40 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: 66168 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2270425qge; Tue, 19 Apr 2016 23:21:09 -0700 (PDT) X-Received: by 10.55.77.216 with SMTP id a207mr8974730qkb.80.1461133269784; Tue, 19 Apr 2016 23:21:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j88si25740732qgf.87.2016.04.19.23.21.08; Tue, 19 Apr 2016 23:21:09 -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 DD1CB67425; Wed, 20 Apr 2016 06:21:08 +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 0A92A673C8; Wed, 20 Apr 2016 06:21:00 +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 8D071667FB; Wed, 20 Apr 2016 06:20:54 +0000 (UTC) Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by lists.linaro.org (Postfix) with ESMTPS id 2B1EB667FB for ; Wed, 20 Apr 2016 06:20:53 +0000 (UTC) Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd001.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u3K6KpPF028629 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Apr 2016 06:20:51 GMT Received: from 10.144.19.15 ([10.144.104.109]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u3K6Ko3v012445 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 20 Apr 2016 08:20:51 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Wed, 20 Apr 2016 09:20:40 +0300 Message-Id: <1461133250-2403-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461133250-2403-1-git-send-email-matias.elo@nokia.com> References: <1461133250-2403-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::1461133251-00001B3D-579BD032/0/0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 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 47f4ff8..edff533 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 4202a90..1fca0d5 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; }