From nobody Sat Sep 09 13:37:50 2023 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 4RjYvM2QRsz4sQm2; Sat, 9 Sep 2023 13:37:51 +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 4RjYvM1yltz3C4x; Sat, 9 Sep 2023 13:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694266671; 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=poT3hJbcoVv4v4RKxU3pOXIj5L5am7w3JfWByntEfss=; b=D6MJiZmRPr5YLlmNyd97K1opdY6nVTjTs/TgI81D8l6HdD75/ns3NtFSwMcYNYKmFY2+yH gBvYixiHOgrRuZ99vc9G1sQEK1eVgXy0TVumkmgwfORU4eKIimZfAshEg5A67905Gii67/ yAF94FiKg5UfkReMv/yQB7kg7jEl7ckbqQZApHSrPppOZxrb+G3aOM7rlUO5pazUXyUQ52 8Sx0HBfE4o5Xx7Qky7tOswszD1sEsUT8Mztcytjirt1Ff4cx8aCA0Qp8de4i1ms+9EJdAV otCedGRrmQ2a6nJZz637fWDAajim5kjrxq3TsYeyPJjV/m+vgpMELzKBU0RTMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694266671; a=rsa-sha256; cv=none; b=yaUMjza39PCWV0eMRQ0WcFrBWFGzRvaI6nE/N3x0A2I14XWmlRk0KrW7L4Vrqk2EhtgV3b VomPaWgp6ueGUE0qJBf1oXXjvbbMsAQoVzgTQE/vFAt8SUq09Ircy75FexbLd4fpcN7ZCR NHMrJMfA/VYa48aElqqSZ6I4rCP3lenWbJpcWyK80MPv2lOdh3N80T2ynpi1AWHEj7LNx1 bnO2aUDtKlGLVM4rHhR/DI3GvW/koqZpdaj6j4ia1f3m5mXnRXzcjSDx7j4fWZ+KmCm1cQ RxVhXUjonFpTfFoJQ4gtWgfsJjgmtCZbVUWUVdlk6SuWANtURwbKJKXjMkHzEw== 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=1694266671; 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=poT3hJbcoVv4v4RKxU3pOXIj5L5am7w3JfWByntEfss=; b=GejfqUxEqkP9fVldr7kev6iToVi0aP6Zj9GLf+qKizM7b8rwSDU/fBBFeU26VwDBdomcuM Mjnc5f/Gme+EeIuarVw6DyI9u1vIGdJsvkrazaDwGF6QCI6bAbrgG062Yq3VS3j/uZxIEK NsoX3Qc5eSmmKkoowVuZJNpaqg2J0fnVKjM0Gq/8rJloDapuHpM3clP50l7NBzfDLkghZS PY4Q+VMYB8P2r/WzfZFwVYw4IfDNpOwNVz6wIZSY5FN46of5YE/fI5rF0umVyVD+ZQyA4m yhwyUfS+lVmPI6AAk/SdsNlsGB8l6A1Pv7c7G50xByQYXKYqK1FREo1NwBmn7A== 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 4RjYvM0YjRzBS6; Sat, 9 Sep 2023 13:37:51 +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 389DboEq067122; Sat, 9 Sep 2023 13:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 389Dbot8067119; Sat, 9 Sep 2023 13:37:50 GMT (envelope-from git) Date: Sat, 9 Sep 2023 13:37:50 GMT Message-Id: <202309091337.389Dbot8067119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wei Hu Subject: git: 63a564508b1a - releng/14.0 - mana: batch ringing RX queue doorbell on receiving packets 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 63a564508b1a4247386cd77d44b679fcdc0436bb Auto-Submitted: auto-generated The branch releng/14.0 has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=63a564508b1a4247386cd77d44b679fcdc0436bb commit 63a564508b1a4247386cd77d44b679fcdc0436bb Author: Wei Hu AuthorDate: 2023-08-28 09:15:16 +0000 Commit: Wei Hu CommitDate: 2023-09-09 13:27:03 +0000 mana: batch ringing RX queue doorbell on receiving packets It's inefficient to ring the doorbell page every time a WQE is posted to the received queue. Excessive MMIO writes result in CPU spending more time waiting on LOCK instructions (atomic operations), resulting in poor scaling performance. Move the code for ringing doorbell page to where after we have posted all WQEs to the receive queue in mana_poll_rx_cq(). In addition, use the correct WQE count for ringing RQ doorbell. The hardware specification specifies that WQE_COUNT should set to 0 for the Receive Queue. Although currently the hardware doesn't enforce the check, in the future releases it may check on this value. Approved by: re (gjb) Sponsored by: Microsoft (cherry picked from commit e4e11c1d07f5d58ff8cf4e07ac8f61eecbbb5417) (cherry picked from commit 55b7a8233e3da9355d555dff80011a97fac23079) --- sys/dev/mana/gdma_main.c | 2 +- sys/dev/mana/mana_en.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 2de606d54957..a601873876cb 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -471,7 +471,7 @@ void mana_gd_wq_ring_doorbell(struct gdma_context *gc, struct gdma_queue *queue) { mana_gd_ring_doorbell(gc, queue->gdma_dev->doorbell, queue->type, - queue->id, queue->head * GDMA_WQE_BU_SIZE, 1); + queue->id, queue->head * GDMA_WQE_BU_SIZE, 0); } void diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index 49558cdc97c6..fa49e06e4862 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -1524,7 +1524,7 @@ mana_post_pkt_rxq(struct mana_rxq *rxq) recv_buf_oob = &rxq->rx_oobs[curr_index]; - err = mana_gd_post_and_ring(rxq->gdma_rq, &recv_buf_oob->wqe_req, + err = mana_gd_post_work_request(rxq->gdma_rq, &recv_buf_oob->wqe_req, &recv_buf_oob->wqe_inf); if (err) { mana_err(NULL, "WARNING: rxq %u post pkt err %d\n", @@ -1757,6 +1757,13 @@ mana_poll_rx_cq(struct mana_cq *cq) mana_process_rx_cqe(cq->rxq, cq, &comp[i]); } + if (comp_read > 0) { + struct gdma_context *gc = + cq->rxq->gdma_rq->gdma_dev->gdma_context; + + mana_gd_wq_ring_doorbell(gc, cq->rxq->gdma_rq); + } + tcp_lro_flush_all(&cq->rxq->lro); }