From patchwork Tue Apr 23 18:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13640527 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2055.outbound.protection.outlook.com [40.107.220.55]) (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 734C113E3FA; Tue, 23 Apr 2024 18:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896010; cv=fail; b=CXeXSQuFsAnkfd0eT/xtJLmCgfOu6RDrVxTRD+cswkF1vMnajch1syvCzyb8hhbvKP3VTGBP1NloA6/5z41UjNmpa2jKiVkllTOFAmHTuicC0Vs5gPi8DVMcTXm/1vUZAwHXSXt8XHOu+YlMSdC2RvgfLZrh0e3fBKpDWfiB/tc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896010; c=relaxed/simple; bh=Efdz8G45dJgRkSatbSl4NcrFXQdgKcLgNq966ZXGMyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=LLU+5zGHPbdJgeyIPJ19Iy1YQbRSMW0TdVHgAH2c+8JmVEauQIH2yrDLE6QhJjPezR8Rxf1ZcWlrpwOZevdC+aonxfXzLNHG73DOOkye+zFXBoiTB3unVFhdFZCoh8sl8tvkVZSwPfwR+UY5rnD/eE5a4NaKeCTOkyGdoLpCXU8= 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=t4B9pgPG; arc=fail smtp.client-ip=40.107.220.55 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="t4B9pgPG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/MiJy/mBbar9wKLFZ7g2ClhMvOF/ICVFaK4szDpp+iCzK43i348bkVs2O+jW055XIQCRP1SsyEPuO8HdEY1yLGfBL0oKAxDBl1VgxiFTcCgMPjL2pQ4zlWwPLxzpsIbRPhIskY1mkGtMX72SqOMMLoJuREKklYJtFMPuKfzU/zql3pWd9tq/nTnWwgmRMOvnBeL7Jk7aKC/iwtviagfJejmvRwWzN0yGR38XOrksR5PxXmFUbBb/zOWwS9Lz/+cXPHWv5A6cuMykohk7PmLVFliF6A0ojBgdXrcNnQPobu1zQCBk5weo3UibDvAP/MYjXc8I8KYkiYi4tuGY6tKNw== 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=jH8zzY06SgsxncpXRTyDASplmbJHu0IicJzATSvfXqloRE+IhnJ3769A5dZDUkRGvtBUYeveh3Xh5DIbvNLKKiVvc+ibtiHveigLPwQygbZ5V7xBZ+REXza1fTU0M0qV0bet5vpfJHPUlw+6j7QmEJKlDoDQcLh7UqS0bEK8TLa1ZbApDhVGqGWeoJsfp6rPajYcu2lkX54zPyMWeuLtsB215vMMxhFhA5Jnmkb7HDiwuZwS+r8oW0qmyDzX51OTf+T9FU9ldH9pe7U+yQrr0W5VxOpNVvxnlcon8dvWJCH/hksTUEnkaiyyTW6gJaEdv4gYfuVkzG4N9HmYVJkqAA== 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=t4B9pgPGz8TxmbcrMLBW6cs+H7qvDGs96nvTJmdZThxSG0glIuU7q0SEBRNgi6mARDw0Pu1iPwP+LBb5W++Ch2SDlphnkhGIiQetnN69I0V/5/9uOaIIlWZD7Bxuf5NC60/9MQq4CzCAE4szS5nOly0kd5PBjxbhQMzNW4/SjEWanS1SGbunVgDsyrqaS1jD98xFxKYirv30o7tlHxoMJJYDZIb/I+y6X7XptEqv5aURSuWaqazPDOWpaNgnKRvQ06qC+IspMngwd5uK8ero4U2+PswyUL464OLlMnKpwOcxVS+x9tVILM1LEwpQagX/N4zAT+sphZMWwafrYNhUkQ== 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 SA1PR12MB6799.namprd12.prod.outlook.com (2603:10b6:806:25b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 18:13:25 +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; Tue, 23 Apr 2024 18:13:25 +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 v3 1/4] macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads Date: Tue, 23 Apr 2024 11:13:02 -0700 Message-ID: <20240423181319.115860-2-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240423181319.115860-1-rrameshbabu@nvidia.com> References: <20240423181319.115860-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0293.namprd03.prod.outlook.com (2603:10b6:a03:39e::28) 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_|SA1PR12MB6799:EE_ X-MS-Office365-Filtering-Correlation-Id: ad5943fd-9133-418c-ac5a-08dc63c11163 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a5MejA9Bw85+1++SHdxL03ITnAxbWMwGOszRdhfPT1H2r/QnnCThhJvfnoVepGwN7GqUDXQknTfQzSSl95838RtZWedo81swB2kfC5TauYsvGQqzSK2mYcSKzH90PzF53SDjiyvPeK+sDnzNugz5GZ8QOjQEzHFzjscErbq4dZ53gQYf2rDCSEU5di7ztKO/9Br1E+JIhfsBThRUONs84qvHXlEIyNPSOfL6Nfi2UpOXYjj+pHMTKTWaTp+jdLP4PM/lthj9gUUzaX9e9WU6mLY5tr+uHKR+xTHSqn6cdCjjDA0atiCAIOEaxFif80R/D6ixrhvh7J1D9uFgls28u0nDuZQ9FZD21pPeH0yjDrPoBSV9jBb3ZIpbhqowIVq7U5syi+ql50gDddTOahWmESU3PQcSjpaTIXujGkMNF0Dl4SvZYat7gRmi5WLooc6wNzkfeZoGumeZsJf/WWhgy17qXWnm5h4O8nvRiIWIwoH3NGaRR4zBlTT9XSJIkbS6xUFKRmPSpcibzLn6peVGPqlO1nQdHhyoqkkt7tNq/H9qgspCpXrINwZEcl1kx8UVRpDrdRaUBpRVofSOhlTaSEofHcfP994KgEOufaUT+x/ChhSyHNPs+xWpFzfcC7WLptOSBjQLAAQ5cUbdezR+lwegaLb/mfoHaH6FeR/jmP1r0/26c6skTsjnAp9L6zHJdKcUvepqC/3Ou1My5KaFh1CUb72p/JoPAjSP4oAV5x10vGg/nxcBa1pUYpCpnAMQ/FaEzwtF8YkaVjnobCnUKrQejSKE1qLOONFOj/4T7LnKlEkhHtX0Npin1EFmbYsMYFtVtPPw2JKWg1OkD7IK7Ew2mhFr9Zh5Tu550AwCPk8dkpBnAkzteEaiON52rDfbgf67z75er5nseeeVwx3JDmRaDg1XNwJCgXO9YNyqMfa0VyctdpLbdzaDlmHMdtSufKOEmBdeOHXQMePrriEqQeZJbtqgoWCHlD2r3lkkil5It1LdvwmpkNtY7/qu6o4bMOHIZpm1ajP9p7GrY8UmM+g4nWcDH5MqK6zEEI5kwhE6cxwKThz8SolCzxWWhXB5nwuVkfwNLjwxa+t1CZNz03sPtkKPhCl/c0mNWpI2ZrENlAKS014nfxaK1JAbMneq6gBpoCCpB8fJC533oaOzU7djurtgdi4dr7sE+c6aSEq8v6uFfPUm4fZRMxz7+phdYxuzvihYtnT36Fd4ThAr0NdenoMr1Uf8xtbW4p3gnvtpXJB4Sa/u4wPKn9IvWdbRiwzjmraYZQ7eyUjoNm/Y3A== 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exch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nEb3zsXVCqGe7AkGncMTfbRapFy10Tu9sHHIAG3o5yl+sZnEX158pI8kxGoFdMQx/yvYuuEyjg7QR+HlzwZucrQ//tuAxbq8VEHu+8bS0ycV+7e/aEVKCsNXnSc4m0kTPoelupcKe9XMESYyiN/DpFjB8NqLFiEDqpS2EcgZA5jU+LCkkZQ4xobZbbFMIj6Sdncnehee5wt4mRK6NUovkNmyMvVYSUCLUIwhOopf4i8VhDwJvhrScnrpQuPhvEEVIjGQJ/5cpjZ+HdewYJbzjQ7MfoIObJb2a2cMtGVToBAOqlxLA/UDWP1wS1dioAR9c/+bSUrHrpJSkAntwGK09MMipJ8OL9DUw/y9Evl7hHeuKFv6EHgGNTeTnx/B//GZdd0lL4JG8lglkOmKhCTwMqwleL+M548wLL8f4e8Fbf9Nv/hr31Cfgj5VeNZYReqxzEgQao642jGCkjKVA0LBKHX6s6j1Fxr6dHHSuskcE9QarpYm9NTsNQwKQ86FM5GdYtDp/zdnd/2ZPclTFUn3bjbHqHF+X+8WOGq7A3W1X71ZPy9BvxpWbj2KTSJTLX7kwM91dFBEYPcV3/4f6OdCA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad5943fd-9133-418c-ac5a-08dc63c11163 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 18:13:25.2643 (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: auWpxboKmGlLRDmatnlO8kP+lFlpyyx9EMf+YKAKd4jgmnmyXxntTsNH+Iwv61mAhbvOwu8MyaU9c8YccowQmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6799 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 Tue Apr 23 18:13:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13640529 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2055.outbound.protection.outlook.com [40.107.220.55]) (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 E881B13FD65; Tue, 23 Apr 2024 18:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896013; cv=fail; b=m1Z5HCod8Rd6PX3L6hLyRwsuY8TeQfILSXLg+G9kKhaypvksKhV2aDWk5MMwWgYJOeAwGDJDmxBLNq4R3JincD6lZvmCVjtZYLbtF0QjIJq96i/l3FrJuMT0Ik8xzn0iTaMKHPPCwsL8XWQzgSL8Dgg0gJIAL9OGDpL5ipmM86c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896013; c=relaxed/simple; bh=TdrdWdKMx67sfvF5513h9oXuSpfKDHRVkYPxFmUO7WY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=C/Ih+1hqzm0wocZhR3ghN72+7g5ltF/kyWippe47w8XSSO8VMbt2R53jd/yZGjIA8KI6FruKpnU+ksszPpBySH6y9AwDr3/WXmGr9KaP3htw4zPKDuWjrm77vUpDFFw47QE9i6Wuyi9R65Pc1nkL1oXLiov/WUJA2vDgXZJu93w= 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=rfgfNiWJ; arc=fail smtp.client-ip=40.107.220.55 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="rfgfNiWJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OgHoTS+hgRvaxTx91YNUiORJmEleVASjai+yAVXyka3GVJImRZFmHHoQkVY/mMPndBlUA/vLkcdt0AIsdqmT6MLnkgHuOlv+mQinAD5Kltnlb4n1MkOXXXYpP4R2uyX8e7cjzLrNmYfV5fT8+HCZmJ6pwRnwV1VEBvl4TNLCfBL+AZGl0OMgZsuwRSAsH/GDOZ3a56qYrLGyNUvPm1gw1CQ2yvswGrQUprmYx0gdDAuGVCp/z1lV2Kk0hvxEpt6S1xOo0bl9w2N5Xu+pJ7bh5xTRfkHmCmFKnLgyT9odpVdVgGq7bOBDZOnCdeCkfI5unaxOtbJw8hQO17ZhbH67Vw== 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=GGYfnk3oVJn78NX8j1P/C26Dl5Nx0pbC5GF6KWVdV1w=; b=Nt+P8AC5aFcCmVeOARUXccsyFc2e+SKGe/X3wP5tdqgbaegLgXG0M1D1NUZuz8efZiFXFZ3Ll1tzoppTnwqDpAPuVjAh4e6dYJT3Sg1ZxXxpNzZxzIJQW4moLB8CVeFw3uGDMpCAjs6i62oaipwgQxOcGEkkCM1wFaLNJsVTfioXuMryfP2tEUjHHAs5Yp2tCvi/RCViVYu+WIb25XJXqoevrWb+USiCkz5qxEcWB3Uv7tYH+UwtKbnA0wefc5LgVE216bCPUcXT9NmysgOWAJIlPQqlJkHvA6qKlTAjipOYDJGSROMkAxUVUvGZoM+Vss+whKcEd8wdimdi2/hkhw== 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=GGYfnk3oVJn78NX8j1P/C26Dl5Nx0pbC5GF6KWVdV1w=; b=rfgfNiWJtKYVjmSyG9pTtblaviHD+M5rEglAsNi00m8besqzNIZyG5j61PdD5yv3Q11cREIlRh9JXE8HG6VZZoEjt+4CPzMvVcjshdHR7sYlugiLJuM8aSN9hYq39WidbX+h5PRk0Cd8RuM1FG9hDIj7R4uMPcmROscJr0hoXZltUVsiJ7QMnpsSFaaZIMvQKwJiQPSyDAeL+hZ873Fp1efDPYcKMDdymT7UxBWMQRnHmlIxyA1MXX+CvDAirMYxuWu5cmKAHaVPLQXiUZyQzRa7TXuNzkHZr37IbN0ndDiW3IC3kQztAXxEAE5IqsqaA3rGxulcq020NQf6nz3xKg== 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 SA1PR12MB6799.namprd12.prod.outlook.com (2603:10b6:806:25b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 18:13:25 +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; Tue, 23 Apr 2024 18:13:25 +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 v3 2/4] ethernet: Add helper for assigning packet type when dest address does not match device address Date: Tue, 23 Apr 2024 11:13:03 -0700 Message-ID: <20240423181319.115860-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240423181319.115860-1-rrameshbabu@nvidia.com> References: <20240423181319.115860-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BY3PR04CA0021.namprd04.prod.outlook.com (2603:10b6:a03:217::26) 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_|SA1PR12MB6799:EE_ X-MS-Office365-Filtering-Correlation-Id: c5a6932f-a35d-4eff-80da-08dc63c111b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g35PERTApWywNR+V7WO9ki4QRM+hoQApu9k7jtGkWBmQ8Y5kgS/h449ir/KvdRwJQlDpOPvaDk/Ne5lGT7qFcEmFAAzE8NuN8L7fuKPxFfNS9b+sACzNsCYYSoJxCu2lFSgUMyQqLeH6D4USC52Hbxj9Sd/DIAP1iUXNQ5In/FaQR7Ca6zYzPt4gqPFiLlC1CNbNY3CeojuQHXSs2qThqPCQWLKXFCJn1b8HTnB4Nl7HCY7/bdXcLFRWYS3el5D8DrKll5WeTDQvxvl34OASGYoaQ6Yfw4/FrsRLmGCPQHby8VfkrwRtQpgt0TEB4TpT6iD3ra+pfSQi59I+jqC6qGaBLazqpgCV4dlMc0GNZCdbEWsuVPVua179DLk3lca580OZlx2yE5XyRJt+9MRcU+0RuJFV78F3POY99KdlzJ6wxa4jxQaEU5UR3ScHEdlTtSd9MJg7I3HhOeICK49Kjp5Z7gy25m633yfpctO0NzLf1xC24Xfa2OjOVaME6sXQiT96O4Q7vJb6EwRmosSI7rjGXCC7WHIj2em3oKa+6c88RptdqgNVyvAEF0MvVOcnQ3ShVKSgrVop9GvFnY0qRNqjOdVnhHvB4XP1TMCr+kXgKXX6d95VfF1R4kRORY55KS1ihxdDOTPP/i35AiHlCpjAVuEJTCYVC0LbCkowdqmdvMg+Jk0irLlSbiJBkPDo4DgCi2MzdcEkmRzgK2J7u7Lv/t8iG0ZeBWIwGaOeFwyvo/gRvGdBoQm3d6leUZXGIcP2F6JnXUjBchMKUHSAPwd6qFdRl563hVk1mI7xK/lOGhfF7J2O8c9WeB/3l/c28+X/JiYen7vzHwRNGinaOeOt2pxRlIZypvFVv+sZZB+s/44rJqKsUWhWRp+pfWvzbsANevWZMIN6Z9ZCFZcv9YOHXimcINm3jCIBuVEx4ngioFvjN6cyC82D8MCxYWckqQX8r3sokwigo/iMDlrUTH9hMPnIGTWAmgj5+M1PfkURpPa7Lf+CAjT104eOmlMaODmlbd4zggBFxp2pZJ4nF0LXwt5ik53EoMUuI/CuZl8Qal3UFyrFR8RszhwJeIkrjjKZQS+T9yv8+YJ6cfYECFbU/Aq9aSdNLOQ1Ttefqpwj6Zt+ArZs0kQXAttylOvqd94G8pHVYoRPA3w/RHVw2LTOvHNL6oxKM+B0rodndNVsXUgTNlkIk5Dh2rQwEBeZR5GvvH/na0cPa3HJSgfi8occt1NuI/HHiuK7g+0HzqKu0oCMW5oKuSqeudJ/xo6V83aAn4bBIVnjJDtM5Mz3RA== 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YEED7Gkbn+Kp9FbRMc/FEBzl+atJjvcmQGtqPa8LlVhkm56KAyfXdZC23yibXe81+pWAGMSys4JnD3DRHHdmZxS5ATNLDIcfuJgxUx5nrpEkidOdk1RCS6zX1Y9YwcfSbr3O6Im8b//WRym0d60fSL/G+mgxRBKWwVysVZZ3cuu6Cy7ZBsz8QCigQLRMoCgzDa1mQDkOHkpDLPxoHw3leL2r8bXuFDo9aI7UyJDZ1rK6lcdmTOaXhmQj+Dihj3bxT7NRBHN5vi/+hrMBcA7NSjYKUrnxI4wDlNZOUkQTwh/QTCKq0yE23gKhp2Hi4QUcM6uEjRGfvvAs69J6rOJuh4f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kH4q+elDBryPVtgFSJF0KYecmX2QXtYsGbWjkpQqvIUzDCRfW2Sf2inVh7AyXjAp+V48mYRs1nn1ZIjP5ZyjatY3sCi5VWOj+WSiOME1rbtJBc8yxw1fA1cktg3hPcTrfQ/KehWqlvEPCzqF1WCoic1BYA4HpNeXs4OOSsBV6YRBrSjQ7XgDtzf8f21ZmT8F42QkUAZ1EcdddTA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5a6932f-a35d-4eff-80da-08dc63c111b8 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 18:13:25.8117 (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: ou+2TgEf5qrbWhJr1oUy8gUzZ8095sXYGa+Fn4MNgCR1nIwOLs/QLA8AO35oJXddSAEoPbHuhDlayfx08LJlQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6799 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 | 25 +++++++++++++++++++++++++ net/ethernet/eth.c | 12 +----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 224645f17c33..297231854ada 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -607,6 +607,31 @@ 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, + const 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 Tue Apr 23 18:13:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13640531 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2058.outbound.protection.outlook.com [40.107.93.58]) (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 0A52413E41A; Tue, 23 Apr 2024 18:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896017; cv=fail; b=PDeKwTxm53VD8AEZWoSXBeorhqqG1qC5Bl5mPnljOd6+YcfJPQEXxHRTCgl17UpBatWzdEYwG5T/qK0Phd9n7+4rbatMtyUXG/zGyorv+SGezfLQbcdkQerKAS7RpLJ11ybFhFxPLLy+EVXUGtXxcRozXo1WL0O625Gh7oStz+A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896017; 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=cKKTxD6SUvqXZcQunLPLUNe8FPXwAmxY6mYr50bEsE4v4PliYBsj8kZGp9AdmTfHw/NmE9EuIljq06rls0jxG1keCq98XsdKqh+cApEBwslbaX+u63Ls7SSTV9dEY1kwOXDtBp56AvdfJqbICT/UBB1rg2LMM6VuaabPrg9VABY= 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=TsvzfDtj; arc=fail smtp.client-ip=40.107.93.58 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="TsvzfDtj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fko1QbdlF51hn1V1ymk+cedDY0EgPPVzvdF1FfRP7WSzN6+y6+c6i9LsksGoPHKrZOuRlege5tFy5wP2GF4gB/FgxHLFjaLBmFAvoGwu0vPCP4J4r7f7mW4HTz7DvVQrZZhaxRhai0snirwOD1N1oK+PQKZKgij9ri0mWv9QowNuxZEQB4G7zXewtxVZ/bbxq3nPUOUf3ijo6/ErCkEQCTChzXPtIaWoBpCBl/uvp7+6pw4jBT4i8ZOna47p7coBcH11p622R4mvYJdTH+IYWmKqQZfy2NZhptlKK9pXVMVua44ip/q396/Osv57gY1xmLsI2z2kdyHdsnZfUsObdA== 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=GSK/TQBgFYEfGWybsX4C9VlgzaTojyrLyqbjggabjKY+cVUUyQaoLWnXG1hF91JGZ2D7u+PdAiH39+1K9CuPapIoT+TzDXVt07cA7zziqtB3wsb6wIJVAJ8qozJey4dnLvER6+Skhbasi4+TcYj/NRmNYAg43SOhhJHm8Puq+2QR3E3urZ4gKSzPJGaQot1lda0UEIUs7vdbnxNJxNKdho7WbXI90OooLl4tZFgA38XdwOe26DHa5bQD7EiUT+qso9Q+budod5ITq7jyLSgAb4ruJdBihBBCS6OG/OEx1wDyfHv7RqExkOutUye1mZOLALD7Lt7OejXAEmk6oxaYZA== 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=TsvzfDtjpzO/qtR8lGfZAJ6ckuuMG0DAd/lxaO0uf2zlyRl+sLJn8kbwU0khbb2Dpil3EAHmVh0G5ERRxRsNtQIR/bVKcHB9RsAs1CULRdV2f+AAQcmxZ5aehVMCuWs8ssqAGbFZmXjGQXygzTSbVreeSRhYTT8m6+dBr2lYEmlMhCotrR2njIaqm+IPvHcfDQV/xxqrOOVVcCZcezSXnX763vSA0It0mZaGpGpcS7H6Zkjx+1R20i8OvGRBhgwYoo/Z79g0V+7UUU4+wcg/O/SoeJBOWCP5sWqs1wadxwL6u5A10aF0yfjgwef52qdn+n4QYCFBemp3BDxmSy8VEw== 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 SA1PR12MB6799.namprd12.prod.outlook.com (2603:10b6:806:25b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 18:13:26 +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; Tue, 23 Apr 2024 18:13:26 +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 v3 3/4] macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst Date: Tue, 23 Apr 2024 11:13:04 -0700 Message-ID: <20240423181319.115860-4-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240423181319.115860-1-rrameshbabu@nvidia.com> References: <20240423181319.115860-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BY3PR04CA0006.namprd04.prod.outlook.com (2603:10b6:a03:217::11) 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_|SA1PR12MB6799:EE_ X-MS-Office365-Filtering-Correlation-Id: de06bd56-25d8-499c-f302-08dc63c1121a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J90vi20e/NumQcRDEfomzpZwnyRAfip/G0TdkmxW+LPt/4M5ePuuo2stOyV15r0T36T6RfMEGfqB8NxrTzXHmyIK+ozmt1dN4bCfTi2oxF5/P0zzu25IQBwCQsUzdM8JLOB7/OhYjUgxZ4dSjmZldA+drYCTqVjYTzFsltVCae/kqnpgzUOqnwvqbeAbDRp9i3UQ4+0HEzfJLUMLVaWuuEBUV49ZZsxD9MBBzq9DFcLRfL8JH2BGvw4qL1lDGI8q8tn3rxilyz62zcyqfX59tTeShCbiJR4iMHXYNHue+/tvYdGkzjvNgO3R1o4fIdcOTGtVvZ8CJBryhKirr7K5ycrDgu/6bNTHrOB8/wgy6ZbAhrZmXKyr6qr/JRMmZWgw6CuGyLbZKgPMr4GFkF9rK/JDxzByvHn2msp9acd14XpgNrZzTXSL61H0QEi0u65T3FY5GZrv5t0ZbGapczpYVY25SvcPQbzy5SPeTMptiJONi7C7qMGqY2W8pm+6XnJ52aOUn71+I6luf2mnyrLWCjtKA/1nS8GBkCYyjp55ByiDcpOOsbcj9alWy8pN7FZ4hJh0HhYHzxfimsROFE2exhGjHd7070yUbKF36zDeToBFuUUsn6ccQ13k80jLShYyEkeOF7K4L1ts32nXZNtwMPGyGuFF0eOILNu0yq+h5mdUWXeZxyvd8RSTdOmAcRSpNcO4wTop0qg0FAQJ8v6OZpiyrBCUggCTIpE/snyrgk/twrH8Tzp2Xj0zBFnNfL1nKkx9WUZccW9mkj1jyAUsDZfMunC1Kg+qB5cWSSo9i68jcxXpJNTe6kqXXWsB9II+kCBAMuKK+LfwJbhlvXHBdgn6274GELSvbDS5qs6kpb1mnf2v1ufP53DO12GqXOFeTWFVHU+SilLXhesGnkHiTBKi2iQI1fjl3DZ1eNkhq9YSxIDsDIYUwL9Q47hUxmCel95P/K9aRIAbX9Jr4jir/J7VE58rhi+YKuyAmPIkK+KoXqxM1zdf8zpq/FVMSc8gN+IGTnRv145fdaoxTSCBGI1/VnxZRymy3sGfoWJ+5lZjMiS8mLrYs2QzZuUBWImtG4xtsFkJzC9/eesR/2jCDk8CbqVQTyRR6Yt0LucqUDHbS5k7SwwQ7vdaLYOw9aR4vpjiHyiI7Gpiab8NyBLdaZgaxdHOLuP+r0vYSlB/c2bAd7q0F6Mp89Y1nVY/TN9FdK+A7Dt+29zs8VYW1jUgIzO+fHuEPuCklF/ASUe7hoaxUOtKsCeoGJSqWzno7qbA9hm+c+YBOYiianZZFN7VnA== 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P1o1lBEm4TukQluWr/FN7iy1kag3m3C5diqV0PxciE6azfFTvxqo6vFTYzyd9/RiB3y41mvMowBtgLJmVnbZftdgTmVs5hOzbCXM+cgNip76jDon4zecZ+UWYGR/bxZVTLbSeDahkgq3Vj3iDBdU6eBib56XjFCv3QwqG9PBwbhTqAFc5BDBt3QPgG5D7JE8aER0dUMhE91vZ8PpRB9Q47mBxWm3xQ0ZNTWYTR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iHCUrhdyN07vIg8Vp/MsHqwPxg6/nHp9RFeTYoAWOhL5QIP9DYeMnUA62RIsSc6Yqql1gQo976KY30GccTDjoR0cECdSFs86POZo0zC5J79JHVgEZjFWNSkeKFGdDY2yShwuWVOmDfT7nnjB52BOIKRA845Sy062EzMywvvyIWukF69vZ8JjUVXjHFibmjcDdcqaKAfvLFbzSODLLggxtcdu3xnsoEQCch2sXAPTWXtoRLvsnd8qQpuBEhlFLEZcbzMZ/8V+XU2uxFy6E/uCzc8dUgf1MwhQikUPQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: de06bd56-25d8-499c-f302-08dc63c1121a X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 18:13:26.4461 (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: GGWrGg+5CeO71vkMC3NqO+bKfNieIuPRcAEyY75HHbBQpyzqj0hezSpG5rotd1gz5hn/D7VfLNe+MH60CQfZ9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6799 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 Tue Apr 23 18:13:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13640530 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2058.outbound.protection.outlook.com [40.107.93.58]) (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 769B9140361; Tue, 23 Apr 2024 18:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896015; cv=fail; b=Fn74+nTFYRHVGQ8FLB6R7z5mOHJsrhDjPV6DU3R3+aiDTmOtqURsg0Q8s9GE6Kiq1L7gJkvnLOaanoIv1RibFL1aYnblAdBrn1JkK/w8WIg6j5AsEboQUV+iV3KUZA6/X5Zv+yI9DWiVq5WMExX6PzHvGmQp++RCdgexpwsySog= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713896015; c=relaxed/simple; bh=wlNxrNZT6VtVgr+St5xHk9CM9YwyQIld5BZC051NgzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=LW1LjNY6Vct6dslJR0ihNtwOG4JMEizQp90Hk1eKCb19EZPsln9sg21DuqHMwvtDytzgdihTl/l+JSSwlGcDAz9Mx4uNKWPpqnO/OcMnqQsz27n2XHdy+/5Th9WLueu+engKe/go5uTatSHUUo/kYaIYFSGEMZh8bzCR6vNARMU= 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=ZZ+IPijC; arc=fail smtp.client-ip=40.107.93.58 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="ZZ+IPijC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PIme1XC0EjHtVYFcQZDKyorpD0XNNe8B0PwaETGFBuOBGZ/UssZS00U3vJFsouWdFLqmh6u7mYUNT8GQdtYTocEpLUAoPXBGbRy4ID2CqKNVDHGUjLYtJSHbirTk6Qa5LE1W0GthpvLCqY+oLssc2Kx2O9q3UUcniSj49VuEhHcltt9CsVG1UwNxnk+PJCfk4TXcPujZp+ufD+JhmP7Xj0CP5iQRVVgwt9DjpqTNg0bGUYIsgt8TSO8DTYzjZHcxQwFpAfXnVpcN/kMaCeQgIGufaQ2+YwfKWpS5B36PPV+MS+CWsTyMYymfGspCqOGAmOmVpdtYfiGrRcVu0056ng== 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=Tbt0mvSFn46u6sMDQyCdy/hCjw7elrW1oV6dNNgNwID2n73ggv+02cuRx6q0G0j4q8wULz4YLHdKTyzmX13mrgh9E91WclyTuVj0qOakhhhl1rEoT+8udg6hdDFCv+EhYmk6HrvBEKyiSyIR80tZP/csJvK7z0wugv/YrMm+pVi/HS/b0qDdHQv9KqQRHS/HYhwNtXS+ABQUb7lfFWzqtTmbJ3CWqKGBVwikE4hEPCwxiQhLnW8VcVbjr5RHGSMbMhX4QK8i7gQrQugy1599jaJzq/siXnpTgNFTXJBzTxjeECe11TfvRDsdIlgEjI8IatJ+XQvfb6ohIokQx2Kfaw== 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=ZZ+IPijCH5yVh6qud+3fLAOiT2fL8+XLqHJFUUFQCchMRVdGkfRLA/GjhrVMbJci6rQ9z5OUruRX/7zdztFaywwCdtNTVSc+i7fZWFN6Qgm0L2OV8L//Cs+t2EaqIQLves8VaQWnff0wYT3nJbxFsK6dMolfZZ5/OfBrVwugjISf0JxWfqtsdoREoGv55EybNgnn6z5S2QQRaG9IFOeY+SVBsnyjevXT2iOOsVNNg7pTxwLAqqhGfVZSMR/B2i63Mef8P5zxYaWPTFp798QKOgfWS8CKVOnK4N6P7cJIWj3p4Ig5jhVxktNk9GMfNO+yr5qqm4to7vrHjACs3Z4rwA== 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 SA1PR12MB6799.namprd12.prod.outlook.com (2603:10b6:806:25b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Tue, 23 Apr 2024 18:13:27 +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; Tue, 23 Apr 2024 18:13:27 +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 v3 4/4] net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec Date: Tue, 23 Apr 2024 11:13:05 -0700 Message-ID: <20240423181319.115860-5-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240423181319.115860-1-rrameshbabu@nvidia.com> References: <20240423181319.115860-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BYAPR21CA0030.namprd21.prod.outlook.com (2603:10b6:a03:114::40) 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_|SA1PR12MB6799:EE_ X-MS-Office365-Filtering-Correlation-Id: 160aedb0-501c-432e-f329-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NPd4ygJsKbkvimj9IR45spVU90WdDkTvaAP1mCtQXJOWZIAMWjnbllaJ7U5OkSoJx3eb92HBPhBD1Rr82ywsg8Wn5oR3MsmoqHLpo05Jh88fPCLt0LN4iRAuLA5OPqkPEzjr0amhAiub15L74bmo6kcGQfVIopuTP/z6KZQOI15NnhwGyP+rG6r0sl9wjrJJykiHGY6aGVnZyYnIL1Oo2xa6oJxkuzWRO7dZsMA2W1O758Zt1iFxOyYwz85zOMl81r+e5atYQXoIA06O9CS3K225TcRuKOyxaVEcSnVAlaP+9Y6cbul2HDlLoCSMxASsSmoQ== 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JGF7IkM09/gC6zwlKBB+gudBVJXeKhe3E2F4MRsYOLEHTi2mW352tumD8fylyLB7PybKnrU8VkJGkyEFiW9d3N6ZAJfVT3zS5EL89J4usTLkxV/Qdx6mbIbBLLYgQuEDuSPYyFxFzqRULN8dhBkC2ikbwZ/wyHI8BPWA/ncNBGt9I/6ykn8H9dHHl0Kma3QzImdCqPjseu18keuUVETHx+YZmzVv4EhH7NRhADK46jSIIYF1fQrjzZRIwFBe3VB8ruYCPe9iCnhonypJRTp1mwaHzZg75Wn087SOuIsANe62H5Cvq4Om2RMpII289EuaYEegHDwiNDWMBfdA3Q3jOcjFS5sAMuy8fBmaYLmZV0zRL7eGU59gOVRXJDnkUhhgmr/r6rxWPbDERztaKItZpIMbP6m6Lyhcw/WORXGprhr5wkHSLg0QZjLkrYWdOKIEQh/9fIj7kTx0onyWelJy0tYbFbE2bYz3uJCOqYqRDE/UKOyp6u6IILHwHVdKct/6HCVFvBmjmz33c2Ga5B925RFrPv1NEMMada9y3LI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z4jfLyAMr9qg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 160aedb0-501c-432e-f329-08dc63c112cc X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2024 18:13:27.6510 (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: UHN/d1yoU893ueeLkjUiLtOcxltqJISx9Gzq30lTttrE6fqyd9LBdZ8fbPjUBpwP5AeL6rDqKg1VUqRonhkgKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6799 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)