From mboxrd@z Thu Jan 1 00:00:00 1970 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 2BFBBC43334 for ; Thu, 7 Jul 2022 02:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234494AbiGGChs (ORCPT ); Wed, 6 Jul 2022 22:37:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235011AbiGGChj (ORCPT ); Wed, 6 Jul 2022 22:37:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E993EB5 for ; Wed, 6 Jul 2022 19:37:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4EAAB81F44 for ; Thu, 7 Jul 2022 02:37:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45471C341C6; Thu, 7 Jul 2022 02:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657161456; bh=IJRIxOmyCRxqRD6kK6334kr2360kQdOjcS/uV2zNkwE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uoOpKi5QIE6Rwrgy2PztrkOZlkJK5xYsIWFrwlTT84s3T+qobZ2NMJY+wNXtX/ZfW XFdIve/x1ClAgIOU6FmWe54MT76QTKjfAfgTQ682MOtnhhsCCY8fWaD3UY9BoiAdXR TtH3pgcIxD/mI/122osdy71iu22GD/rwzrBiLXjgyfhC9rqtXhw1mJ5o4mSuTB8jQV JTS8lOOInWdkRVwkzAQi4WkTKNZfUHtTfz2WDJX6aSR+N+6cKXGhNkGBwKQbMInB/M 0B6u3KWOxDUIgBYCfoalYwiotAPaxGam+UZp6eff7l0pu4hte7ZvjuMR3+rK2j1Gxe eqKoNIYYZ/R7A== Date: Wed, 6 Jul 2022 19:37:35 -0700 From: Jakub Kicinski To: Saeed Mahameed Cc: "David S. Miller" , Paolo Abeni , Eric Dumazet , Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Maxim Mikityanskiy Subject: Re: [net-next 11/15] net/tls: Multi-threaded calls to TX tls_dev_del Message-ID: <20220706193735.49d5f081@kernel.org> In-Reply-To: <20220706232421.41269-12-saeed@kernel.org> References: <20220706232421.41269-1-saeed@kernel.org> <20220706232421.41269-12-saeed@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 6 Jul 2022 16:24:17 -0700 Saeed Mahameed wrote: > diff --git a/include/net/tls.h b/include/net/tls.h > index 4fc16ca5f469..c4be74635502 100644 > --- a/include/net/tls.h > +++ b/include/net/tls.h > @@ -163,6 +163,11 @@ struct tls_record_info { > skb_frag_t frags[MAX_SKB_FRAGS]; > }; > > +struct destruct_work { > + struct work_struct work; > + struct tls_context *ctx; Pretty strange to bundle the back-pointer with the work. Why not put it directly in struct tls_offload_context_tx? Also now that we have the backpointer, can we move the list member of struct tls_context to the offload context? (I haven't checked if its used in other places) > > up_write(&device_offload_lock); > > - flush_work(&tls_device_gc_work); > - > return NOTIFY_DONE; > } > > @@ -1435,6 +1416,5 @@ void __init tls_device_init(void) > void __exit tls_device_cleanup(void) > { > unregister_netdevice_notifier(&tls_dev_notifier); > - flush_work(&tls_device_gc_work); > clean_acked_data_flush(); > } Why don't we need the flush any more? The module reference is gone as soon as destructor runs (i.e. on ULP cleanup), the work can still be pending, no?