From nobody Mon Apr 15 16:21:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VJC8t28yGz5GtjT; Mon, 15 Apr 2024 16:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VJC8t1Zhfz4tvK; Mon, 15 Apr 2024 16:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713198078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kpahFiS3b8BmoQ9auWdFctd6phpPjwqwEUVzJE3/lJc=; b=AIzKRTzs5flVJDdvP/NtXcTIggcEPe8jRXFC1l8y/cCrvbLFWOqo+WjoJljmNN/7kxuGvu olq0ZH6hzOb9uOgK/H2uaMuv/m9brtr5vKa/Xe+f2N4XF1EofF+Z6fSbHeR+9pQX2W9U54 hG9hO7aFZ901IL5zkSzX+7E2quScKhAzqAyePUvt1LUVwONHuI1QgSS7pvj9//TxxYHOW0 QkFSEE5hVSa1og0wUQyZKn4AGDgls8rLw2xeUoA3qIcvsw+NU7BIsDYEPkxu0MXndGOHke fQ83si+I1HPRUAHQQzx7SxeTyDsuGEjRq+mGfoki6ADquF85J7n9pyoIWU3moQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713198078; a=rsa-sha256; cv=none; b=nqI1Rh5yoSDVApqSjyjAMdLq3PaqCjPurHFhEpSs4TcpdmwIQ3QJ7v9LsTHWvuhH6Y6uxA vTuLcY8bNHRvtENWvjx3APuPMorLWkeRnIGNZfzJfJ1dyLS4FlfAosnpPcwYIJLHJEsEmz Kqrh+Tt3jFWQlJtaQVrrnwrGbYwYNgyR8Ic5qW6G3Q/fZKVy5zEkOJodV0zMlkp0+9Fq0w CBHmqjsZTcomSFXPh5M0RfumvnRzl54V2W2Q/BzN0oQrPXbCAB0tCYM7oIsI5Ha6nG2sfZ YL2bRhIwruxIlI4qQFQjVnzO14OaMs+/BqiDSiCXi+eMwISLtfiU468jjIXNDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713198078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kpahFiS3b8BmoQ9auWdFctd6phpPjwqwEUVzJE3/lJc=; b=QGOEIcBo2CRjr1sjR5x9cQv3sNrcPjmZtGn/m8O072WqRAC3mGmcWkLFErS1jYPzfN/Yr6 QYT2FdzlUaTG+ahpPZ+SsNkmi3OShYiBT/VOjIhOUsPgAoLgmCSsZm1NYBfZ62jnwz1SCi sr3ra9Rt2CqiJeYnM8FEByuGFtp9Ljf0MAT2VzNhhEIae60a+X57WuMZ4f5IHjQaGs/d8g aASv35vkZFycudcemgGWp2wkG5nnF6AwdAMjouhnBViTu/i4EpLcCljGo2R2gRJ7YxORFq cJWKnkulHBTNaK3GSjg025F5ulv3qip4hLTR0pD14AUGC2gOVQ4CLKKr6HyD3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VJC8t1Bljz15Wj; Mon, 15 Apr 2024 16:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43FGLIdl000934; Mon, 15 Apr 2024 16:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43FGLIsU000932; Mon, 15 Apr 2024 16:21:18 GMT (envelope-from git) Date: Mon, 15 Apr 2024 16:21:18 GMT Message-Id: <202404151621.43FGLIsU000932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 21761f2ede4e - main - LinuxKPI: napi_schedule() requires return value, implement napi_is_scheduled() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21761f2ede4ebad13e78112b9409c1f20f946781 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=21761f2ede4ebad13e78112b9409c1f20f946781 commit 21761f2ede4ebad13e78112b9409c1f20f946781 Author: Bjoern A. Zeeb AuthorDate: 2024-03-31 17:27:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-15 16:19:47 +0000 LinuxKPI: napi_schedule() requires return value, implement napi_is_scheduled() A newer version of iwlwifi requires a return value from napi_schedule(); unclear if the function always should have been bool. Add the bool to test based on the napi_schedule_prep() result. Also add napi_is_scheduled() for rtw89. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste (previous version) Differential Revision: https://reviews.freebsd.org/D44591 --- sys/compat/linuxkpi/common/include/linux/netdevice.h | 9 ++++++++- sys/compat/linuxkpi/common/src/linux_netdev.c | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h index 95fbf2a0f48c..3d2b309909b4 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h @@ -230,7 +230,7 @@ void linuxkpi_netif_napi_add(struct net_device *, struct napi_struct *, void linuxkpi_netif_napi_del(struct napi_struct *); bool linuxkpi_napi_schedule_prep(struct napi_struct *); void linuxkpi___napi_schedule(struct napi_struct *); -void linuxkpi_napi_schedule(struct napi_struct *); +bool linuxkpi_napi_schedule(struct napi_struct *); void linuxkpi_napi_reschedule(struct napi_struct *); bool linuxkpi_napi_complete_done(struct napi_struct *, int); bool linuxkpi_napi_complete(struct napi_struct *); @@ -272,6 +272,13 @@ netif_napi_add_tx(struct net_device *dev, struct napi_struct *napi, netif_napi_add(dev, napi, napi_poll); } +static inline bool +napi_is_scheduled(struct napi_struct *napi) +{ + + return (test_bit(LKPI_NAPI_FLAG_IS_SCHEDULED, &napi->state)); +} + /* -------------------------------------------------------------------------- */ static inline void diff --git a/sys/compat/linuxkpi/common/src/linux_netdev.c b/sys/compat/linuxkpi/common/src/linux_netdev.c index 4d00dbf5c9ff..fe00e929c168 100644 --- a/sys/compat/linuxkpi/common/src/linux_netdev.c +++ b/sys/compat/linuxkpi/common/src/linux_netdev.c @@ -184,7 +184,7 @@ linuxkpi___napi_schedule(struct napi_struct *napi) } } -void +bool linuxkpi_napi_schedule(struct napi_struct *napi) { @@ -194,8 +194,12 @@ linuxkpi_napi_schedule(struct napi_struct *napi) * iwlwifi calls this sequence instead of napi_schedule() * to be able to test the prep result. */ - if (napi_schedule_prep(napi)) + if (napi_schedule_prep(napi)) { __napi_schedule(napi); + return (true); + } + + return (false); } void