Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3015112pxu; Sat, 10 Oct 2020 16:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu51SFjCOZ05C2KohS++tYn3NM6UkjTQ6abBznQZJ+VGIGbpBIJ7bX4M1LxjwJwZdv3VdB X-Received: by 2002:a17:906:9153:: with SMTP id y19mr20646716ejw.475.1602371434084; Sat, 10 Oct 2020 16:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602371434; cv=none; d=google.com; s=arc-20160816; b=QJf+XyAJhfLIeyNiUQ6B2acvfL2mNKtW+RGf4JYUU220ja78A5IeuVEtRIT4L81TLz i9YcyMRr8GiT+4Iz9dtBOWIibyZuu1e4Tx/Gd0UU+pl+las4x9NuffVjRPXOqcYZZEKM 4YasQkr/Q7nbZecibsd0WbaiOCe8QF39PpxtdCcpli3K3qQls6HfzySWHR9yfujk4h/W bufzhHupjSE4n1xHJdBpQQhptUhvqMvTqQlsgvIPiV0EalDjo+hMSN3C6RT9883RzSGq aZp9k2G+bo43TMtMpVUlOAJeHjwH1PivN0wsvND9/y649hBC3U/5SCro3QKhpZFcocYF vmEA== 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:references:cc :to:from:subject:dkim-signature; bh=IRzgnkzL+y6KxGnUDl6KgaiE0a2YhOVgP91PfZHg4Jo=; b=qAsIikxZijO5wfw41Oei6DjcCUCuAeXUiWOPSuZrgGV664WetjvT3j57l7fZyvNv4o VX1x4u3mfT79h24xKcbgWf38Xr+NOBJ2870xxINxdh9EaQDipCtyfoV9XSi4svA6htJr sf4tlLoc9iNfaMq4MgcyJhRLEr1X3KE0/9KQcZfFdFjXBDcu0KkoU9F91rsQ8c+M8qCv bbR+98uCIQfD8EPZ1BMwD2juQ5b1jwAV5n23k5HK+nAoFSwJHklLRgxrbXfqbtYZ55BN zWtUm+Hd+5Fae+JnMftCbLgzpRUGNZpGSbvJb8UdYRbum+TqnCbhyKWyMKPI+7wbmJDs 72kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=byvw0Fy4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si6630768eje.85.2020.10.10.16.10.11; Sat, 10 Oct 2020 16:10:34 -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=pass header.i=@gmail.com header.s=20161025 header.b=byvw0Fy4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390643AbgJJW6L (ORCPT + 99 others); Sat, 10 Oct 2020 18:58:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730875AbgJJTwD (ORCPT ); Sat, 10 Oct 2020 15:52:03 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFAB7C05BD43; Sat, 10 Oct 2020 06:08:22 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id u21so17025623eja.2; Sat, 10 Oct 2020 06:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IRzgnkzL+y6KxGnUDl6KgaiE0a2YhOVgP91PfZHg4Jo=; b=byvw0Fy4HVNaP4n7smhkuDqjTWMOiaFJVMkeRiZ3ec2F2chtyzQnuMP0wAlP3i+Pn2 phJpF74wVI6sccENkGwj9rueqnRXQ/jl4aTHLB+8wqpm/+L5yVgbAOa3pQSsp+cK1pG1 ftZm36sv696d5/c/iL7qbsxcglHZpjm4AilrMRrZyo2QEDOjAtAJQ0tUnQKevwGXOPr+ 7n/19bs7ClEXbaWInlMsQfTLf5Dbur8Ls0TqTXNQ5KYqijuvicyoqKCr2d4FsV0nJDUt W7cJpFY6AQ0TfOMZ7CEX7witi82v0jv7tJE82bwVSWTbTQbyiLVnMhGgqTc2w0ltbBF6 jZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IRzgnkzL+y6KxGnUDl6KgaiE0a2YhOVgP91PfZHg4Jo=; b=QSWma9SKvUGCq19lpKIQigZDj11wJfuw52/KtFbvpijCjMH65kUe1iWktzEwIyjUr5 Oe3cHPSPsVCmrnuPoH5kQEgHDcM7ALSM0l+a7epnqAxTuCIwyQA8hCJr92WjLdDGyJ6J 0EtnJ/LQkjrzHutwhYOICKOvEcuhh9R5k8fMzMs3DE98gVGDrj7WIP5j+pqT0OoLUsth KL8WBeDIpylQwgLq+QxnFLsHeNEVHodl+HZgguHmucD+lIAWTH8mSxmZS2wbKZKFEdlL /6zwekcICbqA8wR5RN4DBb/WO8lotDXi2WVFjI4L3BxJojS1lso0kVpKOWBYSWRTK50u nK8g== X-Gm-Message-State: AOAM5313ckUZ1HRFURoq8R/blOledTBdOVxM/5o1w8rMhs1SuIm38m34 2cB7FB4OpGyVpidobAaOUwmB++V4LILfsw== X-Received: by 2002:a17:906:39ce:: with SMTP id i14mr20143131eje.170.1602335301421; Sat, 10 Oct 2020 06:08:21 -0700 (PDT) Received: from ?IPv6:2003:ea:8f00:6a00:14e2:2617:c2db:d1c8? (p200300ea8f006a0014e22617c2dbd1c8.dip0.t-ipconnect.de. [2003:ea:8f00:6a00:14e2:2617:c2db:d1c8]) by smtp.googlemail.com with ESMTPSA id gv10sm7888810ejb.46.2020.10.10.06.08.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 10 Oct 2020 06:08:20 -0700 (PDT) Subject: Re: [PATCH] net: stmmac: Don't call _irqoff() with hardirqs enabled From: Heiner Kallweit To: Jakub Kicinski Cc: John Keeping , netdev@vger.kernel.org, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Eric Dumazet References: <20201008162749.860521-1-john@metanate.com> <8036d473-68bd-7ee7-e2e9-677ff4060bd3@gmail.com> <20201009085805.65f9877a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <725ba7ca-0818-074b-c380-15abaa5d037b@gmail.com> Message-ID: <070b2b87-f38c-088d-4aaf-12045dbd92f7@gmail.com> Date: Sat, 10 Oct 2020 15:08:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <725ba7ca-0818-074b-c380-15abaa5d037b@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.10.2020 18:06, Heiner Kallweit wrote: > On 09.10.2020 17:58, Jakub Kicinski wrote: >> On Fri, 9 Oct 2020 16:54:06 +0200 Heiner Kallweit wrote: >>> I'm thinking about a __napi_schedule version that disables hard irq's >>> conditionally, based on variable force_irqthreads, exported by the irq >>> subsystem. This would allow to behave correctly with threadirqs set, >>> whilst not loosing the _irqoff benefit with threadirqs unset. >>> Let me come up with a proposal. >> >> I think you'd need to make napi_schedule_irqoff() behave like that, >> right? Are there any uses of napi_schedule_irqoff() that are disabling >> irqs and not just running from an irq handler? >> > Right, the best approach depends on the answer to the latter question. > I didn't check this yet, therefore I described the least intrusive approach. > With some help from coccinelle I identified the following functions that call napi_schedule_irqoff() or __napi_schedule_irqoff() and do not run from an irq handler (at least not at the first glance). dpaa2_caam_fqdan_cb qede_simd_fp_handler mlx4_en_rx_irq mlx4_en_tx_irq qeth_qdio_poll netvsc_channel_cb napi_watchdog