Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp472468ybh; Wed, 22 Jul 2020 05:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaSS/HYFnawsa7A1OQXQDE2M6xT68rx2j8iqikxwglAf16Y6sNtKc0r1cMtrTsoNhkEq9e X-Received: by 2002:a05:6402:8da:: with SMTP id d26mr31049702edz.109.1595420920624; Wed, 22 Jul 2020 05:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595420920; cv=none; d=google.com; s=arc-20160816; b=YwSZnBRfYAodRd7SDIjM22F4WZfTkN21ZjahdFiGcYSyuHRbKSUxJt9mF6G4nln5iD o5FYYL/DaZdzMZ7+wdTMgnmbdxWdat6XZmcScTcfN6ZmXlloaqiHO7H6PjSogbf91gFf UDxBIDtMblznkqVFNK2+e/ufHRYghpV4EVCazpssTTUfaHEuI++ed7P5AUsOwGrpfF3L TPml2UQKA8j5vpu2iKzBl/E5g7uCuIp1nFIDfj7SDJyg2X2k2wa986zN7wkbStqlUa/M 2lk7Yh7msC4ugEz5/SCIsm5VOwFZLvcrb1d1vrI/Wo4QesY9lERY80Snwv7s2qKyqtsN 1AXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=6Um3eY46ty5qgGLen9Kr+bicC/xmnrvjDfLiPTMsjio=; b=q0sKJtPc+BhibaF5Vusm+KFFtWN7LgMdcfaxN1V8GjA6HoP1kTfUGWQSnbhGoXiexI zyFV4oPjAtCCpI4JRd5dhjmlI34qAtOwJfpGnMbvu8KLA7Dmbi+Wo2ES6OQsT883wuHB IX80a4NTpGanUETw/zGJf9mPol4ct7eVpG5WmnDGltmrEV7nOqqz5w8IXXoXYY9LCLzT LAcqTJ9/bEK0TrKFY1I7GKHn9Cjhx91A1a2H0X6YcSCWzbywgwH3cFf7n0y1havwwYD9 f+dZF4uSyPGNQHkZ/UCp2Oc54IVwFX2aMg0OxsuF8ufwP9VZzXgnXUM2CCNRKdrCoLLr v/qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=uklxvUXg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 r21si13084869ejo.707.2020.07.22.05.28.14; Wed, 22 Jul 2020 05:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=uklxvUXg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731857AbgGVM2F (ORCPT + 99 others); Wed, 22 Jul 2020 08:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726161AbgGVM2F (ORCPT ); Wed, 22 Jul 2020 08:28:05 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26C64C0619DC for ; Wed, 22 Jul 2020 05:28: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:From:References:Cc:To:Subject: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=6Um3eY46ty5qgGLen9Kr+bicC/xmnrvjDfLiPTMsjio=; b=uklxvUXge7GMFuZwK4H9WE+O66 RQ+ThpBVTSjmtykruBKWysb3Su3UZ8z/4h7XF30/t8QxvPPblX6ZmcY9ccJOXCeh++jVnT4X9lFFr KmXcj7hpbwHlFuHsT4fbNimA0K81F+gr1nKyK0kJD+2H7GLexfrg8dJwsEaZSqF0EY5Y=; Received: from p54ae9e66.dip0.t-ipconnect.de ([84.174.158.102] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jyDqZ-0000Z3-VP; Wed, 22 Jul 2020 14:27:44 +0200 Subject: Re: [RFC 2/7] ath10k: Add support to process rx packet in thread To: Rajkumar Manoharan , Rakesh Pillai Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kvalo@codeaurora.org, johannes@sipsolutions.net, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, dianders@chromium.org, evgreen@chromium.org References: <1595351666-28193-1-git-send-email-pillair@codeaurora.org> <1595351666-28193-3-git-send-email-pillair@codeaurora.org> <13573549c277b34d4c87c471ff1a7060@codeaurora.org> From: Felix Fietkau Autocrypt: addr=nbd@nbd.name; prefer-encrypt=mutual; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kY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Bes6z0QdaSOwZCRA3QSLHBwtgUsrT6RxRSweLrcabwkkE GBECAAkFAkah5FQCGwwACgkQ130UHQKnbvW2GgCfTKx80VvCR/PvsUlrvdOLsIgeRGAAn1ee RjMaxwtSdaCKMw3j33ZbsWS4 Message-ID: Date: Wed, 22 Jul 2020 14:27:42 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <13573549c277b34d4c87c471ff1a7060@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-07-21 23:53, Rajkumar Manoharan wrote: > On 2020-07-21 10:14, Rakesh Pillai wrote: >> NAPI instance gets scheduled on a CPU core on which >> the IRQ was triggered. The processing of rx packets >> can be CPU intensive and since NAPI cannot be moved >> to a different CPU core, to get better performance, >> its better to move the gist of rx packet processing >> in a high priority thread. >> >> Add the init/deinit part for a thread to process the >> receive packets. >> > IMHO this defeat the whole purpose of NAPI. Originally in ath10k > irq processing happened in tasklet (high priority) context which in > turn push more data to net core even though net is unable to process > driver data as both happen in different context (fast producer - slow > consumer) > issue. Why can't CPU governor schedule the interrupts in less loaded CPU > core? > Otherwise you can play with different RPS and affinity settings to meet > your > requirement. > > IMO introducing high priority tasklets/threads is not viable solution. I'm beginning to think that the main problem with NAPI here is that the work done by poll functions on 802.11 drivers is significantly more CPU intensive compared to ethernet drivers, possibly more than what NAPI was designed for. I'm considering testing a different approach (with mt76 initially): - Add a mac80211 rx function that puts processed skbs into a list instead of handing them to the network stack directly. - Move all rx processing to a high priority thread, keep a driver internal queue for fully processed packets. - Schedule NAPI poll on completion. - NAPI poll function pulls from the internal queue and passes to the network stack. With this approach, the network stack retains some control over the processing rate of rx packets, while the scheduler can move the CPU intensive processing around to where it fits best. What do you think? - Felix