From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 7F36BC388F7 for ; Sat, 31 Oct 2020 17:14:53 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6DE2120729 for ; Sat, 31 Oct 2020 17:14:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BtU7BEOu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DE2120729 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CNm553R1pzDqZB for ; Sun, 1 Nov 2020 04:14:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=kuba@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=BtU7BEOu; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CNm2C66DSzDqGZ for ; Sun, 1 Nov 2020 04:12:19 +1100 (AEDT) Received: from kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net (c-67-180-217-166.hsd1.ca.comcast.net [67.180.217.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F444206E5; Sat, 31 Oct 2020 17:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604164337; bh=twQgN1Y1z8exlY3r71I3ZihQiCAGvG9Gae4RwmXJ/ts=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BtU7BEOuk65G9AhsBSbq29tqoeagdjbEzoTanYWmoCtuMCYigAiLgK11D5wMFmwcJ nGdnuDEWBvTemNLvy3iTArF4CpVp2MfmgvvkX5CtfAtpJfwrL7jbbg8oi8TU3fN+AS CjvtkSVxRf+kBaJf3M0H7+fviR9KvGGUqFE5Tcjg= Date: Sat, 31 Oct 2020 10:12:15 -0700 From: Jakub Kicinski To: Sebastian Andrzej Siewior Subject: Re: [PATCH net-next 14/15] net: dpaa: Replace in_irq() usage. Message-ID: <20201031101215.38a13e51@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20201027225454.3492351-15-bigeasy@linutronix.de> References: <20201027225454.3492351-1-bigeasy@linutronix.de> <20201027225454.3492351-15-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aymen Sghaier , Madalin Bucur , Zhu Yanjun , Samuel Chessman , Ping-Ke Shih , Herbert Xu , Horia =?UTF-8?B?R2VhbnTEgw==?= , linux-rdma@vger.kernel.org, Rain River , Kalle Valo , Ulrich Kunitz , Jouni Malinen , linuxppc-dev@lists.ozlabs.org, Daniel Drake , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Leon Romanovsky , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Li Yang , linux-crypto@vger.kernel.org, Jon Mason , Saeed Mahameed , "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 27 Oct 2020 23:54:53 +0100 Sebastian Andrzej Siewior wrote: > The driver uses in_irq() + in_serving_softirq() magic to decide if NAPI > scheduling is required or packet processing. >=20 > The usage of in_*() in drivers is phased out and Linus clearly requested > that code which changes behaviour depending on context should either be > seperated or the context be conveyed in an argument passed by the caller, > which usually knows the context. >=20 > Use the `napi' argument passed by the callback. It is set true if > called from the interrupt handler and NAPI should be scheduled. >=20 > Signed-off-by: Sebastian Andrzej Siewior > Cc: "Horia Geant=C4=83" > Cc: Aymen Sghaier > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Madalin Bucur > Cc: Jakub Kicinski > Cc: Li Yang > Cc: linux-crypto@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net= /ethernet/freescale/dpaa/dpaa_eth.c > index 27835310b718e..2c949acd74c67 100644 > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > @@ -2300,9 +2300,9 @@ static void dpaa_tx_conf(struct net_device *net_dev, > } > =20 > static inline int dpaa_eth_napi_schedule(struct dpaa_percpu_priv *percpu= _priv, > - struct qman_portal *portal) > + struct qman_portal *portal, bool napi) > { > - if (unlikely(in_irq() || !in_serving_softirq())) { > + if (napi) { > /* Disable QMan IRQ and invoke NAPI */ > qman_p_irqsource_remove(portal, QM_PIRQ_DQRI); > =20 Nit: some networking drivers have a bool napi which means "are we running in napi context", the semantics here feel a little backwards, at least to me. But if I'm the only one thinking this, so be it.