From nobody Thu Jun 06 10:39:25 2024 X-Original-To: dev-commits-src-main@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 4Vw16P607qz5Mfss; Thu, 06 Jun 2024 10:39:25 +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 4Vw16P4Bd6z4jJ8; Thu, 6 Jun 2024 10:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717670365; 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=jHkXpUt7yAaYfhl27i4H6BQ0WpDkkJIeb4Vc8uVWF4s=; b=RUMzV98vtylGe1uiDFU+EvE/AkEl2Pov1zjXSWKmOrATL37Fu6U3PXN6tVHSENU/+icRtW 5hpOqpOLxxPVb82dHfJqnu0tyEF9nQwTBYws2vwsZwGd0wIFS/bveNhE9aSJ4QaMPdIBfw fntL5Iv8go2fce45qScL9ebxJsqMbykgX3VeBHZIKwkOvCv7VL3I0Ap4WxilrdwmzOWZWA GzmWA6+TJt4/UUpex4+O9EPGRHTJjA9LfL1hTxaXgvS+Rc/RKkoRMDuwuRrQdHtA8oRUp+ 5YjlTMa6Bkl35lEgXPfJD6X5yPg0kIGnevscnojVNEPH7x5gqhJfRxO6KLeRTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717670365; a=rsa-sha256; cv=none; b=NtxX0t+gtXomNe2vdqiZHxXzhJbliLJ5RnF5JXvDt+dVRubp2I5I/Ta4wzstJq+r+ag+Xi anzX7A1qbWLEcyMPYHkzbY82iHX0i/JtT+BXbbJAIAdz+eWNpRCr6Vfa8G3mxyYQrlqwHb uMnGZHRgsLK3vd8PBTaWS70wLrqFQUMrnxD9dY6oBGF5LB/LxUDFSsBDs9vtsFVLVbQIwE zSLk1TF2me0LjA5GNM0QNNV71WuCBkO+cL1iV2r4VGo/GLVIGDR5Qs4asJfQCyjHHanVsU 53tqy6s2VZnAqFCnlvX/v664XhNXtwgR1gjfy37yXNtEfRFiW1NLJncMOwm5Og== 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=1717670365; 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=jHkXpUt7yAaYfhl27i4H6BQ0WpDkkJIeb4Vc8uVWF4s=; b=JXRTcvrqg9HiySJb/NhJGdvEZ6bfBckrWus666gWd2Kl2CnmIczii9iq40xgHrgGIdtipg 12jp+V4jbYJ6FnaxOPLT7wAR0TGoP3dTBjOSk2Rfm7qpGXxeXGHYRtwi80C4tjMdx69MGu nCYDyZxpk/QcSXYepjr+36cn4ofJqK9jCckIPM/S4bDQjL9OCOmABQgk+zPZN/wJKLoM3C r8T1GXq18ixY0U7Q8emHLAxMs7VfjLX8W77OR1D1NVfF15ijkQmwhraEcAZ23dSnpw9HcQ fgIyI7UuQWnd+en39aUTMr2p0ICXo+PxcGuRFGXw+nMn6MgjDN1Ubl5KbSk13Q== 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 4Vw16P30Kjzj8W; Thu, 6 Jun 2024 10:39:25 +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 456AdPDh089760; Thu, 6 Jun 2024 10:39:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 456AdPUG089757; Thu, 6 Jun 2024 10:39:25 GMT (envelope-from git) Date: Thu, 6 Jun 2024 10:39:25 GMT Message-Id: <202406061039.456AdPUG089757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sumit Saxena Subject: git: eb7a4b35de89 - main - mpi3mr: Update consumer index of admin and operational reply queues after every 100 replies List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb7a4b35de89a0e22f1fb373df33d79135b68dd8 Auto-Submitted: auto-generated The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=eb7a4b35de89a0e22f1fb373df33d79135b68dd8 commit eb7a4b35de89a0e22f1fb373df33d79135b68dd8 Author: Chandrakanth patil AuthorDate: 2024-03-14 18:41:07 +0000 Commit: Sumit Saxena CommitDate: 2024-06-06 10:39:15 +0000 mpi3mr: Update consumer index of admin and operational reply queues after every 100 replies Instead of updating the ConsumerIndex of the Admin and Operational ReplyQueues after processing all replies in the queue, it will now be periodically updated after processing every 100 replies. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D44425 --- sys/dev/mpi3mr/mpi3mr.c | 14 +++++++++++++- sys/dev/mpi3mr/mpi3mr.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c index ba649edbe070..1adc19f49dea 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -4388,6 +4388,7 @@ static int mpi3mr_complete_admin_cmd(struct mpi3mr_softc *sc) U32 num_adm_reply = 0; U64 reply_dma = 0; Mpi3DefaultReplyDescriptor_t *reply_desc; + U16 threshold_comps = 0; mtx_lock_spin(&sc->admin_reply_lock); if (sc->admin_in_use == false) { @@ -4425,6 +4426,11 @@ static int mpi3mr_complete_admin_cmd(struct mpi3mr_softc *sc) if ((reply_desc->ReplyFlags & MPI3_REPLY_DESCRIPT_FLAGS_PHASE_MASK) != exp_phase) break; + + if (++threshold_comps == MPI3MR_THRESHOLD_REPLY_COUNT) { + mpi3mr_regwrite(sc, MPI3_SYSIF_ADMIN_REPLY_Q_CI_OFFSET, adm_reply_ci); + threshold_comps = 0; + } } while (1); mpi3mr_regwrite(sc, MPI3_SYSIF_ADMIN_REPLY_Q_CI_OFFSET, adm_reply_ci); @@ -4837,7 +4843,7 @@ int mpi3mr_complete_io_cmd(struct mpi3mr_softc *sc, U32 num_op_replies = 0; U64 reply_dma = 0; Mpi3DefaultReplyDescriptor_t *reply_desc; - U16 req_qid = 0; + U16 req_qid = 0, threshold_comps = 0; mtx_lock_spin(&op_reply_q->q_lock); if (op_reply_q->in_use == false) { @@ -4882,6 +4888,12 @@ int mpi3mr_complete_io_cmd(struct mpi3mr_softc *sc, if ((reply_desc->ReplyFlags & MPI3_REPLY_DESCRIPT_FLAGS_PHASE_MASK) != exp_phase) break; + + if (++threshold_comps == MPI3MR_THRESHOLD_REPLY_COUNT) { + mpi3mr_regwrite(sc, MPI3_SYSIF_OPER_REPLY_Q_N_CI_OFFSET(op_reply_q->qid), reply_ci); + threshold_comps = 0; + } + } while (1); diff --git a/sys/dev/mpi3mr/mpi3mr.h b/sys/dev/mpi3mr/mpi3mr.h index 1cf6718d9047..f8f562184aae 100644 --- a/sys/dev/mpi3mr/mpi3mr.h +++ b/sys/dev/mpi3mr/mpi3mr.h @@ -123,6 +123,8 @@ #define MPI3MR_OP_REP_Q_QD 1024 #define MPI3MR_OP_REP_Q_QD_A0 4096 +#define MPI3MR_THRESHOLD_REPLY_COUNT 100 + #define MPI3MR_CHAINSGE_SIZE MPI3MR_4K_PGSZ #define MPI3MR_SGEFLAGS_SYSTEM_SIMPLE_END_OF_LIST \