From nobody Thu Mar 10 08:35:36 2022 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 D0CD61A03557; Thu, 10 Mar 2022 08:35:36 +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 4KDj7X3779z4Yb1; Thu, 10 Mar 2022 08:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646901336; 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=b148dL4WFdKgIS303srD1NX9Pikl9oj9NdvuoOMNJFo=; b=HghuiJnSmnXsUK+3U0VGK+YlaE4fus68T6OLBxvL4dbtibnbMgSklIyaVh/Mjq5pa6vaJx qL8zA7DRtIEeJDqbRiipgh/GvtoN+HTNLuwXvII8st77DDfP6HMOCOxr/4KKPzxH0Hy6j/ M9a/FZMjPfudWcVDzqtCJESW472u+ti64ooU9HVwVhjGZM4SGxchO6EBTrCaHp7wrxVqKr Xa1bHnHgd8BKKTVnJ0UGd9DijoqH4QDoqaebovi6uodRafBlsdWgyYCu/0JR8HrJhL0XU1 vDNLlXlHu4xT9OtmUpSHdN7H+WW6pzg6kqGtb2EiCmxcFC7BkG1AXj89u+SYeg== 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 3885B219B0; Thu, 10 Mar 2022 08:35:36 +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 22A8ZaHA003370; Thu, 10 Mar 2022 08:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22A8ZaBq003369; Thu, 10 Mar 2022 08:35:36 GMT (envelope-from git) Date: Thu, 10 Mar 2022 08:35:36 GMT Message-Id: <202203100835.22A8ZaBq003369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: afeeccfbed27 - stable/13 - Let the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing the number of completion event TRBs. This avoids wasting memory. 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: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: afeeccfbed271f4f6ba7b300d01eea34281395fd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646901336; 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=b148dL4WFdKgIS303srD1NX9Pikl9oj9NdvuoOMNJFo=; b=C94EMU2M7iS4B14qZkZtl9/9sGf5tyaNnNXkPf0bxPHIDYlhtXAOK+1ImMUC4LEeSgJt+r gdYJwX0CifpSDctWy7j5+QX/Eo4YByt2IVUUE15m+c1Jp97wxNILyivttW6rv9HzpEDWIY qV5/b7omf8oQ3mQzDOBIRUj2Z7i4KnDgRG5tZyfp8ER78r8Ne/4CqHd7uvvpDYEk6DRxak 0s5LQvpZ4ktQmUK8o7rn/sgphnR+nxa+ULsy4ilv8lDKo1KSKXE8p65w/azblM5g3xy6H8 sWYB2Pj9csWvEaDA4KToJ4Y2vPoiB5e2c/9Xl9PTRXIxXFXF6bnYJqIHp0BJpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646901336; a=rsa-sha256; cv=none; b=bIMD7Bh94VX0Jdkju27mjt0GnUzsHOmHXCwmZwjmDJiuXHkthdhKiVVBZZeNc1KfGuSpwC R39oGPUBcV5tKdhudk3anYPxheazxb4tfLUUBTdJoGN7sdEvNoT76r9n6MdEoawrisZGK6 tzclCN04K+/baekdbFjwo57Ulfch2sZwPcaLVjy/m+V/l2WBZ5q3xFTnP7tloob+/VU/bd Do8FN5TLOMx7yZRBCtgATovw8UsneeIQ/KBWdProQSVfpGUWXsS5grFalYIJE41MGOlViW lzqWxFpYZFvQX03AcuAC8nkephl8YKSSVLbgNEQIHQwLBp0MiUIUWCX7JUDw+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=afeeccfbed271f4f6ba7b300d01eea34281395fd commit afeeccfbed271f4f6ba7b300d01eea34281395fd Author: Hans Petter Selasky AuthorDate: 2021-07-10 12:14:11 +0000 Commit: Hans Petter Selasky CommitDate: 2022-03-10 08:18:04 +0000 Let the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing the number of completion event TRBs. This avoids wasting memory. Sponsored by: NVIDIA Networking (cherry picked from commit e036ee6ce2e4d6fe0564f8bb3aa99a2f61d48fc6) --- sys/dev/usb/controller/xhci.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index c0427e0cf11f..e8841a05b134 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -33,7 +33,7 @@ #define XHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) #define XHCI_MAX_ENDPOINTS 32 /* hardcoded - do not change */ #define XHCI_MAX_SCRATCHPADS 256 /* theoretical max is 1023 */ -#define XHCI_MAX_EVENTS (16 * 13) +#define XHCI_MAX_EVENTS 232 #define XHCI_MAX_COMMANDS (16 * 1) #define XHCI_MAX_RSEG 1 #define XHCI_MAX_TRANSFERS 4 @@ -383,6 +383,8 @@ struct xhci_hw_root { struct xhci_trb hwr_commands[XHCI_MAX_COMMANDS]; }; +CTASSERT(sizeof(struct xhci_hw_root) == XHCI_PAGE_SIZE); + struct xhci_endpoint_ext { struct xhci_trb *trb; struct usb_xfer *xfer[XHCI_MAX_TRANSFERS * XHCI_MAX_STREAMS];