Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3730695imm; Mon, 8 Oct 2018 08:38:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV633M2BakuyvGL36xhKP0kxNR4N/Dj8YF/CN7enc+1uUjmjNTkqgNq/c0tM11il9DdTtdozh X-Received: by 2002:a17:902:9045:: with SMTP id w5-v6mr25142090plz.10.1539013088381; Mon, 08 Oct 2018 08:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013088; cv=none; d=google.com; s=arc-20160816; b=Ja3Ixkfcp2mAlZAtZIqOUE/ai/+qxd4Qy7jWgudZNCaQVkZjdQ4oo1mWCDRYL1LjQi IMCmy/y1If4DaY/IHZgbFe94m977q/Dy6ftU2B/RK67E/KTw5d876To15kW4IDF2uMgg keW9TSTzNwvzEQ6ovuuA9prpcxvM9fiqFYqsGivmHKvwUNFWTBwEz9p55xSRVPmzOrLY UYE6bXwBjt1wmn+29GF+n0SNDRd/utBNdWr2UkiGUbGXLtL4REHiXXc/eICq29XeeWUF amlj2kqrZwr+HUI8goR5c1/t3heJg9vHCK+MOImTez15Hi47D2XQ+hRwF5gQl6SwwAbq zuow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DxYeHlJzyloAPwuDlLVT7PPqLuyPhbBlikytvqcqA7I=; b=qGOMD5TB8PtHC/B3NTJuOXV8pxnpG/bwqmOUqLWh80RCMsosIWaGGvIzRLhX2fwy9D abJaxDhl8LoPGq93qtYPrn78pdf2x+Oi8s0e0S1Qy4Ah/5OiFFdJ2RdG8AUegjyKqIST iZzh7n4K1QGKnGc2sPcNe7BrbF1/ffo7C7At4O6a4vWQCx7Bdf27E1vsUQwmh869Q5pb +RhF+XdNYW+vG2zhUD/FKIfMIAwKnx65/en3hNL7WUAVsFM2OcaAGYQ7Xf4axBXss6vo 6mDhzPCgn/1wjynRB72qcJSndS8zukqYTXamaelUgYe/1LZ8QeWj7U+3h3BFiLvNWrz0 Sdzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UuBNetKN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5-v6si18189065pgh.397.2018.10.08.08.37.53; Mon, 08 Oct 2018 08:38:08 -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; dkim=pass header.i=@kernel.org header.s=default header.b=UuBNetKN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727281AbeJHWiC (ORCPT + 99 others); Mon, 8 Oct 2018 18:38:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:56222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727180AbeJHWiB (ORCPT ); Mon, 8 Oct 2018 18:38:01 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 51C86214FA; Mon, 8 Oct 2018 15:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012346; bh=m9CKM/MneY3CS+tofhB2Y+GQoaFs8AbArEsR0IMwYcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuBNetKNIH+/IYr1OkGl9sGjDgWhnIQeVP8UoaKtmMp28cAF9BKm/JORrsBIRC/wp aEDAjUO+wya2VNgKS/ojMVYyWO0qhQJV6H52F6YY6zSDRsTN8SOo/1hmgfFBQojdrR 9rD595jeTjWp1c+/YCEAXbjJDKsdFRCHz2Q+Dohc= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alaa Hleihel , Saeed Mahameed , Sasha Levin Subject: [PATCH AUTOSEL 4.18 21/58] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ Date: Mon, 8 Oct 2018 11:24:46 -0400 Message-Id: <20181008152523.70705-21-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alaa Hleihel [ Upstream commit 6b359d5550a1ae7a1269c9dc1dd73dfdc4d6fe58 ] When modifying hairpin SQ, instead of checking if the next state equals to MLX5_SQC_STATE_RDY, we compare it against the MLX5_RQC_STATE_RDY enum value. The code worked since both of MLX5_RQC_STATE_RDY and MLX5_SQC_STATE_RDY have the same value today. This patch fixes this issue. Fixes: 18e568c390c6 ("net/mlx5: Hairpin pair core object setup") Change-Id: I6758aa7b4bd137966ae28206b70648c5bc223b46 Signed-off-by: Alaa Hleihel Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/transobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c index dae1c5c5d27c..d2f76070ea7c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c @@ -509,7 +509,7 @@ static int mlx5_hairpin_modify_sq(struct mlx5_core_dev *peer_mdev, u32 sqn, sqc = MLX5_ADDR_OF(modify_sq_in, in, ctx); - if (next_state == MLX5_RQC_STATE_RDY) { + if (next_state == MLX5_SQC_STATE_RDY) { MLX5_SET(sqc, sqc, hairpin_peer_rq, peer_rq); MLX5_SET(sqc, sqc, hairpin_peer_vhca, peer_vhca); } -- 2.17.1