From patchwork Fri Apr 19 21:30: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: 13636772 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2040.outbound.protection.outlook.com [40.107.102.40]) (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 E8D991311A5; Fri, 19 Apr 2024 21:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562243; cv=fail; b=Z9WT9G80vGEeN/xokGZLeE9uaeSbvnFmpmsq6VtZGjZUWtJa1ZPFpgPUjckjwsZQ6MAvqaeZCo/QsCbeNIrKuCyvS9+Xzuv3C+c87b9kZd1O4l7dK8FIrwxfE8pfEPD92WaScinlyzOGB1HuGIicsrQpr8DyYzeGIlB5KC7/LVI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562243; c=relaxed/simple; bh=Efdz8G45dJgRkSatbSl4NcrFXQdgKcLgNq966ZXGMyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=NbAQQluvUiYtbpqPDzKh1FvMnc2NAduEPA8oNf4Qq5OGtuOKsmyuSMuIqDInTAkUZZbW1OTg1XeJCBCLEyR0Kl93EddzYt4iUH9eJ3iZ8M0A+bF4z8B1QlGgWjcOmH7andbNCGUn1G+sK+8jNypE1nzGW0xc+Jr5ShXh85Z96x0= 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=B79Dvh/z; arc=fail smtp.client-ip=40.107.102.40 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="B79Dvh/z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVsLgnQ0GWNhNB1+udyuR88At2E60LiNKtFl60iidMp/bfiSrjyKVW6WSk/iejeGQxf/NDfsHaihhvZvMh9w1d7fbm3r5B5ycmA62iW1SkuGOyAiofxlw4Ajj7luILyzAx6lrASwmRFpOVA+WAnASFrb2AvL8qXSQthVqfYSufqsHcMldAylkWmXSWYxMTTbQrH1NdmzBPwXIoBRByG016jnKM3Syz9/1yLtBhvf/LkWKSiNXT+2fdK5bevjDNEdwhQ2bXmj2lhYdQDm8Z86DFeqrbKP+wqiSztH8X52fpyANnbNIf7n5ZpAWhBAbS5sk+TVDhFVwSZPcwDt6N+ciA== 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=oiX/fqj6suKE8LTmyQVM+wxzuokRp/GIE0XrRv5+qfA=; b=BRSG1Szl5mrbeh7IbK8bZpLDUvClSXak7ndfrtUOxR2uJxt3myg3Go1ZlkMEIVUTXICwT3M783GBpbebZNkeBmaCZ2FEyAs6dmzYeP3RkXO7rFBF0IobIUaiF/wsfNMdBzDjGf0z7Y6dZB0iV34HoqYVN4j7jTyJGqm8qWFlbFJEZcbQKHOkL6P49xbbqClC6bk//X7TYxzTiC4dLoIS5GIU0oggqDmeFAzMoPejvTBMPZ54WeLCERC0dpOlNyuP8q0JkuFbhvP6aZ9n3dSA12BSbtuNOUgt1DkJ9mTxqmHZhQyGln4hMNzI9M/X8rK9in6OerGWv6d2XMzik7CJBQ== 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=oiX/fqj6suKE8LTmyQVM+wxzuokRp/GIE0XrRv5+qfA=; b=B79Dvh/z2OwfbQlkScBnkccFEnQgtNheG2TIliN5sXmCPXouCE9VL4Zitplc7rNvwb1GbEUwaeODsC2NLm+fycGsutEjB1Q3gIIxltXqbHWiNIduwcmti3ch9NBdtSYNKM3mskjvrLClwrEwSRtM+AsEhO38vbYi2G4KK5r97sry7hnBRRB2gr37Gc5uhXmhey9FxXKlC+5hAFMyG8yuyamZHWXZ0645vsjgLEqlNfcA8ex7kpAnGjvIIabevayB6nqt4T8nzftLqDGYyLrYpX10S4NJdPudu9x7dr6qsuba9QFHqyCi0gFewJGwgZITP3mwC+1YOUfSBedR1eaZgQ== 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 SA1PR12MB5670.namprd12.prod.outlook.com (2603:10b6:806:239::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 21:30:37 +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.7472.044; Fri, 19 Apr 2024 21:30:37 +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 v2 1/4] macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads Date: Fri, 19 Apr 2024 14:30:16 -0700 Message-ID: <20240419213033.400467-2-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419213033.400467-1-rrameshbabu@nvidia.com> References: <20240419213033.400467-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0206.namprd03.prod.outlook.com (2603:10b6:a03:2ef::31) 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_|SA1PR12MB5670:EE_ X-MS-Office365-Filtering-Correlation-Id: 27a65fe1-3d34-4578-57d4-08dc60b7f455 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: emka+DcG7USriFJDjvgfgMPtnICP3/No0p47cqd4kY91GpAMDaNJI9lHn/Gyp5/iQTNd7/jMXDzz9dh1oJbsEC55/c8JxP9mtQ+bPDXp1ZS+SLSFI9kTz351kfGZzoqU0JKg2esKaqV9RmhFzr4EIuEhbIKbnga/u5jS5jC5B2nY4BtUPIIlHLk8w8fw0SENg2h9ADC9w3sPFLsx7fkISDI7k33i2Ud4RprRPMLT5JqsdXrp3bi/NJbRlLSvFjX4vg3d40vWHSgOUsqZlrVkEwByPE+59+Qc52FEylqZGmXhi5IiaajEpfWzfeu0jUOvsqJpF5J/LRTMj3n6OVygGOGmSyPj1XJlBfs83zv3AheMPgpdMpIwIAbNcIpuP5hCf1us5Yqiyuv4xq0KfNjW7dVU2Dh5XbXd1FWsTUb6wNv3s7j8wqpUmvKrcpIypXJx9+l7C0uu8480s3Sz9rH7i0+UInyhHYwUozaIgXxEbh7HcAfrF4Za4o/buJCPX6qG8zufZe3bk4fnzpJDZU7D1wjlTO4fqT2NUBlxeY2u0ZCQyvv6XYxP/odCBAgBSv+A4kfF5tqhcbY4Kwe6D8d28kNDG6qxvIcFxGvc/1MhOyvbwYtxPaKNmIV/VCjz8cDxUqGriysI1kCH4niHVRVbUsf8Pw0DFjXus3MtoOJRl0CYhrantqE0XHdRpmZGgviMIBxQ8OnRwuo1GLb99NwYGwQVRL3YIANmZTKM7PUyz7ET5Ap37wtX8jPWQPTOlaeDbG6AHlJG8aq1ptuA5peekVCPC4yYijm/jgJkpFN2gWESdNdMKaU0z2QOoalZrF63U2TCQ6aZXfzZ+RYTxRuCmv5f5toIlbwY17iXNXw2R5578o9YCLBAZlBWnMJ9SRatsKMzSKXc6I2g90UqTACQBk7RPjxcdBotw3ElphcFCZ2sORxeJCRUlngkwIZM0xl3E/Wmnc0BkY398pmF0tOYOQIf7+srTqc7wFnPYbrRmL+v6RtMRHpkRNuxdoIzVywJncB616kJWU8VMLvUIBx3F5T3UTz+INCD+Yn6FYxZVArtP0QzCvlcJdbSPtzEGc0SZPMquxINIuB5KLV0EUwhwzQTiArzwNH6kPI/hnqLg9zOFgzdYi2MpsJ8VQh2t34P5UT7Mk4JiYorC+K3hOzR8+DTeG3GNUc6TPn0sSIyfsBstpIl40gfUazKJxt1rxqR9FnLLu4hIrjW7AkZ+s6cH42f5u9+jdwp57h5+GftZ3B96/8QyhoWanJFDZgKihSH899jxJhqnR5TaB44OZ+NbA== 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)(366007)(1800799015)(376005);DIR:OUT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B5bLO4AYTFEnoVVR84/a+I/1p7lUXOE47J+TRhPKqu3Q3/OPk+kH24ItsAUlxV5ar2lbjMRIeJIlrywcyLMp1jdG1+UEKq8jDvebRoFKRNovGbilIhTZ340kp0rDsUf6egC20OwpxFsJ7GInoFxmsLBjGwPgiqPoOVegVCgV4Pgi8ncLC+dBhmEZGXbCJkq3gJqS+sMLJTL7QskCIKJ873aTHH9hRzsKR5ugrANigJZevCHAEoakNNJcPt7jc7z6Iu+v7EuTkG0CyFcQGpmYS4L67dMV+PEwk9VDODoxoVIteaZ8z66l1fe377Q/1qQLCYKh5KsmUyxuOTBlgGGnwSuYgaT2nBG0qP6xT/MqnQIK47MAi3QCUOU6TmB2R0IphDkIdyY60W00P2AZsgBPoFXJZ4sypV1oyZ2drpHsAv9tohBCs1ls+x+n3UApn41ODhWZogDypRFL6Dzfu1Ei2Mk2YstakmHcpT83Cx6/XDgCeuyP/44jtAQY3L2Z/Dww+L9HwtC3PcpZQd8S2jgDCrk6Fd4+SSnOWhYEC7t023+S8TrNtUYrbLDbwOezzKOhHvyVj36gE+koDLmsgQ+4ZQ2ZEOJFu3+VdjvoZIJ7cw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27a65fe1-3d34-4578-57d4-08dc60b7f455 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 21:30:37.6190 (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: e9gzVjD64sy59wa2jy6AQFEB+619zxaSAuutBlMXtgm7b2E8wXHdv5148pwSCiJvVktGgKOLNS8ictTbXkwQXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5670 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 Fixes: 860ead89b851 ("net/macsec: Add MACsec skb_metadata_dst Rx Data path support") 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 21:30: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: 13636773 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2040.outbound.protection.outlook.com [40.107.102.40]) (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 B7D4513CF83; Fri, 19 Apr 2024 21:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562245; cv=fail; b=PskvpwolIf9uWBdhzDkDZmsAbzPIhAc7NCEbhs3+eEe9OyKW+4HOvZX3bD41lzzj+2OljLa0LCFqBvn6n4r7Z49WE1Kza6T5g6iXzsZf0vheS+7f2AjPwVXypRTB74dwS1fRwv3LWNmzaUKWrNdWxtYIX4Kr+iGjdYRJQcIqUgE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562245; c=relaxed/simple; bh=PRreFg2b6JlM1eI2FTA9DBICxWENzZBEIAErLWH/8zE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=l1mwragkdK2LNSgC/5XDOdqCwnpx3tv+BOR8WHjk3xZkJkXc6Cvpkqhz4zxBoFDTs1ODF49mJ1TdyowGCgM4o+JICr9dHxf3M2QXlYYRSDmJz75yIyKwsv/OpCIIozZzMolJ04YgeuaYeudLOkCSPkwfIhEgPmOEby3mPxJyDM0= 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=U9AFzqMV; arc=fail smtp.client-ip=40.107.102.40 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="U9AFzqMV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mJRyn2rP/TJCYhH6dHJ7THl0m+1I1uPnV31r0lkjXP7CP95SuxBElovGnMD5P5F0ZquECX0W2ZUi+jwL9HPaQavmvLFyfXpj4nl23IjutW5LnjLgdY1Sdg3NvG3rkNR+aSjNjygjkFuU1FWDz55cisbbnY5kWC4312yvNzxH0VRtLow+M6mppDDXnoERn9BGLMaKCsM/1sR7bXYZKD5CXRcCUSFdmbbfjn0w6f1+j+bAqlJknsbGvlp+2dGzUxJIpTFpEXjk/qhSL3K8Kt0vQKBXsQ23Z4QVkrJiO74XJAvtZcEI+EzwdSURXJJ7AjIJt2PleYlgAzgwkmLg1LK31w== 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=a+K9qTCgu+fLxD1AmLbEq9daN/nQO9+YR3G2/6HMAZQ=; b=b9x3HXub2GrOylBIrxaKEfxiI8amgySGnn8duJoKYv3q7MyWQwMKhqfJ8ep9bAJ+70rYSQHc/TvUZlWREe7uxcrbNi/LYoYpFxtnczuS31zAT9rusLVteuBhup1LYNnBH6NlDyXtn3D86jqPQTaLBPJRromnlYO6uiJUI9EJMcynqjk7+85i9bv8lSecAofFm2aRFoW7+H/KEmvMixq0gK/d9s3Z4VhXg4MRxvFmb95vRXsOmuOZrGYFu6NhOEEYSa2Gqfqm5xGwULGC2PGGhxtyTYTEa6auORCL6k9tq0ogfDMKcP2YOI4MeynaiTg74j0+acBJQN1LMluD9dWi0Q== 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=a+K9qTCgu+fLxD1AmLbEq9daN/nQO9+YR3G2/6HMAZQ=; b=U9AFzqMVjHZDED9bwiLlsi+RnxK37Dupiir1f9QbOa9aET8iO0PYQikzbDs4wj+CnzDS1U6x9pvw8hyTLyNWSkma4w0/hwOgBTquaK6rfoeAsV2LATnOhOmQfDsgeZKNZZJ3CcfXJvUXiKBf4i5rprNssyvBQEXo8ZyF1KlN4y45fVbHVRyGRHp97QgvlXh4Kx+e2bBNjKZ2kOzS/Ais2onsAHlm6iCXqOGcocYC2NLHHKzzpFbKbRjUEJ618oTbNPV09nYor5kMl0r5/9NxuEHZQC9YzNie5iZ1TLM//QLlZeape9MORapo3LNY0hCos1DNTs13pGJf6kTbysiRXg== 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 SA1PR12MB5670.namprd12.prod.outlook.com (2603:10b6:806:239::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 21:30:39 +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.7472.044; Fri, 19 Apr 2024 21:30:39 +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 v2 2/4] ethernet: Add helper for assigning packet type when dest address does not match device address Date: Fri, 19 Apr 2024 14:30:17 -0700 Message-ID: <20240419213033.400467-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419213033.400467-1-rrameshbabu@nvidia.com> References: <20240419213033.400467-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0228.namprd03.prod.outlook.com (2603:10b6:a03:39f::23) 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_|SA1PR12MB5670:EE_ X-MS-Office365-Filtering-Correlation-Id: 92a91a68-cd06-499b-90f1-08dc60b7f531 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mFFASv8gk4w+efJt066U34s3JOyOcCMkgjREhWChaTPR6c0AP/jGt4Wm+2vafdLyWtwhHgh+Je+2+zbv2WYUlNvXpTUGRwoQACnA7khuAX1ZnyAY74LStZnPwEvCiKUQilYqlgt0VkkaUCKWQmBIlYXyNz0+/avSNtI2ixKEV+LkPmKEHWiwUU/rJDzuiHxNqVn7GU6aLRunYMo2T96Ph/rZ+beD53NpAugCu8ZH1H+Fj2VxOqW7xXxJ16SepOU7Y7oKHgReoOVTdEcDrf1XUyZohV97vm9WnbIMdD7W2NoQXoD7XuFosqtbp2BKqnhSmsObiGT/n3ISWk+GHGykUpgTDHRMOszJycpQ6F+ng/LLUNfNPA6O5A1XfBTC9zaAwIoiYgCioj5e+qNXDnbQuZzm8KuXfpdXaj0OZHbWNl5DYXRQvj3jxbQZRI+31Y8HgzCw9RZ0IbQsBBvuS0lRU0ZeT6SlzL6yMcVLnimeqa8V8PLEQNtSGW1EQNkjsQO4Mh6kilvpwm+t27tDm8xspUt6bevkHLHeQr2UQc5QoB1Ezvzp+F65a4q21gto7rjrcBGCukN0lktMt644M1QNnSEcQ3zl4KkCCT7Gh1CqCytYsNP6eC2EeZr2ccBz4mrA07d2kkG+ujnT5PYnC4gXkk2H0vpYG+hUkU41eJ9Nyl3Q8QaeoUyPUKCNthhp7x8vGpm9QyVtAKH9RocC7p+2q8oCIsJor7KdlKqQHS5mFSCe8mpadZCQznbEBbD3K7SYSfvsI8g3GCSvv7Ky06D0p29hQgv3NBzbpM/iCFTLhT9qlA0iI70FiwVVdpmZPHYOlJjI7Ri1bWIzf4HaR/OjwQFfGk3V54pCD63LOsmQbywRHFXP9NBbymeVqiGz5VRC5rjTcZylBRevQFo6FVKdTFIJ2XuYzwVgtf6Sy0PssG8lAjIgFbomyWNH9Aj4AuvQ7NBYPMIpSn+UY4Am4GeRn6mI72DK7Lo7X2Lyx4hxLc7Hh6HO+Lm7JsAcTkQWM6vYc3sYm30HzMgsB7jcWeBVFktaDtDLRCv/Fp5zJZZAulG4JYvQFAinIQPUprofaep/8o4ql8qIULAfbIljxvGULaJ7XkUb2bq1Q7nIabz4MeyHIYO/PIM49MgzxsqyU4hLOhMme0ZA1NPXiGY45OOzbiDMF1GtSgf62IlWcCgaN8HWo2mQmYzl9adIwYsDXaNVBcQr2nPrUETqb7crQwMU6ALX2pGWwfmf72kTfRXnTopziV7hAlLZ3AKesuwtZLysnYdKERl0A8s0JGzyiXntbQ== 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)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /wrKUOtkiXOOL8xxyavraBq3T0ztHOkjlsmVYcnrdngabM9Qt84KxFHHLjGpZ5OpTy0LJZTwseBtT537WnWLclKGNotwK3wK9pGYoHDm6BzoTneoOcw2r7Mkc7bxtwzSA8l/1PxZcnAYrw9t9QIJbhojpMgxeeS7QG1o0o4aQMiAQvhAGHmb957C442IMWp3LtwG6kdVbdcQ2r8CQOusF7SqEDEa4LkcG7a2JEzahMiKEJb/gISD6FuTS1c9PeNr6AyIL/iQbmKVvWaAmJfEIAgNJGIbrSdKm83MRnKXi/Ud/IfXbDoZeYOTvDPE0su3/gPWsGylkWIBjMXt/YB2fLoG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O+mQ2GJD4pB05TfR5w1oO0KTU/vzaxcSyitOeqrw4Y1OrD4mvh6ik8CcTczCop2B3zJcxpPCjN+MF50YyMEbl42GWXqtsERZd7cNOnUa0USevV6X6jOxP2ynItqJCwxrrHEueRIg8eqXQAFbLF24bn+rle9x8f0lHLlyIHySstLMBe4IdF1I1IbtLgW/QjVoPJ0GS0vCMhaJKBw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92a91a68-cd06-499b-90f1-08dc60b7f531 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 21:30:38.9992 (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: Fgg+MY/sOuZM/HWjDnhbbR45xTu/I8ORdgNeFvmdN8UT2QJU0Klbqg/BJQVvbdu9oF/S/3CghSNltuxje3qWzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5670 X-Patchwork-Delegate: kuba@kernel.org Enable reuse of logic in eth_type_trans for determining packet type. Suggested-by: Sabrina Dubroca Cc: stable@vger.kernel.org Signed-off-by: Rahul Rameshbabu --- include/linux/etherdevice.h | 24 ++++++++++++++++++++++++ net/ethernet/eth.c | 12 +----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 224645f17c33..f5868ac69dec 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -607,6 +607,30 @@ static inline void eth_hw_addr_gen(struct net_device *dev, const u8 *base_addr, eth_hw_addr_set(dev, addr); } +/** + * eth_skb_pkt_type - Assign packet type if destination address does not match + * @skb: Assigned a packet type if address does not match @dev address + * @dev: Network device used to compare packet address against + * + * If the destination MAC address of the packet does not match the network + * device address, assign an appropriate packet type. + */ +static inline void eth_skb_pkt_type(struct sk_buff *skb, struct net_device *dev) +{ + const struct ethhdr *eth = eth_hdr(skb); + + if (unlikely(!ether_addr_equal_64bits(eth->h_dest, dev->dev_addr))) { + if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) { + if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) + skb->pkt_type = PACKET_BROADCAST; + else + skb->pkt_type = PACKET_MULTICAST; + } else { + skb->pkt_type = PACKET_OTHERHOST; + } + } +} + /** * eth_skb_pad - Pad buffer to mininum number of octets for Ethernet frame * @skb: Buffer to pad diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 2edc8b796a4e..049c3adeb850 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -164,17 +164,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) eth = (struct ethhdr *)skb->data; skb_pull_inline(skb, ETH_HLEN); - if (unlikely(!ether_addr_equal_64bits(eth->h_dest, - dev->dev_addr))) { - if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) { - if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) - skb->pkt_type = PACKET_BROADCAST; - else - skb->pkt_type = PACKET_MULTICAST; - } else { - skb->pkt_type = PACKET_OTHERHOST; - } - } + eth_skb_pkt_type(skb, dev); /* * Some variants of DSA tagging don't have an ethertype field From patchwork Fri Apr 19 21:30:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13636774 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2040.outbound.protection.outlook.com [40.107.102.40]) (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 50D7913D247; Fri, 19 Apr 2024 21:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562247; cv=fail; b=tzMG64/HTb3/CY6xC+WRNDPJ0PQbiAp6krJoME3N1kj44uN/ekGI054d0/znYSOMoVPzpMC3MiBPucG0vE1LYd0yO/0P9Mu/SuEijJ+cP4SSeG+z4oADKUoSRPwtd97tqr/b773vVzmSsG7J5f+PNDseJ0v3xTTP4AkcdnSq7mI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562247; c=relaxed/simple; bh=ZSRDmpw+11K0lshwUvrp+IrNu5Ba0+vnhIYdjw+Llno=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=otYMVkiCt9BsoS2XwKpRn/Va/AutYg5z8lCbf5/179rK5QwUok2a/v7S3VXqCrzwICZOn/Mo6vWLqaxQAuM9xDoh20LimIKIaU+iMb0/y939s9O8LqgV/vPPVID6fHExiuZUXiRm4A3oRNZqYBlIGs/UfuBKh+wBLMf5sfGcKZM= 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=dDA4IyNO; arc=fail smtp.client-ip=40.107.102.40 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="dDA4IyNO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Az6vCK3ebX0qzwZ+7a9kDAd9XjBQzcQcLoSNs3V2zY+UI12kGpJsu8pKyxz0DCf1042F+QBcZvr7Ba1RM4lEXBg2oaSPd/ekuV0/61fVkRAYEbcTmX+kRuIxOKxq3X3zbVWAtS8JwTX6wtEpj9DaidMxdF+SuYknJu3GhUZg0fCU+nQXdByKLxROHUWMtc0BWjQNzrDRymJghgyzmpqXBCAJ/5nsuJCvdy2ZnsHZLJ+NIJb0CXCpXi9u64Ly8AQ6kVzdgDUfXAdHpKqwLvjEySynGnIRXWOXjhhmYVO91B8L193j3s10SBJA44PIV9JMvjEnd/jXx3zufkEXxQW8Dw== 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=XVrGf85eSBj90MtLP/dwbEl7uBxndrW0yabcQrZUF9E=; b=i18A8GYzzLLXTEY+iBWT2CJrHi2AK0sUkCN/egtO8u43NBGrsmNeqDtK1kfPISYUfLM8ESk7DkThqSAdaDyifkR8EIcCqE6ipOa2qZKW9lqYPz7ZsDEIb4eDq2WdpyTXgXtQYDD5k8NLPbMb+HontEa7Ch4Jm+brAOpYA5rn18fpJkCXAffh11v/98Jx5O9ATzkhDUpnEjNtn5t5l6Xagn/pgPK8BTQDtlzOZJi/0cLDFJR0STJb1oH2vJx9OMFy/RvquCGK548mz6/8CsKhFNnLR8fSJ6GaWBEcRxBHpNaWnDU9x/+vDg/7IXlZYY2b2G7a/qp23mC/ZAyw56Aqbg== 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=XVrGf85eSBj90MtLP/dwbEl7uBxndrW0yabcQrZUF9E=; b=dDA4IyNOoMKg5lM0MaVd1ROWGrfwGY7HaLwN+2tFw6uD0WwTMzKqGKTufP4+pl8fYTKFAcTBVgrrx6J9ptR0wuEFTjcJYNgJI1lj/2GXByKb4Vq2As0UFQwV1Jcv5+0fSh4M/hZHZNyiRF8rLcBK2qS68MTfm9wF5WiIByh5af98OzjNicabFRGtd1YePzNV4SP3k3HrKcdejhVtbrH6DTndq+iiX73MjbazZ4OdC2dhxitebgOC2Q4WlBXdnfqPS9uehkHThS7hpS9psUBhJJzLwuJ+R4LQdrG4kj1CdU6ka9+Zcy2EKRYsYlyHq9WchhWq5tMfbxhfdmv1CA8Amw== 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 SA1PR12MB5670.namprd12.prod.outlook.com (2603:10b6:806:239::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 21:30:40 +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.7472.044; Fri, 19 Apr 2024 21:30:40 +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 v2 3/4] macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst Date: Fri, 19 Apr 2024 14:30:18 -0700 Message-ID: <20240419213033.400467-4-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419213033.400467-1-rrameshbabu@nvidia.com> References: <20240419213033.400467-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0237.namprd03.prod.outlook.com (2603:10b6:a03:39f::32) 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_|SA1PR12MB5670:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b397b87-b00a-4201-0bb4-08dc60b7f5f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7S9RbOhcfkoId4BUD+OVXySAfThO9ahxqro7ECE0orAC7TlXUDCiUt3EZYT5/KouOWg5/iiKUFsY8OXVDOyI5aZ6CH37RHLimMsdKN6l8KX+V70DSSRYxukvqe2wyhvoL7b73UX+hKCiI4tdpBeqa8/CPd+ngnGgvrTaMuK/S2G4WxQO3z5w2MnfNH9RTyDmgvnDMEOKjBEfabDr0wFur995y3159SIWFcTcCPu+TtAYgvJ7vac2BVLpaRaIO68W+dAFcw5MJ+bBJhf1fL8xL6lx/a9qQdFkgdqSjoAQmmUGAd0JKjf+HJQOMrHSc8f+OBpHiFfBhJmizoJlARNxkPYHlT9B2Y4sRFIBBDPD+W64NP9mLOD9KmjndTkPtHrYEHsrgaaFqgj8cXcq6UdVyrnG3aJn7rcYRf1STsqg4xl+k5AAO9ginyRsx531PAwaDChzEviS+w22mpz6/Mzs8svCgZ7cEGR/iBlMSQI6jhI58I1es6Zcx904QvY8REFuG5P6FXhw8/JVSyEKK2O4tCKHKz3A7G+5/iEWSSVHsjQOx0s25kV6tz4iTGkeUBpnfvaQAsFm5eZBK3fsyyDTRwf8561eR5ChBSX/5mjAo8X4hDkiaNrIeV9RCySxmh4UtxXqjRNBkdBguvVf2Lyo4ZLIkx+1zHP55OCDrjvYndZU4aGGZt1Gwl1+LGI5VpkR70w6vrwboDtSzUCVRoxUNPkrUgGpPpd3OkARhyd3no4Ai0QrxjVrkIcTe5cpS8B382ZUGRKAy3anSgaASPgQ5eDkFGzenmi3Nw4nt5cq1NXY3edGXz5GLIrLmh5JRUnW3bUPv6JhGetjFnxBUHl04+jxnxsG1pF6UL3c44AMzfHZk9k8n0e0j9xYN1EEt14nHXUnk4zuYYKiPkkhkB51stAfyfB8II9dWjMoIE5PZu6GSIL3zZJ/qBgV5Uyor7ZYFOa7OMX2+nR5YxbonOoVX6l6H/twu/G3FsvhloOGmiLbOWLMJgCjNOLQ3DiwP3UHytchB0jcN5USyqyf0zM8zcNdhwJ4UyPhtl5NKxfNXZUNvNcw+mrGXfpEIFGdQjDq1FupC0btWGKlqA5SSZRV9kBYxDgc9LNplQr9GyyT+hBuh1k+m/yOEPNYLTQ0iq5UWYDbo68uEFgp5XQjWfNPhRoJcy82Y5IZnTJsLkKQGEjioRu2hmmXMKzrPGst1sJd5gSbMRn2lF7CM8OxlyiOKwruSV2JJy2J3i8tszxQ5NN268jmXThnDj/nWV0ylsOjJZsk+8Ar1dKv9PMbcR0opg== 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)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mPqGwiCMg/4D33vFunSIFlt47bXkCa2w/2PAeY9KGM5HVzVGaNW+twyRUqZTFBlz/Y16zgJiLNBVq8wpvRHOWXC27ZUgD6LBleaEnj/Pe+Aq+3HZ8bRFceENbKQnFhJvovPWDBmExuaHvxPeKtjIroO34zZqCQDTdUeEDiI0HHD7ahwILp3qhrsJyqdRHqJ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Kly9b+uMkTzyCPs3fekzmideTZ0Pq0Q0Qazm77trc+zBdxSKeJQyzQ7QK3zWi8HmZ7ECh3dOQvV+ObFj0PDDpj7P3h2NikK3co2xjTTd+gzGHqjZrrlkd3HUX/Kn/pQQ2jaS09WTfSeBPfCR5TxieTRndUiY/QRULK4lfO8dmhBkLAtA7PefOByxfMA+lr7VO1sTwq2hhuKTXFFJcRdrBPirId4IcXx/MVDm9qBrv5Sz6TDEhFcyrusWaTn2RJBFCv7hiZRbCKSe4b/JvIve5PzKxQqtPQsFhRe6OoO+bOZaF4BnDErsnq+cBlVe0IUFBekZLdFZUuUvYSVwVEF4+7WCJlg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b397b87-b00a-4201-0bb4-08dc60b7f5f0 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 21:30:40.2438 (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: EvTKJN6lHikoFHU+qj4Dw0QOFkcSIlC/+/k5qtdmG9Fs2pEu+TrUm5PnLDuiED85UuMe143MtWNOD7JKDme5Lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5670 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 Fixes: 860ead89b851 ("net/macsec: Add MACsec skb_metadata_dst Rx Data path support") Signed-off-by: Rahul Rameshbabu Reviewed-by: Benjamin Poirier Reviewed-by: Cosmin Ratiu --- drivers/net/macsec.c | 46 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 0206b84284ab..ff016c11b4a0 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -999,10 +999,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; @@ -1013,14 +1015,42 @@ static enum rx_handler_result handle_not_macsec(struct sk_buff *skb) * the SecTAG, so we have to deduce which port to deliver to. */ 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) { + struct macsec_rx_sc *rx_sc; + + /* 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 = PACKET_HOST; + eth_skb_pkt_type(skb, ndev); + 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. + */ if (ether_addr_equal_64bits(hdr->h_dest, ndev->dev_addr)) { /* exact match, divert skb to this port */ @@ -1036,14 +1066,10 @@ 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; + eth_skb_pkt_type(nskb, ndev); __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 21:30:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13636775 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2040.outbound.protection.outlook.com [40.107.102.40]) (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 4BA0213D269; Fri, 19 Apr 2024 21:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562248; cv=fail; b=GsGFTJuJTw0hMLTt+OrjyT37NtxmkYEDsVZRyPlUOvlk5KmPobnmDOKZyxFu+6CWIsbnXmgeMOogQTIHW97n20qLsZOr43YDFv5VNojBjDjYiw0o8KctAgJoyjByly9E6jWOlCGJazgjCA4rkoA7/VjbtcfHkz3bBtnke9SVF1U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713562248; c=relaxed/simple; bh=wlNxrNZT6VtVgr+St5xHk9CM9YwyQIld5BZC051NgzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=IBTkc219JACyiB594nkdaQWNnZg8o36wQCl0Pp23q7oJdOVmGUjYptwPDwGWBcUzjo6KCkLWS3gyC+DH81ZFcGwjyxYcQlhdoyPnnZGTk6VEIGWrybfpuSEPdUWSuAPHMKk9bNowI3bdWCyxN6w1dnw1assfYInd3SdUlNRfbxA= 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=Mfj+qBkG; arc=fail smtp.client-ip=40.107.102.40 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="Mfj+qBkG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pk8lzgmcGV2ooC5Z1eBYtxbSCTH0o1h0QtdMYiu7RrQ+XcFr7/6ud0fiM9nYbdcW8OmGDXYBXAac61Hwt5fhMGooFAiN1CNue+6JBjqhUa3u9KDKcrfjyeqVWkpWpubh9wQ38hCTO6sRf9dGiwLUss339QQ0RUvDuaY5nZLbOf0FRqN1BImdTnDyIyS9IoGo/DQMdt+krMpRTxx361btpEZ7kjPBSjNSvWh2ycTo+LnmwYPNil7hzEk1T2IWJTmRk/LhQP+BoeJK2UE4OfVoZSrALtys75eEPz2tzAtqL2IG9UxZXTIy/6FjMw8C4+e5thgY4al3OjDkcJDlOOxbEA== 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=eCTQ4Tq6NI7rX1L0FMlB2I4qV4lqKOSFAGQSBwlW6oQ=; b=Q4pGlPct0QzpArAE4/Z26x0lkdkIFLRvi+UlkXyUYmls5O4M04qLNaICubKRTCkL3MnGFx0Hn7YvKql7xcShgJmp+XaK9zyLEVbbQRyx+tcI1IpO1WYwIleffu4kpW4CHoQHqxUhnfiDXZrHyTz8m/JfpF18L6zpAMjpQ7lY2tgTibAxNgZ1MI0uZFAYqNvce8iWbLwdAY7+Dse3afqcRP3isODfZbQ1P40QLmCf7B9u4ew7nTbo3v45Q4NbzVzCgR00OcCWsy2wsCUOIkZCA9D4KwrDNqHTbHfQvu53ViJvrkxcA5qBc1cri0qDtJcEuEHkkTQG2bM7n7TJIJHSPw== 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=eCTQ4Tq6NI7rX1L0FMlB2I4qV4lqKOSFAGQSBwlW6oQ=; b=Mfj+qBkGggCjezNIlNOVo5k9IIlxA8+zpfChIRfO3XnKgB2GobIticmyEKpbh54ooBVsdcV8jiqVg+k4w3YDDn8gncUp7rN5W5TvD+96JDUHUnIyauGANZSqw3m0oUGYL/JB5VnUfzJgw3mnxsnDE19BH/B6+qFMXUrEybVDEJIIC4RP6Cx633nyA+C3LOSWZMA9u4RpWm9XOJijQk/Xqwbwth2fIGLIYSJtm6PRBcoe2w3wcQDCzFz7Z1E9zHj2rRRvC+SjqoqwCAkQ51evpBypdwYAuhSl6Q8W/s9bT0wFpvIknqMIeC0LphZZvpI0rQjZNocmmbH1DuJDWkynmg== 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 SA1PR12MB5670.namprd12.prod.outlook.com (2603:10b6:806:239::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.43; Fri, 19 Apr 2024 21:30:41 +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.7472.044; Fri, 19 Apr 2024 21:30:41 +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 v2 4/4] net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec Date: Fri, 19 Apr 2024 14:30:19 -0700 Message-ID: <20240419213033.400467-5-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240419213033.400467-1-rrameshbabu@nvidia.com> References: <20240419213033.400467-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0237.namprd03.prod.outlook.com (2603:10b6:a03:39f::32) 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_|SA1PR12MB5670:EE_ X-MS-Office365-Filtering-Correlation-Id: 81cd5250-fd12-45a1-18dc-08dc60b7f669 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k8v4AnUavNDmPoaaqlGGL2eo7b4Sa0+n+f+AfPeoOfPSusrkY2OkxD8nHwt38UNTGJ71E+uCttuP3d+4eTRVjhs3tjUVY+HR8RW3WtKW43N48RdjQSzq5RN3/I/Oy4YPXr4Om3G/IKGZz3bDVNw17eQK3Pzaic8AbC0xSvMibxFNmby4kbF8x9Fq6MtgE+wF8OnZUU50k0TZYX5v9turptuHKOxGJO2lqX/IQ4nbvtXBtKRiLOAMXV7vQH4cNYv0oon5QsaE8h436pU7b5rLLrJZOfk/rpkeQQ590AqoLM4IxGzXtUW2sONohz9N+H5Raxputcx5r3c/Q3BPBvmkyl4q5GDXi3XsNz6nPlERXihILUwE5sDmv2N9/F2wlJPtbiobE5caz9U2FQJ0m3SoUnvMZ1Tv2VQm6F0ta1npbo0Ly9Fl4fM3Zz1647AyuhlavFCjsDrQMfCnrLwu1CCHem/JcDF/15RyeMdFwAfiUsDHluJlO92OetiW2RJ/MENEeuBVZFuzfZZXpp7eKwfAjD3vPs0tmmFiJo/QlYhwPPbSaf6j/jk9nGUq2GbtAvdmHqXAmuIbnYUHlnhvc1Cihc0JkOcn61wOOwBwXxwzhERSFQMun2mXbCzWfSIZ9t1jD3pRG6qVVsIf+kJGErrOeISBUy9p26ntiggw5PkyzQJZxpzQeYgNIV475cB19RhgBK/6btciedNzC+wz85dymtZtRDsKu5cUtG6wJtldSnXwm8w0/v9OlZ354opnbCFtjTn0qCZc5t+5FKbuF32OkHW95B+Oeo4FH2i/xywSa+S1udOyJKVGBDI9AmJDQCBT/JBpHEXrdj0f5LmWYj/HMsOR3yJ6uW3LGIX34CQCqHB3XKD2jlJTuvdSvo4mBlPDGvS4FDTakJ404ujLYGN2V02m06P44uObCxaafy+6U+ouFdFmhCAzDM+NgscK2YY7oG3RStZyalAg1vI/HUlGGafsuwY8UmIwWVtTYGM2fWc4/V2sZ9KzOnLXXih6qDInuLQz+F9lsoCQT5y558tkkmIbDOSxFfe8qtnHstVForpMB3rV383nmXY/YWRogsu3KN/lGJ/N6t5gicZX+sLTcIyUnN7NZ9HOvd4+sCgva78oqW+4RfhBwpgbz48exfpgKzrcLbr/+NmYXMAKCD/q6x10w4SJB4J+JN6rXisCLciVpFhPYmKFy6UFcUNhojeBIq25VDGUDe7+ylwaWbMPK3txjLtFd8Qa1sYlVzIBFEwu+sESqO06Uq+8t9/Xgg8nVCK+PHXQVBJACy5yhBC6SA== 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)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K1JZZn5qYUdjRjKLzk6wQlseZ/lK8f9btE3P4xdcRtYbnrkNoTYrNgunhDXIuV/bjKqU0GcdWKUBR2uRgv/RuFJqiemMCG8866s3FJEGIV13jnXOHjHH3kCiJBzutpWP2LpF0hgb2wvFzADyB9X1scdMw/1ZIzrPKNh2H31zQ06Sh86LPjm0KJtdE25awQPgshHcp+BhG8GMpTqEm6WQQHHWrgcKsEyDA+k5gbIoFJK/Pu5eIYM8xCDbpy9tD9oR468nCUXfjv4/m9mgI+FvgrgLuHOJlgm+/utPJmTXsmbArEj2TLhzSmmPvtecls0UHN4KVH6qMFjRvf0gMCrYk4zAVjZqc0PrnHfRz6onLCn/T5EP/iDrHskkGp9TqevbyoZS0GfWCiiMXiyLCtcqitBXFUs+qS7SoBrgwJdoXMYd2wcEfjHa5kERe7mMRidM+jpRi0FIuV++Wa+rPgyDbAj9z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sZau4QYOr08XfCaABf24D9M/sRH2FLwZTF59J5V3E5DVsPMqt3c0GnVmCQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81cd5250-fd12-45a1-18dc-08dc60b7f669 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2024 21:30:41.0522 (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: qH5j3qZ75TlI33+GFrTA7eaZFt+vtowgPhRpr/g0bXFUtnvtR3zwpKA3D2J81+wsbqcLaYXVSlvlMoa3uva3WQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5670 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 Fixes: b7c9400cbc48 ("net/mlx5e: Implement MACsec Rx data path using MACsec skb_metadata_dst") 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)