From patchwork Tue Jan 23 16:00:10 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: 125558 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1840647ljf; Tue, 23 Jan 2018 08:01:06 -0800 (PST) X-Google-Smtp-Source: AH8x224kAaIcBExgP/3n8PVrxozI1xiCG90sIQ/VBqmXYT6LzH7gYqca8Latqhbsk2SiFMN2+247 X-Received: by 10.55.129.195 with SMTP id c186mr4061488qkd.352.1516723266680; Tue, 23 Jan 2018 08:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516723266; cv=none; d=google.com; s=arc-20160816; b=eHnn2+ue0MN45ayM0pbLDWXqH4w1focRwXzpu0fIYuCoJSgpnr33sMj6FbD86hJ4Af Nd7NnaV5suQ6BpHbgY6/yi4K0Gd310MA0dHyowIxaMToEn15tBy4RuTWW+XeNV9LVw8z HM8VCDh1Owvf8M7d+QQI99Oww5xkwF43QTX5mQEXS2hSHy4eakZp8v6GEMyTeUvE2VGA zmqxMLheHRrekg8qjTT3eJVQLOmOxeP15G9Mha5akZzP75uEqMCUjTIgxLGLpuIVum8g p3TtrqDURH1ppNldwFDOrA22khTDwE9+50elk4d1LjJuh4otdLWWrd97uc3pPoaw/009 N5Og== 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=mEG3d82s4ry50oDnPA4VZffEqpy6cx8VO/EV0J0SSFM=; b=Bn9qU/FJT5NvTy7yPJhh6guf530Ww2xFKJ5QlTSMy7eekIMl7xfxQ8qdF3uB6rp/qJ zfc+hjVwOOatyHOZvfPBa2MQaMqBaTYrBMpHAl3IiN4fXx58NF3+kMK4RSk31sO0cjR9 1ophcj7d0T11H3+eIeQhzAgyKpQXVyubZTLtIKRYSk2gTDjSK+uzFp+nD9NvHepMbN9i oUDzNhuUzHANrgvJRqAYR4/Nobh6BlWwKuwvGVf/DSjcfEjJzwOw3g/6twPef15+DAqP nZH1Brs+wJ9LCDOOb/InGYAkYhTqE+zVfHpvyDIcBKeaRK+5kW2GAQmX/PvVDLKd28DD i+Vg== 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 o2si595022qtj.92.2018.01.23.08.01.06; Tue, 23 Jan 2018 08:01:06 -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 347B2617D0; Tue, 23 Jan 2018 16:01:06 +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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 917896178D; Tue, 23 Jan 2018 16:00:27 +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 C73966089E; Tue, 23 Jan 2018 16:00:21 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 7CE056089E for ; Tue, 23 Jan 2018 16:00:13 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 058CF18038F4 for ; Tue, 23 Jan 2018 19:00:12 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NF5ST2mV3F-0BhKn3U0; Tue, 23 Jan 2018 19:00:11 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TENgUAARLt-0BeK1bFF; Tue, 23 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, 23 Jan 2018 19:00:10 +0300 Message-Id: <1516723210-13890-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516723210-13890-1-git-send-email-odpbot@yandex.ru> References: <1516723210-13890-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 421 Subject: [lng-odp] [PATCH v1 1/1] linux-gen: cls: fix: incorrect rss hash calculation 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: Balasubramanian Manoharan updates incorrect operator precedence updates v4 to v6 tuple in ipv6 hash generation Fixes: https://bugs.linaro.org/show_bug.cgi?id=3582 Fixes: https://bugs.linaro.org/show_bug.cgi?id=3581 Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 421 (bala-manoharan:BUG3581) ** https://github.com/Linaro/odp/pull/421 ** Patch: https://github.com/Linaro/odp/pull/421.patch ** Base sha: b122176ee59494dd957f0f5ff41d4b55a1477e13 ** Merge commit sha: 422456c8eb45b1fe3e8734b13a1c3ddb5fc5b9c2 **/ platform/linux-generic/odp_classification.c | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index b41a5fd8c..a4d7086db 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -1025,8 +1025,8 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, if (pkt_hdr->p.input_flags.ipv4) { if (hash_proto.ipv4) { /* add ipv4 */ - ipv4 = (const _odp_ipv4hdr_t *)base + - pkt_hdr->p.l3_offset; + ipv4 = (const _odp_ipv4hdr_t *)(base + + pkt_hdr->p.l3_offset); tuple.v4.src_addr = ipv4->src_addr; tuple.v4.dst_addr = ipv4->dst_addr; tuple_len += 2; @@ -1034,15 +1034,15 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, if (pkt_hdr->p.input_flags.tcp && hash_proto.tcp) { /* add tcp */ - tcp = (const _odp_tcphdr_t *)base + - pkt_hdr->p.l4_offset; + tcp = (const _odp_tcphdr_t *)(base + + pkt_hdr->p.l4_offset); tuple.v4.sport = tcp->src_port; tuple.v4.dport = tcp->dst_port; tuple_len += 1; } else if (pkt_hdr->p.input_flags.udp && hash_proto.udp) { /* add udp */ - udp = (const _odp_udphdr_t *)base + - pkt_hdr->p.l4_offset; + udp = (const _odp_udphdr_t *)(base + + pkt_hdr->p.l4_offset); tuple.v4.sport = udp->src_port; tuple.v4.dport = udp->dst_port; tuple_len += 1; @@ -1050,23 +1050,23 @@ static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr, } else if (pkt_hdr->p.input_flags.ipv6) { if (hash_proto.ipv6) { /* add ipv6 */ - ipv6 = (const _odp_ipv6hdr_t *)base + - pkt_hdr->p.l3_offset; + ipv6 = (const _odp_ipv6hdr_t *)(base + + pkt_hdr->p.l3_offset); thash_load_ipv6_addr(ipv6, &tuple); tuple_len += 8; } if (pkt_hdr->p.input_flags.tcp && hash_proto.tcp) { - tcp = (const _odp_tcphdr_t *)base + - pkt_hdr->p.l4_offset; - tuple.v4.sport = tcp->src_port; - tuple.v4.dport = tcp->dst_port; + tcp = (const _odp_tcphdr_t *)(base + + pkt_hdr->p.l4_offset); + tuple.v6.sport = tcp->src_port; + tuple.v6.dport = tcp->dst_port; tuple_len += 1; } else if (pkt_hdr->p.input_flags.udp && hash_proto.udp) { /* add udp */ - udp = (const _odp_udphdr_t *)base + - pkt_hdr->p.l4_offset; - tuple.v4.sport = udp->src_port; - tuple.v4.dport = udp->dst_port; + udp = (const _odp_udphdr_t *)(base + + pkt_hdr->p.l4_offset); + tuple.v6.sport = udp->src_port; + tuple.v6.dport = udp->dst_port; tuple_len += 1; } }