From patchwork Wed Feb 8 10:22:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13132876 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 519DFC636CC for ; Wed, 8 Feb 2023 10:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbjBHKXf (ORCPT ); Wed, 8 Feb 2023 05:23:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjBHKXd (ORCPT ); Wed, 8 Feb 2023 05:23:33 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2091.outbound.protection.outlook.com [40.107.93.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340B73B3EC for ; Wed, 8 Feb 2023 02:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=as+3HVmSjDF4uTJZ1wr2+3V6wSLNkGdgbbL/adRav92ZChY7cF28g6Gc2Jo8ryISmb4C22/hFYen+Pjrakzll6ZwqG40eQkx4McUpcy0y1HpruVQVWdB040986ZE3LrElTK6VfwG0ZIzPpShjoGDurbDzSXzk3Au5L8Y8GrcTJu68ls+IgNhF/7D8WxWpF6ImQTILjfJt9O6pIjypxx5fS7wEakueAIRNTygOxb3sDKJITMBbkVfQm6ihKtHZAnunwb/RDXl/YRMdLCFuwe0619OLbfQ9kftH+M9kGmkq6pc99pIRp35iz9Smv0HgeVc2MnmHpt+CxdPvkothY7aeQ== 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=niBuY/Pj0LGKTNJZBPYqbAubLg11WCi2VYm1P534P8k=; b=kme20zCW0BKNAieYNc8Kysi6F8nvmkBbR5XRrhOvmw2dK3mzCC8q5IP6gXRRUK33uiFXVTwWJ8KJu0/bL+tbOFRyYxFLYiYvCjo693JAoaBHwVZGQ6pIAMZvo2i+qzeGcp8H1BvcVUWPPcQORuKyxr9cY10maiNe+nJExJkC6rt8HD45GE+8lxFbBtCh+vX8dwG/vkrQy/20AEOo30D4HdsLhKmqtlh/lm6nv8Mf3B3fEx2d+l6bMGATvsSnigq+jTc3HStxK0wEn5uoyULMNRyfG4T7dJLEMJ19cjo6ciefOSqBdzpE3U1fO5Ebg2yw9shiElEN2rZnOcEhIbLZEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=niBuY/Pj0LGKTNJZBPYqbAubLg11WCi2VYm1P534P8k=; b=T6MPgAAcOk1o3800Y3EK1dMS9quXzJX4l26ScFvj+H2ZuYm5XjUk70s7ZjJ0eqnxGa1RLmTp40V6ANRDbuX2xhFzVCJD2C7K/CqG1jGs1xwpSyhNg/fDeKYoUZAVY3umo7XVMtScreT+r2hxBfJxa1yS47OSPNj/k66M9gTKExY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SA1PR13MB5490.namprd13.prod.outlook.com (2603:10b6:806:231::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Wed, 8 Feb 2023 10:23:28 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb5c:910f:3730:fd65]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb5c:910f:3730:fd65%7]) with mapi id 15.20.6086.017; Wed, 8 Feb 2023 10:23:28 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Steffen Klassert , Herbert Xu , Leon Romanovsky , Chentian Liu , Yinjun Zhang , =?utf-8?q?Niklas_S=C3=B6derlund?= , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net 0/2] nfp: fix schedule in atomic context when offloading sa Date: Wed, 8 Feb 2023 11:22:56 +0100 Message-Id: <20230208102258.29639-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AS4P251CA0008.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::16) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SA1PR13MB5490:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ff06cbc-b97a-43f1-21de-08db09be84d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eupLTndT2BRJjVcB2lMrkSjbQNyqIDlX/FrXOtiUev1uHnDUVWuwz+9/sLVFwqPIvjvjHB5+ZJnKZW/ufalZra/Ln14UMa9HURc9f49DWDiDAaeUsJKJhLY54Ejyrc+FwoWLXhZrupfjty5hoshgSt/PlM4WV5+o3irUMUpb5YSjQ68rm2ONhEaeyYJVV8NaOhkeKvtkDAZR3lUePd99af+KX4RcH4T7yKGO4msH1gaI1JHUSYCPrzuLFlMFRn1VfN6YnXDJ05jFcJARlrc/QQwkJawrOHU09cY5/47b3wN3lssqa9NeZfamu5DFxWgKzoR4jRXGnW4U9PesqZh0g+BdP9AVgC3diVbu3/9lPLN9+p7KGy0TqKlvHNKlBpTgAgw5J5qEdWfgB8DJewccmDxuk1f2VNHULqui1yw0NKppklTUIOwuAqQOln8TeOnjWzl5h2rTfQFmDhYq8mzMhGHXCfT4BzXlGaDiGvvq/WHI7gQC11qRa8NxhfgvpojLKR+xPvoqxi+cysxGT/cvf3TNGsJrdBN7GNdjpLXSBrgTuCAspCTUDqcLnb1Tk+cuuv55YmLxsCftjr6yEd5jMUO7Pu2YlQHWK0YgwMp6xjzXZXR9ZL+p+EZQJjBIO1m5gIcJJwhY56+KVIvpC2avKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(396003)(136003)(376002)(346002)(39840400004)(451199018)(66556008)(66946007)(8676002)(66476007)(4326008)(83380400001)(41300700001)(2616005)(38100700002)(5660300002)(86362001)(107886003)(6666004)(6512007)(186003)(316002)(54906003)(6506007)(1076003)(36756003)(6486002)(110136005)(52116002)(2906002)(44832011)(8936002)(478600001)(4744005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p0ggEdyvQ6O/M0jzlfZiW0cDYu4Jd/TL1ynnow4AQI0kPB7mScoJV4LbMowpywgLkN9539WaWPI0WbRiY3u13u+baI8PtEX0khwAbN5w+Z4L2IxRyHGObtnWzdIJygLKvnWpr6dlGKM+WBccBMu1bDiARA0MAnIqH3tn1OOb30WDBknF15v9/+bxtaeaTsXIF4CqPWe4FqUZ+pnCo7yJqybOVtCYZIDpfBDzfUkf9RZI+ua3RaZR2NE/Fmrn+5jQzwS4NeuEDL8mUDmq8Sbz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C52/MT6hci6COIijN8Xc0OfoJHMXC+0M7V96P78VFo+v2fQXRHTnETdDeBKrnQaP9nl+hkauCsSyrjP4QZlvz5ts2zFH+XcQtQraLy/xCPEVvs5FSK79PU64Qj4HRiE82Hdm62met5zlQ6ahtXVulfyh78TBrFhhYgt4w+Dkl5SDFg6UExt85RFkscbWt2B8cWSS1EdWs7KKiQkeHo0QLnnu0r8zz1tIuP5GJZH8oP6vVi4KZr1q7tXt8nuV2yNApmHdVXShTRNjRRmADKRqwnNJO7rCSlxMrvFGXq1SXFkG2YHOveVs2f1b6vzPb6k61C3WLn6ZNTDzFV8w== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ff06cbc-b97a-43f1-21de-08db09be84d9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 10:23:28.3908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sEGlKoTSgN/7/SjSYU0ZOwDhpLWWezuP0Ruqk1Z/nmt40JHKsmkHdyAPjUNlFZPIEw0vktdxUVAcAqIMY00zwVd7KiIJ315qIFPG17voKs4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB5490 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Yinjun Zhang says: IPsec offloading callbacks may be called in atomic context, sleep is not allowed in the implementation. Now use workqueue mechanism to avoid this issue. Extend existing workqueue mechanism for multicast configuration only to universal use, so that all configuring through mailbox asynchoronously can utilize it. Also fix another two incorrect use of mailbox in IPsec: 1. Need lock for race condition when accessing mbox 2. Offset of mbox access should depends on tlv caps Yinjun Zhang (2): nfp: fix incorrect use of mbox in IPsec code nfp: fix schedule in atomic context when offloading sa .../net/ethernet/netronome/nfp/crypto/ipsec.c | 39 ++++--- drivers/net/ethernet/netronome/nfp/nfp_net.h | 25 +++- .../ethernet/netronome/nfp/nfp_net_common.c | 108 +++++++++--------- .../net/ethernet/netronome/nfp/nfp_net_ctrl.h | 1 - 4 files changed, 99 insertions(+), 74 deletions(-)