From nobody Mon Apr 22 19:44:01 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 4VNbKZ0RBWz5Hm1H; Mon, 22 Apr 2024 19:44:02 +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 4VNbKY6Rmxz4mTn; Mon, 22 Apr 2024 19:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713815041; 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=g4+Hwog2VqsilgO1MxNNxkIPfH3HkL4DPHwggbPmV6o=; b=Np19xcDbMS3QkvAOZnG5so1o0tcv1F74jYHwUshfH9CfObNW2/yM+ybZ14FWIcTD4HAQzQ t/7EyrZ0Kjh9nzD/CZsMtMNYJqzBjIZVFAVsDkJFluWZ7lF+Op+uS8RLwlRN4FpWPexwij R5kraGTfWoNkaAayE/Urqk1mvKU8HbIA6vC3qKsZBMOqpIBQi2D4/rjEdKKK4ILK/TtFWv Pv4mXm0Qb2oIgjC7wFsL7AggZkYZfMU+qTK1EhoEhm3Fk1re49ntLaV+7DJqvFKYB+36LM xEXTNQpIGJqZNVRIq3QFZZGPsqBweKjBcef2BxBAghrFYXqaOH62uD8ja/CQWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713815041; a=rsa-sha256; cv=none; b=i47FnrCGmnWh9X2bFX+sX86ynGWL76XJH7b9AqmDMe+D9dFsJLbvbV38UU9KxNb5vxJSAX mBl6zis+bN/nLQTE2AeEdxcIB9bmXtHjb9mx1OgNfoo2eYUORStdfH2J81ifx1NY2bsNY5 qXIAmckVJRDXMWc31ntC9wlQB8sW77jraj4pJ+vpvLLcZFEzVY5LWzYsOKuuHh3iJiuk/j 9FIJdZdHPkhHjDvjDT9GxdFJ6ARYaX61wnHggTExSIs7nLdwGY6W7wyi02Y5ZGP+FDnfuE 5Ue8XSrKuZpfbhAqVpuN53wxwBUc6whszkdCjz+bxk8FAC9fvpOFD/Z40AUzQg== 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=1713815041; 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=g4+Hwog2VqsilgO1MxNNxkIPfH3HkL4DPHwggbPmV6o=; b=sKTvwaQOC5VM/Gjk+NaVqDQSAzJZdvXPkzZXn0mbiolZZf0gWPm2WH8JCUOXRVEbFrJqaJ NG6UJxKicJBc7U8a0v3bMKocHU+zN8Gkx5ysjApjl3bMVtL8/ho/C+Gp/9jFrpcvuvjwOA LFhX9X4Aj6QlmssoBQBBBMPMTF3G+9PvYCUfmWeYGs5itwPTZLA/7h7o32VSalmo6+Gs97 GB49dGZAgMhoSmnqaDWyFau7BfSCzPMR/kJSZAJ/BhNt5U9GV9Jhtn31yuYqPOSeO56mGQ u8byIhHFL+AY15N015hyDYN3fHPNZt9bv2nW74md0YR7TpBjX1u7EwqelimjdA== 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 4VNbKY63Btz11RJ; Mon, 22 Apr 2024 19:44:01 +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 43MJi1PX032223; Mon, 22 Apr 2024 19:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43MJi1wl032220; Mon, 22 Apr 2024 19:44:01 GMT (envelope-from git) Date: Mon, 22 Apr 2024 19:44:01 GMT Message-Id: <202404221944.43MJi1wl032220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 25e0847ef7d2 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 25e0847ef7d213107e4238677489dadcff90a6fd Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=25e0847ef7d213107e4238677489dadcff90a6fd commit 25e0847ef7d213107e4238677489dadcff90a6fd Author: Bjoern A. Zeeb AuthorDate: 2024-03-31 17:27:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-22 17:00:00 +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 Reviewed by: emaste (previous version) Differential Revision: https://reviews.freebsd.org/D44591 (cherry picked from commit 21761f2ede4ebad13e78112b9409c1f20f946781) --- 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 61ebcdbf7a39..61342395f03c 100644 --- a/sys/compat/linuxkpi/common/src/linux_netdev.c +++ b/sys/compat/linuxkpi/common/src/linux_netdev.c @@ -185,7 +185,7 @@ linuxkpi___napi_schedule(struct napi_struct *napi) } } -void +bool linuxkpi_napi_schedule(struct napi_struct *napi) { @@ -195,8 +195,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