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);