Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3922934pxj; Mon, 21 Jun 2021 09:27:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfBo0mgg9rEI8EBvdu8PnsPeg6LKyAHlwJmfyhqITrrqHJUHRMe8gxkqfYMRNe8Sm926Xd X-Received: by 2002:a05:6602:591:: with SMTP id v17mr11700385iox.178.1624292822427; Mon, 21 Jun 2021 09:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292822; cv=none; d=google.com; s=arc-20160816; b=uDDGRUrLvm5Z0LcJzfrQdacaWId2uYQRNR2GexgJhGXCUvXkX1lxj50la2syBDTTYJ 0O4j2Zwa4FPaU7iDb9YFQUw9t3daAhOkCPe1n15sZvf9PxI0AmqCAA6UtlkmoEsU7DuQ NqRIRaf49sAlDp1n4cvMpM3NFgUjnlY7tTtufL8d9DUbXuGFU3DQ6mvfJ7fenl0N9Bpp hSbcxKLwJi6xG8X6SSdKCWW1Q3/92GCQkT/1HPvvqC5jDRETgi7SEWmeBSuQXoI7rAv8 ze00VvZ5P09KTUXd6cJUYomMH98Misb6Pt39TwPbeoLHJ4ippdjX36pR7ERZOWYpWCgg yaRg== 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=x7XBniiFV+XRu+uDLSA3uQ5X3xapYbX//2trYH/aR18H0mwEhhCx/F8Gs0aMwhNDc+ BwZXaldshN/QKXl3wG0NKD8fGowRRNuG0GweVUB/5z40GHkcpEs5HtXRQfT5Hmy+g172 aV5hpXGWs11fzV+oj4MYDd7Bo/qIscDsE/aQKtEgajgwL038Xh7b97O0s0u0HCWXBy/o R1N73rydqXfy25jntFOC1W8UDXAqxkfWidEPfb5CTnKQYJhsDYnA84oX1HxAimcdZzzF 1KxKVHExsorX0tBhWoY3d8Wor2/rNhYXaumFtgu0P2A6ZFeNCupumU/EZrfuM1VwxDAi vYOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I2Gqlapb; 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 i24si21924753jan.76.2021.06.21.09.26.50; Mon, 21 Jun 2021 09:27:02 -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=I2Gqlapb; 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 S232027AbhFUQ1f (ORCPT + 99 others); Mon, 21 Jun 2021 12:27:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:42682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232211AbhFUQZm (ORCPT ); Mon, 21 Jun 2021 12:25:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1563613D9; Mon, 21 Jun 2021 16:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292521; bh=kyF51fD9yOs4mJjlPg9BL4zavpsliWiQaFtbe6aVDeI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I2GqlapbDcyqnWuQqKL0GmykBucKQtRkfV6AlhdzqXHs3JGDoPTAVU4neEF8ehZNP sGcr89I6zd7VaCYOyE0fXuGi9NXoQRHu/emVdEAP+K3PnBspWGVgnZBCNt50vDAUcs 1p4yeHf0OF6j4PZAvK3jMDUs9OsVKvXd3do8Xxr8= 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.10 030/146] net/mlx5: Consider RoCE cap before init RDMA resources Date: Mon, 21 Jun 2021 18:14:20 +0200 Message-Id: <20210621154912.302571017@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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