From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 981C8515980; Wed, 30 Sep 2026 17:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790789514; cv=none; b=qZFidoU29+naAWZkP201b4fV8Ek3qU2B8O6NNX6t5gQoW6xbU/DW1Hi1Bj9UsAlnxeapLSXQ+io1XH1CmFHiVYxSV+b9pHS8VXIscRtjHGiGxyMfv5e06R9I4PcDacAbgsE6limZ/Ca7ru+wJN/DBw4CcSu8aIcl8BkKO23xr+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790789514; c=relaxed/simple; bh=EFpZtfNDFPX56MsnGGDcZDurUzAaMWLZ74mZylwWxaM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WXMQ9goKzfjzOa7KH6l4eYAmx405mljJ5bRbo2gHXrIsBV1DD3rezhtsZ+Pw+7s1FECL+xCNa5YsC62SXn+nAZDjz1Vuowu7bvST6vG2apGCW4MImDK67T4sTKW0BZYvsf1bWNAhMhaJ1moRs2Mil0vKOL92mRIXRPMstOf1X14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cFt2olbv; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cFt2olbv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4F601F00898; Wed, 30 Sep 2026 17:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790789513; bh=CwfLvt6llqWXh5EIZ1ExpnWMYBZIzdCvURdQeuckGCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cFt2olbvr07brEa8hcZP+B0SkUXN2KhDUQbQg758aKlXHZn1ZINLohhwB87tJJrXv iprsJB+1RE+eIsIpYFXqv0fw+V2SF8GIFMFA+WITtfPKBYq6hRuWPvDi2l2DAhaT7z OMWe29UDfCbaXm5uBOkkoSCRVNOF7OygCtcPlbkc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tariq Toukan , Ralf Lici , Jakub Kicinski Subject: [PATCH 6.12 505/877] net/mlx5e: advertise MACsec offload only when supported Date: Wed, 30 Sep 2026 17:23:36 +0200 Message-ID: <20260930152425.559753910@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152414.738996857@linuxfoundation.org> References: <20260930152414.738996857@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ralf Lici commit 4581c3d2adc3c73a019bc38db64ca11f28bbd7fd upstream. Commit 339ccec8d43d ("net/mlx5: Enable MACsec offload feature for VLAN interface") added NETIF_F_HW_MACSEC unconditionally to vlan_features so that VLAN devices could inherit MACsec offload support. mlx5e_build_nic_netdev subsequently copies vlan_features into hw_features and features. As a result, all mlx5e NIC netdevices advertise MACsec hardware offload, even when the firmware does not support it and the driver does not install macsec_ops. Set the MACsec feature bits in mlx5e_macsec_build_netdev, after device capabilities have been validated. This preserves MACsec-over-VLAN support and the ethtool feature control on capable devices, without advertising either on unsupported hardware. Fixes: 339ccec8d43d ("net/mlx5: Enable MACsec offload feature for VLAN interface") Cc: stable@vger.kernel.org Reviewed-by: Tariq Toukan Signed-off-by: Ralf Lici Link: https://patch.msgid.link/20260917122724.654639-1-ralf@mandelbit.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 2 ++ drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -1727,6 +1727,8 @@ void mlx5e_macsec_build_netdev(struct ml mlx5_core_dbg(priv->mdev, "mlx5e: MACsec acceleration enabled\n"); netdev->macsec_ops = &macsec_offload_ops; netdev->features |= NETIF_F_HW_MACSEC; + netdev->hw_features |= NETIF_F_HW_MACSEC; + netdev->vlan_features |= NETIF_F_HW_MACSEC; netif_keep_dst(netdev); } --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5433,7 +5433,6 @@ static void mlx5e_build_nic_netdev(struc netdev->vlan_features |= NETIF_F_SG; netdev->vlan_features |= NETIF_F_HW_CSUM; - netdev->vlan_features |= NETIF_F_HW_MACSEC; netdev->vlan_features |= NETIF_F_GRO; netdev->vlan_features |= NETIF_F_TSO; netdev->vlan_features |= NETIF_F_TSO6;