From patchwork Fri Apr 19 01:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13635568 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) (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 7957CEC3; Fri, 19 Apr 2024 01:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713489480; cv=fail; b=X4l2+eEEH7XTDxJ8f05+CPxJk/5+9/9ceYy6qNJ7PC/TmC8rLRg6ZKgfYiPNnv6bctRRj8zWRYZs30SlQHB66oCPU+BTDcqN6kk4Wfjsy8dkXT5pkkHt1u5pxxjky7wZEM6fWnzMDZk7Pj6biHf++IeUEYg3Zfavr+lLNddhF0g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713489480; c=relaxed/simple; bh=CL00HhW6V1SB2Ag5E8EbRgtJKAyZsDL0ENkfFkMnooc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=UCzVraomdgQpPqXodD4cY3BT9aOE/8mmLAcR5mMW0Ah7IF10MumPb+PGJlmdCAxQjtyDSxsWM3bhbK23khmdgwqWbmHsGHWlkj1w/WMiaJDIV0z6La+g8TprsPeMlUyh1yYB8ufhxpUBSi/ZQea+sEFOhko7PJjWgkZWsjXR4yA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=OsivvEaN; arc=fail smtp.client-ip=40.107.237.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="OsivvEaN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U0Tp+sVZeje143xYdlpcRnvvs+4lcXFWhR3Sq87i4lnNNbH9lrAFK9x0y5SHfSzKBiN6F66okyUNqsI6g0dphYRRV/zgAfol074/oVsx0qbqGkjbKWXr5hKlQE+wht8l4F/ySlJUUhxf0TYi+orNV3EGKcjxwgxJC3O0IKgUBz2EfepI1Bh58/rfCWxNR5ZM1/uPaPzclzkt2jwXFxmWnWiM7UrV9aSPQr2AiCESQhw3/XMDvtBo6e19mAR05gpoXvbuDBwlOvJkDOAOFCOMKJbxNjpsoZ0aTReC3a/4T9XQ7XJMkIcU+V0IWiDLjjHfU7RykvHNCJAs7rTqgTWGxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dErcV3cvMN/wVBySyeKVEjtjSnWp3MSPybJmhmKdLxk=; b=TSlB8IuZQJ1mfc5v/WpSSLKqqTiWs6TGzUGT5F5lr36MkVliURWGXmB07on2JyRhT0Tqpz5bkMTj9c1PUPkuSO0MuKSbWgHzC2lY5cNlVU9e4UziyMWVIKVIjk6kjFeGvcwWCTelOwCypVkscS2u11HSCpmrmg5actSfvVh/ht0Vb9HC4niV+a+FiHTspcdjqxwJUZmTb2yYKaRh/V9BNZCLq/BfXOjJAqh8BsQFiWk4rAyi1QJv0eA6prIcbQqXxKsZcNjCAlLzEUnKnOasRNo+tYPw36pBOpve02crIBfKOfvQvR2X/FznmS5e6e7HnhxRnuh+Z1hcPSNIdrikLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dErcV3cvMN/wVBySyeKVEjtjSnWp3MSPybJmhmKdLxk=; b=OsivvEaNlkKKlcgdRRSVrlg6R4ouB9/BeeMKsBE76PqqPUawMRI8a7RqZSAta4+wprOdmI6NpknYZh9P8FJlQxrwXueH1dShX3ikSbCOzY8QwKXPz0/DjEMfq95fJSZb2okoV0y6za+gO/pwvqCbgWSnP/++aRWXGZ2LlcJJ7D5vQCB9iyhdTePZVOGtnvXeNlbnA3h2eQoAOqhDjysXmS4ZqJdi/LZuCu2Qjxofu7WYoeCjRqkQSc9e56nuEdFy5YT6td5UJlkek4CGH7pYPnmM67p/npV4p9pgfWAWgwGKVkoGREII3M+sMAUkc6eQzgyRvrdYwe3RzrWAb6GlwQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by DS0PR12MB6656.namprd12.prod.outlook.com (2603:10b6:8:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.41; Fri, 19 Apr 2024 01:17:53 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::3ec0:1215:f4ed:9535]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::3ec0:1215:f4ed:9535%4]) with mapi id 15.20.7452.049; Fri, 19 Apr 2024 01:17:53 +0000 From: Rahul Rameshbabu To: netdev@vger.kernel.org, stable@vger.kernel.org Cc: Jakub Kicinski , Eric Dumazet , "David S. Miller" , Paolo Abeni , Gal Pressman , Tariq Toukan , Sabrina Dubroca , Yossi Kuperman , Benjamin Poirier , Cosmin Ratiu , Rahul Rameshbabu Subject: [PATCH net-next 1/3] macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads Date: Thu, 18 Apr 2024 18:17:15 -0700 Message-ID: <20240419011740.333714-2-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419011740.333714-1-rrameshbabu@nvidia.com> References: <20240419011740.333714-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BYAPR08CA0067.namprd08.prod.outlook.com (2603:10b6:a03:117::44) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|DS0PR12MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: a2d09f7d-0fe0-4491-cdae-08dc600e89c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9rMIsFgp4fyDVI6DSjJdcN3dzSA7nVKmEJ238x8O1HPUn46sQwWKH6UzmAndL5zCYR9L7API7v/PugcVuW6H+VBMxt2DzopYwyds0zAc3UR6xR3ycqD9Di7sBsDkcgBKSWIIfghOaU5cFLpkGngBgD1K/ZejNFNmUEmTYA/EFRpU0JUAyoifGSBCp5SpwisiJdaC4xqzwAhZV6zHbKxnR59iDT3WGaBhegyyu6ZZW8X5uxlq7OmSEzBI6YqXupsOHLS08JzbKwU/87hRbvEwfUFKuuy5ZYSgVfed+fqaHhTgckjpEMlMsW/jITsUv+PnTb58+1cM7IuqyubPwXVl3gn+f86cxms1pnml3w5qLYgusN45p3g9cwOS+RIDrt8Ck3Q19iTp/wpBIQRe6WNkiqf4yBnCWdsV50MfKGutU1c7Kx56rZt5ReYOG+kM9poqjyLedWqqqgEbZpowX16s0HygOwkw7nLeAF+GXY5kLiPRAc6THorZALF7kFxQ4IaOC7igxNj91jBeXQp+gBzWhmUbJANzhJgUwtJujY21FNzD5KHFo4QvI2vXaPSmE2u5w099hNfzhLn7VGi/zgcw22XJp9/7enPo9Z0wQYfPVJ2UI/yccqGueaB7xEu8XkX3QYysJfrdy7jIrDIcwAn7lB682lRVUDBzD+OIJRkk4FiDocUstqZA8DwpPuFrCju8IPh1eOiOTKmLukJe4JSmSS+vWge5K+EfXC1E4loHIsWKGTmRQZZ447ZxEhZCSGgPbIl57GzdvO0sbwlXybDkBqdj0wMpm/3yBFzTH30/+QNI2ZLYI4YFukVlq9xLpDqWiggFF6bWgkQPewkJ731YMpKdO+AeHY4A8lJrtPuheHhA9PWZuP8tQlUhdFMIA9Z7TiNETwn1reHxOTK30EKItAZa57P9mfcmC1tCKWrcPMgzNUy23KFUcjrkoQW0VHHaFe0xMr5V316T0HGRLH5DAev2b5LEWiAuP0CeQO5Lpv5FADEBxn8uA/GmSlBJPvSar2JR3sISCM+mpy+RdubPH2mmEtOUu422R8xQt2iRktVT7nYCFhwKdCV7mPRUqDOss6nA7mPkVCDnSfon1KO57Bm2UO7MxYwbt8+CojWFTZbS49Vg/LmK4MPgHgy3oprItFK4VGnYDUJEmIkDIU6FZtUjCBfOWYtG3xgNcDQDNXvdDd7bCMGBny+7/UxS+XvdUnqWA0a4QD7umLmHW1WWx9Zv0wro0ygzhgAXHJc5dtsHQ+5OtOP6e6VlH70klpZycuQn/vn0gymUgjAp0HZBQg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X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sI/HfRTbEzM9X1TLNPkt5hNDHx5RysP2E9SxBHfLWqvbrYUCE+xf2nTcqmmo57PnDMRuqW4Va+79SRZIq8ivF9L+w56ThyRPGwPEtFVfCsEPSSyrjNsP9ZezwTM4wrVEBbqQB7wZrEWj4n/69YCRWGH8Fq5xVpiw5q54l7zoJq8SZ8a2WEy863POGOfjRn/DGMTz2hYyFWLLtHSFnGdYepI11SCzmzpg8AULV++LC6p0PGyGI0wrqPXz/0GnsBH39rlojITWl99cOszIF8LM3Qs0V9bt7GP96PZYokXWy9WUsnqh5FIBabc1umStz6IqPlk5Pa/kXTZTYjaQvrO17BxTWCTIDy40phAL438ZRrOo5kdmQtYnOddEsojPBk1VXtLHC0XHQsrDn4EPnian1hbAeEgXkyHH8pNRetDxXAP2GhKcVBHIpVtZot50VFwn5ibU/7h8XUgk2YC5UTKdpUBIfhGdfjEQHMkh3E4MvfIbuW3FfbAKi7WXcH3TCSffZLoAAHdkxHDT1hG7uQDtjgfiYoIIFNE9K8UJpDLC62bWDvrHKGXEwCzK4ZgguwK21VtyRxrl5F93ThaA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2d09f7d-0fe0-4491-cdae-08dc600e89c6 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 01:17:53.8211 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NJf0kmyw7OeqCbXruCW4A/H/Iic1hck05uUqYjw9OctIBhQnZoiMnVIcdGBTcB+gpoEtCsEqgvtIvaw7iOD8Eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6656 X-Patchwork-Delegate: kuba@kernel.org Cannot know whether a Rx skb missing md_dst is intended for MACsec or not without knowing whether the device is able to update this field during an offload. Assume that an offload to a MACsec device cannot support updating md_dst by default. Capable devices can advertise that they do indicate that an skb is related to a MACsec offloaded packet using the md_dst. Cc: Sabrina Dubroca Cc: stable@vger.kernel.org Signed-off-by: Rahul Rameshbabu Reviewed-by: Benjamin Poirier Reviewed-by: Cosmin Ratiu --- include/net/macsec.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/net/macsec.h b/include/net/macsec.h index dbd22180cc5c..de216cbc6b05 100644 --- a/include/net/macsec.h +++ b/include/net/macsec.h @@ -321,6 +321,7 @@ struct macsec_context { * for the TX tag * @needed_tailroom: number of bytes reserved at the end of the sk_buff for the * TX tag + * @rx_uses_md_dst: whether MACsec device offload supports sk_buff md_dst */ struct macsec_ops { /* Device wide */ @@ -352,6 +353,7 @@ struct macsec_ops { struct sk_buff *skb); unsigned int needed_headroom; unsigned int needed_tailroom; + bool rx_uses_md_dst; }; void macsec_pn_wrapped(struct macsec_secy *secy, struct macsec_tx_sa *tx_sa); From patchwork Fri Apr 19 01:17:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13635569 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) (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 2FC26138E; Fri, 19 Apr 2024 01:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713489482; cv=fail; b=ekQZyQwd73yOcAX3SyvuNizQLs4He5FGSc0XIfvzogi4LK+7PMVqI+aaD+TBc4QzTA6rixb/w3ZeN3rlNvC/zdgpODBtJjcc8SEXxiRcvYgPRE50ilVAEdAun4UroaKWjJPPNw5M5t4/NUg0HY1rqFQyAgEiZfDDrE4GSCmTOI8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713489482; c=relaxed/simple; bh=Mg7FIGZLWCigxgji2ObwkLNGKIIzYe+C+30GMV+wBCs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=H1voftO+DtYVPwibSBsThSPE1PO9ApWsyXAXh8S4dXSztWF+fOSZD/GtlZGj7jMQtgx7LBZ0njpQvObeqIBm4b2fOcFrf8seaZUwr4OgBIc3a7KWAW9T1h8F2/zfPABHn3JLHgzLPdLOXlwTN+aG4rcc9o1bsrZD1qVS//bDjW8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=GRq7KVTn; arc=fail smtp.client-ip=40.107.237.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="GRq7KVTn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jHwV/nn8riWT76pefpJVif6HC7wlXWouLJ89YUR/oNtFnj5w0VR69REtx77rZKeI57n3r6FUxfDgQ4kfqAwhbTSnuzhMUNcmJNtH0PX8mxzCJE1t/2DfTIUAVQQQWGHcmDVkPSipqA+HW5Jgf4BMbbxS0SkPq14Od1bCX9olYR3v8KxUyqgI1iplg58jjHmjlAjzcyC1ZyzEoaTLvfxaw+b/AAcuJOADl6HXc/RiZ/TXdq6b5XAnzgTKwMHNjBllLZxKJHNvQbd9upSfMBgks9NIoiG+pqhpGnmsQ6/ZL1LNBcMjRT39dPs/rjGzv001vPXnONjqU6dpyHZIFEUMVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BE4XveWR3UJ8PrXFToXTa5cByaafijAMMpdpwhc35B4=; b=Jk9frtL4mNy2pH2g9XGluLv5IZ6LVjROvbkGeqmmyFq+h8Qmys1lXQw6KrQOClfNHhHIaJuWATLP1LnhFRE7ydrWssHDjWVRaMn2pPnbNEkm/pWEll8DMZVr+8XDmURr0Qobiznk/hDApbvOAX4cWTAJcyrEUu0wIS3NTFGwPww2J95x1K/5e1g8fCU2w3GVKmqYzFtAb3UsAroFnJ2jz1wAxfHm5ZOQUsi8z5hdw5LrQA9SHcF9eXLGvQisVpTrkdRuQsyxcfnU/tHUoF9jgbBva4wLKAr1e7sUSmszZUDgvRHPJrZF3aLe++PxhgMJHpp/Qnb1bEsYYhlEXyNTqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BE4XveWR3UJ8PrXFToXTa5cByaafijAMMpdpwhc35B4=; b=GRq7KVTnmDVqqgNrt2GHO1FicGlA5T0imS7+0XCt8o1GjG1uVnTSKfbNxn/l2gh4mc+ur/eBb63oaSzwc7rQqWErl9VcPBJIgEij86joEre8QxcPgZfJMjPSe/H0XjPmv5AKqPbrOlzbOW77EtEWLs8D3MDmtUTz/xoR1vnvzpKrhePCiftG1miCtFVGhbv5QBw3UP2LFnt30V3G3RK1dpTu41l79ttX+1mmrIo/VxtQW0Gl10W+qr7qYeffPM4pG/b1JMUsePLaUDj/QNNyFcznOXyo49QUG0M3bv6hnQiWoE8yUkllDIMSMgvHG7I0uUGRC3HB/A/MWdUlU6mVGg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by DS0PR12MB6656.namprd12.prod.outlook.com (2603:10b6:8:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.41; Fri, 19 Apr 2024 01:17:54 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::3ec0:1215:f4ed:9535]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::3ec0:1215:f4ed:9535%4]) with mapi id 15.20.7452.049; Fri, 19 Apr 2024 01:17:54 +0000 From: Rahul Rameshbabu To: netdev@vger.kernel.org, stable@vger.kernel.org Cc: Jakub Kicinski , Eric Dumazet , "David S. Miller" , Paolo Abeni , Gal Pressman , Tariq Toukan , Sabrina Dubroca , Yossi Kuperman , Benjamin Poirier , Cosmin Ratiu , Rahul Rameshbabu Subject: [PATCH net-next 2/3] macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst Date: Thu, 18 Apr 2024 18:17:16 -0700 Message-ID: <20240419011740.333714-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419011740.333714-1-rrameshbabu@nvidia.com> References: <20240419011740.333714-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0014.namprd03.prod.outlook.com (2603:10b6:a03:33a::19) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|DS0PR12MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: c80ee0ac-19ac-4925-07a7-08dc600e8a16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q4i6XPIZYq4CcCB70s6BUxMmoNJWv5hxAl/a7xv1DjbU8Zx6j1sLosD9OVx+0MJv/7zUBdP8wM/tsx7GEPzcZZjuwlSjtFa14OpIKkFjw6kfPJ0wV5tpsBy4sQaZOLSjNInalh77y6Pk33MTZVqsqsA8BD3vY9h1OYmOqTtuRJD+TvTaQAn22KxnNkdNItXU8c+i4sdLbvt+HkjGXnlIbp+4LTOAuSm51GqzAkBOW64M7ICeXB9XSmZmciI+dz5i+pGcvCG2S0tZz6D4DoSCo8mjwejmX90/66u+TDmm2pGPS7JxA2qrCLqn6yrZd37/kW6nFvABKNWNf3W15Dx0EOQy6JGZTOR7kynyzoxsTyecX7vD4b6UMuGdtMDOsFoFkUsvq+tv6BZ/fKln3f65GlJ7g6QyZV2djcQ8FeX4ykNps2QwgszjGYixvEbG7zMyilS0RPqxQhhG/FH36JOltluFC2nSY16vc23g8KOt8JuMJ5m77hmhTaHjmUB18u8/mmCRTKh1OOqjeJXvluhssIyN4qhxXlJdW1bIbKjWKl2rxAAAnbjNqZlKL158+PK49wwO19egoosTqiCgf1NTbg6toKx7T4Z1n/dfVLEPtJO8WJh21T6Hu7t/DOhYJ0OND5gjTloVYyRukK0Na75JiT57kMBjngyG1g2AqUurQoWAHXht1trWHSDBOLo5ZiIpnSrbvMpPPgAlwDiT0q2PAWhX4cw+45D2lTvA8uTNHYX+3/YMGv4Dsqa0GaoBqudDiE+CzAQoJMLqDv4maSijCsYFcxJVw827pCpxzfUJcP4y6DJviBI5aOKQnzGe6XEuU/dlgZpC2pd7RRLKkvnRa+dKfAHHj2boEdLwvKykSS3p+xWiZWTjjT5YUOv4TWDky4WMXiM1bbEyA+0SCZAZ9cbW9OYEds5SMMSv2PAXOI9vR6LKNAhIVKDlrYcE2cIaT2vIEESWBOoFUAqThqCgSrJ+XHe2LgmLIjOubyAempS1Rkm0/h0T5OFer48WeYBl2d4OX0N2WlW0lDT0qg1pxNp3KhLnqRSKTH4M5oh7deDLClWSscYYbJqXcnlbsyP6yyc5jeAup5V4nWjj0HzZpm/TrCVDLFOdQDFIuM4dv6F8FjSFqv3/thX96q+90YD/Mc30glSrxtrOs/5fAqD//w6ib1bMkfe9qq4R9WW9mrEgnv81/L8mZ7PLm+UePnuxoE/GT5bdpUo6y1trffv5ij3wch7QtSnobcAue9aU/JKnYeqpnH6vcwvQ4zlafSJ4v2kHq6Nn/oVHW0MP+ym48w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xvwnJC9LoKfMKRAd+t/fxkvJu38fJQx5ptYKI+x9o2u9cBHMRRQgDhVc5cuxKmpHjrqks9FNTd7CMdIB6M0Qdq5wJboXnbxKIUu9UlKuHW1EuLgX54BBTZ0SiZFS/IB8pf8hEy6gKAh/4MbX9txH5kQ6c7ibxVeivz4fnYIKDoLf4lFeogmvAvurjgRmfLCihs4krP5C27Abrpwct827Yspb4vjdF5P774ewu6YiBYtrGUieBzyyW+oUgWF48oPdBL745Sw76k+JxbgXI+UFDEWT7a+mOGaS89j2HNhEYn1Jsq6NH5RYSxZnK1C+i/b5d4JU3D19KDtlS96H0ewv774kEE+Et8qbIDNkDkda4ZXwNUH1MatY1Eyj1xrYTz4q/ZKnE7tM66zU4BGWRewiefMw3unJ68XiPvgnzpBW0bf8TF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W9kUM7CfrQCifGUEDlHkGkHbks5os49ZOluVPQox9W6b7kJopydBE561x1ZMCLlNahfS7KlQk5yWcZ95Yf031Kzx1mzzvag0aC93PAsyKQ+83GIQrJMLuw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c80ee0ac-19ac-4925-07a7-08dc600e8a16 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 01:17:54.3902 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ELuBBHFz5MFDOc0M+I+iKaV49wOMVEPmEw6iZLBhdki8Ch9l1o6GMlxxVcjTLVvH+nupEhChLxQ4cL3rrENAEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6656 X-Patchwork-Delegate: kuba@kernel.org Can now correctly identify where the packets should be delivered by using md_dst or its absence on devices that provide it. This detection is not possible without device drivers that update md_dst. A fallback pattern should be used for supporting such device drivers. This fallback mode causes multicast messages to be cloned to both the non-macsec and macsec ports, independent of whether the multicast message received was encrypted over MACsec or not. Other non-macsec traffic may also fail to be handled correctly for devices in promiscuous mode. Link: https://lore.kernel.org/netdev/ZULRxX9eIbFiVi7v@hog/ Cc: Sabrina Dubroca Cc: stable@vger.kernel.org Signed-off-by: Rahul Rameshbabu Reviewed-by: Benjamin Poirier Reviewed-by: Cosmin Ratiu --- drivers/net/macsec.c | 57 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 0206b84284ab..679302ef1cd9 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -991,6 +991,19 @@ static struct macsec_rx_sc *find_rx_sc_rtnl(struct macsec_secy *secy, sci_t sci) return NULL; } +static __u8 macsec_offload_pkt_type(const u8 *h_dest, const u8 *ndev_broadcast) + +{ + if (is_multicast_ether_addr_64bits(h_dest)) { + if (ether_addr_equal_64bits(h_dest, ndev_broadcast)) + return PACKET_BROADCAST; + else + return PACKET_MULTICAST; + } + + return PACKET_HOST; +} + static enum rx_handler_result handle_not_macsec(struct sk_buff *skb) { /* Deliver to the uncontrolled port by default */ @@ -999,10 +1012,12 @@ static enum rx_handler_result handle_not_macsec(struct sk_buff *skb) struct metadata_dst *md_dst; struct macsec_rxh_data *rxd; struct macsec_dev *macsec; + bool is_macsec_md_dst; rcu_read_lock(); rxd = macsec_data_rcu(skb->dev); md_dst = skb_metadata_dst(skb); + is_macsec_md_dst = md_dst && md_dst->type == METADATA_MACSEC; list_for_each_entry_rcu(macsec, &rxd->secys, secys) { struct sk_buff *nskb; @@ -1014,13 +1029,40 @@ static enum rx_handler_result handle_not_macsec(struct sk_buff *skb) */ if (macsec_is_offloaded(macsec) && netif_running(ndev)) { struct macsec_rx_sc *rx_sc = NULL; + const struct macsec_ops *ops; - if (md_dst && md_dst->type == METADATA_MACSEC) - rx_sc = find_rx_sc(&macsec->secy, md_dst->u.macsec_info.sci); + ops = macsec_get_ops(macsec, NULL); - if (md_dst && md_dst->type == METADATA_MACSEC && !rx_sc) + if (ops->rx_uses_md_dst && !is_macsec_md_dst) continue; + if (is_macsec_md_dst) { + /* All drivers that implement MACsec offload + * support using skb metadata destinations must + * indicate that they do so. + */ + DEBUG_NET_WARN_ON_ONCE(!ops->rx_uses_md_dst); + rx_sc = find_rx_sc(&macsec->secy, md_dst->u.macsec_info.sci); + if (!rx_sc) + continue; + /* device indicated macsec offload occurred */ + skb->dev = ndev; + skb->pkt_type = macsec_offload_pkt_type( + hdr->h_dest, ndev->broadcast); + ret = RX_HANDLER_ANOTHER; + goto out; + } + + /* This datapath is insecure because it is unable to + * enforce isolation of broadcast/multicast traffic and + * unicast traffic with promiscuous mode on the macsec + * netdev. Since the core stack has no mechanism to + * check that the hardware did indeed receive MACsec + * traffic, it is possible that the response handling + * done by the MACsec port was to a plaintext packet. + * This violates the MACsec protocol standard. + */ + DEBUG_NET_WARN_ON_ONCE(true); if (ether_addr_equal_64bits(hdr->h_dest, ndev->dev_addr)) { /* exact match, divert skb to this port */ @@ -1036,14 +1078,11 @@ static enum rx_handler_result handle_not_macsec(struct sk_buff *skb) break; nskb->dev = ndev; - if (ether_addr_equal_64bits(hdr->h_dest, - ndev->broadcast)) - nskb->pkt_type = PACKET_BROADCAST; - else - nskb->pkt_type = PACKET_MULTICAST; + nskb->pkt_type = macsec_offload_pkt_type( + hdr->h_dest, ndev->broadcast); __netif_rx(nskb); - } else if (rx_sc || ndev->flags & IFF_PROMISC) { + } else if (ndev->flags & IFF_PROMISC) { skb->dev = ndev; skb->pkt_type = PACKET_HOST; ret = RX_HANDLER_ANOTHER; From patchwork Fri Apr 19 01:17:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13635570 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) (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 439064696; Fri, 19 Apr 2024 01:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713489483; cv=fail; b=Ylrzqiw8HNSCMMWabbdKRXtWiJESinIvXUfNf08QNVnh4B39PHg1bEiunxhR2iNeMuRKjiMh+M8JNjdP5E1q36rFdbYjmRBVkU0LAXBzwHHddgdgpV2W9o5LAUlXu7sYH1G0FyzrfFc5NuphJDfltUQCxJPups6lj2GrZYpWrSw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713489483; c=relaxed/simple; bh=ngvh2qc4htDMIy6YBph6Cs5B2mv5a/73cwIVLNEvUg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=MUF+V6XkTgp1tm7wr0qgYYKXlqfgimqczUZ9jBtrbIiB+YDXCwgAud8FxftujUCfj7KKMreG4Sjp/LB8yf2uX0GWm8PZYik1+YZmn11dhYsJVAZOj5eEPc2AixCdtMpn1Xa/+ewHcVfmlp7OJAmJHLM3jsp/PpU+lRWJUcErswk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=r6JTQ9HY; arc=fail smtp.client-ip=40.107.237.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="r6JTQ9HY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TwFqww6+HnKSElj8HhDAyGlIkvrXebcSa7iByh4vzMHuNaB2hsrMt0RxSD7KvKAI9NaOj/ggT5ZOGbzwbM8Lm2nu5BwkpRLQfT13mv+WBy8AruBHOqhw8eGb+FkhR9MCS3vqn7zdSIoCPTWnLW/myRimRuQ2TgH1W1PkwMTYAi8T8K73u82odV0NQunLrNNL6UwiLztb+YAEE1LLdZ2OxW2Y4JcPI8aDFysCq1Z8Dkjlt63WD15TYPZ416/tGp4EE9C0EQ/RItnxrxPjrbdrySwIk5at3P/StMDepMVAtIQUEyItVUIYUTejRkh8TueyTN6mQwKr5fhMjSeIiyTDGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=16IWn82d0wSU4/zaNVShA83xDTy+3kxeAB0bDaf9BS4=; b=n/XYCCK2bBHXQsF3xCnyApsvcifyX+duS6atB+ZZFYIWFYWAV38PidyG25WvDWPRVHhtJyYAPW0YxGnlD7ypWAdE1oUYHtzyMQ9EZ5s/yb/1G61R7SOWHa8cwxpgM3L8hngoTEWjVRe2ls32lcGKcCWQaYuxUlpV/rq4cxISVkQHoOJKq2ZRe0JdLOIXvATY4541l+Z2vv0yk33CMkXQD93JZE1tUK2/r52aTXqtwehpsZWmvyXtdcFj0f5kbMZPSGShkIqO346exb9M9RmRrTHbr5qRIVMknCCXBILV6OvCSpB/3V7wAenp6qn40qEGyUfHTk2bVexxAmfzhWV8Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=16IWn82d0wSU4/zaNVShA83xDTy+3kxeAB0bDaf9BS4=; b=r6JTQ9HYFGdLJXE0el+DIfPuauA6wiqPS0oIchRGUn+YnSTCQptsWASE/E3VwiSqcOVOqYBgtVST778zXWtkRPsTTSqwlTUoZk0YsWx0ZUCNKRKmXpGpQ8cpTTXKgg7NoWrc1r9yFGRccg8DeSJdlDsHqiZa1vwCTyIZH5ua8ggLN4uM++sLFIw5c8SLnAv9aqPKD73NEskLE7HwRUDUlH1fyXqxDc6lfza6jO9frfNwadQlg8mcWJcMuBAsDim7jaSZNlEVvslGz9+R7ByHJ+o9an86ox2EwkJbTl0LkqH7B64p29CeX0e6sdg4j4qBEYBca0Ty+ti9B+H+wqOplg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by DS0PR12MB6656.namprd12.prod.outlook.com (2603:10b6:8:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.41; Fri, 19 Apr 2024 01:17:55 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::3ec0:1215:f4ed:9535]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::3ec0:1215:f4ed:9535%4]) with mapi id 15.20.7452.049; Fri, 19 Apr 2024 01:17:55 +0000 From: Rahul Rameshbabu To: netdev@vger.kernel.org, stable@vger.kernel.org Cc: Jakub Kicinski , Eric Dumazet , "David S. Miller" , Paolo Abeni , Gal Pressman , Tariq Toukan , Sabrina Dubroca , Yossi Kuperman , Benjamin Poirier , Cosmin Ratiu , Rahul Rameshbabu Subject: [PATCH net-next 3/3] net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec Date: Thu, 18 Apr 2024 18:17:17 -0700 Message-ID: <20240419011740.333714-4-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419011740.333714-1-rrameshbabu@nvidia.com> References: <20240419011740.333714-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BYAPR08CA0061.namprd08.prod.outlook.com (2603:10b6:a03:117::38) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|DS0PR12MB6656:EE_ X-MS-Office365-Filtering-Correlation-Id: 29f1a788-b84f-4626-b228-08dc600e8ac2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dOrrNCCxsFCheHzWX9s+q6NPa8Lp6Eixn+3HUJHI+U/OT+u+r9pVTZZTET1c6vGDZEMJkjKlj8vZZ7Enf8YAVpng9ku8KQz+ma8GJCrwc571bWc9bOzZ06p60PsE6oHBM6uiCnuyQNYbuKR0Nar4BlYPgcbfJm2NjK9vUMtNc28PkMUF1MaY1/ZFdLiMUqFQFsG17BgWoleoDo15zuUQfPPudNbQ2gFKTo3qjEKnGz/YGOz0mta5SJMlAP25BSrz0KuNb7w/aHnxfk0CcyjnuvODCY3pzaQ75Bf0578xGS2HqL6YpGKe9LTCy73EdBPu4FhRrgopjWbVsF7YQWc1v7LOQEr46G84Sck43h9WlFvLY3enOOvl20+w+877Qw8a9QMixAEEZKkJASFYuq3se8I6X4ikN6q8hh8ZrDZl0ce0nJA8keViAXjCJA96rGmE6EXAU5hLwXMYBoHmou8MOzGjqh00LktnDR52/B12vIksgI8E17zLNdPegdV46EA+Yblfwv2I7LsDZOSeuO+NeC6tKRHXy9pUK3z4i2wzKZ+ubW2KevyJeUrb9c3HJBebmPwAPW4qxf7QtbTiLfYYcrtrreMmi7e7ffL5F3xROyzOkE9cNRNqJ5Jta03uNetRAxRbUI6igFKpFr0gqAI99EFLeTJHib63AIunXxCxbnSIKMDP9WzueXuZ23Rxo8yqxYvw8nkymTW0Ezj7ql9ZdJUi3hkmct7KYDOwYE04xfl5lLT5PCcUA2PpEL9FIU1MkFX2Qn0LdenGLTRjqa7ap7orRXjgu8XC3GveADhwTzeCXjbejh0JmQmQl+WZgJ9t6pZZYCkXBKHiy1x7pfqX/VN7gCrBXGp6vca6jkiDCrPNhKPUhhK478s/AwaqTFhDAAB9ejPV6x0dPmsnpzk9ofNFKteFnNW8+oRzSp/UkII5FMU+rN6HwGuKxJDM/+xrw3/rvMKaocjoSs8fOB4nMOERXSjbdYC8eWgCJAd/n+umfX8O7yhw96QGTb9ogxuVtpbULK7zu19MrPWqA473kzDMUfI9MHwurZAs5gDl1XoQNt/KkZ3NOKzkSoRK4hOGm77u5im8/jutC8ezEU+DbZuMDrR7fMMRdrLB4KZVnZnUmoq3jwRz13kIFWwQiRftuPqvjNXXsFmnUL57W7kJb7ncfrlvyU2kBjQb3Peb06JAGzPy7ln/Yr6OFsnjLZB4jncyeKK6pXgCuEuG1Wuz76JHwJNEmarrtDGqF1KuTuVv52beNKyUZ60dOf0cjB6LZFUmJ64mK1HvfzOkQCk2kw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cUutMAcN2nXBtlBe5IO2Z26CN4gAMIEjS3HymXwCKZN7BkB3v+8Cet4l2+1JwBbotYANqsam4WdcRorgrt8c0A0WiN1Hm8qiRdXNewfS3jDNRaBfExEbspRtcRV6K2nxxUL4rjQBmcdXe6+yGXqvIfBaeI09Q+1IWa2iEkwbe0Fa/lzhHNdXewRBVNGog9S3D6S5de9I5Tg3QefrfVkdCBfaM4RX4Laxocoafi7gMw/EbW9cIMWNKRs5HOecxcjwolp0Oo0M3MzsXaKerGFaEwY5PAOrJa5nAYgT22kuafMsPgNNGJOwwTbvTzH2D9BrpoktUM11R6FTGMn4Q6PelG1DL6l5hKdyrBHPl/3PCrh7Bnp4UqMpYhDHLoaUWY8B4OC1vfgNsb0ml54BU5Vo7v8YaVmNNZO46dNiaIPNflpW0z2MuXaCUH3+qxmva0kT/UCCdyPN0/KZFtXziBPQ4wm+/TW6ppSbhrwa8ZpH2/t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57J2ptrd5QF2P0nRaEFgondVJrzdeBaZphiQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29f1a788-b84f-4626-b228-08dc600e8ac2 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 01:17:55.4665 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FctHSoftRy8oITPdjCghCmaxINbHVoJUuKHVILdG5XgHiGywzTmPaWTcuBPelpK9gfAtIa/pr3IGi4WiBof+tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6656 X-Patchwork-Delegate: kuba@kernel.org mlx5 Rx flow steering and CQE handling enable the driver to be able to update an skb's md_dst attribute as MACsec when MACsec traffic arrives when a device is configured for offloading. Advertise this to the core stack to take advantage of this capability. Cc: stable@vger.kernel.org Signed-off-by: Rahul Rameshbabu Reviewed-by: Benjamin Poirier Reviewed-by: Cosmin Ratiu --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index b2cabd6ab86c..cc9bcc420032 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -1640,6 +1640,7 @@ static const struct macsec_ops macsec_offload_ops = { .mdo_add_secy = mlx5e_macsec_add_secy, .mdo_upd_secy = mlx5e_macsec_upd_secy, .mdo_del_secy = mlx5e_macsec_del_secy, + .rx_uses_md_dst = true, }; bool mlx5e_macsec_handle_tx_skb(struct mlx5e_macsec *macsec, struct sk_buff *skb)