Received: by 10.192.165.156 with SMTP id m28csp1078754imm; Wed, 11 Apr 2018 12:01:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx49aFDZhe1yJ+Va44ryXa03K6W7faLxCNky9aog0NPmVca3w6Uono8GTk7wLqDSnK6OaLbfx X-Received: by 10.99.95.75 with SMTP id t72mr4286059pgb.411.1523473302437; Wed, 11 Apr 2018 12:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523473302; cv=none; d=google.com; s=arc-20160816; b=LtMr+k+3xNUcETAt6/8NipviHUvx7JSTMeC044WO579WUzX0mKQ0gO/FjZdsKj0tCQ bH8UcWBusu+PHW334sXcu/gUkem4lcMl1V2wJtl3jIH+ykl8QLRI4/ZzeENMwCV2NTlh rn1tah3v6uRLy6dltQjpv6XDEON7HmGL75P2afl7D+00w45qoBX7+yGu/CBHnxkE9Ax7 eUqreL/w+XPa7GCr8PbSVFqFTJ6BpswQDRMbge3yFZXK62sa5AIYigI0YH5rG2DQVxte g2fE0+cPd8PnZuHnin26slM/Hm+ZxwqkyKDfLwWNrzONIfNBFpTbbi0xeVKq4ypVjenJ 3svg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fKzUr8M3DqIbyIiaZbd3nLqDUCvRsMxJUCox5Je25C8=; b=yHlqytVtjXJc42OnsGTCf4UDK/b9SxOUS+UJ3dmJYYvR9w/IH8RWNQNIHqsKtlk+E5 ZXfrrz2zBcq7IVHcikM23IX8fcGGgaqGjFS/rBe9Pl6qK3MVlziIaPJi7cVqYP+orbKj ZBmpWSle+i/lKrEhNH6XJF2QkZ3NJsklFgB/HqIhEAzUbClR+M19lwamas7RFFikxOxj ppfuqnz3FCQXw4H2TS20LQM6z0cLN5AtobkQcIC+GMFwAM40rxqSethvHp90LaUPGAQg M9Q/MQbYNTMjOfGcxFibXTuuIBiS74gaH8g2zCX0nfz6k4itbZqZgBh4pmZC/FylfQ99 IcJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si1570847pls.305.2018.04.11.12.01.05; Wed, 11 Apr 2018 12:01:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756319AbeDKS5B (ORCPT + 99 others); Wed, 11 Apr 2018 14:57:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35980 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756305AbeDKS45 (ORCPT ); Wed, 11 Apr 2018 14:56:57 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 63FB4C06; Wed, 11 Apr 2018 18:56:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesper Dangaard Brouer , Saeed Mahameed , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 098/310] mlx5: fix bug reading rss_hash_type from CQE Date: Wed, 11 Apr 2018 20:33:57 +0200 Message-Id: <20180411183626.439983579@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jesper Dangaard Brouer [ Upstream commit 12e8b570e732eaa5eae3a2895ba3fbcf91bde2b4 ] Masks for extracting part of the Completion Queue Entry (CQE) field rss_hash_type was swapped, namely CQE_RSS_HTYPE_IP and CQE_RSS_HTYPE_L4. The bug resulted in setting skb->l4_hash, even-though the rss_hash_type indicated that hash was NOT computed over the L4 (UDP or TCP) part of the packet. Added comments from the datasheet, to make it more clear what these masks are selecting. Signed-off-by: Jesper Dangaard Brouer Acked-by: Saeed Mahameed Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/linux/mlx5/device.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -750,8 +750,14 @@ enum { }; enum { - CQE_RSS_HTYPE_IP = 0x3 << 6, - CQE_RSS_HTYPE_L4 = 0x3 << 2, + CQE_RSS_HTYPE_IP = 0x3 << 2, + /* cqe->rss_hash_type[3:2] - IP destination selected for hash + * (00 = none, 01 = IPv4, 10 = IPv6, 11 = Reserved) + */ + CQE_RSS_HTYPE_L4 = 0x3 << 6, + /* cqe->rss_hash_type[7:6] - L4 destination selected for hash + * (00 = none, 01 = TCP. 10 = UDP, 11 = IPSEC.SPI + */ }; enum {