Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6550511pxu; Thu, 24 Dec 2020 05:34:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJykcYGWXrj/HzHV2Zkq6tIEXDsWUThdqzwh3sX9ByRlzuCx/UT/IRryEQlqUBOH8ADUlJ7l X-Received: by 2002:a05:6402:212:: with SMTP id t18mr28940284edv.37.1608816847931; Thu, 24 Dec 2020 05:34:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608816847; cv=none; d=google.com; s=arc-20160816; b=fIV1WtDtDAfQd1u3nkcJxzYSyOA8i2HZvXDE2RXx7//8FrjQn4E3v/+quM2oAIbmv1 fCEdOxk8QpLjrOC6NYQ9A4LrIULHWM/TIRjxMrzS3aw2lmeX7APnCh1w1YATLvDLiWKB mk7MVFQH1AWC2m5QEs3+rppJ4gEycvKWFGBEJzVWY3M6r2l1s1D+5Tv6wY3lY3LrQw/O 1ZBn9IOGdBhTGVL22A121t+auDMhXn2hVuLJkEmHQ7UHee5r1i82BQVopxVLoaDKutfI X8iVdisTqTRcR3LtTs/eDou+0C1EU0a3h38ML9v2xAxSXf0n9Yi9H3CNZxY6wG6zFyPF 0kJQ== 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:dkim-signature :dkim-signature:date; bh=Kj19jrn3JZDiqAb47VRLam2/Y7njoczA4wmTN/+icz8=; b=sZmOZFi2Elysf08rGbHFB/Y/y4+9AKgbHINb78TdHViJgnbMfheyY8yOJosT+FUxD+ yfIW8RCBaCS3Vkt0BvUr9KQFVULBgloXz7hlFVZ+XugZNe3fHWPhbFUIGpjcSGgvsUpY DzEGCtisZthAoIB/L+q1kAGToo3g3rvVylhbWSB5DS3A4OQRT3hHMFJ8CrGO+mJXmsgv Cc6aIUSgPayDISF9SAVXPNKBcwIP8+6T0MFfY0lAEA8SeHFIIAybLCk0JsYdkcNt/htI vpdDKfX9OXm3aWMQS8lPBx1MMvKHrWTwazQw+mvmStOdKvPBEabAMVKw3Clo4V7DHTaA YGow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0mxtZ5ms; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si15705567edr.4.2020.12.24.05.33.45; Thu, 24 Dec 2020 05:34:07 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=0mxtZ5ms; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728957AbgLXNcV (ORCPT + 99 others); Thu, 24 Dec 2020 08:32:21 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35058 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728701AbgLXNcV (ORCPT ); Thu, 24 Dec 2020 08:32:21 -0500 Date: Thu, 24 Dec 2020 14:31:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1608816698; 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=Kj19jrn3JZDiqAb47VRLam2/Y7njoczA4wmTN/+icz8=; b=0mxtZ5msZR9fZtUR6kwi4JnSZ1GJWyp0fYY/dbvBLYP+ZKDm36BTziTN3g3Ze8NBRGZI51 VFMj/K7rkRnz5ilV9iLBGG3pBAvOTESLlU4H7TSSVo1y85OrcZYT63+ZvMbRpKhAGBdCT2 8LFnvw/mcLG8hDYvVCB964vcUQw3InKRaIPcffWeXq+NWX8yyurNbUX42dNSoO5Belq1SO q7izcEzcByqyxiQlLNrAp4IxGxJMtafNLGBXai1nR/JK5DFAtAU4EB8IVYvzsPgW2WswY8 /PdDjdgGmEHcwClVw0SrB5HjfWtHgJmkMHsyrkes9j7+wZ6WXMTXQslGQWWkCg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1608816698; 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=Kj19jrn3JZDiqAb47VRLam2/Y7njoczA4wmTN/+icz8=; b=S/gHJK0rwAUxhKpvRxUhW2dcGuPnXF0/mNeFaH6wQ8HDVZm0JHJ3cZWT1DKOapoEd8ahn9 8T0tN785V5D2VZBQ== From: "Ahmed S. Darwish" To: Rahul Lakkireddy , Rohit Maheshwari , Vinay Kumar Yadav , Vishal Kulkarni , netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Eric Dumazet , LKML , Thomas Gleixner , "Sebastian A. Siewior" Subject: Re: [RFC PATCH 1/3] chelsio: cxgb: Remove ndo_poll_controller() Message-ID: References: <20201224131148.300691-1-a.darwish@linutronix.de> <20201224131148.300691-2-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201224131148.300691-2-a.darwish@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [[ Actually adding Eric to Cc ]] On Thu, Dec 24, 2020 at 02:11:46PM +0100, Ahmed S. Darwish wrote: > Since commit ac3d9dd034e5 ("netpoll: make ndo_poll_controller() > optional"), networking drivers which use NAPI for clearing their TX > completions should not provide an ndo_poll_controller(). Netpoll simply > triggers the necessary TX queues cleanup by synchronously calling the > driver's NAPI poll handler -- with irqs off and a zero budget. > > Modify the cxgb's poll method to clear the TX queues upon zero budget. > Per API requirements, make sure to never consume any RX packet in that > case (budget=0), and thus also not to increment the budget upon return. > > Afterwards, remove ndo_poll_controller(). > > Link: https://lkml.kernel.org/r/20180921222752.101307-1-edumazet@google.com > Link: https://lkml.kernel.org/r/A782704A-DF97-4E85-B10A-D2268A67DFD7@fb.com > References: 822d54b9c2c1 ("netpoll: Drop budget parameter from NAPI polling call hierarchy") > Signed-off-by: Ahmed S. Darwish > Cc: Eric Dumazet > --- > drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 14 -------------- > drivers/net/ethernet/chelsio/cxgb/sge.c | 9 ++++++++- > 2 files changed, 8 insertions(+), 15 deletions(-) > > diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c > index 0e4a0f413960..7b5a98330ef7 100644 > --- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c > +++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c > @@ -878,17 +878,6 @@ static int t1_set_features(struct net_device *dev, netdev_features_t features) > > return 0; > } > -#ifdef CONFIG_NET_POLL_CONTROLLER > -static void t1_netpoll(struct net_device *dev) > -{ > - unsigned long flags; > - struct adapter *adapter = dev->ml_priv; > - > - local_irq_save(flags); > - t1_interrupt(adapter->pdev->irq, adapter); > - local_irq_restore(flags); > -} > -#endif > > /* > * Periodic accumulation of MAC statistics. This is used only if the MAC > @@ -973,9 +962,6 @@ static const struct net_device_ops cxgb_netdev_ops = { > .ndo_set_mac_address = t1_set_mac_addr, > .ndo_fix_features = t1_fix_features, > .ndo_set_features = t1_set_features, > -#ifdef CONFIG_NET_POLL_CONTROLLER > - .ndo_poll_controller = t1_netpoll, > -#endif > }; > > static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) > diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c > index 2d9c2b5a690a..d6df1a87db0b 100644 > --- a/drivers/net/ethernet/chelsio/cxgb/sge.c > +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c > @@ -1609,7 +1609,14 @@ static int process_pure_responses(struct adapter *adapter) > int t1_poll(struct napi_struct *napi, int budget) > { > struct adapter *adapter = container_of(napi, struct adapter, napi); > - int work_done = process_responses(adapter, budget); > + int work_done = 0; > + > + if (budget) > + work_done = process_responses(adapter, budget); > + else { > + /* budget=0 means: don't poll rx data */ > + process_pure_responses(adapter); > + } > > if (likely(work_done < budget)) { > napi_complete_done(napi, work_done); > -- > 2.29.2 >