Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3382290pxy; Sun, 25 Apr 2021 23:48:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaZ/XmZF4Jw9YNlJBF8jirUUsgvmUYXPK1LTq/e+Aayy5g/a4cRpDTgPzn8CMw54s4uPTc X-Received: by 2002:a17:902:ed52:b029:ed:2f0e:eac with SMTP id y18-20020a170902ed52b02900ed2f0e0eacmr3832309plb.47.1619419704158; Sun, 25 Apr 2021 23:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619419704; cv=none; d=google.com; s=arc-20160816; b=S+Sn37tBvR+D43WeS4PfELB4nDrnKzRfYiAo/BXxXNr9bbgbr3H+oD9wFw9uPltUQD 70X7kp41J9zoO3B7EdogWIHyGQko4xYUl9vg5lc8x2WOhVOcqImx+hg5rnMRQ3drwwAL W1QBjIo3LMlD73z+JyLytbUgXW9jfBj2sL4gGzj2GESpCsrJFlxEUeEL+01dYJgg1MQc /oZcOVdvR6HTJsoAKnjzCqBU/BbR0imLH0imDRjjSGx32ywBa9vHI5ZQKIH+d0EQmjCk cGWBya8te0XuxRa57828dviYDh5hkYCmkoVCye/n4BPoXUrgGTqD7LK4NdqP7+2S+p3M ywnA== 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:dkim-signature; bh=hFtP1eOQddasIQX+cRuKOVejzwpAMEMFVa7yR+iwH4I=; b=yDKFJ14lyjU37dR7NsD3lstAXV4zpYHL/3CA4vczkMMOpRigMnvzhrJ+hAa0YKqouR wkMntIll8fkpTU9isd11489mSFOP9sw8v4rYnvh0iI+2hjNj1jj7h70epfaJE0m5uqcf uJ4IkmnzZLFCasKMK0uTpc9kNzeE9Iy1VYMZrVJujxCCB/vbuwLhuYXAPe5B7sSjW6J8 0VCOHdAfJCzb9aPIYWz4srLFj1SkdXzJ9j3CpCK1POv7fDltjRSk8aS6y8+grHI6zKqX XQ6KA4KY+RmWgABHX2uVSlS6VKwrl0mWZwDF0ggs/Vzc2VZc/EJq9/RxFXk9/u45+0Om 7f0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=L3ZsAqfU; 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=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si17950541pfb.80.2021.04.25.23.48.11; Sun, 25 Apr 2021 23:48:24 -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=@natalenko.name header.s=dkim-20170712 header.b=L3ZsAqfU; 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=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231945AbhDZGsX (ORCPT + 99 others); Mon, 26 Apr 2021 02:48:23 -0400 Received: from vulcan.natalenko.name ([104.207.131.136]:40852 "EHLO vulcan.natalenko.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231616AbhDZGsW (ORCPT ); Mon, 26 Apr 2021 02:48:22 -0400 Received: from localhost (kaktus.kanapka.ml [151.237.229.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id B09E1A4F81D; Mon, 26 Apr 2021 08:47:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1619419657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hFtP1eOQddasIQX+cRuKOVejzwpAMEMFVa7yR+iwH4I=; b=L3ZsAqfUjUWgneNywT2x9J81/ncsgSJzdZrKsmkpSJOI2ZW8NXFvavseYFTF4bRJsIcrCY hk1gIisOhNWdd4LKvWzgOdOLAQsq9UPvVlWR4VRjButDwaCZ5K1lp1HYur1S0KyHX5h3xK wcwlTBb3d9XfYW1ElJgpdoNQLXyKLQg= Date: Mon, 26 Apr 2021 08:47:36 +0200 From: Oleksandr Natalenko To: Jakub Kicinski Cc: Alexander Duyck , linux-kernel@vger.kernel.org, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: Re: [igb] netconsole triggers warning in netpoll_poll_dev Message-ID: <20210426064736.7efynita4brzos4u@spock.localdomain> References: <20210406123619.rhvtr73xwwlbu2ll@spock.localdomain> <20210406114734.0e00cb2f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210407060053.wyo75mqwcva6w6ci@spock.localdomain> <20210407083748.56b9c261@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210407110722.1eb4ebf2@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210423081944.kvvm4v7jcdyj74l3@spock.localdomain> <20210423155836.25ef1e77@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423155836.25ef1e77@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On Fri, Apr 23, 2021 at 03:58:36PM -0700, Jakub Kicinski wrote: > On Fri, 23 Apr 2021 10:19:44 +0200 Oleksandr Natalenko wrote: > > On Wed, Apr 07, 2021 at 04:06:29PM -0700, Alexander Duyck wrote: > > > On Wed, Apr 7, 2021 at 11:07 AM Jakub Kicinski wrote: > > > > Sure, that's simplest. I wasn't sure something is supposed to prevent > > > > this condition or if it's okay to cover it up. > > > > > > I'm pretty sure it is okay to cover it up. In this case the "budget - > > > 1" is supposed to be the upper limit on what can be reported. I think > > > it was assuming an unsigned value anyway. > > > > > > Another alternative would be to default clean_complete to !!budget. > > > Then if budget is 0 clean_complete would always return false. > > > > So, among all the variants, which one to try? Or there was a separate > > patch sent to address this? > > Alex's suggestion is probably best. > > I'm not aware of the fix being posted. Perhaps you could take over and > post the patch if Intel doesn't chime in? So, IIUC, Alex suggests this: ``` diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index a45cd2b416c8..7503d5bf168a 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -7981,7 +7981,7 @@ static int igb_poll(struct napi_struct *napi, int budget) struct igb_q_vector, napi); bool clean_complete = true; - int work_done = 0; + unsigned int work_done = 0; #ifdef CONFIG_IGB_DCA if (q_vector->adapter->flags & IGB_FLAG_DCA_ENABLED) @@ -8008,7 +8008,7 @@ static int igb_poll(struct napi_struct *napi, int budget) if (likely(napi_complete_done(napi, work_done))) igb_ring_irq_enable(q_vector); - return min(work_done, budget - 1); + return min_t(unsigned int, work_done, budget - 1); } /** ``` Am I right? Thanks. -- Oleksandr Natalenko (post-factum)