Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3934040pxj; Mon, 21 Jun 2021 09:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu40Gw5hay7jOYDG3g+WdVnZ2GvSkahdKLnWNFI7APDZZ5mKxsugpzlr6HHHsQrUKp7+Pk X-Received: by 2002:a5e:8810:: with SMTP id l16mr19947071ioj.31.1624293673354; Mon, 21 Jun 2021 09:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293673; cv=none; d=google.com; s=arc-20160816; b=mdMN/DXavcYSR5XGNORc1a8WV61BQYk8xsPwGHEN8my5Vw7Fl6tGxqGyYGOsUVVe89 ic69iQTNnWIgM44ZcgYl6BAob8Cxz/1cYDLgJfKvnABRTWvLBfR1DBUWKJvc5zn/aTts eCVjlBh8yJ45YM3VnhfsouV7UM+aQZGs0+9VIzKf9NQ08txyjVdaPgnpObQGxct4kgep /PTVb26ykUQzc81HIltg7Tb6ApJDIiYoZl7L5r4ZkN/Ew4uG2IDulOrMfANOlQ03c/gL lFB1V5RocFIpiXcPRBe3py5NuMfZ3oJJ8EEk7V20lv+lxE3wUYVCeZof5YBoMlRr+Yay OsOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UTyPXtiBXYNBxa69qpPbaxe1QzwGYoVKFfIAGLzz/pk=; b=Mdm6c8bogJHnmA2x+9TqfYEbF70NdzJCU1Jv+AqXXnocgyXqOxiq7ll7VSU18HvTOx FnZyyNAWVJuNgefR7b7Zdk99XKQJupf+hOTLqPR/VSoJFzsDaape06DsJ4Pkj5yH1JLV kWFTd0qjCampfaqVLE1DAbJeC+3QZXp2uv6zvKuIM1RpLkr8v0fUS2NMU1jR7M0Oimtm U+4C/Fm7gS+GB81P5BURjOKhvqdKd5IXWsi1rejsPLc6GOWop0NX//SqWXO4Wj6UPa/u AdM6P8wwkD4ftIdizxJ6riAEoU2G1wKvgWU+Cr2/BZHZa6Al3WOovsOQjRWE3cMCSimJ zIcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lDx7EpAo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si11930462ilk.46.2021.06.21.09.41.01; Mon, 21 Jun 2021 09:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lDx7EpAo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232609AbhFUQlD (ORCPT + 99 others); Mon, 21 Jun 2021 12:41:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:55398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbhFUQhN (ORCPT ); Mon, 21 Jun 2021 12:37:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DEB3861424; Mon, 21 Jun 2021 16:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292923; bh=kyF51fD9yOs4mJjlPg9BL4zavpsliWiQaFtbe6aVDeI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lDx7EpAonAegIpWvdwY/v0drWPJ7j7pCD1AqKgeS0uRMtRCB7Phmpj6fHXeYgxuUn MlBXzgybRB09WtC9wxkdgEBRWkF44WVbmSZiNIQcXV7vIbYGqZSHMFDf7Z9dQVmkYb 42lDv+ANi9kVlOGWgMHZO6j+ULT5w+srE30K+mQE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maor Gottlieb , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.12 035/178] net/mlx5: Consider RoCE cap before init RDMA resources Date: Mon, 21 Jun 2021 18:14:09 +0200 Message-Id: <20210621154923.214360955@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maor Gottlieb [ Upstream commit c189716b2a7c1d2d8658e269735273caa1c38b54 ] Check if RoCE is supported by the device before enable it in the vport context and create all the RDMA steering objects. Fixes: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic") Signed-off-by: Maor Gottlieb Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c index 8e0dddc6383f..2389239acadc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c @@ -156,6 +156,9 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev) { int err; + if (!MLX5_CAP_GEN(dev, roce)) + return; + err = mlx5_nic_vport_enable_roce(dev); if (err) { mlx5_core_err(dev, "Failed to enable RoCE: %d\n", err); -- 2.30.2