Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3732035pxy; Mon, 26 Apr 2021 08:30:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkla83SlMxCQJWIo4xrMNrYt0jW9ccDyZevpIhyW55qjNanXmAJB4TS2zalfhqx1iTmVm7 X-Received: by 2002:a17:90b:302:: with SMTP id ay2mr23545520pjb.84.1619451002095; Mon, 26 Apr 2021 08:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619451002; cv=none; d=google.com; s=arc-20160816; b=s0P8YojsqpUd1jPtxGY4KjfZEKvXkOiDZiDKDnthvoDCNxjoC1ZSFhrp7v1sgCZdvS O8hqcmwz2SrOCUQAOnopM1DW39F1u8e+TvlxhHvKK0VPvcmpOSL4U86WmhzXs3mMTAWN F7xxJiQn7IybM87Y8sbEAeY/TEN7wj5ZJ3O5BvNpb58XLxHG/WTkEiOpD9pJAZ6r1ngc SMxW04pnP21RuIGPUAp0GmtwP/Xd/lSjn+2TXK2GTT6TOE4MNW+ZbZptF3zvOILr/UPJ DlbNPqoPe/Ic3k6ZgDVON+/ERPcUPITe4TQ4WwPPKE705TNQajCz99Eiu50WSGnF6ga6 G4+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=M5rHl1uTPHcNcUuxY/E3wd4JEZWlIuCjeq1wxcyEpDI=; b=tXSrKu43Ti7D6jwiIg5tQ+YAiBQcivWY1eaMAbie+9cstK8RPrxFOk3/B2MCN1WYBS SREJpn+oGscJfo1bvyE4JqjFfF6N2CbHIm9faxh/LDLQEx25/zB7wmpIhfcJyLzZoQm7 nQDqejmI54KppHFzi6Cj5y91Sera+aoJ7gOTqOe0yO+jpIFIKbVkC1NSQp/Pmh74UJZo Ov96+UH+6hanNagzWWfcT69Qvhn1rOyOZiksdWTtEzCOV8bfDvGki0chUR3gXs71LMEG ZbwwFmDT37TCTvBntanixhzgImjceDJca/rpsb9f78xdEZF38pGo7oZkRNsox6WejvD+ W4+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gxIek4o9; 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 lk18si25175982pjb.95.2021.04.26.08.29.49; Mon, 26 Apr 2021 08:30:02 -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=gxIek4o9; 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 S234079AbhDZP3f (ORCPT + 99 others); Mon, 26 Apr 2021 11:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233674AbhDZP3e (ORCPT ); Mon, 26 Apr 2021 11:29:34 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E906C061574; Mon, 26 Apr 2021 08:28:52 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id t4so1782093ejo.0; Mon, 26 Apr 2021 08:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M5rHl1uTPHcNcUuxY/E3wd4JEZWlIuCjeq1wxcyEpDI=; b=gxIek4o9quqavrkE+Xlb1OWBOADVfMEK55W1qRIFN+jG9v8r15SD/LJCR4ow5Gx2nA Kn71I+KZGVenIf5dBtOLRMnSnptyYWeHWyZzD4TetNo6vCL0YcwW/hDqGccrra1WeyDV kKiKqIN/6UdiUGTKl6dzvQkCadXAt1BP9bBlz/bQaSQ+KuWS1w9JEx+fSKv5OiT4d0Ke Mrt9P2eN+0Vdl1VJtWESOBl6rnJhkjd0XNJFLqNPqiGvxr+zDZYNGxhhF3DNUZG9z+RB Jv3YTr9h6DNwihnohBT6SvCzS/JTaeJkKlMVmWOZhvuM53N+iUzr9wP1woKY1lnZ1FBh QCpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M5rHl1uTPHcNcUuxY/E3wd4JEZWlIuCjeq1wxcyEpDI=; b=CaV0Nt/D8Hj332fVQ6Y07I1NHCfJ5nJh/FjewPy5XZvZwB40MA3ODO0Ruaxl4joMSR auz/G0YGfkxznvln5v6QxXCcDrCYNaNhZ015xrK4Ml6KMU1JKYwpGfUreRwynj9R5Cqu Y31+yS+Lj2WiY7b1yNNtBtwhT2syX004Gky+Nu1HxDGquLoaaHtBGJZepZVfiuL+/PTj mNjAUQ6ltCZRHY+69Fxaj7I1WPLp06Mvodse84vzkK++2tBS7BdzwTttPmxyMfKxVSSC J3BtEevYq6Yl8T1gymJaxbf+6TzHt4MRK113PuNoTd6yeyY+8B93yD5JMEx+O7ha0B83 qeEA== X-Gm-Message-State: AOAM530YJCNZ1buzL6ShIvIXIpZqNGtZj6p4dr+r2VfXVIojJgFxO9P3 Qrtk+jnYvc7bnTE02JB8k76fghPdaYHgg2daq3c= X-Received: by 2002:a17:907:7b9f:: with SMTP id ne31mr3671687ejc.139.1619450931244; Mon, 26 Apr 2021 08:28:51 -0700 (PDT) MIME-Version: 1.0 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> <20210426064736.7efynita4brzos4u@spock.localdomain> In-Reply-To: <20210426064736.7efynita4brzos4u@spock.localdomain> From: Alexander Duyck Date: Mon, 26 Apr 2021 08:28:40 -0700 Message-ID: Subject: Re: [igb] netconsole triggers warning in netpoll_poll_dev To: Oleksandr Natalenko Cc: Jakub Kicinski , LKML , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , intel-wired-lan , Netdev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 25, 2021 at 11:47 PM Oleksandr Natalenko wrote: > > 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. Actually a better way to go would be to probably just initialize "clean_complete = !!budget". With that we don't have it messing with the interrupt enables which would probably be a better behavior.