From owner-dev-commits-src-all@freebsd.org Tue Mar 2 23:41:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F62955507A; Tue, 2 Mar 2021 23:41:22 +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 4Dqttp3DsKz3ngG; Tue, 2 Mar 2021 23:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5795E1F6BD; Tue, 2 Mar 2021 23:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122NfMcY012502; Tue, 2 Mar 2021 23:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122NfMuH012501; Tue, 2 Mar 2021 23:41:22 GMT (envelope-from git) Date: Tue, 2 Mar 2021 23:41:22 GMT Message-Id: <202103022341.122NfMuH012501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 09c3f04ff3be - main - iflib: add support for admin completion queues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09c3f04ff3be97ef442f2484396b1f963565b259 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 23:41:22 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=09c3f04ff3be97ef442f2484396b1f963565b259 commit 09c3f04ff3be97ef442f2484396b1f963565b259 Author: Marcin Wojtas AuthorDate: 2021-03-02 23:24:29 +0000 Commit: Marcin Wojtas CommitDate: 2021-03-02 23:40:47 +0000 iflib: add support for admin completion queues For interfaces with admin completion queues, introduce a new devmethod IFDI_ADMIN_COMPLETION_HANDLE and a corresponding flag IFLIB_HAS_ADMINCQ. This provides an option for handling any admin cq logic, which cannot be run from an interrupt context. Said method is called from within iflib's admin task, making it safe to sleep. Reviewed by: mmacy Submitted by: Artur Rojek Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28708 --- sys/net/ifdi_if.m | 4 ++++ sys/net/iflib.c | 2 ++ sys/net/iflib.h | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m index 2214d17fbcf1..077b19dd7481 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -321,6 +321,10 @@ METHOD void link_intr_enable { if_ctx_t _ctx; } DEFAULT null_void_op; +METHOD void admin_completion_handle { + if_ctx_t _ctx; +} DEFAULT null_void_op; + # # interface configuration # diff --git a/sys/net/iflib.c b/sys/net/iflib.c index a7d5a8c24658..05e99ba318df 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4008,6 +4008,8 @@ _task_fn_admin(void *context) callout_stop(&txq->ift_timer); CALLOUT_UNLOCK(txq); } + if (ctx->ifc_sctx->isc_flags & IFLIB_HAS_ADMINCQ) + IFDI_ADMIN_COMPLETION_HANDLE(ctx); if (do_watchdog) { ctx->ifc_watchdog_events++; IFDI_WATCHDOG_RESET(ctx); diff --git a/sys/net/iflib.h b/sys/net/iflib.h index 95305850f7d3..1e8aed271334 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -398,6 +398,11 @@ typedef enum { */ #define IFLIB_PSEUDO_ETHER 0x80000 +/* + * Interface has an admin completion queue + */ +#define IFLIB_HAS_ADMINCQ 0x100000 + /* * These enum values are used in iflib_needs_restart to indicate to iflib * functions whether or not the interface needs restarting when certain events