Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp262041pxf; Thu, 25 Mar 2021 03:36:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWn/tMmMV2nB44u+UuEeeO7sVMJnZx3MV1BiCFgwj75kXZ/LZ2KuW6AEOWw33eGdLzMk2J X-Received: by 2002:a17:906:26d4:: with SMTP id u20mr3587816ejc.114.1616668569218; Thu, 25 Mar 2021 03:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616668569; cv=none; d=google.com; s=arc-20160816; b=FBU5uMihD5F2Mc/cYRTGYpVjNGGSyb/nHFQOD8gaZQ9qJNSkldLks/tqllXTiU8enp 3oCeJHvCdK8dYfrITcAlifrI7YDu6uGsGbn8OtnapdF3ON3iQv4kznFuvjGnBLYNuxfL dl6Gl+yW+hACqAdJ9T6ceMoCroiclK2AIlCBxvv5+PuS5tLlmodaa8i8Nbx38ORMjBOm DAj899RjC/fyVckwudtReEOiFA8wq9UzXMxUGy2l7Vxciye3LSo22i53D8r7EuhVsB0G oEWSTMDU3bDak4qegzXht/nLM68QGezshuzdCBh/NgskfAkOBc3XpeXJZ4UxBmPekbzW yiOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=zX4w/YCkqpoXy6bZV/Ut/Ci2wQiJmAv2JfLAPxQJFqE=; b=V2rZwFf+/R8Vc13iND4GJRiGb/xb0CrzzvWczt62VoQHuq2Yz8PA0MGZrVYeeEAgGs yHED/W+klputD3hxzfSPxuiF9UF7xWGK1DeLClCqp81YVzG9SOEbTSPjt1mmay3j+XHw g8H8pB7NA3WtMZgBHFsg542FFZZUEtDYq2tBKwSgO5/99wTDAVCidZ4Jf3XR1Dl3t8bW s9a7jlLidIzY3fDlDf3V2I/mPROrGgAUkvMne4oNSWibqGHDbClIerN2EveJtgTPPdnM 7aeb0j9yGc8bpl2YlcR2SfFKsdpP1EyPhblmRVf6wGQXJSY7EqK6Uv4dnxGG4mCIRi+j 7kcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Ia8EkU18; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si3988761ejs.40.2021.03.25.03.35.46; Thu, 25 Mar 2021 03:36:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Ia8EkU18; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229979AbhCYKeY (ORCPT + 99 others); Thu, 25 Mar 2021 06:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbhCYKeF (ORCPT ); Thu, 25 Mar 2021 06:34:05 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD0FC06174A; Thu, 25 Mar 2021 03:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Subject:From:References:Cc:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zX4w/YCkqpoXy6bZV/Ut/Ci2wQiJmAv2JfLAPxQJFqE=; b=Ia8EkU18A2xNwsyK3OpzgjLKLN 5CoFQt5FqnnsFZdgK9ZQAHhiC//FyW9i1ap51uUVLdvmTahmQPtEpeO1O0QXweTu1njJ1rf/oomaz bhhfmOoH9d118Fg1dbfcniJgUstgdh4CnwLGfZzXH6BAtG8O4ej9hHECFYAPeiA8J+Fg=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lPNJL-0003xC-IU; Thu, 25 Mar 2021 11:33:55 +0100 To: Rakesh Pillai , 'Ben Greear' , 'Brian Norris' Cc: 'Johannes Berg' , 'Rajkumar Manoharan' , 'ath10k' , 'linux-wireless' , 'Linux Kernel' , 'Kalle Valo' , "'David S. Miller'" , 'Jakub Kicinski' , netdev@vger.kernel.org, 'Doug Anderson' , 'Evan Green' References: <1595351666-28193-1-git-send-email-pillair@codeaurora.org> <1595351666-28193-3-git-send-email-pillair@codeaurora.org> <13573549c277b34d4c87c471ff1a7060@codeaurora.org> <04d7301d5ad7555a0377c7df530ad8522fc00f77.camel@sipsolutions.net> <1f2726ff-8ba9-5278-0ec6-b80be475ea98@nbd.name> <06a4f84b-a0d4-3f90-40bb-f02f365460ec@candelatech.com> <47d8be60-14ce-0223-bdf3-c34dc2451945@candelatech.com> <633feaed-7f34-15d3-1899-81eb1d6ae14f@nbd.name> <003701d7215b$a44ae030$ece0a090$@codeaurora.org> From: Felix Fietkau Subject: Re: [RFC 2/7] ath10k: Add support to process rx packet in thread Message-ID: Date: Thu, 25 Mar 2021 11:33:53 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <003701d7215b$a44ae030$ece0a090$@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-03-25 10:45, Rakesh Pillai wrote: > Hi Felix / Ben, > > In case of ath10k (snoc based targets), we have a lot of processing in the NAPI context. > Even moving this to threaded NAPI is not helping much due to the load. > > Breaking the tasks into multiple context (with the patch series I posted) is helping in improving the throughput. > With the current rx_thread based approach, the rx processing is broken into two parallel contexts > 1) reaping the packets from the HW > 2) processing these packets list and handing it over to mac80211 (and later to the network stack) > > This is the primary reason for choosing the rx thread approach. Have you considered the possibility that maybe the problem is that the driver doing too much work? One example is that you could take advantage of the new 802.3 decap offload to simplify rx processing. Worked for me on mt76 where a dual-core 1.3 GHz A64 can easily handle >1.8 Gbps local TCP rx on a single card, without the rx NAPI thread being the biggest consumer of CPU cycles. And if you can't do that and still consider all of the metric tons of processing work necessary, you could still do this: On interrupts, spawn a processing thread that traverses the ring and does the preparation work (instead of NAPI). From that thread you schedule the threaded NAPI handler that processes these packets further and hands them to mac80211. To keep the load somewhat balanced, you can limit the number of pre-processed packets in the ring. - Felix