Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp169205imd; Wed, 31 Oct 2018 16:42:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5f/bX1r0wlY8iwMyxDd7OQmMcZw8EVbCHWGmwRlSfNXjKkJmd9wks2dxZs7l/3YRz5p8j3N X-Received: by 2002:a17:902:650a:: with SMTP id b10-v6mr5306488plk.36.1541029374679; Wed, 31 Oct 2018 16:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029374; cv=none; d=google.com; s=arc-20160816; b=UAvVX/zlPO4plz1Ntff2FaO8BBkRSLLHtp6QeP2aDvdehuSebLbj+CBW3yoXG+hdI5 1wZbAn2nyetLOD8dgrrBt13IJSDvtK0Q+fNTIh4yqtkfW+yOxHFrFylTFH/68AOwPo9A LiHcUWfdccoGpbfZvFycXK6ri19PTfX9DfCPEsYzKhYFCDIJyjk8ahFKjoLZT6P7B6hL u0dADZZtbexqKCW6pOS2f+wTO06WQJwZ71oS6Z0GtFeda4JNbT8CAvt5nTRAsafG1VtU RU6x3ayLZbsB9TLzxa5yuMfmIRRzY4efJ3goCAVekcGlP9w3VmVeMsSqVEWzJsDmd16P ftCw== 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=YAUAWSpWpvNKVbYL/8zZ8D7I1DUuVwvFSJiNEEWLRos=; b=HKe6qK7TDhGNwT8E7ozn71ZPnlJHbyhLLsrQdm7uQzqG98nx8UqbyT0vjxPfcvYb2R DwwAH9Qd3uOCSnnNsh0NM5VqjzCqV3h6MJIBtyKY54LC+ud3eWEfjsCAHjCI1AhPA/sZ Qf0Wc3asf1VpYnGMmQY+fU6BkTLUSB3ZFn9AnDLeV92mB6whN0YpHMG7NgCfLmmFEeVH HqjcJUkVgQht9LrIoANemsLUI3T3oCgyQPpbPllOgb2G/R+oY5u1dDnUaA+6xzi0biee bOvappRRawnLf6AuUsFU6J9SJJpnWVnvNEP0sReP/OvbSMiVGSV/N3J8qx7Wei4RtEMM bvZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hlRkDzV+; 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 x8-v6si28810105pge.545.2018.10.31.16.42.40; Wed, 31 Oct 2018 16:42:54 -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=hlRkDzV+; 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 S1729296AbeKAIHz (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:56158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729279AbeKAIHy (ORCPT ); Thu, 1 Nov 2018 04:07:54 -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 2029520840; Wed, 31 Oct 2018 23:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027263; bh=+HO/lVP/Q5O6sXq47kLAeDC4vHbyvLENQeQRCAFGzyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hlRkDzV+3VqseZUh8djxSDXnESp5yXm6/gd7rexLhKArunz5hCcorhOKWI1Iktqcd sEuc0yNjj0/VkxS8cQMNCJ+Xq/oKQJmpOb9EX2Jk8CXrbGbeXHy4AK7tgzr6hJXUWQ xKjhVU1KJ7BAqp3dXaUtv8NJU5qJO2j8jYqEC2yM= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Moni Shoua , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH AUTOSEL 4.19 135/146] IB/mlx5: Allow transition of DCI QP to reset Date: Wed, 31 Oct 2018 19:05:30 -0400 Message-Id: <20181031230541.28822-135-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Moni Shoua [ Upstream commit 99ed748e878a99c6c7b87bbec063eefd9e47cb42 ] The transition is allowed from any state and the atrribute mask must be IB_QP_STATE. Fixes: c32a4f296e1d ("IB/mlx5: Add support for DC Initiator QP") Signed-off-by: Moni Shoua Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/qp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 6cba2a02d11b..d53d954ac8af 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -3243,7 +3243,9 @@ static bool modify_dci_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state new int req = IB_QP_STATE; int opt = 0; - if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) { + if (new_state == IB_QPS_RESET) { + return is_valid_mask(attr_mask, req, opt); + } else if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) { req |= IB_QP_PKEY_INDEX | IB_QP_PORT; return is_valid_mask(attr_mask, req, opt); } else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_INIT) { -- 2.17.1