Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1867844rwl; Sun, 26 Mar 2023 10:36:53 -0700 (PDT) X-Google-Smtp-Source: AKy350aqhhfdB97VTQCvfb+3LAEx8zTgDh9O0koTj7yBY9GTRJ1BhdzlH8oj/98OlgnMth9B7MNN X-Received: by 2002:aa7:c84a:0:b0:502:26b7:8311 with SMTP id g10-20020aa7c84a000000b0050226b78311mr6078918edt.17.1679852213759; Sun, 26 Mar 2023 10:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679852213; cv=none; d=google.com; s=arc-20160816; b=vpUTP9HXaI6rbzTkZaW8JIGmih7VRjyhg022+2q7E8750dHe3llmtTovKkIUDLOviH dQnlmUN5OcuJVV51SW05BzncGUuEQm1nQ7lvqc1IdU8JIKBBms7SYHv+DBgvNYnP6HQX WDQBkU7s952eurH06ytt8idec3wuBozXvdm4aKAmgXb4ocfwa9tbPnZjQwN9DLCSg6iA 5GLEPC96ImpzFqtfP1eeQPIAdYImCaddV6OPnNprpbCNDzur9rSWUrbNNSV19N63GfNr qJSQSt347ZIHdFuFRpyTeZmS14PHET05wRNwoEQyAS0/U+teYIPdGe4dTJJGNQpMEA+4 xQtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eZf4Q1Tx6L+B1KzWs59sfdK76WmqOF9UglHcQK60Ewo=; b=WysUfLL5C2gh2X7JiDRq7XJlU30yWuVfll3LYksj8dtXoaDVOkIatMPy4zjsFD5nF8 Cvu8jto1oFJn4vOEbSXJmUWrhvZQYtwtQcJu9DgtN6OlMKE7WcFmNXjGQuyI8qzQkz0Y DtJuQT8+QvF7cOXJXHFIDQGbx1milfIX/IKXLh8CjX9BK8rWjJ2od2m9p9VQgaDKE0fj S0EbQEvD7muPAzZcucS/zsSLoBDE8jzw5hLRFJY9QcEGwm0Gbf4JGUt5wlCmrnos+G5g 2WpOCZeB+HFVir4KiDKwu1BEl8fUt/wIOQbtmRHyLZqjeiQSwTlQE2xiJ7epwWNiV51P Ud0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Jwy+JVvh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020aa7d714000000b00501e59e6198si13708133edq.613.2023.03.26.10.36.29; Sun, 26 Mar 2023 10:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Jwy+JVvh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231706AbjCZRf3 (ORCPT + 99 others); Sun, 26 Mar 2023 13:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjCZRf2 (ORCPT ); Sun, 26 Mar 2023 13:35:28 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9822972B1 for ; Sun, 26 Mar 2023 10:35:27 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id n1so2788842ili.10 for ; Sun, 26 Mar 2023 10:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679852127; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eZf4Q1Tx6L+B1KzWs59sfdK76WmqOF9UglHcQK60Ewo=; b=Jwy+JVvhRuLgLuCfY6CQw+fTLE+tY6ltHEUlD3QiASg8te6DytHym0PZmc5ig+PnbS NNhtOtov9yRmf9b6SDyrgNkeHybtXFzfu9D81NF6gx2xlMZQ4ai9QkZkuVQBE+Gvym+8 3KTsHzRc9l3iUFFYm2n0qAm+wtpuht8FoTYaBDb2VqLrJxFVoJAmMYCCJeLb3+ZueR1B O0TjiLYi9f9t2+4L2QZslbxUm3SG9lQicIOalQb+59kYWnyMHLWTOXc5NVxpVSHCBhBR HVVUBWO7b4kxJganBEKL1GutJsZEoM/eO5QZjrmpp/ReXknvUhQ8eYyUwX5+8pFz2Hek exEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679852127; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eZf4Q1Tx6L+B1KzWs59sfdK76WmqOF9UglHcQK60Ewo=; b=XbsbVEG02Rzb15YI9A9GKAuxwMGjjQon4XmDXOy/k/ZZCY6UyEgwEzDkd3JW5GgYIc pJojmdAHHDzDO30+Ix9DWFusLcTkbeBmNapN7kjand38ydhUJIAgpwtpGqo8BreAk1hX AlA2BYoI7XXzOPvYuOVCF7QO6dLk3fQusBxA6zTAVmbTrjDVk6NsCMz3mJEoYU9wFJMB gMDKVLZtTESamHefnqDG+5y9WkOuG/qQOf+F1iJZDq6aIbnXrG0dNLNmLFydE8AVuwjB JwUS1csw6lU+jTfj1rkEjQWtZxXRVFlngx0nEWBwIUUH4HX7r8tTjLvQJFHN8tjKIKTP yL5Q== X-Gm-Message-State: AO0yUKWsvBaYMpwk12k9uAkxpE6SskfrKcotmjJClU6VWtUmxgloaqpd QwRjvUN8qgr/titKBPIMy2YLFHzV7eZ9ogyUdsxbEQ== X-Received: by 2002:a05:6e02:2207:b0:323:ecc:daf1 with SMTP id j7-20020a056e02220700b003230eccdaf1mr8501949ilf.2.1679852126729; Sun, 26 Mar 2023 10:35:26 -0700 (PDT) MIME-Version: 1.0 References: <20230325152417.5403-1-kerneljasonxing@gmail.com> In-Reply-To: From: Eric Dumazet Date: Sun, 26 Mar 2023 10:35:13 -0700 Message-ID: Subject: Re: [PATCH net] net: fix raising a softirq on the current cpu with rps enabled To: Jason Xing Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Xing Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Forgive me. Really I need some coffee. I made a mistake. This line > above should be: > > + if (!test_bit(NAPI_STATE_SCHED, &mysd->backlog.state)) > > But the whole thing doesn't feel right. I need a few days to dig into > this part until Eric can help me with more of it. > I am still traveling, and this is weekend time :/ It should not be too hard to read net/core/dev.c and remember that not _all_ drivers (or some core networking functions) use the NAPI model. eg look at netif_rx() and ask yourself why your patch is buggy. Just look at callers of enqueue_to_backlog() and ask yourself if all of them are called from net_rx_action() [The answer is no, just in case you wonder] In order to add your optimization, more work is needed, like adding new parameters so that we do not miss critical __raise_softirq_irqoff(NET_RX_SOFTIRQ) when _needed_. We keep going circles around softirq deficiencies, I feel you are trying to fix a second-order 'issue'. Real cause is elsewhere, look at recent patches from Jakub. Thanks.