From patchwork Thu Apr 21 07:59:22 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: 66317 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2898224qge; Thu, 21 Apr 2016 01:01:56 -0700 (PDT) X-Received: by 10.50.83.105 with SMTP id p9mr1817694igy.63.1461225716476; Thu, 21 Apr 2016 01:01:56 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 101si2258379iom.2.2016.04.21.01.01.56; Thu, 21 Apr 2016 01:01:56 -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 ED2BB68AD2; Thu, 21 Apr 2016 08:01:55 +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 7EB1668A92; Thu, 21 Apr 2016 07:59:50 +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 591EA68A97; Thu, 21 Apr 2016 07:59:44 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 3C46868A89 for ; Thu, 21 Apr 2016 07:59:37 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u3L7xXQc006183 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Apr 2016 07:59:33 GMT Received: from 10.144.19.15 ([10.144.104.109]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u3L7xWVx018712 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Thu, 21 Apr 2016 09:59:33 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Thu, 21 Apr 2016 10:59:22 +0300 Message-Id: <1461225572-18238-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461225572-18238-1-git-send-email-matias.elo@nokia.com> References: <1461225572-18238-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::1461225573-00002418-906BF5D2/0/0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v5 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 ef0a7d3..2c06e97 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -453,7 +453,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; }