From patchwork Thu Jan 16 21:55:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13942357 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94FE3241A1C for ; Thu, 16 Jan 2025 21:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737064554; cv=none; b=R+VrV8JjM6rOydqMEZXcxBmP9JsXd3m0mys5qk6psFpWpfLquTkIwU5EKo0iMJFEFNb+TUqyHikys90GUgBM+b640rQZiOzSJPq14fLKvq1li30xOzm2OnixrjI4WSdNIrmhAPSPnkj18FZ1uc/8XNAc1MjjakqHmIT0jRBIxxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737064554; c=relaxed/simple; bh=VklbB5178MBwLG13lY+GR1utck8zyHlhXcYJQWB8cJ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I/Y9Zb+r9I9dh3RicAgX2/vc8GBEGe0PGQDOE4mI+LB/Xnwo1VXJbFhY1JT5hA+NwN239CSTV5dmChKDafLZyxT0s5msKSwoFcwiDPoPIyKoWGDiNOlO64c9MZIxv4E/1pDKXRjZEjpQExIK7uh8MCQSmId4Cz1mDRUL/FJMFDM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fLXizuR6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fLXizuR6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12774C4CED6; Thu, 16 Jan 2025 21:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737064554; bh=VklbB5178MBwLG13lY+GR1utck8zyHlhXcYJQWB8cJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fLXizuR63kPThXsgX+vd4YhORInn/kKV4K+NVaFtclLlMN6nUKTtb7+5jP0k63NmD Fwnd+ULLlEFg5RvAZxReslCrLr5KcY7RR7X7HRrb9Q+emqc6RAkVMn0cFdi8tc6Qku AIk0rsoQ1SMqOSTa7meJ4TZEjYW8kX8jx9aaBErd1ivxM8pEdbiJTzVfuAEbw+KQvk ncVioJDE3T/aGxwIcCgRIUyPq912/kJ6DGLr+Dqkm4B6hnTmsY5OsgGvJvoPH1CxuT rOcNZfR/43106Fz+MzudmfPupHBqRvKen5uMH/Zns9wALmVX78DX1sLSTWyHkYoODv QTi2G24miFp9w== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Gal Pressman , Leon Romanovsky , Dragos Tatulea Subject: [net-next 04/11] net/mlx5e: SHAMPO: Improve hw gro capability checking Date: Thu, 16 Jan 2025 13:55:22 -0800 Message-ID: <20250116215530.158886-5-saeed@kernel.org> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250116215530.158886-1-saeed@kernel.org> References: <20250116215530.158886-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Saeed Mahameed Add missing HW capabilities, declare the feature in netdev->vlan_features, similar to other features in mlx5e_build_nic_netdev. No functional change here as all by default disabled features are explicitly disabled at the bottom of the function. Signed-off-by: Saeed Mahameed Reviewed-by: Dragos Tatulea Reviewed-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 73947df91a33..66d1b3fe3134 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -77,7 +77,8 @@ static bool mlx5e_hw_gro_supported(struct mlx5_core_dev *mdev) { - if (!MLX5_CAP_GEN(mdev, shampo)) + if (!MLX5_CAP_GEN(mdev, shampo) || + !MLX5_CAP_SHAMPO(mdev, shampo_header_split_data_merge)) return false; /* Our HW-GRO implementation relies on "KSM Mkey" for @@ -5508,17 +5509,17 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) MLX5E_MPWRQ_UMR_MODE_ALIGNED)) netdev->vlan_features |= NETIF_F_LRO; + if (mlx5e_hw_gro_supported(mdev) && + mlx5e_check_fragmented_striding_rq_cap(mdev, PAGE_SHIFT, + MLX5E_MPWRQ_UMR_MODE_ALIGNED)) + netdev->vlan_features |= NETIF_F_GRO_HW; + netdev->hw_features = netdev->vlan_features; netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX; netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; netdev->hw_features |= NETIF_F_HW_VLAN_STAG_TX; - if (mlx5e_hw_gro_supported(mdev) && - mlx5e_check_fragmented_striding_rq_cap(mdev, PAGE_SHIFT, - MLX5E_MPWRQ_UMR_MODE_ALIGNED)) - netdev->hw_features |= NETIF_F_GRO_HW; - if (mlx5e_tunnel_any_tx_proto_supported(mdev)) { netdev->hw_enc_features |= NETIF_F_HW_CSUM; netdev->hw_enc_features |= NETIF_F_TSO;