From patchwork Mon Jul 1 21:49:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 11026813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0062F138D for ; Mon, 1 Jul 2019 21:50:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAA0D286E2 for ; Mon, 1 Jul 2019 21:50:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF36928793; Mon, 1 Jul 2019 21:50:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82665286E2 for ; Mon, 1 Jul 2019 21:50:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727039AbfGAVuI (ORCPT ); Mon, 1 Jul 2019 17:50:08 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:46036 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727029AbfGAVuI (ORCPT ); Mon, 1 Jul 2019 17:50:08 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 84C12A0190; Mon, 1 Jul 2019 23:50:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id byAd4MXEvp_f; Mon, 1 Jul 2019 23:49:57 +0200 (CEST) From: Hauke Mehrtens To: backports@vger.kernel.org Cc: Hauke Mehrtens Subject: [PATCH 11/18] header: Make napi_complete_done() return bool Date: Mon, 1 Jul 2019 23:49:06 +0200 Message-Id: <20190701214914.8066-12-hauke@hauke-m.de> In-Reply-To: <20190701214914.8066-1-hauke@hauke-m.de> References: <20190701214914.8066-1-hauke@hauke-m.de> MIME-Version: 1.0 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the current kernel napi_complete_done() returns a bool and this is now used by the mt76 driver. Try to backport this functionality by doing the check which makes the function return false already in backports. This was added in upstream kernel commit 364b6055738b ("net: busy-poll: return busypolling status to drivers") Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/netdevice.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index c3e91a0c..76b57e4d 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -289,13 +289,21 @@ static inline void u64_stats_init(struct u64_stats_sync *syncp) }) #endif /* netdev_alloc_pcpu_stats */ -#if LINUX_VERSION_IS_LESS(3,19,0) -#define napi_complete_done LINUX_BACKPORT(napi_complete_done) -static inline void napi_complete_done(struct napi_struct *n, int work_done) +#if LINUX_VERSION_IS_LESS(4,10,0) +static inline bool backport_napi_complete_done(struct napi_struct *n, int work_done) { + if (unlikely(test_bit(NAPI_STATE_NPSVC, &n->state))) + return false; + +#if LINUX_VERSION_IS_LESS(3,19,0) napi_complete(n); -} +#else + napi_complete_done(n, work_done); #endif /* < 3.19 */ + return true; +} +#define napi_complete_done LINUX_BACKPORT(napi_complete_done) +#endif /* < 4.10 */ #if LINUX_VERSION_IS_LESS(4,5,0) #define netif_tx_napi_add LINUX_BACKPORT(netif_tx_napi_add)