Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1235184pxb; Fri, 18 Feb 2022 03:39:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPd+pu6eNDaR7jPFLqJ3rCaHdpdh3RzNfpkG5W8yfJFG5yYtB5vZ4LzGvtZfKgxynCZPTM X-Received: by 2002:a05:6a00:891:b0:4ce:912b:e388 with SMTP id q17-20020a056a00089100b004ce912be388mr7267252pfj.79.1645184362935; Fri, 18 Feb 2022 03:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645184362; cv=none; d=google.com; s=arc-20160816; b=lBBItOBrBkYr96JVMvzWteFPevPYTsPvBOBydegpWfQi1Qu9UM0su+o2A37/zWvYax DcHGEG0V0rvhUYd7kkhN4SRemETx0XOGrVbB0MuRQEU4XgEVVvXiFihRMxhjMPN4w9u3 T8VExm/uwFUX88GO3qlY097ki4PhIQ8LzFlZpcCqOBCUKqpeH0yxbMEji2XFY0wll4iY RuBVkI8Sgc2ptuDzgIo9IDG9zy3JXXRXZARAnBKG8eaFALDcXgbMdR8BYjSu/gV8kwGj PgNagWrkTrUZ9/VB19VNXBk+Jiyih3Rk+Rg62TeIcH+mj75ErlBWnB4fxBZtg/EoTNr1 5siA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Nr9xKTA1MfzCZ3n93QJrw5zuxL5F+SXxQUPoR5nmX1A=; b=rMf3ktZr+bPyehyXcspHji3WrOYjaid0GPzo6pCnvg2vyQMxo3+z3ED7wj5DiPvmrZ S5arycMTCrwJnb9JeGkYRhQlEpVFbm8yA9oUmjcKfdfawHxxW5YFLznKIXtQVANqw0nF ZMScuJfsPdAt1se1gBfyxKy5DdutZrLhc8f/SUGi2PnDPk7n+L1Z7LVER2mCqEuZTx2R z/InLhMHYs9SMh/khD5D26QRm1kh+8sgLXMamy5s/57agIB4m6yiR+4DLMI2J7btvkDc JZdZnEwt5+bkao9LC8j2d3dGwZ0TjeiEF3IhtTLgI3ZpG+zYxMjWHecdv96QWbCFAxG7 CE1A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18si21000466pls.455.2022.02.18.03.39.07; Fri, 18 Feb 2022 03:39:22 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234156AbiBRKpl (ORCPT + 99 others); Fri, 18 Feb 2022 05:45:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234137AbiBRKpk (ORCPT ); Fri, 18 Feb 2022 05:45:40 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD5025AE56 for ; Fri, 18 Feb 2022 02:45:24 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL0lE-0007Wy-FR; Fri, 18 Feb 2022 11:45:12 +0100 Received: from pengutronix.de (unknown [195.138.59.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 9A31436EAB; Fri, 18 Feb 2022 10:45:07 +0000 (UTC) Date: Fri, 18 Feb 2022 11:45:04 +0100 From: Marc Kleine-Budde To: Jakub Kicinski Cc: Vincent Whitchurch , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , kernel@axis.com, Lars Persson , Srinivas Kandagatla , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: Enable NAPI before interrupts go live Message-ID: <20220218104504.62sfwbc4yoaceqdw@pengutronix.de> References: <20220217145527.2696444-1-vincent.whitchurch@axis.com> <20220217203604.39e318d0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h4oitkp7lwuotckt" Content-Disposition: inline In-Reply-To: <20220217203604.39e318d0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --h4oitkp7lwuotckt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 17.02.2022 20:36:04, Jakub Kicinski wrote: > On Thu, 17 Feb 2022 15:55:26 +0100 Vincent Whitchurch wrote: > > From: Lars Persson > >=20 > > The stmmac_open function has a race window between enabling the RX > > path and its interrupt to the point where napi_enabled is called. > >=20 > > A chatty network with plenty of broadcast/multicast traffic has the > > potential to completely fill the RX ring before the interrupt handler > > is installed. In this scenario the single interrupt taken will find > > napi disabled and the RX ring will not be processed. No further RX > > interrupt will be delivered because the ring is full. > >=20 > > The RX stall could eventually clear because the TX path will trigger a > > DMA interrupt once the tx_coal_frames threshold is reached and then > > NAPI becomes scheduled. >=20 > LGTM, although now the ndo_open and ndo_stop paths are not symmetrical. > Is there no way to mask the IRQs so that they don't fire immediately? > More common flow (IMO) would be: > - request irq > - mask irq I think you can merge these, to avoid a race condition, see: | cbe16f35bee6 genirq: Add IRQF_NO_AUTOEN for request_irq/nmi() > - populate rings > - start dma > - enable napi > - unmask irq > Other than the difference in flow between open/stop there may also be > some unpleasantness around restarting tx queues twice with the patch > as is. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --h4oitkp7lwuotckt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmIPeK0ACgkQrX5LkNig 011lEAf/ceZBFk9BF55mTJawpi5z5TpEgwyp84woyMIdPDmhW3IArp/mlLOJTaMF 7lcjuYVsoI2YmLM5uuk8XFrI/+7ajWtphtGFcks3RxEMR3/GoSPdY8UI5Z4bdMT8 c0dMjvNeD77ha6lQ2ZUHflAaBzCbtRctty+f8nxqVix/uI2xLQ4AAgehs079auMh +yEBwQ8WWBF5UWdLCcLe9zqcQ5NPHMLfPiiHLA3VLUr8ilDTcp1gy613RDzHRPnj qGvowf3Kwa4jAN0LISa1kJ1/4OsezXdrTvUTwfns6JxvP/PmktSX0ENg6jVKefds vIR5lSdqHX0L74ub2GLCNXqf7rJCdw== =WZKK -----END PGP SIGNATURE----- --h4oitkp7lwuotckt--