Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1660529pxy; Mon, 2 Aug 2021 07:17:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSbAeE12tjP4oWXJrweNmhSioUpjhJEbcIZeawu8Mf8abfZFpud1tO74xejAb4dA2U2yCF X-Received: by 2002:a05:6638:35aa:: with SMTP id v42mr15048749jal.21.1627913845778; Mon, 02 Aug 2021 07:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627913845; cv=none; d=google.com; s=arc-20160816; b=fVg1FnMoJIDWnlLJCT8gRxR29p3l5pqeZvxBJ5ZStElQ0p2QYTPG6+dcojvy713ozu 6L4i+XCA5RGWmC4eyEg11/FM69I43MRkC2PmHpP5/GBFWe6ghTqkLqaOG00nnbYkZBOJ BZTKjBDyZovVDAYc0zp+RQcdv4oYCLj/QrTkae+TtG6LUBjcJ4wxLCw0ei9uAvPq7nn2 mvzLEoQtEpDm06t0JNjbi8Fi3lNGRgKkoYxj6+EmRMSUbRqM10+GRV/kcOvrFy+dTsrG nCqPAXlix03mz3YIVupPtK70Jj2TzEqOgDE7bR+uFl0U4tS2Sxm9lkxFZYXEEnknzKy1 b1oQ== 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=dgfnERHFtjYgRBc2G56s2KPak2FMJGXLoprDLHx2XuA=; b=EFtwTk45hKKmKv07Eu11gTB2W+NkS19LJ51bNhCyzU08WR7wnmDZxOT1vndop6fH9b 6QjmkvlMQOUS/gV7qRTjbv1cZ7Wy9KrIjIRHdl/kyIVXjskJoDX7VjcMZNDj12C+v93u kC21e2xDtEh8UyOnmIFKPhPhZECoUMsxN9O4/JpfOJFAQBDtkJmfMK5nPYP66GYvNOkJ YLU0gq5ZqwEEkF0fXfsBJD27NICpSK8MYuakJCwliwDC5V6QKJefZ8Pg94lJSstOw8/i +hSseHsu3pN9MqD/pYwK7rOydLyUWPoAXvJ8zHDI3k0f5RcUd+Mi1KS7KntXwFlQSnGy 7eJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LwNOYxdj; 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 z12si11517325iln.160.2021.08.02.07.17.14; Mon, 02 Aug 2021 07:17:25 -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=LwNOYxdj; 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 S238504AbhHBOPK (ORCPT + 99 others); Mon, 2 Aug 2021 10:15:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:48986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235731AbhHBODR (ORCPT ); Mon, 2 Aug 2021 10:03:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 46EFD6124B; Mon, 2 Aug 2021 13:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912633; bh=cVelJkhvseI4o4ns7nAQi66mJf1r3ubjKSeahjw8QLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LwNOYxdjNXHYZNr6MamFI5fCqiuXDlpsx7WbVKDcgSfqqb1qo83uc+aPwYuTDBFxP 90nFr8SDTRNlHeOGUQnnbXLly+zIgnAi280n4B9iEnGGIqWng4/ar2N/wMIWYxopEC L7hI/JNnh5dcDFEaPecdYjf2d3UnFzATYUMhkMjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Mikityanskiy , Tariq Toukan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.13 080/104] net/mlx5e: Add NETIF_F_HW_TC to hw_features when HTB offload is available Date: Mon, 2 Aug 2021 15:45:17 +0200 Message-Id: <20210802134346.642859271@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134344.028226640@linuxfoundation.org> References: <20210802134344.028226640@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: Maxim Mikityanskiy [ Upstream commit 9841d58f3550d11c6181424427e8ad8c9c80f1b6 ] If a feature flag is only present in features, but not in hw_features, the user can't reset it. Although hw_features may contain NETIF_F_HW_TC by the point where the driver checks whether HTB offload is supported, this flag is controlled by another condition that may not hold. Set it explicitly to make sure the user can disable it. Fixes: 214baf22870c ("net/mlx5e: Support HTB offload") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 86a27b0b42cb..d0d9acb17253 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4866,6 +4866,9 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) if (MLX5_CAP_ETH(mdev, scatter_fcs)) netdev->hw_features |= NETIF_F_RXFCS; + if (mlx5_qos_is_supported(mdev)) + netdev->hw_features |= NETIF_F_HW_TC; + netdev->features = netdev->hw_features; /* Defaults */ @@ -4886,8 +4889,6 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) netdev->hw_features |= NETIF_F_NTUPLE; #endif } - if (mlx5_qos_is_supported(mdev)) - netdev->features |= NETIF_F_HW_TC; netdev->features |= NETIF_F_HIGHDMA; netdev->features |= NETIF_F_HW_VLAN_STAG_FILTER; -- 2.30.2