From patchwork Thu Apr 21 00:14:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 66260 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2741627qge; Wed, 20 Apr 2016 17:15:01 -0700 (PDT) X-Received: by 10.140.32.161 with SMTP id h30mr9889743qgh.51.1461197701401; Wed, 20 Apr 2016 17:15:01 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w12si1098357qha.29.2016.04.20.17.15.01; Wed, 20 Apr 2016 17:15: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=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0C8C8684A3; Thu, 21 Apr 2016 00:15:01 +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, RCVD_IN_DNSWL_LOW, 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 88A8A687F7; Thu, 21 Apr 2016 00:14:30 +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 C144A67483; Thu, 21 Apr 2016 00:14:21 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by lists.linaro.org (Postfix) with ESMTPS id 83C1762C41 for ; Thu, 21 Apr 2016 00:14:20 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id x201so60922218oif.3 for ; Wed, 20 Apr 2016 17:14:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9EuvqdeC+y4Zez7Nvjb6fgfqfl602H0jfjYOT8Ym/5c=; b=YfeqkdrZaJS4upa1+Ix+MpAwBgnXyRA2ag+APycM96MH/zetsk+UT7+yh01KhdZLq0 /NnHq58S7bKGF3TxqK47tNkItzg6XWljiOU6pNmd9IWoVpiyLtHtm25bToGW7KRosof2 xkDON8oRaNli4W14FDnKJvygM6nl80+Ttfdae0s5jOIZibrdK+bzpUlP7XPRdzTPiT+I +oE9z0TdyrM5HJimQDvYWErSzcWqYAHmXXKhpmCvbqk3fFetBeOV0vpo3ZYOdO7w7T+D mn8uYfldTybWIsgijQf6n01ulkohWqcv0L6g+vgVIXEwEtwFg43bBfjqXLUVXk9+lFkL qLHA== X-Gm-Message-State: AOPr4FXSk1BzW/+VRI0eqkMcJMWbC9WHDdmWbD1j4ydUfeo2YxvwR/wvw4a+2n9GVrIVsxEy9n8= X-Received: by 10.202.218.4 with SMTP id r4mr2370661oig.36.1461197660067; Wed, 20 Apr 2016 17:14:20 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id a34sm335otb.1.2016.04.20.17.14.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 17:14:19 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 20 Apr 2016 19:14:05 -0500 Message-Id: <1461197655-23743-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461197655-23743-1-git-send-email-bill.fischofer@linaro.org> References: <1461197655-23743-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4 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" From: Matias Elo Move flow_hash present flag to the same location as all the other packet input and protocol flags. Signed-off-by: Matias Elo Reviewed-and-tested-by: Bill Fischofer --- 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; }