Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466AbdIRJnA (ORCPT ); Mon, 18 Sep 2017 05:43:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55604 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754134AbdIRJNw (ORCPT ); Mon, 18 Sep 2017 05:13:52 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huy Nguyen , Parav Pandit , Saeed Mahameed Subject: [PATCH 4.12 23/52] net/mlx5e: Check for qos capability in dcbnl_initialize Date: Mon, 18 Sep 2017 11:11:17 +0200 Message-Id: <20170918091020.120825913@linuxfoundation.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170918091016.620101134@linuxfoundation.org> References: <20170918091016.620101134@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 35 4.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huy Nguyen [ Upstream commit 33c52b6718d2a6cb414440c98560818910d896dc ] qos capability is the master capability bit that determines if the DCBX is supported for the PCI function. If this bit is off, driver cannot run any dcbx code. Fixes: e207b7e99176 ("net/mlx5e: ConnectX-4 firmware support for DCBX") Signed-off-by: Huy Nguyen Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c @@ -754,6 +754,9 @@ void mlx5e_dcbnl_initialize(struct mlx5e { struct mlx5e_dcbx *dcbx = &priv->dcbx; + if (!MLX5_CAP_GEN(priv->mdev, qos)) + return; + if (MLX5_CAP_GEN(priv->mdev, dcbx)) mlx5e_dcbnl_query_dcbx_mode(priv, &dcbx->mode);