Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp617416pxy; Thu, 22 Apr 2021 09:27:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP1JRNWEpHhKcRnqxVcAIuDCvOxae5WbpTPPNTp+Gh/iBaXFP3M3e81hJlS/zEKWrwfRlc X-Received: by 2002:a17:906:3a8c:: with SMTP id y12mr4241551ejd.70.1619108852567; Thu, 22 Apr 2021 09:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619108852; cv=none; d=google.com; s=arc-20160816; b=aGd268HrxcSBeUcZQ+kP9cU36oZYh1zRVZIaKxEgyNuSXzLiIo7lI3YIh/vCUvoaEZ JqylpqVVjKsdfuLqOF7do6lL7KnFkfaGHGW4/cYQRPv0tIwSkmJ5oWqiTvkq+f/KqtJx E8Jo7TmPOoGphWBazYvpyp57icm5moC4o0GG9SBiN0L7NVovSlmQIJFjU9aNcqgXkA4/ htV2V8HaE+GgMnIVD6qTyac+xgTW8WWCz8C5bd9KYNgVxCQPz/1nBW5gX6avmRhlrXg+ XyS9h0dbqnKlVTfIooTJcHB4XPybZ+jgF2q+LxxyyUXlfcIK7FNR6ZiaTDjpshkDJm+w HSTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gVybRWJFc5lywM3Z+b8dBIeE9ingG17eKCymsC5C6IA=; b=Owgsw2CK+J/OSoqFtDAr0mLCz9gBRQ4r3EoSgeZTydVesFHd2ZyTfv4aJ0MbtN/d5U iEIZxFD+KAOmVAlf/umAE3SNtzjLB5j1LiDJA5h4xuciwFRD54a4ehdScaNlG/zY+l39 sXuQG8nsCUS25KuvRUCNutEH0zuHhP7clGCJfGRkViKN+2OWCFP7fWgmuTq0XnApCVrd SQPfK4K1MamNIb4pNa+cGzklvR8+rUSa0lAJ36kv2ayR61Mnjw6rA06DvCQsxFu/FFC5 /Mm4cQZ+TjDoqtLWVvUlJiwmncD9P7qp5GdrD4OR1KHm5e5jupjqQedoN42/V3caPDrv FiIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ddbkm6nU; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oq24si2621711ejb.208.2021.04.22.09.27.08; Thu, 22 Apr 2021 09:27:32 -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=@kernel.org header.s=k20201202 header.b=ddbkm6nU; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236571AbhDVQ0p (ORCPT + 99 others); Thu, 22 Apr 2021 12:26:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232670AbhDVQ0o (ORCPT ); Thu, 22 Apr 2021 12:26:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED2BC61417; Thu, 22 Apr 2021 16:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619108769; bh=I2WaeiJyXXVput4O2vCSGgTUD62VIg+b5/9OZeNer4g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ddbkm6nULFik6lQwyUg+f/HHVor/75WN2z3nfh4Oo6zHjiWZxu5/VAtCyW0ZGJKSJ LF/ux71hVBLC17FtLb/EmvHw9zQ86i6Ut0OztUwIODFKyTMcs60pwj7LU7M6JGbnI1 z0y/Tl3WJESFarWx6KK2gVHPlYO6xI7a2dwEkc3wapcCL0pcj4w2guHsKvRQ0mn/oS jNT+pMOdh/CH1RfeQXiWCuD5R5bYhssn96MvoR699jvn23c256fBLaReArtohsEOPS cwAnXiPoxL1iqmCt7LuL2gMHZP0iJ/LYMOPJJWwsisXxcZqIFcGB6I7jdrNdLFFyF3 5MaLju2cAyIXQ== Date: Thu, 22 Apr 2021 09:26:08 -0700 From: Jakub Kicinski To: Ilya Lipnitskiy Cc: Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net-next 12/14] net: ethernet: mtk_eth_soc: reduce unnecessary interrupts Message-ID: <20210422092608.6b8ed5ff@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210422040914.47788-13-ilya.lipnitskiy@gmail.com> References: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> <20210422040914.47788-13-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Apr 2021 21:09:12 -0700 Ilya Lipnitskiy wrote: > @@ -1551,8 +1551,9 @@ static int mtk_napi_rx(struct napi_struct *napi, int budget) > remain_budget -= rx_done; > goto poll_again; > } > - napi_complete(napi); > - mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); > + > + if (napi_complete(napi)) > + mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); Why not napi_complete_done(napi, rx_done + budget - remain_budget)? (Modulo possible elimination of rx_done in this function.)