Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp728586rdb; Fri, 6 Oct 2023 18:18:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKbKMLcDKg6BTXWrMhK4CIwsMTePkPmIxU7sN24aDYzYc53ITD4jciojtoPnQZiF+Wnp8Z X-Received: by 2002:a05:6358:9992:b0:143:3179:1a67 with SMTP id j18-20020a056358999200b0014331791a67mr8059007rwb.29.1696641509013; Fri, 06 Oct 2023 18:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696641508; cv=none; d=google.com; s=arc-20160816; b=qVFZEYETcQ4FbaETBaOUk64ey0j2m6p8YG0wwystK+2XoYY7sthYnY5DRbNp/zj9N7 YH0kDYSTgI5mGTiUqrgLBmb4x4LFV9J6GEHK6xUJXr/cZPp2w4WiiSgw5w/d3tRSKK8U gP/LhHDOjnp2B9gZkhDFV083q8fNxiWWr9rDs1Jv24j2bb5rD6LSRpyB4+D0RwwZIMWE ebwuVcV1nbpvzlLwF8PvsukevHvRkt+y6J44AvFZrwcwxosuKsoX2fV3FcoXLncO9IE0 vVstDFU60XRz+cY+K1As6LmsSI80KbUn/k7+q+g+dTnAb5D6+cSjXRFG1GQUudvdhwA3 bSRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=0b+a42Lvh1jbiovZJdaPKcmgeY0YgWaPKbmyOZOXkW4=; fh=FQFx3PKLDMXkbEXaz3PZ19ad1HPZwCxSOzWdKjhL1yo=; b=EFBGn8/SSoShNQnK5tIuhyQZ04+sVcW68LvFPO14AVlZ00g1fvKw0t0uLiR98G++Nn 2bn7RaI/x643UhVAKppqSeFwoyRRvQejplLjn39zaVKj5tU1cXQ8P3N+3bDz71RzgQoq 5/pYUKyFogUbjmPiqiQaz7H68IkcF/E2yF1XO27aRnE2kvlGX2+eBPtKSHbB8xhNTngd TCCbo0fbgHwR6zCq1i9bo12tYazYvTn3/6VazaJbdHaFEQRiHf5DJUpCgVqa/FktzijG rsMLlK4Ck2EK9zOxsmo+LvhEf335cWQJcp2tAUxtNbdUsKF5aHqyOQgbpqryfmINHMQ+ MUPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i10-20020a17090acf8a00b00279020d1fb0si4696979pju.129.2023.10.06.18.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 18:18:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5E67880A28DF; Fri, 6 Oct 2023 18:18:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233942AbjJGBSP (ORCPT + 99 others); Fri, 6 Oct 2023 21:18:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233269AbjJGBSP (ORCPT ); Fri, 6 Oct 2023 21:18:15 -0400 Received: from wxsgout04.xfusion.com (wxsgout03.xfusion.com [36.139.52.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61F65B6; Fri, 6 Oct 2023 18:18:10 -0700 (PDT) Received: from wuxshcsitd00600.xfusion.com (unknown [10.32.133.213]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4S2S6F6pBQz9xg1l; Sat, 7 Oct 2023 09:15:49 +0800 (CST) Received: from localhost (10.82.147.3) by wuxshcsitd00600.xfusion.com (10.32.133.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 7 Oct 2023 09:17:59 +0800 Date: Sat, 7 Oct 2023 09:17:59 +0800 From: Wang Jinchao To: Steffen Klassert CC: Daniel Jordan , , , Subject: Re: [RFC/REFACT] Refactoring and significantly reducing code complexity Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.82.147.3] X-ClientProxiedBy: wuxshcsitd00603.xfusion.com (10.32.134.231) To wuxshcsitd00600.xfusion.com (10.32.133.213) X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 06 Oct 2023 18:18:26 -0700 (PDT) X-Spam-Level: ** On Fri, Sep 29, 2023 at 07:47:22AM +0200, Steffen Klassert wrote: > On Thu, Sep 28, 2023 at 04:53:38PM +0800, Wang Jinchao wrote: > > This is a refactored version with the following main changes: > > > > - The parallel workqueue no longer uses the WQ_UNBOUND attribute > > - Removal of CPU-related logic, sysfs-related interfaces > > - removal of structures like padata_cpumask, and deletion of parallel_data > > - Using completion to maintain sequencing > > - no longer using lists > > - removing structures like padata_list and padata_serial_queue > > - Removal of padata_do_serial() > > This removes all the logic that is needed to ensure that > the parallelized objects return in the same order as > they were before the parallelization. This change makes > padata unusable for networking. The RFC use the following three to ensure serial timing sequence: 1. Use alloc_ordered_workqueue() to create a serial worker queue where serial() function runs. This ensures that serial() function executes as serial work was enqueued using queue_work(). 2. Queue the serial work before enqueueing parallel work in padata_do_parallel(). This ensures the serial work follows the same order as the padata_do_parallel(). 3. The serial work wait for completion of parallel_done, which will be complete()ed after the parallel() function within the parallel work. This is just a design idea, because I am not familiar with IPsec, I haven't tested it in a real network environment yet. Could you give me some clues on how to use pcrypt in an IPsec scenario?