Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3725C2D0A8 for ; Mon, 28 Sep 2020 08:45:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56352207C4 for ; Mon, 28 Sep 2020 08:45:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Saju/COA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbgI1Ipo (ORCPT ); Mon, 28 Sep 2020 04:45:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47367 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbgI1Ipn (ORCPT ); Mon, 28 Sep 2020 04:45:43 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601282742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R/p+lmIVfxbJUcYSj4nC9UmZQslqUK3jR+nD79F1NfM=; b=Saju/COAmcJtGI8H2ahFQoLwhmxzmyJk6+rRT4sV2CrJxPZuKPdi463t7Efzty8+ab+Piy 2JMgfikY7w2MKdF6rgtnB/uT2oE6A3naUdsFWv59kFomP4WlPJnxw5R4R8/s+Ce5gYH1GI 3B8RzcYuYaCTMFzILO5GZtteIikKYwg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343--tLdz3qgO32GPoQyiYpOiw-1; Mon, 28 Sep 2020 04:45:40 -0400 X-MC-Unique: -tLdz3qgO32GPoQyiYpOiw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B99A2801F97; Mon, 28 Sep 2020 08:45:38 +0000 (UTC) Received: from ovpn-115-6.ams2.redhat.com (ovpn-115-6.ams2.redhat.com [10.36.115.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B49678482; Mon, 28 Sep 2020 08:45:36 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH net-next 1/6] net: implement threaded-able napi poll loop support From: Paolo Abeni To: Hannes Frederic Sowa , Wei Wang Cc: David Miller , Linux Kernel Network Developers , Jakub Kicinski , Eric Dumazet , Felix Fietkau Date: Mon, 28 Sep 2020 10:45:35 +0200 In-Reply-To: <021e455b-faaf-4044-94bb-30291e1c9ee1@www.fastmail.com> References: <20200914172453.1833883-1-weiwan@google.com> <20200914172453.1833883-2-weiwan@google.com> <2ab7cdc1-b9e1-48c7-89b2-a10cd5e19545@www.fastmail.com> <021e455b-faaf-4044-94bb-30291e1c9ee1@www.fastmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello, On Sat, 2020-09-26 at 16:22 +0200, Hannes Frederic Sowa wrote: > On Sat, Sep 26, 2020, at 01:50, Wei Wang wrote: > > I took a look at the current "threadirqs" implementation. From my > > understanding, the kthread used there is to handle irq from the > > driver, and needs driver-specific thread_fn to be used. It is not > > as > > generic as in the napi layer where a common napi_poll() related > > function could be used as the thread handler. Or did I > > misunderstand > > your point? > > Based on my memories: We had napi_schedule & co being invoked inside > the threads I just looked at the code - I really forgot most details. The above is correct... > without touching any driver code when we specified > threadirqs. But this would need a double check. ... but still that code needed some per device driver modification: the irq subsystem handled the switch to/from threaded mode, and needed some callback, provided from the device driver, to notify the network code about the change (specifically, to mark the threaded status inside the relevant napi struct). Cheers, Paolo