Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6537374pxu; Thu, 24 Dec 2020 05:14:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIFQOtJ8qUER8DyYy/HweA06ITIgrR73gC32HcTmOdu4LH1Flgyk94kBwgyuFnWROnSQdc X-Received: by 2002:a17:906:b2da:: with SMTP id cf26mr28573122ejb.176.1608815643969; Thu, 24 Dec 2020 05:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608815643; cv=none; d=google.com; s=arc-20160816; b=y+YJrRNRCcPVULA60iE/FEJake33vzs2bPhmbDuNx+tXQQqeDZyHIegdeOonXXzNr5 TutvXJlm6IPXT2ZxoEUyPV9CEXfSdoN455Pwo469mNmWPNmDZsx1auimarWQg2XlGrxy NasHOjjKXF8eHuUk9VjBi42Sf5RDsM9T/38bQPIPlYjmmIXrHxElpITcGasbLmb1FChw 5f6bEnrcwI3dmc/IP8ZZV0nqivm9eVVtucurIyEAz60CsE5py4DbWi7i8IEuc0r/S7Sn BGp6I+3hbzrv7Tajk6GpAbSIQHSET8aXw1LfUhNXvVDDAj/U7yHjtFsy7ryaW20ydoIv Twpg== 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:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=k23O2xyiw8gGd/X+qORUBIx3eM546L8uEpAKnZ3UL7s=; b=nylF+VF0AHN4dM6uHPrs4wURydJ7RB1DO/5I+VIoFfWtK/67weFe7jLw4KXd+Tk7kr UKzb7GmusU4cZS0WzV1BLvKyqwdMW345398MQn68KF7I//TN95C6H+1Mi7m+5L7ubmA1 Lpg3+49WUpoNKo/UPP69xtjp6MoAywUxKt1l+/6wFeOvTVKI8A2rNAnjcvv0jBsWiLen cpsjcMOSTYj3ANrIxNkW8Hi4Vdx5yhKUgp4o6iy6W+iWP7tfDjx5EWCyXbILIAi5itNb T924wMudSs+8vipLuFasUgnHfuidcrifwIcJGwdlcSmWskNQfcJXUJletdOOzFn+diQ2 9DHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1RBjqIJ7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=xz9jTuyv; 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 i22si16356400edb.413.2020.12.24.05.13.41; Thu, 24 Dec 2020 05:14:03 -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=1RBjqIJ7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=xz9jTuyv; 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 S1728176AbgLXNMj (ORCPT + 99 others); Thu, 24 Dec 2020 08:12:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726544AbgLXNMi (ORCPT ); Thu, 24 Dec 2020 08:12:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7667EC061794; Thu, 24 Dec 2020 05:11:58 -0800 (PST) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1608815515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k23O2xyiw8gGd/X+qORUBIx3eM546L8uEpAKnZ3UL7s=; b=1RBjqIJ7osehDAyPJ88oI9YIN34wB49UR8tfVzfmmvuvk2i9uAmmEN1pZBzIZqewpPhjLL 7RUzsErTdvajQ0PLbvQ1/vc37/LNK1MgDCzJTZ8fwxC7WjKceq4kFkou5k7ZLx8rksbW4T S2OQ4agyL03NNk5Hyl3DlCZrfOgEbNwTehpRQlae0T3r9jx7O8aGQaEvUsIfZH9PHp4oDE s9+6tXzGEVSukvpXLixCZIvxlI5Gl5fgD5cnhbKWG0YKAAzJRXOfmMAykqGmYxejp0CO1i y7YP5RUZDnbgkWPt5nF+QGN+3txqvBk8ogadZfig9sk5hOWABDRSRQJ97wYgeQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1608815515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k23O2xyiw8gGd/X+qORUBIx3eM546L8uEpAKnZ3UL7s=; b=xz9jTuyvkmSVelH5/sfjwfLTssNgh5ejOynV/LI+iG15kPxnDtVC7yw1YwceJKhZZBOwKl aYnw48qeaEiFcyDw== To: Rahul Lakkireddy , Rohit Maheshwari , Vinay Kumar Yadav , Vishal Kulkarni , netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , LKML , Thomas Gleixner , "Sebastian A. Siewior" , "Ahmed S. Darwish" Subject: [RFC PATCH 1/3] chelsio: cxgb: Remove ndo_poll_controller() Date: Thu, 24 Dec 2020 14:11:46 +0100 Message-Id: <20201224131148.300691-2-a.darwish@linutronix.de> In-Reply-To: <20201224131148.300691-1-a.darwish@linutronix.de> References: <20201224131148.300691-1-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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