From nobody Mon Jun 3 01:34:49 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 4Vsx9P54RYz5LgR8 for ; Mon, 03 Jun 2024 01:34:49 +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 4Vsx9P4Bswz4PVt; Mon, 3 Jun 2024 01:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717378489; 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=FXYV68anDqKhB9mX5X2GIoN8EdtKAedAvLvk6qh+/7A=; b=MMvG2qt6MLdmItrhJfbsLJz4CPiPyErgUQWgCGebECrRCT3j2kSX11yOodaznYwi+VSzBf TRHwUs0i9EaywMYO53X0TZHpxrUKPwlVQwKzTBC7GjjQtoPedMi7MRn8zfYDy3mlu6fnci 5JUpIpOR6JAuY3oHutoljMCaYo23kp2uTU74u4TV2cno+DeYv6umJ5DGCVFaB8fInMoy0G Br6yZS/yxUzw4AKSr11s05h7gWZL4mG9dJRxAY1gFMjiZ5tNdUz0IusrWrkrBD0AlGHoK1 qn3SUycj54WhG6gqeh3ke4zn0tV1+7zY+5PtMfhi9jPQcmHeYY6CNHVmdatuSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717378489; a=rsa-sha256; cv=none; b=GZIIRhZbxkYWGfZn8my/rP78eE1GM8gFNvFfU7HYWRpxyHSjWPWd2/jeQnFjjbWTc4UIOE QRJ3VIsH2gz3NYwXQKAo8oPwScogZeekmn8m2YuxNcDu23yQbPjM8jRjijyskww9aORv/B R+YDOFlYsQ9oOHFd1fSX0XOEmPXmtyk1URXnJBv9Sr++RAWJqEUJpsQDbVd8FUH9o8WTa1 zG8LB+umaqe7sRG+tk/5xnDC/gaZ/AUhU17QLxsRVQvPdyyJYMZLiM8Cs1QaQOJxxjuaWj KuTMoZhA43Dl/qnSwWCahApGy1D/5SH1uPakYnb3mE1hRqUlbvzITwH/kbeoFA== 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=1717378489; 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=FXYV68anDqKhB9mX5X2GIoN8EdtKAedAvLvk6qh+/7A=; b=VGJHm/ckPZD7QhAKI7l/8FGr4msEEPcao5VS9IT1M9c6OrDb1SiMJLcYcF1r2q4NK4uPL9 fbFd0SKPkOfRb9oU3E3AlPAk4Km9iZ6q1r0sOs+Ljn2SgyGubx/y75HoTwbhk6Zxbg1yH/ mg8Dk40WhU3gessObg44Wue1XB2b2lpb1Oq5O1eMzazM6YQtn6MINpXrgXnkJaPUFxYlPc grYDocqDwhFPOHFyC13R6qTG8KxwywXxlOdx/cKi+UxJ3XEiL5X8KWkIyuiYt78brUpwT3 5227kA0T5RxDaPmdhQBsqDoCEDFOpVd1Bor6ck4CfrMHLu+fmYU6Sn6lIdeCHA== 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 4Vsx9P3p4KzFgh; Mon, 3 Jun 2024 01:34:49 +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 4531Yngv042619; Mon, 3 Jun 2024 01:34:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4531YnaW042618; Mon, 3 Jun 2024 01:34:49 GMT (envelope-from git) Date: Mon, 3 Jun 2024 01:34:49 GMT Message-Id: <202406030134.4531YnaW042618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: 738776b12054 - Create tag vendor/sqlite3/sqlite-3460000 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: cy X-Git-Repository: src X-Git-Refname: refs/tags/vendor/sqlite3/sqlite-3460000 X-Git-Reftype: annotated tag X-Git-Commit: 738776b12054ac11c09917bf8ffa39be198778bc Auto-Submitted: auto-generated The annotated tag vendor/sqlite3/sqlite-3460000 has been created by cy: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/sqlite3/sqlite-3460000 tag vendor/sqlite3/sqlite-3460000 Tagger: Cy Schubert TaggerDate: 2024-06-03 01:34:21 +0000 sqlite3: Tag 3.46.0 commit 259d29fd8c012d4392fa59ff803b691ead5b304d Author: Cy Schubert AuthorDate: 2024-06-03 01:33:10 +0000 Commit: Cy Schubert CommitDate: 2024-06-03 01:33:10 +0000 sqlite3: Vendor import of sqlite3 3.45.1 Release notes at https://www.sqlite.org/releaselog/3_46_0.html. Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460000.tar.gz From nobody Mon Jun 3 02:42:54 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 4Vsygy6pvpz5LmXS; Mon, 03 Jun 2024 02:42:54 +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 4Vsygy6C1Rz4TWX; Mon, 3 Jun 2024 02:42:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717382574; 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=ShvYrX4WyoRR7WX5XE07PyZL8LCoqVXdZNyw1Bjx7RM=; b=S0xp669vCdWtsiTiFXgCK/L5OzoluEc+QaZJdSivNOnoQofKFhY9kjuf7VGoQ3qfdrLAEd ryfw79xvbY68R7qUaV35DGp2+6n/tD7rZ6Fjts0meMB2q/kaWsvoPz+Ty69pXaFIn+vZ/k arkjI4UNhsUPuX+qr+W5Z98Oz5HS1IIIdkoxHuAvzO6kbrVrqHMmf9/0Ne0PejavDl8rJ4 FF4WOqCN9QAwrTZEHkWtlnGwtlpS3rD0cGSUXvnoA+GBCzJvmk5s8ztx/4QLujjnzajwsG 6xCs2fMATSM/HBnggxkboNByr8F3Jyj5BWvM9hCul4FoZCG7VvK2zJ3y04LYMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717382574; a=rsa-sha256; cv=none; b=pg+yD/iHhb7r4STL7vpL/hhvvRTeWqDVvDt7tP0KCPZMZSxaWEkve2wwl1//6bKFPnQeSR PFjuiEU5VXXZpRx4l6snowYc5lrkCAE6nzpO0lqDV+/YvTvD5MEQ9umkwJXRY8NHHG4AdR E2ahA3jFgY3B1ldg9/IobZRMpbV24Ec74B+uxiXskMWqAEYccXNRIU6V4xHHe4U95dvWmq 3T1PsG9VZ6g6bZNlG2LODOyVNKt4dNRqwOH5CE06k1DphXZJCgQ+LFJny7WZLGKIkclhI+ STSw5f8bCbQxbyWiEVKgXJXCiue+pWa0ZV6Rq7QqAMS7MovxVCz9wudcBXHqcQ== 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=1717382574; 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=ShvYrX4WyoRR7WX5XE07PyZL8LCoqVXdZNyw1Bjx7RM=; b=q+jOB1jSisl4dALJP6dHA46sCZL98ZaOMSPj6x1ztVDq1h7k28vuAGWSKMxE034OxD9uxR nOVk2KlY4DohxZX3C0QDQZF9fDSrCIyZU7kr8OKdaGT9YDOROwhfoBAxZZ3saqL7VDGveB ColJQfMxhSqe6XF8r9eK0MrcID6KFUYxqvkysr9bru1wr+AshDvOq20ovg4SK1qqVkix8m govAKSsTsg4vaexu0Pm8XqiFQiy6WOBlwxqKp37XGzBff6R8GmD+KsxAg7ywZxcgGqI/FC /Jte+aw6LFis+XsXjOe/RxuBTwKPlX8ZekMEI3j22rKfANBm/uAl6DcxSlPMHQ== 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 4Vsygy5nj0zH7G; Mon, 3 Jun 2024 02:42:54 +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 4532gsNr060210; Mon, 3 Jun 2024 02:42:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4532gsq4060205; Mon, 3 Jun 2024 02:42:54 GMT (envelope-from git) Date: Mon, 3 Jun 2024 02:42:54 GMT Message-Id: <202406030242.4532gsq4060205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0f996f45418e - main - sqlite3: Vendor import of sqlite3 3.46.0 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f996f45418e82dae151e5d1da478da38d70049f Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0f996f45418e82dae151e5d1da478da38d70049f commit 0f996f45418e82dae151e5d1da478da38d70049f Merge: 542f9494b747 259d29fd8c01 Author: Cy Schubert AuthorDate: 2024-06-03 01:40:14 +0000 Commit: Cy Schubert CommitDate: 2024-06-03 02:28:53 +0000 sqlite3: Vendor import of sqlite3 3.46.0 Release notes at https://www.sqlite.org/releaselog/3_46_0.html. Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460000.tar.gz Merge commit '259d29fd8c012d4392fa59ff803b691ead5b304d' into main contrib/sqlite3/Makefile.msc | 7 + contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 1943 +++++++-- contrib/sqlite3/sqlite3.c | 8935 +++++++++++++++++++++++--------------- contrib/sqlite3/sqlite3.h | 116 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 9 files changed, 7287 insertions(+), 3758 deletions(-) From nobody Mon Jun 3 06:26:50 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 4Vt3fZ6pVcz5L9tf; Mon, 03 Jun 2024 06:27:02 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (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 "anubis.delphij.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vt3fY284Rz3y2C; Mon, 3 Jun 2024 06:27:01 +0000 (UTC) (envelope-from delphij@delphij.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=delphij.net header.s=y07n header.b=PZMwhvg4; dkim=pass header.d=delphij.net header.s=w44o header.b=HHWCNoIR; dmarc=pass (policy=reject) header.from=delphij.net; spf=pass (mx1.freebsd.org: domain of delphij@delphij.net designates 64.62.153.212 as permitted sender) smtp.mailfrom=delphij@delphij.net DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=delphij.net; i=@delphij.net; q=dns/txt; s=y07n; t=1717396013; h=message-id : date : mime-version : reply-to : subject : to : references : from : in-reply-to : content-type : from; bh=Zj/s7p70149eCOsTFDSz9/8IK5PMNHjNh1ulzaDorXs=; b=PZMwhvg4az/+NV+UvOn9Hd28PbnoYge80AFHoY6D3kXYeK8/Pcdlwh/QrWvVvnj7de118 po0bwowIGvjW/7ACA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=delphij.net; i=@delphij.net; q=dns/txt; s=w44o; t=1717396013; h=message-id : date : mime-version : reply-to : subject : to : references : from : in-reply-to : content-type : from; bh=Zj/s7p70149eCOsTFDSz9/8IK5PMNHjNh1ulzaDorXs=; b=HHWCNoIR4U/5pqMJXgBQRlwi+WyuBpbLJ0J0BBQ88QUxQNjN/u1co6uTdk7W8ih8ymISU 1wxkCo3dWXfv/r5D6IeBuaYpnI7PjjS2oPFng2R+soJb0w0/NyyjB6K2PrGT6GHhbcDR93i jkyZCYmjfEuN2yRIQBtdR5OtI7zZYfZfzn1LSL5Dnww71IjA98M3ALhOLhW0dyitewMBOs/ BZvzP8rgCMmfHpDCVzgmBSNo8ahVsig4HylB4Bpc43jCypvjanSGr9Nyk3Ykai8+oyeDt8M DIfPmCjjb8kq26zwFfDq7v901//BwFpPqjyh9gJYM4WV4gf5fm426yFOEEAw== Received: by anubis.delphij.net (Postfix) with ESMTPSA id 183B930ACF; Sun, 02 Jun 2024 23:26:53 -0700 (PDT) Message-ID: <8288d7d3-c4e1-4387-a4c2-b6783c3a0c79@delphij.net> Date: Sun, 2 Jun 2024 23:26:50 -0700 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 User-Agent: Mozilla Thunderbird Reply-To: d@delphij.net Subject: Re: git: 14a5c1068d37 - main - man: do not ignore the exit status of roff tools To: Wolfram Schneider , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202404200830.43K8UkDt000569@gitrepo.freebsd.org> Content-Language: en-US From: Xin Li Autocrypt: addr=delphij@delphij.net; keydata= xjMEZPbDoRYJKwYBBAHaRw8BAQdAsUNmxEWz6QiGdFbBrVVEpjNpgQV9FXjDWsLsY0UwRPvN HFhpbiBMSSA8ZGVscGhpakBkZWxwaGlqLm5ldD7ClgQTFgoAPhYhBLskk2pXNatsapeNzxED 4uuXWeTFBQJk9sRMAhsDBQkKBDXmBQsJCAcDBRUKCQgLBRYCAwEAAh4FAheAAAoJEBED4uuX WeTF6yIA/2Ls3Rb/qC8mQZ6D2S0UO5vblPghJfboFJLNJFw3i4GYAQCsTmQg3ahgbNEJu/vU xgtro2kTxa6kKnZ35IbqPqPcCc44BGT2w6ESCisGAQQBl1UBBQEBB0Cxji+sQgVPajLNA/Lw yHx0ogSalPQszdkfVgeg3iR3FAMBCAfCeAQYFgoAIBYhBLskk2pXNatsapeNzxED4uuXWeTF BQJk9sOhAhsMAAoJEBED4uuXWeTF3BQBAIx/gPCTFN2DPBrKLkE3oC/+j9EkmNLMUCGidlP/ Zb6HAP4nL1kStTsOldIGhi/3m1LvU7r3Kel3MnlIK8/9BlLPAg== In-Reply-To: <202404200830.43K8UkDt000569@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------La05vMXNZBfhDzg1hDQGlOtz" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.50 / 15.00]; SIGNED_PGP(-2.00)[]; MIME_BASE64_TEXT_BOGUS(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.61)[-0.611]; DMARC_POLICY_ALLOW(-0.50)[delphij.net,reject]; R_DKIM_ALLOW(-0.20)[delphij.net:s=y07n,delphij.net:s=w44o]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; MIME_BASE64_TEXT(0.10)[]; ONCE_RECEIVED(0.10)[]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[delphij.net:+]; HAS_ATTACHMENT(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:6939, ipnet:64.62.128.0/18, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[delphij]; HAS_REPLYTO(0.00)[d@delphij.net] X-Rspamd-Queue-Id: 4Vt3fY284Rz3y2C This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------La05vMXNZBfhDzg1hDQGlOtz Content-Type: multipart/mixed; boundary="------------xuJiGFuvKwsbfqeMLJXXs7Vc"; protected-headers="v1" From: Xin Li Reply-To: d@delphij.net To: Wolfram Schneider , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <8288d7d3-c4e1-4387-a4c2-b6783c3a0c79@delphij.net> Subject: Re: git: 14a5c1068d37 - main - man: do not ignore the exit status of roff tools References: <202404200830.43K8UkDt000569@gitrepo.freebsd.org> In-Reply-To: <202404200830.43K8UkDt000569@gitrepo.freebsd.org> Autocrypt-Gossip: addr=d@delphij.net; keydata= xsFNBFuSR4oBEACvvEgwRIHs6IcSP/yaDtySF78Ji3rP29qdiQsxhMsOtvtffdbS56VApIWO UFb3/iN2gA8HwLvrmjijN0HEoLVX7na1WARmxRYzQMtApsZIUTtx7hnUYlsi2F5odZa6CDW9 a954DLRzYxiUwYDcu5Zjl9bglK1H8e/N9uC0Vuigr4teWfh86brzOyf819QzwFVYfMIK4ihw QGwMvTzbyVuCFy+LENkmcVYni70oQy6rZ5ktSuYbuOFvu7inRRfhSWPHziV7k+bW88sJ7xhv lBlegcnhkSudWX2M8tZ3MO1PJOcyys0CJlsBY5Weiog2lIPi05h/E9pZ9mc1Vud17iqDaL6w RaggOUhuPfDGCdO5ro82W4BZGeQMRnRF5Ntk+t2ShIH4nn3xRLV0E5nziCiKlgiMqOrz/ZTL QTVbHrCuiwD+fSK14y0oHbkOLYTYLlgh1JbwfY2Ty7elOYiWzyeJ7sJh2dF91NSEneWIOys3 mBpuvtU3nSzzTvAB48VV+Nbg1CpIOgNlPjj7uhIum/Z/VjUaJEyaLpTIRh0MVJVcbP7hXSqZ NA35EEZZVnWEOYdycm4CmEdeNPWkrAf2Ya77iR5VLGypwMlsUMQPh+sKVWDD38M8stFGBBNm d01Hi74Bsq5hKan654dOqMt5eYklrVj0ucMzFQtus7oE502UswARAQABzRZYaW4gTEkgPGRA ZGVscGhpai5uZXQ+wsGUBBMBCgA+FiEEceNg5NEMZIki80nQQHl/fJX0g08FAluSSJkCGwMF CQmuhAAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQQHl/fJX0g0+Utg/9ED4Mw4K82Asp 3vYnVeziDlXOAif9EAhEpU989DUfk++p7BV6OOWLU1EwdpLBxqcz1kSNJmAbZWoiH3E3tYit 2jP304+lZ0vtEDhu8MFrCAaFCQmerDP2pLI784/rwT6yZPLvFHqqa9gWH41LILhev/L9pNE2 ygQ+fnU7pT5xp5/ebNnAwDrgbFdFLXZi5e1TWnbaEanKBKHoXwzm1C4ERDJSIVvUpuQsXsPa AObnEIwScagJFKZoEywCe9+CwA3cXOPYtBThZdduM7yIjXgwOn4k/EOpP2AqpzAE+kK7llxu rNhm8dw3Pf5mIehl4BKxsZGmxau2CSPe695gqG9hdeJSxQ4FXvnAMObhaioPQntrcEajSop0 jb8vOJat6ZHeSvzqsMxPkT4cEIF6njUepCNiGebVUn2SALqBsve9n4Ur1Y7fkRDyIld+hz/l sD8/lEeYjnr5ft43OT+Y38SV/g+EwXpyptlZOTV9mQWrj8cd1ROSBZber2BRMlLWzVfsmX1w fFUrBMo6tupflcfvvIRtQyu1A6CAJ9veRRispNJ1tjo0WFpKRA1ou5hX2gHs0EjusV1wrD+Y WQDf0QP1PZHwW8V21gOZ4p7n8kTe/7vEFsARLQ4Weq7g5Kn7/qApXzona6nbj9J+PWD4l8eA 4O8wPCXZE61M/JyZwsfLuB7OwU0EW5JHigEQANiBmIFAfRNH3nzYNWC0yC+tfx3zsUwAsH1V aBM/cTib+yKtbBOSIlXWjJZWX3MHwoI/1LeGghB2mxkkX1L0pJ/vj1eXNR+sFZ320pYcl61F xg/5fioG4QDTM4i3i7NR5PxDnc6UVaynSlII93DedRhZ1ROtdn4vyMgzsDiqhbL7BthDOt5K xjqdRk4qRPSw7BovEqZLOcG5IJtf/zZUzRbM7SBljEbOAfekDGx1Br+RrYSD7/EfPwwzou9T 8315IpBpIHyQF/dZNk3iFiB9Ed5CA71ZRYV5YoLWE9lL0j9kxOLQ5vHnX3mVq7QZBc7nzwZ6 UhQgYmrG5+RWvuiPpGwvDRIsugJUGXucYkAQh5kuNblmkwpv6u9rNMjCNbzAylOaqdogra5E W+RUSbRz0b4iIr8nnZeAlh7BihCe7JjOwbDjoBEEEtSfVc4hD/LENqpcYVrChphfaOLB9YIX hnVDTVvMc9OklWT/81HzAaDQqOQCzEfY92199Ct9/CwRoQ2OpO8TO5+8A7b9Nb33nmxMn09m b48ruRacMrfHxCWbgU4w9SEfbip4GcS5wGG6yTC+hw55Iwnnwus40NrJ0GEr8a4rcdsLbkvl yoNHB8ZGgyJ4aFCQ1V4qE1BnlTk7Z8BYBUkJM1odPSkVvHpCnMUjVpJ3hEOC+73ZYH1dh7lZ ABEBAAHCwXYEGAEKACACGwwWIQRx42Dk0QxkiSLzSdBAeX98lfSDTwUCZPl6RwAKCRBAeX98 lfSDT1iFEACK+s6CnjVbEXn5I1s6HptCeXiwYxkOfSzSRDAZZDNWzUxu/2dwl/55Wf9AdJsI It08WOoH405nHSvyp4enicRUyk6tNi4C52qtU7lK9ESpKN8MlICgSd4bdnPxxGFbZE7nDgfF LWSaDmEjLDBDBFN+Oi7dRrWX8LZxUvHrYdO9BiYWVtFJC+hTpdFQbefJ3gLvrZhiwmDPhPq/ IVPPe+IFWcRPnwvSVFAg/hSjNRyRA05MaW7PuEWzciiXhw2oENddyLihZVqJlka0L2ceoDe4 Mf9PpOOmk1z73i42RfQ1Farfyl9MuxzA4DIUEXro0gutao1FVIwGK5cXDOu1vsARSYJ2Qz4M xeOWnObadCJEDLIuQM3XYo9FbCr44dhnwFK8tXSkHBw8NUpVlFIbofcs10qf2ZwbCHKjgISh PtxN9oYM42lNjnhaXtxtaxQagnDv6ynnLaQ2nxfD4ZClr1qUOmC79d67joY+FWncKtqqxNym KaETklfpmBG15tysTQY2MHlfUq9UiROTz+xcvmLZq5q09B/QfOyAt28ugm3MK37xdkPCpUeQ XktNLVlta74Eysucda7PBgqICp2AmrVdq1uKk4kj6IxqG5X3SPeSouU8LWpQSHSrsWKOSMif 0mUVLlzzSNbp5P/y0bXs/7Muw2bPLfLiofmULRXlbXvuhQ== --------------xuJiGFuvKwsbfqeMLJXXs7Vc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGksIFdvbGZyYW0sDQoNCk9uIDIwMjQtMDQtMjAgMDE6MzAsIFdvbGZyYW0gU2NobmVpZGVy IHdyb3RlOg0KPiBUaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4gdXBkYXRlZCBieSB3b3NjaDoN Cj4gDQo+IFVSTDogaHR0cHM6Ly9jZ2l0LkZyZWVCU0Qub3JnL3NyYy9jb21taXQvP2lkPTE0 YTVjMTA2OGQzNzUxMTczZGM0MWYzMDk3YjEyZTk1NzkxYjIxNjANCj4gDQo+IGNvbW1pdCAx NGE1YzEwNjhkMzc1MTE3M2RjNDFmMzA5N2IxMmU5NTc5MWIyMTYwDQo+IEF1dGhvcjogICAg IFdvbGZyYW0gU2NobmVpZGVyIDx3b3NjaEBGcmVlQlNELm9yZz4NCj4gQXV0aG9yRGF0ZTog MjAyNC0wNC0yMCAwODoyNDo1OCArMDAwMA0KPiBDb21taXQ6ICAgICBXb2xmcmFtIFNjaG5l aWRlciA8d29zY2hARnJlZUJTRC5vcmc+DQo+IENvbW1pdERhdGU6IDIwMjQtMDQtMjAgMDg6 MzA6MzMgKzAwMDANCj4gDQo+ICAgICAgbWFuOiBkbyBub3QgaWdub3JlIHRoZSBleGl0IHN0 YXR1cyBvZiByb2ZmIHRvb2xzDQo+ICAgICAgDQo+ICAgICAgUFI6ICAgICAgICAgICAgIDIy MzUxNg0KPiAgICAgIEFwcHJvdmVkIGJ5OiAgICBlbWFzdGUsIGJhcHQNCj4gICAgICBEaWZm ZXJlbnRpYWwgUmV2aXNpb246ICBodHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcvRDQ0Nzk4 DQo+IC0tLQ0KPiAgIHVzci5iaW4vbWFuL21hbi5zaCB8IDggKysrKysrKy0NCj4gICAxIGZp bGUgY2hhbmdlZCwgNyBpbnNlcnRpb25zKCspLCAxIGRlbGV0aW9uKC0pDQo+IA0KPiBkaWZm IC0tZ2l0IGEvdXNyLmJpbi9tYW4vbWFuLnNoIGIvdXNyLmJpbi9tYW4vbWFuLnNoDQo+IGlu ZGV4IGZkNTE2NDg3NTdhOS4uMDM4MDNiNzc3NDYzIDEwMDc1NQ0KPiAtLS0gYS91c3IuYmlu L21hbi9tYW4uc2gNCj4gKysrIGIvdXNyLmJpbi9tYW4vbWFuLnNoDQo+IEBAIC0zMyw2ICsz MywxMiBAQA0KPiAgICMgaXQgaXMgYmV0dGVyIHRvIHRlcm1pbmF0ZSBpdC4NCj4gICB1bGlt aXQgLXQgMjANCj4gICANCj4gKyMgZG8gbm90IGlnbm9yZSB0aGUgZXhpdCBzdGF0dXMgb2Yg cm9mZiB0b29scw0KPiArc2V0IC1vIHBpcGVmYWlsDQo+ICsNCj4gKyMgaWdub3JlIFNJR1BJ UEUgZXhpdHMgYmVjYXVzZSBwYWdlcnMgbWF5IGV4aXQgYmVmb3JlIHJlYWRpbmcgYWxsIHRo ZWlyIGlucHV0Lg0KPiArdHJhcCAnJyBTSUdQSVBFDQo+ICsNCj4gICAjIFVzYWdlOiBhZGRf dG9fbWFucGF0aCBwYXRoDQo+ICAgIyBBZGRzIGEgdmFyaWFibGUgdG8gbWFucGF0aCB3aGls ZSBlbnN1cmluZyB3ZSBkb24ndCBoYXZlIGR1cGxpY2F0ZXMuDQo+ICAgIyBSZXR1cm5zIHRy dWUgaWYgd2Ugd2VyZSBhYmxlIHRvIGFkZCBzb21ldGhpbmcuIEZhbHNlIG90aGVyd2lzZS4N Cj4gQEAgLTMxMiw3ICszMTgsNyBAQCBtYW5fY2hlY2tfZm9yX3NvKCkgew0KPiAgIAkjIFdl IG5lZWQgdG8gbG9vcCB0byBhY2NvbW1vZGF0ZSBtdWx0aXBsZSAuc28gZGlyZWN0aXZlcy4N Cj4gICAJd2hpbGUgdHJ1ZQ0KPiAgIAlkbw0KPiAtCQlsaW5lPSQoJGNhdHRvb2wgIiRtYW5w YWdlIiB8IGhlYWQgLW4xKQ0KPiArCQlsaW5lPSQoJGNhdHRvb2wgIiRtYW5wYWdlIiAyPi9k ZXYvbnVsbCB8IGhlYWQgLW4xKQ0KPiAgIAkJY2FzZSAiJGxpbmUiIGluDQo+ICAgCQkuc28q KQl0cmltICIke2xpbmUjLnNvfSINCj4gICAJCQlkZWNobyAiJG1hbnBhZ2UgaW5jbHVkZXMg JHRzdHIiDQoNCkkgbm90aWNlZCB0aGF0IGFmdGVyIHRoaXMgY2hhbmdlLCBtYW4oMSknaW5n IHNoKDEpIHdvdWxkIGdpdmUgbWU6DQoNCm1hbmRvYzogPHN0ZGluPjogU1lTRVJSOiB3cml0 ZTogQnJva2VuIHBpcGUNCm1hbmRvYzogc2VlIGFib3ZlIHRoZSBvdXRwdXQgZm9yIFNZU0VS UiBtZXNzYWdlcw0KDQppZiBJIGRvbid0IGZpbmlzaCBzY3JvbGxpbmcgdGhyb3VnaCB0aGUg d2hvbGUgbWFucGFnZSBmaXJzdCwgd2hpY2ggSSANCnRoaW5rIGlzIG5vdCBkZXNpcmFibGUg KHdlIHNob3VsZCBiZSBhYmxlIHRvIHF1aXQgJE1BTlBBR0VSIGVhcmx5KS4NCg0KSWYgSSBk byB0aGlzIHRoZW4gdGhlIGVycm9yIG1lc3NhZ2Ugd291bGQgYmUgZ29uZToNCg0KZGlmZiAt LWdpdCBhL3Vzci5iaW4vbWFuL21hbi5zaCBiL3Vzci5iaW4vbWFuL21hbi5zaA0KaW5kZXgg MjRhMDQ2NDY4OWNjLi40MmFlODZjZmVjNWIgMTAwNzU1DQotLS0gYS91c3IuYmluL21hbi9t YW4uc2gNCisrKyBiL3Vzci5iaW4vbWFuL21hbi5zaA0KQEAgLTM4MSw3ICszODEsNyBAQCBt YW5fZGlzcGxheV9wYWdlKCkgew0KICAgICAgICAgaWYgWyAtbiAiJHRmbGFnIiBdOyB0aGVu DQogICAgICAgICAgICAgICAgIHBpcGVsaW5lPSJtYW5kb2MgLVRwcyAkbWFuZG9jX2FyZ3Mi DQogICAgICAgICBlbHNlDQotICAgICAgICAgICAgICAgcGlwZWxpbmU9Im1hbmRvYyAkbWFu ZG9jX2FyZ3MgfCAkTUFOUEFHRVIiDQorICAgICAgICAgICAgICAgcGlwZWxpbmU9Im1hbmRv YyAkbWFuZG9jX2FyZ3MgMj4vZGV2L251bGwgfCAkTUFOUEFHRVIiDQogICAgICAgICBmaQ0K DQogICAgICAgICBpZiAhICRjYXR0b29sICIkbWFucGFnZSIgfCBldmFsICIkdGVzdGxpbmUi OyB0aGVuDQoNCmJ1dCBJJ20gbm90IHN1cmUgaWYgdGhhdCB3b3VsZCBkZWZlYXQgdGhlIHB1 cnBvc2Ugb2YgdGhlIG9yaWdpbmFsIA0KY2hhbmdlLiAgQ291bGQgeW91IHBsZWFzZSB0YWtl IGEgbG9vaz8NCg0KQ2hlZXJzLA0K --------------xuJiGFuvKwsbfqeMLJXXs7Vc-- --------------La05vMXNZBfhDzg1hDQGlOtz Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQS7JJNqVzWrbGqXjc8RA+Lrl1nkxQUCZl1iKwUDAAAAAAAKCRARA+Lrl1nkxWN4 AP9fj5sIe7TcJu21aSAXTPF5MX8D4QLUsRS4Vn4VAOQgvgEA/F/dyme/P5v1KFsFEdn5MHo1GLKw Lr42Y0PyYVNiMwY= =Ho4L -----END PGP SIGNATURE----- --------------La05vMXNZBfhDzg1hDQGlOtz-- From nobody Mon Jun 3 07:36:22 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 4Vt5BZ5Dzrz5M2Hr; Mon, 03 Jun 2024 07:36: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 4Vt5BZ4cPfz45k5; Mon, 3 Jun 2024 07:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717400182; 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=n9wC8gW61mO+PqL7rkMCmzm587M+6H08BJPTJHVBXag=; b=tGaF5JgcYEQVpkoZwFcYWgOR5pFjI4Mc6eoPNEzj7rN1Fi1BTSDP71HU1pEyXApyc/r8Ba qx9ujLLrm5Tyb4urGfEGMIdU+XZ/psFOuLIp+6ixe8hF0ojG0RGCjAb1DQcZFnG3kBkxnr cpebbstC41ZOgNxqTJqIKy6VdFTpI/iIwEUKBMCQ53RgdcnBHmCpsx9yBnXXwOjYuc/nPH xYZC/sl3yoKmPzEBZ5BJwG4ariixFI2eWzqmxhXsdLDk6mc4TY8LYLrWbc9Cj1lO+uXiaf KIAAsE4FuOn++glrAI3m12B9nAKokHPLqr9o2h7XAMRe7flKzQgCqwks5Xq0cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717400182; a=rsa-sha256; cv=none; b=boREQph7itysvNkYJA094fGUJzRG9KA2isL7/AhEQyE23Ehkp4BfrI5GqOOgH9lUtwOPr9 kfY8K+Jucffkv2XTeb+jl8yzc/6Oojjw5DLP2Wj0Ed/GsBlSNy4vwUkKIUXXd1aX8vk1B+ PV9Ajr4c2VjlIL1MGj5BTlmFKTmiVLCTPDagtPiXMdtK8akuypBM5d3p/iw4P9T2LCahhu /lzqxpNoI4hmeQmg2uBKymrt+MyqwPy98OCqr15KtWuCXN8iqDz3UcGtG+PDl9Coa0S2W7 TiMusOVOflEbV/TwmU12XURuyosOvTPaP8qNSfUVvQJiHFXLx9QSDn6TtHabiQ== 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=1717400182; 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=n9wC8gW61mO+PqL7rkMCmzm587M+6H08BJPTJHVBXag=; b=uOAQb/CAGyhd/YKfSDXBeynaYHFFFExE9OuAIw+oJ54902tZSRiQ3ZZuH0yR5/ibbnHOKX CRzqeYPurYY//IV8OsB+orUNl+9jDOdoY5mglQi06u+gdU1gorqPZ+NGKBgkibvZH0nLpC s1rUINsHVNMKtFW3CCkKVH96BWUFi2FgSvdMv98ckJIC838h49umMRmAb77TBhOn9/wrLP gNh8DO2Lfkvu6cqdOQjVoU2lc04ps/bVpXG89iGz3ymC80vbktnA5WvnHNQ7k2s09n64UO ADxr6WIFVTp93nXNgvizWhbJxVg05A0ggdhzM+RkwcgpxNLza/bsLW3yWYH5Xg== 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 4Vt5BZ4CllzR4L; Mon, 3 Jun 2024 07:36:22 +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 4537aM9H063155; Mon, 3 Jun 2024 07:36:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4537aM9S063152; Mon, 3 Jun 2024 07:36:22 GMT (envelope-from git) Date: Mon, 3 Jun 2024 07:36:22 GMT Message-Id: <202406030736.4537aM9S063152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 9fe726012df9 - stable/14 - pam_xdg: pam_get_item can return NULL 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9fe726012df9a125a40df0b70a2e5c6f6b7bb913 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9fe726012df9a125a40df0b70a2e5c6f6b7bb913 commit 9fe726012df9a125a40df0b70a2e5c6f6b7bb913 Author: Andre Albsmeier AuthorDate: 2024-05-27 06:31:34 +0000 Commit: Emmanuel Vadot CommitDate: 2024-06-03 07:35:41 +0000 pam_xdg: pam_get_item can return NULL Fix pam_xdg as pam_get_item can return NULL, this happens when pressing control + C in xdm for example. MFC after: 1 week PR: 279268 (cherry picked from commit cca0ce62f367d03ed429bf99e41e6aca8cb7f2ac) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 4d586a21566a..2c80f0a0332f 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -67,7 +67,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, /* Get user info */ rv = pam_get_item(pamh, PAM_USER, (const void **)&user); - if (rv != PAM_SUCCESS) { + if (rv != PAM_SUCCESS || user == NULL) { PAM_VERBOSE_ERROR("Can't get user information"); goto out; } @@ -221,7 +221,7 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused, /* Get user info */ rv = pam_get_item(pamh, PAM_USER, (const void **)&user); - if (rv != PAM_SUCCESS) { + if (rv != PAM_SUCCESS || user == NULL) { PAM_VERBOSE_ERROR("Can't get user information"); goto out; } From nobody Mon Jun 3 14:19: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 4VtG791yWxz5Mb1v; Mon, 03 Jun 2024 14:19:01 +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 4VtG791Th2z4l6m; Mon, 3 Jun 2024 14:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717424341; 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=TL7SGeErpvJF2fJktyJC7ItLeg4kPw76fAR+XubAkDQ=; b=UOJrWajyCa9eTZspE8On9u+BpnoYfKbTR9mhR9GbB8tW6Wk9QTXDH7Im6oMkWQtbuNOeKn wJEes7eAUayA+nu/gVUEWduHBhMNCht6sARQrfGtrDsS7+Lz9YZkf7ighx1nEBwItwztNQ V6iNEElv9slGKnlmMnj8AE6O5zYEbaV/LKs/X5B3moUHBvb58K7X08bhNOaN9dEGd053KV ujJO6WWqCOZxJYHRzoKjZ+G656LIk1hy7pBmaGZD+PkKK6a5e4j2EALjBDjMK9dlWnNbai XljBLfOxMrXOglslmrrfrnc1zYYzvByK3abWktoeWFJOoSz4jT2P4zgCBUEy1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717424341; a=rsa-sha256; cv=none; b=pAhCby29xsoVInD82fK/Zn0i0uewdBxIhSjGXlRqYLH2uMM4ehidNGcI8rYzQ5wy8DUx1K srmU/gnZjyckXv+dlho2hkQtMJZlTPRioQsIKKqA7U20bAPITVbXaU/F7Z/ORN0r+LgNa8 mZRMCDvA/ekRjxSO82dHD/BeC7stdiI2GOxPQ41pVVJW19KZJJ1aWzhtJoMuSgK1Zw8S7m QQxZuUcnCN5RGoCGsvc2+jGv4m98e1Ib0ZL6UeBMMUv1zjHF/rNK2/42envRCaLYNv+OPk vRCaNdTBA/gDM1KxN1jgn49xcD6QNRHM8o6K119FvPwAvONWIME2GiKFBARGUQ== 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=1717424341; 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=TL7SGeErpvJF2fJktyJC7ItLeg4kPw76fAR+XubAkDQ=; b=Bv3Oq0OWfif1tiu4RgN2gKA7HgMyhbKwSdjcm0qG51YVk23QRVELPV5G5uiveJINbtkZho nh4tncSy6b5Sqd0+5/KCpOqwcrmPrmOo22LGrv7s3E7qmmPkXeGprHptL7k2ITpEhfPbJD XfF1p4VG7uCDXFIc7imu0On1UhmWtbBB7RJlcWYf6S61+4gaRI6JEokfu4VrL7m/tGZcUf muCsdoXLBDVe2DqeYkYXPtjYPuvlKTh3cmgYzML2j/HwifEB6bkCIKTJUFMgWQKhFYPNHu vcB1OCm7TxUYB9xGpL4aBY9AwwaCaVy6UdQr01ZJWbVSoBz0PhHZDxFKoVr3ng== 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 4VtG7914cRzdvn; Mon, 3 Jun 2024 14:19: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 453EJ1ox040040; Mon, 3 Jun 2024 14:19:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453EJ11G040037; Mon, 3 Jun 2024 14:19:01 GMT (envelope-from git) Date: Mon, 3 Jun 2024 14:19:01 GMT Message-Id: <202406031419.453EJ11G040037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Salychev Subject: git: 645a228481c7 - main - ds1307: Return error code instead of boolean 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: dsl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 645a228481c778b62fcd6c23e6f4786ceb8f1300 Auto-Submitted: auto-generated The branch main has been updated by dsl: URL: https://cgit.FreeBSD.org/src/commit/?id=645a228481c778b62fcd6c23e6f4786ceb8f1300 commit 645a228481c778b62fcd6c23e6f4786ceb8f1300 Author: Dmitry Salychev AuthorDate: 2024-06-03 13:41:11 +0000 Commit: Dmitry Salychev CommitDate: 2024-06-03 13:41:11 +0000 ds1307: Return error code instead of boolean It's probably a copy-paste leftover from the other functions which return a boolean value and generates annoying "CLOCK_SETTIME error 1" from subr_rtc.c on Traverse Ten64 in verbose mode. No functional changes intended. MFC after: 3 days --- sys/dev/iicbus/rtc/ds1307.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/iicbus/rtc/ds1307.c b/sys/dev/iicbus/rtc/ds1307.c index e8aa6a258edc..67a753bb3edb 100644 --- a/sys/dev/iicbus/rtc/ds1307.c +++ b/sys/dev/iicbus/rtc/ds1307.c @@ -346,7 +346,7 @@ mark_epson_time_valid(struct ds1307_softc *sc) if (error) { device_printf(dev, "%s cannot read Control 2 register: %d\n", __func__, error); - return (false); + return (error); } control_mask = (RX8035_CTRL_2_PON | RX8035_CTRL_2_XSTP | RX8035_CTRL_2_VDET); @@ -356,9 +356,9 @@ mark_epson_time_valid(struct ds1307_softc *sc) if (error) { device_printf(dev, "%s cannot write to Control 2 register: %d\n", __func__, error); - return (false); + return (error); } - return (true); + return (0); } static bool is_dev_time_valid(struct ds1307_softc *sc) From nobody Mon Jun 3 15:14:58 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 4VtHMl0M1Cz5Mh66; Mon, 03 Jun 2024 15:14:59 +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 4VtHMk6yPnz4v8p; Mon, 3 Jun 2024 15:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717427699; 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=erDQUiHYCs8CKKK4OMTgoV8tF0z6XvBrT/Li9QQLcLs=; b=FEyoB4VzHdAOQzhYcEznUZK5ubzoGlBJHkfHqcIhV14zXgOldGXmNlXtvHuJiyQLlX3IKj lvK13JJlkWLolN082Sb032XF4o64VlhdojlmXONs0xvu/NLC4TbN4BnKjF2valP6rhO9j3 i7iufTNmVkVnHaWKu7sLYBGpfuoTyI9Qv/cHHqeaS9uyacPP8QExyqJY0MfR4yEUJ+AYSq y3evkAeLWQNyMowta+dUW2dwl+YeEtSs0/lZJP1B5ybWSKi1lrKPnMet6/I3iPOwLDIBth nkzI5c8pvToueaUtu38t4h/rrySCrh/FKY4D5Ib4w6BRuBRIdfa34wTMbHlKxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717427699; a=rsa-sha256; cv=none; b=gYoHAnOGW3qsbW5q6PwqXvadjCvzDMDUuGeiOkG2cLCftqIFRlYC2OaryfuUp4bIlPZ2DI q2ahArHbgTOpRqCcHqIJPTKKeZmDGKLr4UlprFWLr/Dhha+QHhl4UD6ZxWokB9LvBdoevZ n3AySS8ma9Y0L8Sy9onYZU5rTCK3LXxQvC+Kf3BMWQjfE74dbvxjgR8fHaq7KMC0mHaK6W S4WT6k842cnQl2EBh/Z9Lvxzy21uBRH4Sm+dYpAKvUWhFdYjc+JvcetygK6mLHUlQgDTzT wlYxiL4175pWs0nB+N4DkrbQkS2JWgbA3+LN911+/wo1kuPO6e/sLcZ10Y1sqQ== 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=1717427699; 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=erDQUiHYCs8CKKK4OMTgoV8tF0z6XvBrT/Li9QQLcLs=; b=puXeYLkLhbpqA7L+NezQxLrqcg8w3vs363roQNTSkJNzl0ZGHbrTsjuLPiS/PT6LUuTh2c NtYE6zQeUprZgYvgasZujOr6jJxRQXabJGhThbBIsBedVWmCEXelHnpFJn53rAFnkWAgF6 EXJ1zBIpLIVgQZwX8rl0E8G8B7tprqWGjADJdv2tralnRRvtY9IO+Rexii5g0u5YS4aTta 6W1yzR32ULgCNATVUE+mFvd5LyTvGZsNAQ7g1rVNQKvVz6Ua4f5ZIMtn2F/frquj5It3nR j6U27rdvCQIPz4yYpk4UXI5RFhI/V4VCoGh2WCv0HOKehZfjoNJoxqUJFVf2+g== 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 4VtHMk6YXBzg8x; Mon, 3 Jun 2024 15:14:58 +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 453FEwTu043348; Mon, 3 Jun 2024 15:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453FEws3043345; Mon, 3 Jun 2024 15:14:58 GMT (envelope-from git) Date: Mon, 3 Jun 2024 15:14:58 GMT Message-Id: <202406031514.453FEws3043345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 079d67b1d861 - main - sys: Disable C standards prior to C99 from kernel build 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 079d67b1d8618f1bc02b6507d7ee934529818a49 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=079d67b1d8618f1bc02b6507d7ee934529818a49 commit 079d67b1d8618f1bc02b6507d7ee934529818a49 Author: Minsoo Choo AuthorDate: 2024-06-03 14:58:18 +0000 Commit: Warner Losh CommitDate: 2024-06-03 14:58:18 +0000 sys: Disable C standards prior to C99 from kernel build The kernel hasn't built with anything less than c99 for a long time. Retire support in the build for it. In addition, retire the translation of c99 to -std=iso9899:1999, since all latter day C compilers that we support have had this for maybe 15 years or so (gcc since 4.5, clang since the earliest version) and it simplifies the code. Reviewed-by: imp, emaste Differential-Revision: https://reviews.freebsd.org/D44145 --- sys/conf/kern.mk | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 5cd3a43f01b8..d51aa1f1dfa9 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -284,14 +284,10 @@ PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ CSTD?= gnu99 -.if ${CSTD} == "k&r" -CFLAGS+= -traditional -.elif ${CSTD} == "c89" || ${CSTD} == "c90" -CFLAGS+= -std=iso9899:1990 -.elif ${CSTD} == "c94" || ${CSTD} == "c95" -CFLAGS+= -std=iso9899:199409 -.elif ${CSTD} == "c99" -CFLAGS+= -std=iso9899:1999 +# c99/gnu99 is the minimum C standard version supported for kernel build +.if ${CSTD} == "k&r" || ${CSTD} == "c89" || ${CSTD} == "c90" || \ + ${CSTD} == "c94" || ${CSTD} == "c95" +.error "Only c99/gnu99 or later is supported" .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD From nobody Mon Jun 3 15:52:06 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 4VtJBZ64Hwz5Mk4Q; Mon, 03 Jun 2024 15:52:06 +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 4VtJBZ5ZY4z40l2; Mon, 3 Jun 2024 15:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717429926; 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=fS4+Hu3dL66RadJfbsqlCrLYh6T1nyWBhJehzjt5ZVk=; b=YHC33m/NMKPZwuCSWjGbrWf3zViUw21dpJ+lkOjXtmaic02jbB8fFcQOj3e5dNeb4Ixfe5 pASI5RBGwDR7zcluymGqcNAEPEouNdW8aULtybvpDgnQ+Ld5RLo6+xu7rlGoaGiyST4t1s T9wK1umPDrP81E2tfFt60KXSg7L6by7uzwNl3ISdWq2edsvo38n4dLgguoQ4SVrjwzXf28 0qdEzr0USZ4lKxRp5HL8kDWgQG9xxgBb/etkeq6opi8AMk74N5E2fH7Knc7ZleZ9UHa+p+ 1Z6tgXzQussu83xNcp/2F7bwbgSqNnlMmt/YJwbtetZ/mx1PvfVyw06/0Xy8mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717429926; a=rsa-sha256; cv=none; b=EsEcJB+MocLFpPk6eFSt1SzJ7c9jegFYN8O/vEU+WF9SRMnb6M3S0yXFRlAcg0JnNyf5nv no9wjJU+aDjgOmypnlnPWHVfZjvp9sYPUhGeM2eMg2Tdc7E7jZChAEn/LqppzgS2WMuUmy 4+dsx/NFJ8bXdvhN6mlhFvqTqk29E88CrUCmN7LPgAcpj2PbGdhlGnjFjP/fD2lH6Pg3Rp DnwnpKWzIkRZLyf9BPL4e1DxHPJ/1UBUJ/tO23lkVWqqS3jk/1H8DK5sUMOUxzDGgbk3hk 3/IOOB6yxW5r4b9OG41j1S0tJruklTk+nU5lc4XbMRLqDDqBKYuDXxrakeuoQw== 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=1717429926; 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=fS4+Hu3dL66RadJfbsqlCrLYh6T1nyWBhJehzjt5ZVk=; b=pfJWGKWEnHrFfOMs7DWhvzuDzsqUyq/j6+s6m42hI/GDhIWkVFxaTvk+67/aJ6cead2QT3 KysnldlKh4PAE3k+DkSMo4iKaS7wDZMMZI3WnpyZYYB+JSboVFT9ayKCpClMH0kNCTHM2B vGe4SzRZi1y4wobxsQpmV94FtmckKXYoXp8prpO93pclKbFUk1wFQmWrev64uEzhZ3Umni +gnax6QNwsh2a93Re9eZwwzjZRPJS0etw0UhvfTUsaJ+0NsA+UQWHvkyQyKKxUZmVoqVCQ XjEsSlngq5rKlasddEw0aTJjqZ2qCOMl4aAc9r2JaY4f3GWLMiCEXhfa9Zr9vw== 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 4VtJBZ4sZBzhSR; Mon, 3 Jun 2024 15:52:06 +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 453Fq6sc008789; Mon, 3 Jun 2024 15:52:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453Fq6dC008786; Mon, 3 Jun 2024 15:52:06 GMT (envelope-from git) Date: Mon, 3 Jun 2024 15:52:06 GMT Message-Id: <202406031552.453Fq6dC008786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: c3e9423743d9 - main - Move print_bits to ifconfig.c and make available to other src files. 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3e9423743d91ae5b5865602a905900a1855055e Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c3e9423743d91ae5b5865602a905900a1855055e commit c3e9423743d91ae5b5865602a905900a1855055e Author: Gordon Tetlow AuthorDate: 2024-05-31 17:48:10 +0000 Commit: Gordon Tetlow CommitDate: 2024-06-03 15:48:35 +0000 Move print_bits to ifconfig.c and make available to other src files. Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202406 Differential Revision: https://reviews.freebsd.org/D45441 --- sbin/ifconfig/ifconfig.c | 23 +++++++++++++++++++++++ sbin/ifconfig/ifconfig.h | 2 ++ sbin/ifconfig/ifconfig_netlink.c | 23 ----------------------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index a8bd5a0c89db..92543a281959 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1877,6 +1877,29 @@ Perror(const char *cmd) Perrorc(cmd, errno); } +void +print_bits(const char *btype, uint32_t *v, const int v_count, + const char **names, const int n_count) +{ + int num = 0; + + for (int i = 0; i < v_count * 32; i++) { + bool is_set = v[i / 32] & (1U << (i % 32)); + if (is_set) { + if (num++ == 0) + printf("<"); + if (num != 1) + printf(","); + if (i < n_count) + printf("%s", names[i]); + else + printf("%s_%d", btype, i); + } + } + if (num > 0) + printf(">"); +} + /* * Print a value a la the %b format of the kernel's printf */ diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 76a5aeb718b1..555e7dbaca64 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -260,6 +260,8 @@ void setifcap(if_ctx *ctx, const char *, int value); void setifcapnv(if_ctx *ctx, const char *vname, const char *arg); void Perror(const char *cmd); +void print_bits(const char *btype, uint32_t *v, const int v_count, + const char **names, const int n_count); void printb(const char *s, unsigned value, const char *bits); void ifmaybeload(struct ifconfig_args *args, const char *name); diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 8964b63caf7b..729d4ca56545 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -81,29 +81,6 @@ static const char *IFFBITS[] = { "LOWER_UP", /* 24:0x1000000 IFF_NETLINK_1*/ }; -static void -print_bits(const char *btype, uint32_t *v, const int v_count, - const char **names, const int n_count) -{ - int num = 0; - - for (int i = 0; i < v_count * 32; i++) { - bool is_set = v[i / 32] & (1U << (i % 32)); - if (is_set) { - if (num++ == 0) - printf("<"); - if (num != 1) - printf(","); - if (i < n_count) - printf("%s", names[i]); - else - printf("%s_%d", btype, i); - } - } - if (num > 0) - printf(">"); -} - static void nl_init_socket(struct snl_state *ss) { From nobody Mon Jun 3 15:52:07 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 4VtJBc22Vsz5MkHg; Mon, 03 Jun 2024 15:52:08 +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 4VtJBb6bv5z40X4; Mon, 3 Jun 2024 15:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717429927; 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=ca3uAXzlAkBfgpKcl9Nb8XjBleMCU/0dehQWaDXEUoU=; b=LfN7VooIyNd5l+mJ4fzbidUHLVFI7CTzg9hVm+X0zI8vXSajGvoH3wdnxzcTlLx0KRcD0z GvggVPL0bC9SH5HAN35GGR9kFrk2RDFPWVodc9EevpvUzme1weyhvmR5pDx4sryL+dJ+UH eZlJ1W+BaeMuFqVC0kpKQiGkYqh7zaQ+PDDs5I5Nh+2GNISteXNT1LyGtj3mQYI9BHtEe9 5XIoI4alHrK20iL61L7bk7KjU0y6N5XwwORQIFDHRA8rCIYhnoXgeFLMMY8VWN3f7cLffc ZlZMGxS7je40xmeNFptD3zxX3IfYLJPbu4RI0ugy/25n/bYpDAYcNksT16zRIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717429927; a=rsa-sha256; cv=none; b=NqQr2dLSI154qwnKtU9QmbcTKjEYH6yoWB6iyfTuoT7zkMSElfOslBjLcJ7oS49hEJ7qvO pB9yzlZhD1Z2JcN79fv7FLen0Ljbk1V9RIQb3MmIkIHDziE62l5WVFhRkx2AiVX+iHoetc P7P4JEzbM3w8XZmtRX6ocOZYvYOODwjBi3gGS02rbKTiXcVtR0Hv5Yb/CiVK6I0HwWWeFk a/pW26O+/4uJkZSFBhVogMi29JuESp2DYs1IKURD17hr3ZtcjGarcx6YmqTtemm7UnZYTD 9J2qxYfF+aAz2dMEiC9zI42yXO4umzmekhaxI+0CWrbBohvOFDgLygqsAOabnA== 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=1717429927; 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=ca3uAXzlAkBfgpKcl9Nb8XjBleMCU/0dehQWaDXEUoU=; b=Mu483yT3ry6sU3k+F7+z1W9UM+4VLqNpZ0zjqsLyPZ356busIaJeDsMe82IBOUF9jDrRnO OKAk/I4CPnfQzoaxPqPES5eXU3BvvYvyp1ZKGCv0AVfJK/8LRxlZ5xWU94/a5V4LlcsS6A wIY0a3E7+U2prIpOQTcKhqgKvYeM2PJVxCOtj2YFriYdk5c97Nv0xh7efloilyMt7oVay+ mbZkjsVvnNvpVrGQsLVyVPQ6GBv+x6X9JDqb3dF54iTzkSiViqSQNb8Ymyuw/E6vvEfhkn YfX7Hm83oImPZmQu20fJ18hiadHluMUf9K7694pY4efw1Tr7n9iLoEsed3k31w== 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 4VtJBb6CLSzh9M; Mon, 3 Jun 2024 15:52:07 +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 453Fq71S008846; Mon, 3 Jun 2024 15:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453Fq7MT008843; Mon, 3 Jun 2024 15:52:07 GMT (envelope-from git) Date: Mon, 3 Jun 2024 15:52:07 GMT Message-Id: <202406031552.453Fq7MT008843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: a68e4f7a0652 - main - Migrate from printb to print_bits for locally defined bit fields. 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a68e4f7a065218f0bcc5b34ff8d2e73a240b59b2 Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=a68e4f7a065218f0bcc5b34ff8d2e73a240b59b2 commit a68e4f7a065218f0bcc5b34ff8d2e73a240b59b2 Author: Gordon Tetlow AuthorDate: 2024-05-31 20:58:52 +0000 Commit: Gordon Tetlow CommitDate: 2024-06-03 15:48:35 +0000 Migrate from printb to print_bits for locally defined bit fields. Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202406 Differential Revision: https://reviews.freebsd.org/D45441 --- sbin/ifconfig/af_nd6.c | 29 ++++++++++++------- sbin/ifconfig/ifconfig.c | 75 ++++++++++++++++++++++++++++++++++++++---------- sbin/ifconfig/ifgif.c | 7 +++-- sbin/ifconfig/ifgre.c | 9 ++++-- 4 files changed, 90 insertions(+), 30 deletions(-) diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c index 73044e95740a..2899ad6a0778 100644 --- a/sbin/ifconfig/af_nd6.c +++ b/sbin/ifconfig/af_nd6.c @@ -52,17 +52,22 @@ #include "ifconfig.h" #define MAX_SYSCTL_TRY 5 +static const char *ND6BITS[] = { + [0] = "PERFORMNUD", + [1] = "ACCEPT_RTADV", + [2] = "PREFER_SOURCE", + [3] = "IFDISABLED", + [4] = "DONT_SET_IFROUTE", + [5] = "AUTO_LINKLOCAL", + [6] = "NO_RADR", + [7] = "NO_PREFER_IFACE", + [8] = "NO_DAD", #ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG -#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ - "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ - "\007NO_RADR\010NO_PREFER_IFACE\011NO_DAD" \ - "\012IPV6_ONLY\013IPV6_ONLY_MANUAL" \ - "\020DEFAULTIF" -#else -#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ - "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ - "\007NO_RADR\010NO_PREFER_IFACE\011NO_DAD\020DEFAULTIF" + [9] = "IPV6_ONLY", + [10] = "IPV6_ONLY_MANUAL", #endif + [15] = "DEFAULTIF", +}; static int isnd6defif(if_ctx *ctx, int s); void setnd6flags(if_ctx *, const char *, int); @@ -141,6 +146,7 @@ nd6_status(if_ctx *ctx) int s6; int error; int isdefif; + uint32_t bits; strlcpy(nd.ifname, ctx->ifname, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { @@ -159,7 +165,8 @@ nd6_status(if_ctx *ctx) close(s6); if (nd.ndi.flags == 0 && !isdefif) return; - printb("\tnd6 options", - (unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS); + bits = (nd.ndi.flags | (isdefif << 15)); + printf("\tnd6 options=%x", bits); + print_bits("options", &bits, 1, ND6BITS, nitems(ND6BITS)); putchar('\n'); } diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 92543a281959..615de5d4ae14 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1617,17 +1617,60 @@ unsetifdescr(if_ctx *ctx, const char *val __unused, int value __unused) #ifdef WITHOUT_NETLINK -#define IFFBITS \ -"\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\7RUNNING" \ -"\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2" \ -"\20MULTICAST\22PPROMISC\23MONITOR\24STATICARP\25STICKYARP" - -#define IFCAPBITS \ -"\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ -"\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" \ -"\36VXLAN_HWCSUM\37VXLAN_HWTSO\40TXTLS_RTLMT" +static const char *IFFBITS[] = { + [0] = "UP", + [1] = "BROADCAST", + [2] = "DEBUG", + [3] = "LOOPBACK", + [4] = "POINTOPOINT", + [6] = "RUNNING", + [7] = "NOARP", + [8] = "PROMISC", + [9] = "ALLMULTI", + [10] = "OACTIVE", + [11] = "SIMPLEX", + [12] = "LINK0", + [13] = "LINK1", + [14] = "LINK2", + [15] = "MULTICAST", + [17] = "PPROMISC", + [18] = "MONITOR", + [19] = "STATICARP", + [20] = "STICKYARP", +}; + +static const char *IFCAPBITS[] = { + [0] = "RXCSUM", + [1] = "TXCSUM", + [2] = "NETCONS", + [3] = "VLAN_MTU", + [4] = "VLAN_HWTAGGING", + [5] = "JUMBO_MTU", + [6] = "POLLING", + [7] = "VLAN_HWCSUM", + [8] = "TSO4", + [9] = "TSO6", + [10] = "LRO", + [11] = "WOL_UCAST", + [12] = "WOL_MCAST", + [13] = "WOL_MAGIC", + [14] = "TOE4", + [15] = "TOE6", + [16] = "VLAN_HWFILTER", + [18] = "VLAN_HWTSO", + [19] = "LINKSTATE", + [20] = "NETMAP", + [21] = "RXCSUM_IPV6", + [22] = "TXCSUM_IPV6", + [24] = "TXRTLMT", + [25] = "HWRXTSTMP", + [26] = "NOMAP", + [27] = "TXTLS4", + [28] = "TXTLS6", + [29] = "VXLAN_HWCSUM", + [30] = "VXLAN_HWTSO", + [31] = "TXTLS_RTLMT", +}; static void print_ifcap_nv(if_ctx *ctx) @@ -1699,10 +1742,12 @@ print_ifcap(if_ctx *ctx) if ((ifr.ifr_curcap & IFCAP_NV) != 0) print_ifcap_nv(ctx); else { - printb("\toptions", ifr.ifr_curcap, IFCAPBITS); + printf("\toptions=%x", ifr.ifr_curcap); + print_bits("options", &ifr.ifr_curcap, 1, IFCAPBITS, nitems(IFCAPBITS)); putchar('\n'); if (ctx->args->supmedia && ifr.ifr_reqcap != 0) { - printb("\tcapabilities", ifr.ifr_reqcap, IFCAPBITS); + printf("\tcapabilities=%x", ifr.ifr_reqcap); + print_bits("capabilities", &ifr.ifr_reqcap, 1, IFCAPBITS, nitems(IFCAPBITS)); putchar('\n'); } } @@ -1790,8 +1835,8 @@ status(if_ctx *ctx, const struct sockaddr_dl *sdl __unused, struct ifaddrs *ifa) old_s = ctx->io_s; ctx->io_s = s; - printf("%s: ", ctx->ifname); - printb("flags", ifa->ifa_flags, IFFBITS); + printf("%s: flags=%x", ctx->ifname, ifa->ifa_flags); + print_bits("flags", &ifa->ifa_flags, 1, IFFBITS, nitems(IFFBITS)); print_metric(ctx); print_mtu(ctx); putchar('\n'); diff --git a/sbin/ifconfig/ifgif.c b/sbin/ifconfig/ifgif.c index 6a4bb8b5a240..991cf110678f 100644 --- a/sbin/ifconfig/ifgif.c +++ b/sbin/ifconfig/ifgif.c @@ -48,7 +48,9 @@ #include "ifconfig.h" -#define GIFBITS "\020\2IGNORE_SOURCE" +static const char *GIFBITS[] = { + [1] = "IGNORE_SOURCE", +}; static void gif_status(if_ctx *ctx) @@ -60,7 +62,8 @@ gif_status(if_ctx *ctx) return; if (opts == 0) return; - printb("\toptions", opts, GIFBITS); + printf("\toptions=%x", opts); + print_bits("options", &opts, 1, GIFBITS, nitems(GIFBITS)); putchar('\n'); } diff --git a/sbin/ifconfig/ifgre.c b/sbin/ifconfig/ifgre.c index 3eeed8f3d200..43c86a546167 100644 --- a/sbin/ifconfig/ifgre.c +++ b/sbin/ifconfig/ifgre.c @@ -41,7 +41,11 @@ #include "ifconfig.h" -#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ\03UDPENCAP" +static const char *GREBITS[] = { + [0] = "ENABLE_CSUM", + [1] = "ENABLE_SEQ", + [2] = "UDPENCAP", +}; static void gre_status(if_ctx *ctx) @@ -60,7 +64,8 @@ gre_status(if_ctx *ctx) ifr.ifr_data = (caddr_t)&port; if (ioctl_ctx_ifr(ctx, GREGPORT, &ifr) == 0 && port != 0) printf("\tudpport: %u\n", port); - printb("\toptions", opts, GREBITS); + printf("\toptions=%x", opts); + print_bits("options", &opts, 1, GREBITS, nitems(GREBITS)); putchar('\n'); } From nobody Mon Jun 3 15:53:22 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 4VtJD318ZQz5Mkp6; Mon, 03 Jun 2024 15:53:23 +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 4VtJD30CJ2z41PL; Mon, 3 Jun 2024 15:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717430003; 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=7WKw9+O3RqaVaoXIllQSqe8TvR1+gSC+p3Wq+KQ24xI=; b=yntVO+55g+ulyHZ8SfjJbD9xPrWEDQ0qtv1cPQUv/lM4WGY1+byZIQBTL0q8FBzio2e2w8 iPrG33BVkdKP2PK5/dIgkWC3ETlUDflOpGV7h9XVBionCUWajC8au9VcuCI6/bw5sjYrwM 7OyvNDb+3DVmOKzKamYKuo5/3PjUKSPPSKTumd4U0XeK8bulLAENR3mvp1L/WCrVBPGk/7 Rxh5JFcClVRmjgo+Ti1MzN5EWBhVAIm0QZaKAFqJ4VHfZb7IWHPvAxoj8ZednxyPKy3TPm M2P+Bp8WDqj7PBjM0Nb41OF0Mi6r6d+L1K20Zgp3FmIigKmAcnvyNxXPVJN/0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717430003; a=rsa-sha256; cv=none; b=QLMqQ/EhxhS2STu/QMYEuc3KVpY90r3SIzNuOvfRewXN0BfILU7Dxz6dFwlE57PggJLE7O VvAHT6HydSGtGaokACV6v7l6WOWmsK2VmSZBqj9yqsOR84qBeq837glECPZueUs5Ghln3Q BByAcbbGrEeB7Jf7M0MDMIkGSGqJJ4ymJgJOKxqVUlZvlU37OzYB5YajzkY/gcTAN/HCfp DOImeDxSAMZhmjZSc3sSl0MCJe3/n8LK2TnPMAsqTnMq7Yk1Xn+xXgsmheJRHKgz4BwA4n Tx1zJg9rwhtedLp+nxa5ADI18b5suz2FmN7rcr+/b+OXwPdO8bvSXCRfVq2KwQ== 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=1717430003; 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=7WKw9+O3RqaVaoXIllQSqe8TvR1+gSC+p3Wq+KQ24xI=; b=cU9Mt2kG3svZnLpVP6FiWGaKDlx1PfKcnQwvfsW+OUTnXqvxxUtZXy9/ny8il3yLU8+Z28 RYm9xOOssbQkT5dzPVfWTkIEWG2FMQbpncCFUzMbdb8YnYSiCeWd/jjoL3OzlgL/VpEb+c U08pyJt0XgKOTPLf3ExYCEwSst373CJfCzVOte0u2P0kVMoSiTYZFyTyw5tWmYSFAmBhn9 +Dpf5UUjc6pMxHCgWLRJ+6B26Czj/tLZC3f3Evq2lPb452ggX9qexAchjEd40e4VcQVy34 ksr0OncYkQVK+DTZEOje0Lp87KSB2KxSOSN77OKQMJcOT2ylzlwCisblmvuc1A== 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 4VtJD26wRhzh9X; Mon, 3 Jun 2024 15:53:22 +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 453FrMIH010184; Mon, 3 Jun 2024 15:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453FrMlG010181; Mon, 3 Jun 2024 15:53:22 GMT (envelope-from git) Date: Mon, 3 Jun 2024 15:53:22 GMT Message-Id: <202406031553.453FrMlG010181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 80828c6fab02 - main - kern: Remove leftover saf1761otg bits 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80828c6fab0292b5c5a34a63558d837cb9308fbd Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=80828c6fab0292b5c5a34a63558d837cb9308fbd commit 80828c6fab0292b5c5a34a63558d837cb9308fbd Author: Joshua Kinard AuthorDate: 2024-05-25 20:26:28 +0000 Commit: Mitchell Horne CommitDate: 2024-06-03 15:52:58 +0000 kern: Remove leftover saf1761otg bits Almost all code related to the saf1761 driver was removed in commit 44796b7e822e, except for two small bits related to saf1761otg support. This patch completes the removal. PR: 279302 Signed-off-by: Joshua Kinard Reviewed by: mhorne MFC after: 3 days Fixes: 44796b7e822e ("mips: remove saf1761") --- sys/conf/files | 2 -- sys/dev/usb/controller/usb_controller.c | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 4685d7a63227..875021aaa357 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3247,8 +3247,6 @@ dev/usb/controller/uhci.c optional uhci dev/usb/controller/uhci_pci.c optional uhci pci dev/usb/controller/xhci.c optional xhci dev/usb/controller/xhci_pci.c optional xhci pci -dev/usb/controller/saf1761_otg.c optional saf1761otg -dev/usb/controller/saf1761_otg_fdt.c optional saf1761otg fdt dev/usb/controller/uss820dci.c optional uss820dci dev/usb/controller/usb_controller.c optional usb # diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index 163ee14bd097..838bd6bf7621 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -135,7 +135,6 @@ DRIVER_MODULE(usbus, octusb, usb_driver, 0, 0); /* Dual Mode Drivers */ DRIVER_MODULE(usbus, dwcotg, usb_driver, 0, 0); -DRIVER_MODULE(usbus, saf1761otg, usb_driver, 0, 0); /*------------------------------------------------------------------------* * usb_probe From nobody Mon Jun 3 16:04:48 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 4VtJTF2rJyz5MmDv; Mon, 03 Jun 2024 16:04:49 +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 4VtJTF0Pwlz42RP; Mon, 3 Jun 2024 16:04:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717430689; 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=CKKMdtGCn2AkIzImopcd2RKmAMOCTsSiO/kBs++wF8A=; b=Nguc6xHtAU1haF/7jnJ85pNBd6Ohxwxyeky23XIvAQXOxoFoOF/MpoU5cDa9md5MN0Vpk/ fsU7sRXFGg/7O5YDHY+RN9eDqcRHLGoPpxioNWjiSzBCsUNoNYYwJvxrRXCHT8m6EaibMG awHnBmTtGJ7Jp6fEV2lmwR/pRqJ1lr9VBsCrAiSp76WJQUGz/vNpBNPyN2bu2jF8MoxJ/7 wHMy+EYzVYlvcWvxnJ7IHUhJ553JJsqrmxgVtWFLDPn4jS3T1NDAAFMktH4mpzbXvay3QY XDZFn7oyssB0/7ahaJhoHkptYJtMAHNNeKdR3qmJhvxewH326M0eILQDq43JIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717430689; a=rsa-sha256; cv=none; b=s6maDrhKVKjQMY9cXI8luNYb7jvYChRCj9pfyPMjqc7I1GUDq14tOL/HvtQ7uMg8xjDnsJ j7i0qSu12pLFPkJlRulHivtWxQnSio94ehRXUBbNL3mDe2TOV9guvZkBRRFwYbKIBJL2US x7e09fSXWWzCzSgScdf9sYELGBRSFqCfkUqcMyAX/m3LqhU+iGdlykP3FYZWQ2i7bcIGmr 8MEK6wIyiDWPQa3h2IlUZqbjW1iI0wsx/JuEGPPsid4Wug6hjFgsG26l2SXAE2SRivXLJl muMB3ZIfIJWQ0zQmD+1BgkH8q+B+1JVqcN90cim+Sbq/ITSa5zsBk7hTfEKDTQ== 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=1717430689; 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=CKKMdtGCn2AkIzImopcd2RKmAMOCTsSiO/kBs++wF8A=; b=msc4S0zcn/YQJopTwC/dDMGsrF8GsWkeXJFAyo9lYIOpmPa/t12VEF4VQaTAcvGAhNKD1/ kqhqXPE4JiVhU/MBmDU+NIUU9hFI1xaAUe8bxf06S+91J2lDQW1SKKOELxuyarCHW/I+Aa WsscPE96PFbpJ6OH9GNrwhl1XDdVHFYncifDHoCYQVaYLJo403MurD70sqVEEg0xoYiCq4 OofvT1ks0BQlxKW4ZkcVAoNceue75iYGkrAb2/Vnkde88UPWDWMQF3Nlrnoax2UmePXxoc Ghjr57cNxqEJmhSMkLCRvsZJuJzihBev9TiCNWn7T9zO+/E1mrf5n/rICnXAVQ== 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 4VtJTF014DzhlL; Mon, 3 Jun 2024 16:04:49 +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 453G4mLh027974; Mon, 3 Jun 2024 16:04:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453G4mGY027971; Mon, 3 Jun 2024 16:04:48 GMT (envelope-from git) Date: Mon, 3 Jun 2024 16:04:48 GMT Message-Id: <202406031604.453G4mGY027971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 965fff98260f - main - man(1): ignore absolute path for .so include 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: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 965fff98260ff53707b4ba38ff44fc5683a7189f Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=965fff98260ff53707b4ba38ff44fc5683a7189f commit 965fff98260ff53707b4ba38ff44fc5683a7189f Author: Wolfram Schneider AuthorDate: 2024-06-03 16:00:42 +0000 Commit: Wolfram Schneider CommitDate: 2024-06-03 16:00:42 +0000 man(1): ignore absolute path for .so include We want only a relative include, as ".so man1/foobar.1" MFC after: 1 week --- usr.bin/man/man.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 24a0464689cc..7461153942f5 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -324,7 +324,8 @@ man_check_for_so() { do line=$($cattool "$manpage" 2>/dev/null | grep -E -m1 -v '^\.\\"[ ]*|^[ ]*$') case "$line" in - .so*) trim "${line#.so}" + '.so /'*) break ;; # ignore absolute path + '.so '*) trim "${line#.so}" decho "$manpage includes $tstr" # Glob and check for the file. if ! check_man "$1/$tstr" ""; then From nobody Mon Jun 3 16:22:16 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 4VtJsN582hz5MnTt for ; Mon, 03 Jun 2024 16:22:16 +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 4VtJsN4jbFz44xG; Mon, 3 Jun 2024 16:22:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717431736; 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=yjvBoGCElRg0ymLmMxzFNSVn4m0PIYrmyrARAhEF9PU=; b=Fbs17Jno1rEHYFUYuYhSmYi5kq8g+gtVssOzcY0yhFX0XH1qVrZbmb/N/4N2IIA5BxDns5 p/MulIVmQnzq7QitOrcoM7HdPd/vpHHyosbUs9BQoFoCVbXygjItSO6U1OdjuqVv37rcnU aUQPy6r6UpSvWsNdXRrIUD63GscsWi+8FG/ta3W5zauTdd0EqMAtrAaXtQ+VHuAykFKUo9 GjLIqM3mfIKOCs4K2EsuPISM50ajCbcekA4krKmPjiVPDAl8TgMwy1dsQvafJqMefzYuIk PgN1+LOtiMACV5dMd3CfrziLd/dTMC5nBSANXA1lBPqtgMUQb3in08zqaCCcGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717431736; a=rsa-sha256; cv=none; b=aTdQ2TTJ/ksywxCE8QotvyRjTsfuFjEmEJptsLA3ERuFRVepm60WbykT8pBfPbKIJ6zLW7 tJDp5vevT6PsZk7tUTBqityLyGXsi2JvhmX6e6RzqADMAqiJ/lQ7eGPBmG/68MX9D4B0aQ b0KulRmzcvYKUWGIoHA95bxN5qQil3kpaD5MODfWMci7WYRc3vOlmMXOeINiAppCzaQu3a ow4bodxworQHJw9HHEALwkbaQ9mchYzFsWB9FgBskjcYm7XJjwaEZvm2FAAJNUoEfVLhXU 2jOQiaF6Yzd4O/VIy/jie75JcMLQfAG2d4JaLf8h8ze5QrGi1kXwaKCA7GsJQw== 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=1717431736; 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=yjvBoGCElRg0ymLmMxzFNSVn4m0PIYrmyrARAhEF9PU=; b=EUd1aImytXZT8+pCaiXnWwY4rzvwDjOufSLWpa063VSTXjhf4wibodyL1aaRi7W69SItTj CYw50VMX1aGtWRq/sOfutFXkiGhdotM9gbqfulzrbi5A1gy+fvMDh4pFQSd3xoF/Kk4xaE PaRvUbtP/Z5V+3dF4cc1BGaMydhfX8yZL2wGxThYts/NEk4UY6i+OgmFoq8i+LkPC+jloZ /mJuKiuk+5kLLl1VEqDYMbbbdYa0X4iX6vhHdPwye+3WYNrGKoV29odR8ppVKYNZ8myLw6 R2THv/XOuuh8HbaxW1X7Z5w4LAmIlQ+2aIck2lA1fG+tU7V/EmbCcVyqoCfRLA== 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 4VtJsN41N9zj6Z; Mon, 3 Jun 2024 16:22:16 +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 453GMGFJ061807; Mon, 3 Jun 2024 16:22:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453GMGlW061806; Mon, 3 Jun 2024 16:22:16 GMT (envelope-from git) Date: Mon, 3 Jun 2024 16:22:16 GMT Message-Id: <202406031622.453GMGlW061806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 96dba636abec..1b2aa3deeb0d - vendor/dhcpcd - vendor branch updated 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/vendor/dhcpcd X-Git-Reftype: branch X-Git-Commit: 1b2aa3deeb0dbbace9fed635fa01b6f6e8480901 X-Git-Oldrev: 96dba636abec6d5451820add99300bda2ca6d86a X-Git-Newrev: 1b2aa3deeb0dbbace9fed635fa01b6f6e8480901 Auto-Submitted: auto-generated The branch vendor/dhcpcd has been updated by emaste: URL: https://cgit.FreeBSD.org/src/log/?id=96dba636abec..1b2aa3deeb0d 1b2aa3deeb0d Import dhcpcd 10.0.8 From nobody Mon Jun 3 16:22:21 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 4VtJsT3K7kz5Mn62 for ; Mon, 03 Jun 2024 16:22:21 +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 4VtJsT2hhLz44kG; Mon, 3 Jun 2024 16:22:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717431741; 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=5An2cCen4GAVXAv/Y42cnCdixoq8ASnwB6S+ls3ic+M=; b=Oo6qJIVm2twOXWwXHxQBQMHRf7zG+zKLilQ9GTz6ubu2BwGFg8owOsAiDiCsGyCeb31Nta SAejf2yTkC9E9pnlY20QMIdvDCXOFTQjNPYXsnHtu5LtESy1+spcolJaSQXFkYLgrtdr4r BcAKGVDIW2rmGWMLSix0g8XeKt8quxsvqhSrm/ok575uD4ibaV5gU2fw4FX268/34K5teE HAH5lLzHt4DobPKlBrLJqRLixCWvPTQbh6ivpvfYaQ+VA/ydE53HqinPfAQvtIQwGrgcu+ bVlo8O93QsOMQHBC5TjHTUgBz9JxM94LlDeDVsv7neO2tlCy5+mp7noFHmOVuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717431741; a=rsa-sha256; cv=none; b=ZhIZwpYRQdKhuuUoAfOTmhVXvhEX4SYTaRK6zhqBlOtbV+oeBPC/++UjQU6sLHLglO+JtB k/XVcUHZR1yO7M4KYqmY4Zjzq+VxVfeNVe00t5gR2Yai7gZsb1oCFfe/bXPhVg1VsUZ/tS PKdp+s7oyem8b7lvQI/MOE98FQAClfvI7VoM8VfvjN4G0EZHWfbAELWWZDKmUBR9ITXKKh byCt0jJdsJ8yn7fgxy/a/Q+AqE6bsSGThN+EQW/BGsJCJGweM9d5Ls1AdtToBPtLkQ60Rp 9v3qwwPbepS5f1W6LW9uwJJ9iCM5bdUO/GnWehQH4LdR/8/P8a1vT6ye3lHmqA== 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=1717431741; 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=5An2cCen4GAVXAv/Y42cnCdixoq8ASnwB6S+ls3ic+M=; b=JNlabF0VlU3H0tMC++yK4GvXkGtAz32kBz5MTBuKX50mtSLiS5iQbkuhURF8lyc+UrPpe7 TxbuimdloDr9IN2dfzHnLjw7PNklZWDvsBGYpj+PqsQkRDI1M0/ka5zWQx/d3a4/MsHLgI 2DQeEaAomwY3dkZpo7dyYHnxijPOB1ZAqHJHFIzlBVbfn/c+bgXc7WYn5UcgEjh/U7Tb1k 5ejIULC5ybF1HSMzKVgGFo8Zi5NEPOcafVReftjFHLsbprQrprAC0yx04wvE9CCAV5EmiB Yv5MgXvAE4CmZSyK8X/tfTf0jOdoOvg9bM1CQi4EYtAblRZXxjWDOXPLVSHr7g== 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 4VtJsT2GdnzjNV; Mon, 3 Jun 2024 16:22:21 +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 453GML2H061905; Mon, 3 Jun 2024 16:22:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453GML9S061904; Mon, 3 Jun 2024 16:22:21 GMT (envelope-from git) Date: Mon, 3 Jun 2024 16:22:21 GMT Message-Id: <202406031622.453GML9S061904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 0a8237ce99cf - Create tag vendor/dhcpcd/10.0.8 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: emaste X-Git-Repository: src X-Git-Refname: refs/tags/vendor/dhcpcd/10.0.8 X-Git-Reftype: annotated tag X-Git-Commit: 0a8237ce99cf0921e3ac783fec18af5cb277e5cb Auto-Submitted: auto-generated The annotated tag vendor/dhcpcd/10.0.8 has been created by emaste: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/dhcpcd/10.0.8 tag vendor/dhcpcd/10.0.8 Tagger: Ed Maste TaggerDate: 2024-06-03 16:20:34 +0000 Tag dhcpcd 10.0.8 commit 1b2aa3deeb0dbbace9fed635fa01b6f6e8480901 Author: Ed Maste AuthorDate: 2024-06-03 16:17:02 +0000 Commit: Ed Maste CommitDate: 2024-06-03 16:19:54 +0000 Import dhcpcd 10.0.8 Event: Kitchener-Waterloo Hackathon 202406 Sponsored by: The FreeBSD Foundation From nobody Mon Jun 3 16:34:37 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 4VtK7f0xQTz5MpZG; Mon, 03 Jun 2024 16:34:38 +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 4VtK7d6Zdnz4778; Mon, 3 Jun 2024 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717432477; 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=5ycGEYSIpzAE2cf8lqUQ3R+5hj0SmsvdyrkGG8Z9N44=; b=GM7VSZLM8sLbRpyUnQpbYvhg0RGsd8Ind2P/L26F5Kw80zftPYB80aHhOUb3awVbm9nS+c 6cFNMkCNwTlNUDlcx5jNmUHXfIg1Uw48Piw/SigQnJyTAMQ5II1zlgncL2+j6i4nH6SMmW T/SVXJz+y0JcRcrqRDhHXPWngqLsmTj3XM1O4zYNWsmC3R6+d1lGm1UiPlKcuScAcP/srr rAC6MAAtDd5xB9wK3wiR/UVny25Y+f2IAuzxyVtpWVFZ49ResTHEsCvRguUHNAXPKeochB iXjAWJanS7K1PN0jefXwJoO8xSChyuv15lv2KV9dSLH6zBwZHfwabmOLaD93+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717432477; a=rsa-sha256; cv=none; b=oYAKXOwuzOwulK4xMdU4DL2FPYtqkCHpVUZMefZz6uJgEYR0EPLimJqF2HzUDA1dgldSar FDkwCI33OZD/iWV/7oLNWBAdBP+WbCAoHFjhv/GRoT076p3fNZM+oQzt38lIfo51BZHP0U EeVBySbXaUucL7q9Db3nWFtJCsCFZFBXu+SgdWI5LYeRpYa79ev/b0rclWUea/f6KhK12k 0vBEbSl8A4Bd6UT/A7IlLzlqoa+wjnterezPE5iD/UaRVD96GUpJ4klG+hlWQ5YELIHSje qTvpiISePMd2fN6lJOhtxcm+/9I6Cm0vcqf9hn7V3LviKbK3l86r6i9drd2Hyg== 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=1717432477; 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=5ycGEYSIpzAE2cf8lqUQ3R+5hj0SmsvdyrkGG8Z9N44=; b=tD4SCxKLAwrnMxcWWsOLwhfrMF2u3XARZE0Hq/sH/GCMfwUH8+qlR+L97Uw4wfiXAVyBz7 PcVNigLxIei/B92ZIUlBWRSjb8uFpZOHc/zpri8QahntkLwKAW5Qc1HK56HHtO8+tgi/8I IUP96PKun68RMQH79LASzuYwjuuBBeW1hl9L+s6Pk3M3ZB3sverIg8N2s1V3kEvcd17zJI OXSU60nOpcN5IomF8to8WIfEyXHQ1hMvurbn2CBuuNwhFcvwCYAfz6wEXH2//1ztMKsyQd K+U722M5LVM98kDbbofLy6dFLfOffRqvxm7/WwIce91ykx0sbPydTuMAuC+DQg== 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 4VtK7d5pw7zjTr; Mon, 3 Jun 2024 16:34:37 +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 453GYbKT078629; Mon, 3 Jun 2024 16:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453GYbtt078626; Mon, 3 Jun 2024 16:34:37 GMT (envelope-from git) Date: Mon, 3 Jun 2024 16:34:37 GMT Message-Id: <202406031634.453GYbtt078626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: e1f5c22be431 - stable/14 - man(1) needs to check for .so files not only in the first line PR: 279182 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: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e1f5c22be4317523102a98f7f62c780fbe73b40f Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=e1f5c22be4317523102a98f7f62c780fbe73b40f commit e1f5c22be4317523102a98f7f62c780fbe73b40f Author: Wolfram Schneider AuthorDate: 2024-05-26 05:48:40 +0000 Commit: Wolfram Schneider CommitDate: 2024-06-03 16:23:05 +0000 man(1) needs to check for .so files not only in the first line PR: 279182 Some manual pages have a copyright notice or commit id before including other files with the .so macro. We need to skip comments and empty lines at the beginning of the manpage while checking for the first .so macro. MFC after: 1 week (cherry picked from commit 73eb53813fe3a2245edbeb670902e4bb9d41e288) --- usr.bin/man/man.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index e8eb27850873..ec14fe08cf67 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -322,7 +322,7 @@ man_check_for_so() { # We need to loop to accommodate multiple .so directives. while true do - line=$($cattool "$manpage" 2>/dev/null | head -n1) + line=$($cattool "$manpage" 2>/dev/null | grep -E -m1 -v '^\.\\"[ ]*|^[ ]*$') case "$line" in .so*) trim "${line#.so}" decho "$manpage includes $tstr" From nobody Mon Jun 3 16:54:51 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 4VtKb00tL8z5Mr35; Mon, 03 Jun 2024 16:54:52 +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 4VtKZz5pY9z49dt; Mon, 3 Jun 2024 16:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717433691; 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=IoepO2uCpBaLT0z1S9jyUjamqmR4V6Ndpnw3orAgXZ4=; b=gRsz/1XsBy6IYCrCmtQjzINQRYdE+Y+4shqSVBEvjGFHRPJRuB49KVa13F6Am7THHOraDu pAYZhCHMguQ45d1hKly3nxwdwNfSC727THld6SaK5RQ2b0SaWoEL+bPuaAK8gYrN/Yx64g x5CpogjW129TkomfPBaQHIcZ1EV8b8tOe9cF26dbP3B1R78y82xVA9qELDhxs3g/+O6VWj FxoAvgQGvHNNQMYgOLyUKndG6MHeS5JOrpS7qllep6k7HVWqMg8+wck0uT6Yu9urtBz1Xh WxTq40ROTNHxBCMk8hofN7zI6y9tAHJODXPb8vRbaoXmBujjeEZ3oT/scTQyuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717433691; a=rsa-sha256; cv=none; b=vFSEcrp8y6/XCTB9sbwl900huFKFkv9OC0wAxTCUSxgzVkM0xILEPmtYmdd26U+b8DDZij Z5w05emyNp/O3NengMNyAmt78G3cOElpZYT5BjqjwCevQkk1AssgJ3H5NmbQc7rOuGKr4q ddVJAEAWk+2fCikzd/9QXTYcZC3aEheW5JU0LiJhU1MBqMkvyss+yzauAWlAOOLAmm1z3T 8pcFuxSI1PEACx6Zfai/v+HRBd8dLDbSKL8D2ok/ycuG6+tYlkSGypAdOQ0McynQDnE3W5 iWLML7aZG8hncROMORtVhgUALTKI+34bJfqw5o/YQLD5zzH7k8fCewK86yg1Zg== 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=1717433691; 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=IoepO2uCpBaLT0z1S9jyUjamqmR4V6Ndpnw3orAgXZ4=; b=UAIczTi9yYJ9LZ2G7TzqI7brdV1wRYKPNk3QqBdp/1pvjWRHOwN3QDJ5jCsNXDEAWeJ3S3 BNaDIeJKxTeJP8RCrYRmkXieBNn+AqVDQK5qYyOxnbqrOYi9nyYMgHuG+Pk6fXhmToe2Pm YJ2NffZ6ZrYyEhgKQ44A5zvfUAHQgpJp23GOVw+yoAdRc828/K7GnR4HygPqqRuqpnGguc qpwrn02T8ipDLIOrDsPKqZorMb5gmTH/HxCDxr3yQVmdA3ph8QL6LgMVsP3MwJarwOmJ2i f1+9EJQQQCNQukh3Lw0gI/8oohQqm7ABLGK3VcaRNRNErxJTDhBry8blxSz6XA== 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 4VtKZz5Hcqzk7H; Mon, 3 Jun 2024 16:54: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 453Gsphd012243; Mon, 3 Jun 2024 16:54:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453Gspu0012240; Mon, 3 Jun 2024 16:54:51 GMT (envelope-from git) Date: Mon, 3 Jun 2024 16:54:51 GMT Message-Id: <202406031654.453Gspu0012240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b0056b31e900 - main - libkern: add ilog2 macro 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0056b31e90029553894d17c441cbb2c06d31412 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b0056b31e90029553894d17c441cbb2c06d31412 commit b0056b31e90029553894d17c441cbb2c06d31412 Author: Doug Moore AuthorDate: 2024-06-03 16:37:55 +0000 Commit: Doug Moore CommitDate: 2024-06-03 16:37:55 +0000 libkern: add ilog2 macro The kernel source contains several definitions of an ilog2 function; some are slower than necessary, and one of them is incorrect. Elimininate them all and define an ilog2 macro in libkern to replace them, in a way that is fast, correct for all argument types, and, in a GENERIC kernel, includes a check for an invalid zero parameter. Folks at Microsoft have verified that having a correct ilog2 definition for their MANA driver doesn't break it. Reviewed by: alc, markj, mhorne (older version), jhibbits (older version) Differential Revision: https://reviews.freebsd.org/D45170 Differential Revision: https://reviews.freebsd.org/D45235 --- sys/amd64/include/cpufunc.h | 4 - sys/arm64/iommu/smmu.c | 9 -- sys/compat/linuxkpi/common/include/linux/log2.h | 73 ---------------- sys/dev/bxe/bxe.h | 10 --- sys/dev/bxe/ecore_sp.h | 2 +- sys/dev/cxgbe/osdep.h | 8 -- sys/dev/enetc/enetc_hw.h | 1 - sys/dev/mana/gdma_util.h | 9 -- sys/dev/qat/qat/qat_ocf.c | 2 +- sys/i386/include/cpufunc.h | 9 -- sys/powerpc/booke/pmap.c | 1 - sys/powerpc/booke/pmap_32.c | 13 --- sys/powerpc/booke/pmap_64.c | 13 --- sys/sys/libkern.h | 106 ++++++++++++++++++++++++ 14 files changed, 108 insertions(+), 152 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 44d93494d830..62e782304fca 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -65,10 +65,6 @@ breakpoint(void) #define bsfq(mask) __builtin_ctzl(mask) -#define bsrl(mask) (__builtin_clz(mask) ^ 0x1f) - -#define bsrq(mask) (__builtin_clzl(mask) ^ 0x3f) - static __inline void clflush(u_long addr) { diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c index 1d1996a69027..76a7d29dc2db 100644 --- a/sys/arm64/iommu/smmu.c +++ b/sys/arm64/iommu/smmu.c @@ -309,15 +309,6 @@ smmu_write_ack(struct smmu_softc *sc, uint32_t reg, return (0); } -static inline int -ilog2(long x) -{ - - KASSERT(x > 0 && powerof2(x), ("%s: invalid arg %ld", __func__, x)); - - return (flsl(x) - 1); -} - static int smmu_init_queue(struct smmu_softc *sc, struct smmu_queue *q, uint32_t prod_off, uint32_t cons_off, uint32_t dwords) diff --git a/sys/compat/linuxkpi/common/include/linux/log2.h b/sys/compat/linuxkpi/common/include/linux/log2.h index 27e91a8bdbe0..2d54c75c7c23 100644 --- a/sys/compat/linuxkpi/common/include/linux/log2.h +++ b/sys/compat/linuxkpi/common/include/linux/log2.h @@ -51,79 +51,6 @@ rounddown_pow_of_two(unsigned long x) return (1UL << (flsl(x) - 1)); } -#define ilog2(n) \ -( \ - __builtin_constant_p(n) ? ( \ - (n) < 1 ? -1 : \ - (n) & (1ULL << 63) ? 63 : \ - (n) & (1ULL << 62) ? 62 : \ - (n) & (1ULL << 61) ? 61 : \ - (n) & (1ULL << 60) ? 60 : \ - (n) & (1ULL << 59) ? 59 : \ - (n) & (1ULL << 58) ? 58 : \ - (n) & (1ULL << 57) ? 57 : \ - (n) & (1ULL << 56) ? 56 : \ - (n) & (1ULL << 55) ? 55 : \ - (n) & (1ULL << 54) ? 54 : \ - (n) & (1ULL << 53) ? 53 : \ - (n) & (1ULL << 52) ? 52 : \ - (n) & (1ULL << 51) ? 51 : \ - (n) & (1ULL << 50) ? 50 : \ - (n) & (1ULL << 49) ? 49 : \ - (n) & (1ULL << 48) ? 48 : \ - (n) & (1ULL << 47) ? 47 : \ - (n) & (1ULL << 46) ? 46 : \ - (n) & (1ULL << 45) ? 45 : \ - (n) & (1ULL << 44) ? 44 : \ - (n) & (1ULL << 43) ? 43 : \ - (n) & (1ULL << 42) ? 42 : \ - (n) & (1ULL << 41) ? 41 : \ - (n) & (1ULL << 40) ? 40 : \ - (n) & (1ULL << 39) ? 39 : \ - (n) & (1ULL << 38) ? 38 : \ - (n) & (1ULL << 37) ? 37 : \ - (n) & (1ULL << 36) ? 36 : \ - (n) & (1ULL << 35) ? 35 : \ - (n) & (1ULL << 34) ? 34 : \ - (n) & (1ULL << 33) ? 33 : \ - (n) & (1ULL << 32) ? 32 : \ - (n) & (1ULL << 31) ? 31 : \ - (n) & (1ULL << 30) ? 30 : \ - (n) & (1ULL << 29) ? 29 : \ - (n) & (1ULL << 28) ? 28 : \ - (n) & (1ULL << 27) ? 27 : \ - (n) & (1ULL << 26) ? 26 : \ - (n) & (1ULL << 25) ? 25 : \ - (n) & (1ULL << 24) ? 24 : \ - (n) & (1ULL << 23) ? 23 : \ - (n) & (1ULL << 22) ? 22 : \ - (n) & (1ULL << 21) ? 21 : \ - (n) & (1ULL << 20) ? 20 : \ - (n) & (1ULL << 19) ? 19 : \ - (n) & (1ULL << 18) ? 18 : \ - (n) & (1ULL << 17) ? 17 : \ - (n) & (1ULL << 16) ? 16 : \ - (n) & (1ULL << 15) ? 15 : \ - (n) & (1ULL << 14) ? 14 : \ - (n) & (1ULL << 13) ? 13 : \ - (n) & (1ULL << 12) ? 12 : \ - (n) & (1ULL << 11) ? 11 : \ - (n) & (1ULL << 10) ? 10 : \ - (n) & (1ULL << 9) ? 9 : \ - (n) & (1ULL << 8) ? 8 : \ - (n) & (1ULL << 7) ? 7 : \ - (n) & (1ULL << 6) ? 6 : \ - (n) & (1ULL << 5) ? 5 : \ - (n) & (1ULL << 4) ? 4 : \ - (n) & (1ULL << 3) ? 3 : \ - (n) & (1ULL << 2) ? 2 : \ - (n) & (1ULL << 1) ? 1 : \ - (n) & (1ULL << 0) ? 0 : \ - -1) : \ - (sizeof(n) <= 4) ? \ - fls((u32)(n)) - 1 : flsll((u64)(n)) - 1 \ -) - #define order_base_2(x) ilog2(roundup_pow_of_two(x)) #endif /* _LINUXKPI_LINUX_LOG2_H_ */ diff --git a/sys/dev/bxe/bxe.h b/sys/dev/bxe/bxe.h index 0c7e6232dbdb..79d2792f7d6f 100644 --- a/sys/dev/bxe/bxe.h +++ b/sys/dev/bxe/bxe.h @@ -126,16 +126,6 @@ #ifndef roundup #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif -#ifndef ilog2 -static inline -int bxe_ilog2(int x) -{ - int log = 0; - while (x >>= 1) log++; - return (log); -} -#define ilog2(x) bxe_ilog2(x) -#endif #include "ecore_sp.h" diff --git a/sys/dev/bxe/ecore_sp.h b/sys/dev/bxe/ecore_sp.h index f39c908f7530..917f27549c1b 100644 --- a/sys/dev/bxe/ecore_sp.h +++ b/sys/dev/bxe/ecore_sp.h @@ -159,7 +159,7 @@ typedef struct mtx ECORE_MUTEX_SPIN; #define ECORE_FREE(_s, _buf, _size) free(_buf, M_TEMP) #define SC_ILT(sc) ((sc)->ilt) -#define ILOG2(x) bxe_ilog2(x) +#define ILOG2(x) ilog2(x) #define ECORE_ILT_ZALLOC(x, y, size) \ do { \ diff --git a/sys/dev/cxgbe/osdep.h b/sys/dev/cxgbe/osdep.h index 39675339dd2c..b8692692fd43 100644 --- a/sys/dev/cxgbe/osdep.h +++ b/sys/dev/cxgbe/osdep.h @@ -130,14 +130,6 @@ typedef boolean_t bool; #define PCI_EXP_LNKSTA_NLW PCIEM_LINK_STA_WIDTH #define PCI_EXP_DEVCTL2 PCIER_DEVICE_CTL2 -static inline int -ilog2(long x) -{ - KASSERT(x > 0 && powerof2(x), ("%s: invalid arg %ld", __func__, x)); - - return (flsl(x) - 1); -} - static inline char * strstrip(char *s) { diff --git a/sys/dev/enetc/enetc_hw.h b/sys/dev/enetc/enetc_hw.h index 507c4657453d..323d5529f50a 100644 --- a/sys/dev/enetc/enetc_hw.h +++ b/sys/dev/enetc/enetc_hw.h @@ -9,7 +9,6 @@ #define BIT(x) (1UL << (x)) #define GENMASK(h, l) (((~0U) - (1U << (l)) + 1) & (~0U >> (32 - 1 - (h)))) -#define ilog2(x) (flsl(x) - 1) #define PCI_VENDOR_FREESCALE 0x1957 diff --git a/sys/dev/mana/gdma_util.h b/sys/dev/mana/gdma_util.h index 822c831b9d70..37c2653d5ec9 100644 --- a/sys/dev/mana/gdma_util.h +++ b/sys/dev/mana/gdma_util.h @@ -170,15 +170,6 @@ find_first_zero_bit(const unsigned long *p, unsigned long max) return (max); } -static inline unsigned long -ilog2(unsigned long x) -{ - unsigned long log = x; - while (x >>= 1) - log++; - return (log); -} - static inline unsigned long roundup_pow_of_two(unsigned long x) { diff --git a/sys/dev/qat/qat/qat_ocf.c b/sys/dev/qat/qat/qat_ocf.c index 8958c7b82e49..b25135b6a678 100644 --- a/sys/dev/qat/qat/qat_ocf.c +++ b/sys/dev/qat/qat/qat_ocf.c @@ -517,7 +517,7 @@ qat_ocf_session_init(device_t dev, M_NOWAIT, 0, ~1UL, - 1 << (bsrl(sessionCtxSize - 1) + 1), + 1 << (ilog2(sessionCtxSize - 1) + 1), 0); if (NULL == sessionCtx) { device_printf(dev, "unable to allocate memory for session\n"); diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index bf643e6da21f..4bed57b5afbf 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -63,15 +63,6 @@ bsfl(u_int mask) return (result); } -static __inline __pure2 u_int -bsrl(u_int mask) -{ - u_int result; - - __asm("bsrl %1,%0" : "=r" (result) : "rm" (mask) : "cc"); - return (result); -} - static __inline void clflush(u_long addr) { diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index fe84a2a3c213..9f96255ea00e 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -239,7 +239,6 @@ static __inline uint32_t tlb_calc_wimg(vm_paddr_t pa, vm_memattr_t ma); static vm_size_t tsize2size(unsigned int); static unsigned int size2tsize(vm_size_t); -static unsigned long ilog2(unsigned long); static void set_mas4_defaults(void); diff --git a/sys/powerpc/booke/pmap_32.c b/sys/powerpc/booke/pmap_32.c index 580c54c3642f..efeefb6a91c5 100644 --- a/sys/powerpc/booke/pmap_32.c +++ b/sys/powerpc/booke/pmap_32.c @@ -116,7 +116,6 @@ static unsigned int kernel_ptbls; /* Number of KVA ptbls. */ #define VM_MAPDEV_BASE ((vm_offset_t)VM_MAXUSER_ADDRESS + PAGE_SIZE) static void tid_flush(tlbtid_t tid); -static unsigned long ilog2(unsigned long); /**************************************************************************/ /* Page table management */ @@ -931,18 +930,6 @@ mmu_booke_quick_remove_page(vm_offset_t addr) /* TID handling */ /**************************************************************************/ -/* - * Return the largest uint value log such that 2^log <= num. - */ -static unsigned long -ilog2(unsigned long num) -{ - long lz; - - __asm ("cntlzw %0, %1" : "=r" (lz) : "r" (num)); - return (31 - lz); -} - /* * Invalidate all TLB0 entries which match the given TID. Note this is * dedicated for cases when invalidations should NOT be propagated to other diff --git a/sys/powerpc/booke/pmap_64.c b/sys/powerpc/booke/pmap_64.c index 802f37e921a4..affa08ebee3f 100644 --- a/sys/powerpc/booke/pmap_64.c +++ b/sys/powerpc/booke/pmap_64.c @@ -125,7 +125,6 @@ static pte_t ****kernel_ptbl_root; #define VM_MAPDEV_PA_MAX 0x4000000000000000 /* Don't encroach on DMAP */ static void tid_flush(tlbtid_t tid); -static unsigned long ilog2(unsigned long); /**************************************************************************/ /* Page table management */ @@ -746,18 +745,6 @@ mmu_booke_quick_remove_page(vm_offset_t addr) /* TID handling */ /**************************************************************************/ -/* - * Return the largest uint value log such that 2^log <= num. - */ -static unsigned long -ilog2(unsigned long num) -{ - long lz; - - __asm ("cntlzd %0, %1" : "=r" (lz) : "r" (num)); - return (63 - lz); -} - /* * Invalidate all TLB0 entries which match the given TID. Note this is * dedicated for cases when invalidations should NOT be propagated to other diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 6fbb97e48dac..84d982c43a76 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -186,6 +186,112 @@ flsll(long long mask) 8 * sizeof(mask) - __builtin_clzll((unsigned long long)mask)); } +static __inline __pure2 int +ilog2_int(int n) +{ + + MPASS(n != 0); + return (8 * sizeof(n) - 1 - __builtin_clz((u_int)n)); +} + +static __inline __pure2 int +ilog2_long(long n) +{ + + MPASS(n != 0); + return (8 * sizeof(n) - 1 - __builtin_clzl((u_long)n)); +} + +static __inline __pure2 int +ilog2_long_long(long long n) +{ + + MPASS(n != 0); + return (8 * sizeof(n) - 1 - + __builtin_clzll((unsigned long long)n)); +} + +#define ilog2_var(n) \ + _Generic((n), \ + default: ilog2_int, \ + long: ilog2_long, \ + unsigned long: ilog2_long, \ + long long: ilog2_long_long, \ + unsigned long long: ilog2_long_long \ + )(n) + +#define ilog2(n) \ +( \ + __builtin_constant_p(n) ? ( \ + (n) < 1 ? -1 : \ + (n) & (1ULL << 63) ? 63 : \ + (n) & (1ULL << 62) ? 62 : \ + (n) & (1ULL << 61) ? 61 : \ + (n) & (1ULL << 60) ? 60 : \ + (n) & (1ULL << 59) ? 59 : \ + (n) & (1ULL << 58) ? 58 : \ + (n) & (1ULL << 57) ? 57 : \ + (n) & (1ULL << 56) ? 56 : \ + (n) & (1ULL << 55) ? 55 : \ + (n) & (1ULL << 54) ? 54 : \ + (n) & (1ULL << 53) ? 53 : \ + (n) & (1ULL << 52) ? 52 : \ + (n) & (1ULL << 51) ? 51 : \ + (n) & (1ULL << 50) ? 50 : \ + (n) & (1ULL << 49) ? 49 : \ + (n) & (1ULL << 48) ? 48 : \ + (n) & (1ULL << 47) ? 47 : \ + (n) & (1ULL << 46) ? 46 : \ + (n) & (1ULL << 45) ? 45 : \ + (n) & (1ULL << 44) ? 44 : \ + (n) & (1ULL << 43) ? 43 : \ + (n) & (1ULL << 42) ? 42 : \ + (n) & (1ULL << 41) ? 41 : \ + (n) & (1ULL << 40) ? 40 : \ + (n) & (1ULL << 39) ? 39 : \ + (n) & (1ULL << 38) ? 38 : \ + (n) & (1ULL << 37) ? 37 : \ + (n) & (1ULL << 36) ? 36 : \ + (n) & (1ULL << 35) ? 35 : \ + (n) & (1ULL << 34) ? 34 : \ + (n) & (1ULL << 33) ? 33 : \ + (n) & (1ULL << 32) ? 32 : \ + (n) & (1ULL << 31) ? 31 : \ + (n) & (1ULL << 30) ? 30 : \ + (n) & (1ULL << 29) ? 29 : \ + (n) & (1ULL << 28) ? 28 : \ + (n) & (1ULL << 27) ? 27 : \ + (n) & (1ULL << 26) ? 26 : \ + (n) & (1ULL << 25) ? 25 : \ + (n) & (1ULL << 24) ? 24 : \ + (n) & (1ULL << 23) ? 23 : \ + (n) & (1ULL << 22) ? 22 : \ + (n) & (1ULL << 21) ? 21 : \ + (n) & (1ULL << 20) ? 20 : \ + (n) & (1ULL << 19) ? 19 : \ + (n) & (1ULL << 18) ? 18 : \ + (n) & (1ULL << 17) ? 17 : \ + (n) & (1ULL << 16) ? 16 : \ + (n) & (1ULL << 15) ? 15 : \ + (n) & (1ULL << 14) ? 14 : \ + (n) & (1ULL << 13) ? 13 : \ + (n) & (1ULL << 12) ? 12 : \ + (n) & (1ULL << 11) ? 11 : \ + (n) & (1ULL << 10) ? 10 : \ + (n) & (1ULL << 9) ? 9 : \ + (n) & (1ULL << 8) ? 8 : \ + (n) & (1ULL << 7) ? 7 : \ + (n) & (1ULL << 6) ? 6 : \ + (n) & (1ULL << 5) ? 5 : \ + (n) & (1ULL << 4) ? 4 : \ + (n) & (1ULL << 3) ? 3 : \ + (n) & (1ULL << 2) ? 2 : \ + (n) & (1ULL << 1) ? 1 : \ + (n) & (1ULL << 0) ? 0 : \ + -1) : \ + ilog2_var(n) \ +) + #define bitcount64(x) __bitcount64((uint64_t)(x)) #define bitcount32(x) __bitcount32((uint32_t)(x)) #define bitcount16(x) __bitcount16((uint16_t)(x)) From nobody Mon Jun 3 17:14:04 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 4VtL190Wcjz5Ms4H; Mon, 03 Jun 2024 17:14:05 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtL18722vz4D0R; Mon, 3 Jun 2024 17:14:04 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717434845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Goo78YMjGJcDPxOzrR/uAXPZKJd55/7B16J3WtlU3KU=; b=Gin1bDd6mYzxxkaUvlcYGPS2vqHvlXsoayr411RLhvshmxx7he7vECYEouwK6Ae+fVU5QK rVi9JCvibwY/CCI+GYzslId2TlLKIb8gks5Q6SL2xvT3cFLB6qTxpnE6nOT59t6vdY3Ma2 WaH1D/RkTUc9xUYPYKRF6n/Sy6X0KQkOZJ8ergxTom+pC4c8gQIPzfDgZyxqsUfoHYOZYz ZVi5FAcvEs1sXDJdChY0ZvZQ4w7GVR3oDZuZIVpLB0rG2xRdDKcodnH/iAMDW5zN7v/vw0 mDLQmO0wtHvats5CYKV8O1huPVqK4VsYuzilpNjHLYyVQ6GoPszlUa6sXlou3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717434845; a=rsa-sha256; cv=none; b=JjiealKeZQ09Eou5vFUf2eE0HD3ba/Qq5jdeVJQGCXGvJzwrA0q/S/RM9TF6wQRupOKPYz bF15k57oZcUyj6qLhFeZJnXvq/N6kH158D4UjPy0QhAk5rS/SVMfWmpshjtHZw0GRCfh0O taxC9bz66pPp7xonK/DI5q1XPqIF2T7xqoon/ZQCRJRzkAPayPVWk7lhZHfq2VIJjOwtvN tc19/yjVeFTUtXnTPyH+qw0ywXfrN+hxwn1Pg4HdyNvuEP3lWpw2jmdcy3eCTivNKcEoWn /MrgwfSTm8OVLPZ3Fk19LpUKSlXsNXmGfdfYk/IewlP/L0YclyvKbCBxm7Op1g== 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=1717434845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Goo78YMjGJcDPxOzrR/uAXPZKJd55/7B16J3WtlU3KU=; b=OWx/YGS4Cagn4ns3ya1zxlxqfGXdP8MPCw83iZ9Wjgi2PlBdQMwWGjTkgEhAmI08R92w/x b1bKo8l30V4BBDk3ArDPaxTdRmXhDHhRBdUx0TkQ9ktiihZk0OlQJ5AINprPyLup9XQJmR k7qjO0yshJjQWMn2fJ+0UUmcCwOMvSo+t/bbK+87twhSdmRdez+uoIMVKqp7zT8M87dnKk bz7QydbL+SpyVlPF/G4eBQWNkCrwxnTzsZVLEnCcHIaUOM4xXjuK+luSHVqPgw9vm818RL pFgB7tBVA8PVGz2ygiiO8o3Jtl6RzQSKqIfmgVB5QUtihIRgS7JxPaaqksmpMQ== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VtL186Q2Rz11VP; Mon, 3 Jun 2024 17:14:04 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 192D93C019B; Mon, 3 Jun 2024 17:14:04 +0000 (UTC) Date: Mon, 3 Jun 2024 17:14:04 +0000 From: Brooks Davis To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: af8cafb2a380 - main - iovec: macros to manipulate len and base together Message-ID: References: <202406021843.452Ih9Us047105@gitrepo.freebsd.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <202406021843.452Ih9Us047105@gitrepo.freebsd.org> On Sun, Jun 02, 2024 at 06:43:09PM +0000, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=af8cafb2a38070907ed5c4d872599617ce9d6d48 > > commit af8cafb2a38070907ed5c4d872599617ce9d6d48 > Author: Brooks Davis > AuthorDate: 2024-06-02 18:36:55 +0000 > Commit: Brooks Davis > CommitDate: 2024-06-02 18:41:22 +0000 > > iovec: macros to manipulate len and base together > > A set of convenience macros to initialize struct iovec's and increment > the base and length together. > > IOVEC_INIT - sets iov_base and iov_len > IOVEC_INIT_CSTR - takes a string and sets iov_len to strlen + 1 > IOVEC_INIT_OBJ - takes an object and sets iov_len to sizeof obj > IOVEC_ADVANCE - increments iov_base and decrements iov_len I've got the vast majority of iovec initializations and simple uses of IOVEC_ADVANCE handled in CheriBSD. I'll be bringing those over in batches as time permits. It's straightforward, but files tend to have multiple unrelated changes so I need to extract the diffs by hand. I plan to leave contrib code alone for now. Thanks, Brooks From nobody Mon Jun 3 17:25:59 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 4VtLH908Lbz5Mt8v for ; Mon, 03 Jun 2024 17:26:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtLH75vf9z4DhC for ; Mon, 3 Jun 2024 17:26:11 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42136faf3aeso12865055e9.2 for ; Mon, 03 Jun 2024 10:26:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717435570; x=1718040370; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aotK3EbxMfIJbPwXG9b6gyGvEnCLD4+tut4M1NaEkW8=; b=DYFXhaPEzuLQu8QIrUZuY+G9n4z2GUvewMFJmH3Euy5SYWFP2Fe34jb0dLxZFmpMyf HAqnzFxVflaeH2gY/Dj4ZklHm0MWdCd22X3oqyUjCVietVJeCA0SX3AV8BezLOMFyNY3 YaODyk6/EHBLLjxDgsjyHdJI55gNh7JVQWHQVOLlyy78n0xBSWi5UX/xY7643oht2FiQ SPd19kS6XguctvSbwLXrIhg48O2hMoRNvYPmxyQs8kQwRKRKcN+J0ns/mA31wUHcmsbr FDMttCtF684CuC5v03a+NhxItkD0J1DYVL1DyO56vtd9cez8MBzqfrS1M2LY4X/KcN1f g5yQ== X-Forwarded-Encrypted: i=1; AJvYcCX68cqBq9D+MQ6/swx76OpVUgyYzESwKFSPOMhOkNhuE66I0nC0gP4AVr6EMN4oF6nOan/XBsf+i9bzysUCaFOSbR0qzt90A/1y2Xncys5A X-Gm-Message-State: AOJu0YwidngmmG2jFBMRwTJDadjGBwcZ/TbV/6w+n31uM6L3wvyIv2li Lc8ozrv5hdybskix/a2Mk+TVJWJlnF6phjCPBRYHEaWfW53/cqUD4aYccPci0Bj4DsB7xxnl6bA G X-Google-Smtp-Source: AGHT+IEXOOlSGiQ0e2oPMNJvI5I1LacTXMrv2Hl9GCUzRwNE8RAdAlvMP2weKvzMYPBZWPWFl9Roqw== X-Received: by 2002:a05:600c:4754:b0:421:2a0c:b5ad with SMTP id 5b1f17b1804b1-4212e049ccamr99693315e9.10.1717435570139; Mon, 03 Jun 2024 10:26:10 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04d9c73sm9287436f8f.58.2024.06.03.10.26.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2024 10:26:09 -0700 (PDT) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: git: 077f757d72e5 - main - newfs_msdos: align data area to VM page boundary by default From: Jessica Clarke In-Reply-To: <202406021227.452CRx8I007470@gitrepo.freebsd.org> Date: Mon, 3 Jun 2024 18:25:59 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6D077B35-48BA-4516-BAB7-0B23CD3AB042@freebsd.org> References: <202406021227.452CRx8I007470@gitrepo.freebsd.org> To: =?utf-8?Q?Stefan_E=C3=9Fer?= X-Mailer: Apple Mail (2.3774.500.171.1.1) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.995]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEFALL_USER(0.00)[jrtc27]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.52:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.52:from] X-Rspamd-Queue-Id: 4VtLH75vf9z4DhC On 2 Jun 2024, at 13:27, Stefan E=C3=9Fer wrote: >=20 > The branch main has been updated by se: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D077f757d72e561eb84193d8e58f63e96= e69b8096 >=20 > commit 077f757d72e561eb84193d8e58f63e96e69b8096 > Author: Stefan E=C3=9Fer > AuthorDate: 2024-06-02 12:07:52 +0000 > Commit: Stefan E=C3=9Fer > CommitDate: 2024-06-02 12:07:52 +0000 >=20 > newfs_msdos: align data area to VM page boundary by default >=20 > Without alignment, the data area will not be aligned with the = buffer > cache, leading to overhead, higher write multiplication on SSD = devices > and issues with very large cluster sizes (see PR 277414). >=20 > The -A option used to align the start of the root directory to a > multiple of the cluster size, which happens to align the start of = the > data area with a buffer page boundary in case of large clusters and > the default number of directory entries (512 entries requiring 16 = KB > for FAT12 or FAT16, FAT32 puts the root directory into the data = area). >=20 > This commit aligns the start of the data area with the page size, = if > neither -A nor -r is used. It changes -A to align the start of the > data area (end of the root directory) to a multiple of the cluster > size, since this is the alignment that prevents write = multiplication > due to clusters crossing erase block boundaries of a SSD device. > The -r option is unchanged and will prevent any automatic alignment > from occuring. Hi, This has completely broken[1] all of the Linux and macOS cross-build CI jobs (which pass -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP). Please either fix this promptly or back it out until you can do so. Jess [1] See https://github.com/freebsd/freebsd-src/actions/runs/9338256762 From nobody Mon Jun 3 17:49:45 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 4VtLpK3671z5MvkJ; Mon, 03 Jun 2024 17:49:45 +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 4VtLpK2SNRz4Gdm; Mon, 3 Jun 2024 17:49:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717436985; 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=VveQMbggL9xsGzl/g3lkNy6kEBmgkK7rhieKW0HOEgk=; b=LEgA4sbYJcEs1zvj0wGSKDEM8hMGT1+Cd4C4IvH3a1yiSFYWWNKKWkAwdgQn+G20uIzJSn DJOYI2F1e7gwvdQ4Bj/nVksHmjzJ9/fPb0OXkkq3ZnorhblKHZkNeSRyWFDLENKQXBcupy /ohVCUhpsERkRgLcVprJvmcG7Vqpvfrq8aNt3TXxsx5clfMC2tW2V+n05F0fdH2cgSNVQp Abf7+goGTikly7nde7l+n6ZlQtCxxXsQg9zxUsFzllWZV4LyQxNnSGnyN1+ssNOaJxc6Y0 DdbHkCdFl2raoqNenNSfxWgTJHutIT4DnhF0004GPo1zF8hoFjUZujnE4ovn8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717436985; a=rsa-sha256; cv=none; b=tGNJQ6TMFPSKGCVcVaCTrdsEXKueZOAS7T3UoWiJtP+Tdbn91RMw4jkW2lKIfJrIk3bKJA sxCE4in52PzEYza4wBQoeYnIJOap0wfv9RR5dfx1pOW5Dci9ga2uH75U/DIrNGLgLJLK/p SIQk9YdLVx+qGM9Fa7zVmf6o7Stt4hylyX+i/tKa568eAtJr/TDsStjoCWF/BiUfc40Yix 7dICjjDAOK8AVehDGOn47JR1xEVo3IoX17TeMvabUK2NDuN8JOKwFYsPMwIM4Ca6u5gpSJ iZ900wvgaIa6NPQKpJOFCLyjahK4dSO6SKyqlcThazf1fxKlsinVT1N2lXZ+aQ== 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=1717436985; 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=VveQMbggL9xsGzl/g3lkNy6kEBmgkK7rhieKW0HOEgk=; b=tDdp7PNXHwQEGGz68G/r+vZsbjdwMuxWfMNCp0GIRtGXYdudReJ7XPjYGr1HdqbLgxjIuK vpqo1qQPCRxOoOEvjh4qFOpmG1y+MDursbW5cukFpJa9zzxQmzGmGIgeuw8fKTjQ2fjGR0 4aOeaIuChFtn9GSuJtGC9S7CeTkrJaOFCb/cWi+FAVggio7VYS0Kg3PJ1vbVcmGls+5isi j8+n9xAUW3WdY+IkVI7C+bK14mnIHHr247ExgaXc/f5UM9MLCYdLJAjzObcn6Lj70ID3Km sUQ6R2+FfVxiymF7jGrGBUK4kLP2CEy2q6Ep4nx8WlLhf3RSEgcgh8WQq9fDsQ== 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 4VtLpK23SWzlDY; Mon, 3 Jun 2024 17:49:45 +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 453HnjJN097498; Mon, 3 Jun 2024 17:49:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453HnjKC097495; Mon, 3 Jun 2024 17:49:45 GMT (envelope-from git) Date: Mon, 3 Jun 2024 17:49:45 GMT Message-Id: <202406031749.453HnjKC097495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 574ef6506950 - main - subr_pctrie: use ilog2(x) instead of fls(x)-1 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 574ef650695088d56ea12df7da76155370286f9f Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=574ef650695088d56ea12df7da76155370286f9f commit 574ef650695088d56ea12df7da76155370286f9f Author: Doug Moore AuthorDate: 2024-06-03 17:45:45 +0000 Commit: Doug Moore CommitDate: 2024-06-03 17:45:45 +0000 subr_pctrie: use ilog2(x) instead of fls(x)-1 In three instances where fls(x)-1 is used, the compiler does not know that x is nonzero and so adds needless zero checks. Using ilog(x) instead saves, in each instance, about 4 instructions, including a conditional, and 16 or so bytes, on an amd64 build. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D45330 --- sys/kern/subr_pctrie.c | 6 +-- sys/vm/_vm_phys.h | 4 +- sys/vm/vm_page.c | 5 +- sys/vm/vm_phys.c | 123 ++++++++++++++++++++++++++++++------------------- sys/vm/vm_phys.h | 2 +- sys/vm/vm_reserv.c | 33 +++++++------ 6 files changed, 104 insertions(+), 69 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 85df0a9bf9e4..76f4ee17a8ca 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -350,7 +350,7 @@ pctrie_insert_node(void *parentp, struct pctrie_node *parent, uint64_t *val) "uint64 too wide"); _Static_assert(sizeof(uint64_t) * NBBY <= (1 << (sizeof(parent->pn_clev) * NBBY)), "pn_clev too narrow"); - parent->pn_clev = rounddown(flsll(index ^ newind) - 1, PCTRIE_WIDTH); + parent->pn_clev = rounddown(ilog2(index ^ newind), PCTRIE_WIDTH); parent->pn_owner = PCTRIE_COUNT; parent->pn_owner = index & -(parent->pn_owner << parent->pn_clev); @@ -546,14 +546,14 @@ pctrie_lookup_le(struct pctrie *ptree, uint64_t index) KASSERT((pred->pn_popmap & ((1 << slot) - 1)) != 0, ("%s: no popmap siblings before slot %d in node %p", __func__, slot, pred)); - slot = fls(pred->pn_popmap & ((1 << slot) - 1)) - 1; + slot = ilog2(pred->pn_popmap & ((1 << slot) - 1)); pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); } while (!pctrie_isleaf(pred)) { KASSERT(pred->pn_popmap != 0, ("%s: no popmap children in node %p", __func__, pred)); - slot = fls(pred->pn_popmap) - 1; + slot = ilog2(pred->pn_popmap); pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); } diff --git a/sys/vm/_vm_phys.h b/sys/vm/_vm_phys.h index 36e1074568e9..e3cf09081537 100644 --- a/sys/vm/_vm_phys.h +++ b/sys/vm/_vm_phys.h @@ -51,6 +51,8 @@ struct vm_freelist { int lcnt; }; +typedef struct vm_freelist vm_freelist_tbl[VM_NFREEPOOL][VM_NFREEORDER_MAX]; + struct vm_phys_seg { vm_paddr_t start; vm_paddr_t end; @@ -62,7 +64,7 @@ struct vm_phys_seg { void *md_first; #endif int domain; - struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; + vm_freelist_tbl *free_queues; }; extern struct vm_phys_seg vm_phys_segs[]; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 9ba31cb9e1b3..7c2bed8339ed 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -509,7 +509,7 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segind) m->psind = 0; m->segind = segind; m->order = VM_NFREEORDER; - m->pool = VM_FREEPOOL_DEFAULT; + m->pool = VM_NFREEPOOL; m->valid = m->dirty = 0; pmap_page_init(m); } @@ -785,7 +785,8 @@ vm_page_startup(vm_offset_t vaddr) m = seg->first_page + atop(startp - seg->start); vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); - vm_phys_enqueue_contig(m, pagecount); + vm_phys_enqueue_contig(m, VM_FREEPOOL_DEFAULT, + pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 66ad9c13dceb..945e018710a1 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -669,6 +669,7 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, int tail) { vm_page_t m_buddy; + int pool = m->pool; while (oind > order) { oind--; @@ -676,6 +677,10 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, KASSERT(m_buddy->order == VM_NFREEORDER, ("vm_phys_split_pages: page %p has unexpected order %d", m_buddy, m_buddy->order)); + KASSERT(m_buddy->pool == VM_NFREEPOOL, + ("vm_phys_split_pages: page %p has unexpected pool %d", + m_buddy, m_buddy->pool)); + m_buddy->pool = pool; vm_freelist_add(fl, m_buddy, oind, tail); } } @@ -693,7 +698,8 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, * The physical page m's buddy must not be free. */ static void -vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) +vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, + int tail) { int order; @@ -709,6 +715,7 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) order = fls(npages) - 1; KASSERT(order < VM_NFREEORDER, ("%s: order %d is out of range", __func__, order)); + m->pool = pool; vm_freelist_add(fl, m, order, tail); m += 1 << order; npages -= 1 << order; @@ -729,7 +736,8 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) * parameter m. Otherwise, the physical page m's buddy must not be free. */ static vm_page_t -vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) +vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, + int tail) { int order; @@ -745,6 +753,7 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) order = ffs(npages) - 1; KASSERT(order < VM_NFREEORDER, ("vm_phys_enq_range: order %d is out of range", order)); + m->pool = pool; vm_freelist_add(fl, m, order, tail); m += 1 << order; npages -= 1 << order; @@ -752,18 +761,6 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) return (m); } -/* - * Set the pool for a contiguous, power of two-sized set of physical pages. - */ -static void -vm_phys_set_pool(int pool, vm_page_t m, int order) -{ - vm_page_t m_tmp; - - for (m_tmp = m; m_tmp < &m[1 << order]; m_tmp++) - m_tmp->pool = pool; -} - /* * Tries to allocate the specified number of pages from the specified pool * within the specified domain. Returns the actual number of allocated pages @@ -772,7 +769,8 @@ vm_phys_set_pool(int pool, vm_page_t m, int order) * The returned pages may not be physically contiguous. However, in contrast * to performing multiple, back-to-back calls to vm_phys_alloc_pages(..., 0), * calling this function once to allocate the desired number of pages will - * avoid wasted time in vm_phys_split_pages(). + * avoid wasted time in vm_phys_split_pages(). Sets the pool field for + * every allocated page. * * The free page queues for the specified domain must be locked. */ @@ -801,14 +799,18 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) vm_freelist_rem(fl, m, oind); avail = i + (1 << oind); end = imin(npages, avail); - while (i < end) + ma[i++] = m++; + while (i < end) { + m->pool = pool; ma[i++] = m++; + } if (i == npages) { /* * Return excess pages to fl. Its order * [0, oind) queues are empty. */ - vm_phys_enq_range(m, avail - i, fl, 1); + vm_phys_enq_range(m, avail - i, fl, + pool, 1); return (npages); } } @@ -819,11 +821,12 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) while ((m = TAILQ_FIRST(&alt[oind].pl)) != NULL) { vm_freelist_rem(alt, m, oind); - vm_phys_set_pool(pool, m, oind); avail = i + (1 << oind); end = imin(npages, avail); - while (i < end) + do { + m->pool = pool; ma[i++] = m++; + } while (i < end); if (i == npages) { /* * Return excess pages to fl. @@ -831,7 +834,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) * are empty. */ vm_phys_enq_range(m, avail - i, - fl, 1); + fl, pool, 1); return (npages); } } @@ -843,7 +846,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) /* * Allocate a contiguous, power of two-sized set of physical pages - * from the free lists. + * from the free lists. Sets the pool field in the first page only. * * The free page queues must be locked. */ @@ -864,7 +867,8 @@ vm_phys_alloc_pages(int domain, int pool, int order) /* * Allocate a contiguous, power of two-sized set of physical pages from the * specified free list. The free list must be specified using one of the - * manifest constants VM_FREELIST_*. + * manifest constants VM_FREELIST_*. Sets the pool field in the first page + * only. * * The free page queues must be locked. */ @@ -915,7 +919,7 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) m = TAILQ_FIRST(&alt[oind].pl); if (m != NULL) { vm_freelist_rem(alt, m, oind); - vm_phys_set_pool(pool, m, oind); + m->pool = pool; /* The order [order, oind) queues are empty. */ vm_phys_split_pages(m, oind, fl, order, 1); return (m); @@ -1122,7 +1126,8 @@ vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end) } /* - * Free a contiguous, power of two-sized set of physical pages. + * Free a contiguous, power of two-sized set of physical pages. Assumes that + * only the first page has a valid pool field. * * The free page queues must be locked. */ @@ -1133,18 +1138,19 @@ vm_phys_free_pages(vm_page_t m, int order) struct vm_phys_seg *seg; vm_paddr_t pa; vm_page_t m_buddy; + int pool = m->pool; KASSERT(m->order == VM_NFREEORDER, ("vm_phys_free_pages: page %p has unexpected order %d", m, m->order)); - KASSERT(m->pool < VM_NFREEPOOL, - ("vm_phys_free_pages: page %p has unexpected pool %d", - m, m->pool)); + KASSERT(pool < VM_NFREEPOOL, + ("vm_phys_free_pages: page %p has unexpected pool %d", m, pool)); KASSERT(order < VM_NFREEORDER, ("vm_phys_free_pages: order %d is out of range", order)); seg = &vm_phys_segs[m->segind]; vm_domain_free_assert_locked(VM_DOMAIN(seg->domain)); if (order < VM_NFREEORDER - 1) { + vm_page_t m_start = m; pa = VM_PAGE_TO_PHYS(m); do { pa ^= ((vm_paddr_t)1 << (PAGE_SHIFT + order)); @@ -1155,25 +1161,28 @@ vm_phys_free_pages(vm_page_t m, int order) break; fl = (*seg->free_queues)[m_buddy->pool]; vm_freelist_rem(fl, m_buddy, order); - if (m_buddy->pool != m->pool) - vm_phys_set_pool(m->pool, m_buddy, order); + m_buddy->pool = VM_NFREEPOOL; order++; pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1); m = &seg->first_page[atop(pa - seg->start)]; } while (order < VM_NFREEORDER - 1); + if (m != m_start) { + m_start->pool = VM_NFREEPOOL; + m->pool = pool; + } } - fl = (*seg->free_queues)[m->pool]; + fl = (*seg->free_queues)[pool]; vm_freelist_add(fl, m, order, 1); } /* - * Free a contiguous, arbitrarily sized set of physical pages, without - * merging across set boundaries. + * Free a contiguous, arbitrarily sized set of physical pages, without merging + * across set boundaries. Assumes no pages have a valid pool field. * * The free page queues must be locked. */ void -vm_phys_enqueue_contig(vm_page_t m, u_long npages) +vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) { struct vm_freelist *fl; struct vm_phys_seg *seg; @@ -1187,14 +1196,15 @@ vm_phys_enqueue_contig(vm_page_t m, u_long npages) */ vm_domain_free_assert_locked(vm_pagequeue_domain(m)); seg = &vm_phys_segs[m->segind]; - fl = (*seg->free_queues)[m->pool]; + fl = (*seg->free_queues)[pool]; m_end = m + npages; /* Free blocks of increasing size. */ lo = atop(VM_PAGE_TO_PHYS(m)); if (m < m_end && (diff = lo ^ (lo + npages - 1)) != 0) { order = min(flsll(diff) - 1, VM_NFREEORDER - 1); - m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, 1); + m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, + pool, 1); } /* Free blocks of maximum size. */ @@ -1203,15 +1213,17 @@ vm_phys_enqueue_contig(vm_page_t m, u_long npages) KASSERT(seg == &vm_phys_segs[m->segind], ("%s: page range [%p,%p) spans multiple segments", __func__, m_end - npages, m)); + m->pool = pool; vm_freelist_add(fl, m, order, 1); m += 1 << order; } /* Free blocks of diminishing size. */ - vm_phys_enq_beg(m, m_end - m, fl, 1); + vm_phys_enq_beg(m, m_end - m, fl, pool, 1); } /* * Free a contiguous, arbitrarily sized set of physical pages. + * Assumes that every page has the same, valid, pool field value. * * The free page queues must be locked. */ @@ -1221,17 +1233,22 @@ vm_phys_free_contig(vm_page_t m, u_long npages) vm_paddr_t lo; vm_page_t m_start, m_end; unsigned max_order, order_start, order_end; + int pool = m->pool; + + KASSERT(pool < VM_NFREEPOOL, + ("%s: pool %d is out of range", __func__, pool)); vm_domain_free_assert_locked(vm_pagequeue_domain(m)); lo = atop(VM_PAGE_TO_PHYS(m)); max_order = min(flsll(lo ^ (lo + npages)) - 1, VM_NFREEORDER - 1); - - m_start = m; + m_end = m + npages; + for (m_start = m; m < m_end; m++) + m->pool = VM_NFREEPOOL; + m = m_start; order_start = ffsll(lo) - 1; if (order_start < max_order) m_start += 1 << order_start; - m_end = m + npages; order_end = ffsll(lo + npages) - 1; if (order_end < max_order) m_end -= 1 << order_end; @@ -1240,11 +1257,15 @@ vm_phys_free_contig(vm_page_t m, u_long npages) * end of the range last. */ if (m_start < m_end) - vm_phys_enqueue_contig(m_start, m_end - m_start); - if (order_start < max_order) + vm_phys_enqueue_contig(m_start, pool, m_end - m_start); + if (order_start < max_order) { + m->pool = pool; vm_phys_free_pages(m, order_start); - if (order_end < max_order) + } + if (order_end < max_order) { + m_end->pool = pool; vm_phys_free_pages(m_end, order_end); + } } /* @@ -1292,7 +1313,7 @@ vm_phys_unfree_page(vm_page_t m) struct vm_phys_seg *seg; vm_paddr_t pa, pa_half; vm_page_t m_set, m_tmp; - int order; + int order, pool; /* * First, find the contiguous, power of two-sized set of free @@ -1324,7 +1345,8 @@ vm_phys_unfree_page(vm_page_t m) * is larger than a page, shrink "m_set" by returning the half * of "m_set" that does not contain "m" to the free lists. */ - fl = (*seg->free_queues)[m_set->pool]; + pool = m_set->pool; + fl = (*seg->free_queues)[pool]; order = m_set->order; vm_freelist_rem(fl, m_set, order); while (order > 0) { @@ -1336,8 +1358,10 @@ vm_phys_unfree_page(vm_page_t m) m_tmp = m_set; m_set = &seg->first_page[atop(pa_half - seg->start)]; } + m_tmp->pool = pool; vm_freelist_add(fl, m_tmp, order, 0); } + m_set->pool = pool; KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency")); return (true); } @@ -1477,7 +1501,8 @@ vm_phys_find_queues_contig( * alignment of the first physical page in the set. If the given value * "boundary" is non-zero, then the set of physical pages cannot cross * any physical address boundary that is a multiple of that value. Both - * "alignment" and "boundary" must be a power of two. + * "alignment" and "boundary" must be a power of two. Sets the pool + * field in every allocated page. */ vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, @@ -1536,14 +1561,16 @@ vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, fl = (*queues)[m->pool]; oind = m->order; vm_freelist_rem(fl, m, oind); - if (m->pool != VM_FREEPOOL_DEFAULT) - vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, oind); } /* Return excess pages to the free lists. */ fl = (*queues)[VM_FREEPOOL_DEFAULT]; - vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, 0); + vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, + VM_FREEPOOL_DEFAULT, 0); /* Return page verified to satisfy conditions of request. */ + for (m = m_run; m < &m_run[npages]; m++) + m->pool = VM_FREEPOOL_DEFAULT; + pa_start = VM_PAGE_TO_PHYS(m_run); KASSERT(low <= pa_start, ("memory allocated below minimum requested range")); diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index 1f502ad745c4..8b2d2f7e2251 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -66,7 +66,7 @@ vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); -void vm_phys_enqueue_contig(vm_page_t m, u_long npages); +void vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index a4bbccdfb428..80f62981dee0 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -889,30 +889,35 @@ out: static void vm_reserv_break(vm_reserv_t rv) { - int hi, lo, pos; + int pool, pos, pos0, pos1; vm_reserv_assert_locked(rv); CTR5(KTR_VM, "%s: rv %p object %p popcnt %d inpartpop %d", __FUNCTION__, rv, rv->object, rv->popcnt, rv->inpartpopq); vm_reserv_remove(rv); rv->pages->psind = 0; - hi = lo = -1; - pos = 0; - for (;;) { - bit_ff_at(rv->popmap, pos, VM_LEVEL_0_NPAGES, lo != hi, &pos); - if (lo == hi) { - if (pos == -1) - break; - lo = pos; - continue; - } + pool = rv->pages->pool; + rv->pages->pool = VM_NFREEPOOL; + pos0 = bit_test(rv->popmap, 0) ? -1 : 0; + pos1 = -1 - pos0; + for (pos = 0; pos < VM_LEVEL_0_NPAGES; ) { + /* Find the first different bit after pos. */ + bit_ff_at(rv->popmap, pos + 1, VM_LEVEL_0_NPAGES, + pos1 < pos0, &pos); if (pos == -1) pos = VM_LEVEL_0_NPAGES; - hi = pos; + if (pos0 <= pos1) { + /* Set pool for pages from pos1 to pos. */ + pos0 = pos1; + while (pos0 < pos) + rv->pages[pos0++].pool = pool; + continue; + } + /* Free unused pages from pos0 to pos. */ + pos1 = pos; vm_domain_free_lock(VM_DOMAIN(rv->domain)); - vm_phys_enqueue_contig(&rv->pages[lo], hi - lo); + vm_phys_enqueue_contig(&rv->pages[pos0], pool, pos1 - pos0); vm_domain_free_unlock(VM_DOMAIN(rv->domain)); - lo = hi; } bit_nclear(rv->popmap, 0, VM_LEVEL_0_NPAGES - 1); rv->popcnt = 0; From nobody Mon Jun 3 17:50:02 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 4VtLpk1y20z5Mvn8; Mon, 03 Jun 2024 17:50:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtLpj6lJ8z4Gtb; Mon, 3 Jun 2024 17:50:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id E8BZsUKQY2Ui5EBorsIQrm; Mon, 03 Jun 2024 17:50:05 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id EBopsAefrWhyfEBoqskJLu; Mon, 03 Jun 2024 17:50:05 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=MenPuI/f c=1 sm=1 tr=0 ts=665e024d a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=T1WGqf2p2xoA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=gdmwz_W1BZgnn1yQzGQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 11AAB862; Mon, 03 Jun 2024 10:50:03 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 07A7430E; Mon, 03 Jun 2024 10:50:03 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Jessica Clarke cc: =?utf-8?Q?Stefan_E=C3=9Fer?= , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 077f757d72e5 - main - newfs_msdos: align data area to VM page boundary by default In-reply-to: <6D077B35-48BA-4516-BAB7-0B23CD3AB042@freebsd.org> References: <202406021227.452CRx8I007470@gitrepo.freebsd.org> <6D077B35-48BA-4516-BAB7-0B23CD3AB042@freebsd.org> Comments: In-reply-to Jessica Clarke message dated "Mon, 03 Jun 2024 18:25:59 +0100." 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=us-ascii Date: Mon, 03 Jun 2024 10:50:02 -0700 Message-Id: <20240603175003.07A7430E@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEF3Z7rLHFm2F9nv0sdg30FL+tI4E7qJmh+RJCRiTDDk/nhnIUV5yKo3GLND7UJVvmw2QowU/udaJQHnEp22G4o6+yJFCZBwx+jxxvyDKdqWooMCsEx4 i7YFOQYw6ct8Yd/m2iRdoaO5CTRqtbIz4h2/bGcRz8OkQDraF+BAoK5Oe8XpEiKv6Ls5BIXxu6/mfoQrBZjWlnUOnnsn6/L4W++SHUtK/Rq2UhfrR37xTeVg oA5RQ5rbwiIQU1I3EmkNLVquIXy0DcTAUeulaTWxd3xi6EH1qGq5UhNhC9nKKlgNZtJMW+doWtqGvhXJ0lEN/EqpYRV0+hnGfWEc2TUtVkz5SkZJNsTUj0LZ M4iWBFVq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4VtLpj6lJ8z4Gtb In message <6D077B35-48BA-4516-BAB7-0B23CD3AB042@freebsd.org>, Jessica Clarke w rites: > On 2 Jun 2024, at 13:27, Stefan E=C3=9Fer wrote: > >=20 > > The branch main has been updated by se: > >=20 > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D077f757d72e561eb84193d8e58f63e96= > e69b8096 > >=20 > > commit 077f757d72e561eb84193d8e58f63e96e69b8096 > > Author: Stefan E=C3=9Fer > > AuthorDate: 2024-06-02 12:07:52 +0000 > > Commit: Stefan E=C3=9Fer > > CommitDate: 2024-06-02 12:07:52 +0000 > >=20 > > newfs_msdos: align data area to VM page boundary by default > >=20 > > Without alignment, the data area will not be aligned with the = > buffer > > cache, leading to overhead, higher write multiplication on SSD = > devices > > and issues with very large cluster sizes (see PR 277414). > >=20 > > The -A option used to align the start of the root directory to a > > multiple of the cluster size, which happens to align the start of = > the > > data area with a buffer page boundary in case of large clusters and > > the default number of directory entries (512 entries requiring 16 = > KB > > for FAT12 or FAT16, FAT32 puts the root directory into the data = > area). > >=20 > > This commit aligns the start of the data area with the page size, = > if > > neither -A nor -r is used. It changes -A to align the start of the > > data area (end of the root directory) to a multiple of the cluster > > size, since this is the alignment that prevents write = > multiplication > > due to clusters crossing erase block boundaries of a SSD device. > > The -r option is unchanged and will prevent any automatic alignment > > from occuring. > > Hi, > This has completely broken[1] all of the Linux and macOS cross-build CI > jobs (which pass -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP). Please either fix > this promptly or back it out until you can do so. > > Jess > > [1] See https://github.com/freebsd/freebsd-src/actions/runs/9338256762 > Because PAGE_SIZE is undefined during non-FreeBSD prebuild phase. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Jun 3 18:08:15 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 4VtMCg3Ynpz5JkXl; Mon, 03 Jun 2024 18:08:15 +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 4VtMCg3Cr7z4Jp2; Mon, 3 Jun 2024 18:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717438095; 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=3oCjMTbIfjiJ4JbiSPOvWbHyoI+fqWT7yy4Ku/8Rcsg=; b=Mfk9Yp9w0zHC0ArlXYTjw4qhez+hEjmBx0uLSjGDXueOwGGC46Lq2L3X6aNL1sqg8I1+2c HUKP1AdGXMSqF6NiJ3IEH1jqoNKQK6SWbhkyubHMaQ2wJEximdGxH9SzKgi3BNESoFhdI/ cUqNaUpb3grS2H34iy5h2lhQvpKxu7RLfFB02XAc7FLN6BrZJmD8vJzJUfn+AFGlurgMNJ CrGLF65rr5H6j1NOzD3qPEdmvs6Hyudibz7yaPqy+RrR8MSgdhDEuYtf+b4rxopWHyXPFv nJqJY8sLW71I45tnSZ/QZzRcFYPFNxc6K6BwW7ptUnPI0V48pm615fX5xLo+dA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717438095; a=rsa-sha256; cv=none; b=Lx8VZqDRz0F6HsHZYDsVvVXNOxbZLMVI3X6yDWpyQMT6QsT7Hv1c0UmAO2MxVXkwmk8ehv QsWpQFNmx9iFpTcqZaAiMkFXSAo1q5q2By3GlHnn27IBNrXmQL8cGfzWOybGzCt0YmaFGr cpeUJW8TDYm60NrDvujH4KQmrlj8AG+OMhRKFth+qllomk8A2MpEKnzAsmwupO7CbKQBnr DmfbV/SU/owv8ohilKQBPK1t6P5uw+lacnUY5XrNudFf+5/WrrDIbkg8CHF+drRXTuBLGt xeliFQR8ETqYqrdzBaUC1ZhnA0Vn6dL5oyOxRJ4TdqS+tT05OR0ahptY95ZCww== 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=1717438095; 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=3oCjMTbIfjiJ4JbiSPOvWbHyoI+fqWT7yy4Ku/8Rcsg=; b=wSxsrJRqSt8j62/7FDIM4+tPwRbOT2DZubYUWmINdMdx4P+Z6Y84t8Yg4ZySMQymdlValH RUBmfSm+jzLyNflE2+DHi1lWZbl3l1wuhWXEiELkmceuixXPGDOQ1hq34OejzekBPnIKGb YbSw+FNKxJdtB+MNyj7Ugr9hNnj1sMj8mQDookCjEsXcsshpbplYAv+5QVEiO8Xaiof17f 7xzE+ee0Dnm0r1WzdaoJFy0A7n0aAAwkdwTTgI3vxNpWW0yHKvl1k0wdMijJipfAyfmepW /fOyMZteNgbX9FI6ebLnVY11NMrCIExStpexFVFuSDz+sjOXorDOxVfy68aumA== 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 4VtMCg2q0Bzktt; Mon, 3 Jun 2024 18:08:15 +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 453I8FFX031944; Mon, 3 Jun 2024 18:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453I8Fi8031941; Mon, 3 Jun 2024 18:08:15 GMT (envelope-from git) Date: Mon, 3 Jun 2024 18:08:15 GMT Message-Id: <202406031808.453I8Fi8031941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: e3537f9235ba - main - Revert "subr_pctrie: use ilog2(x) instead of fls(x)-1" 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3537f9235ba237b7f35d88c3d8147c164f2a86c Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=e3537f9235ba237b7f35d88c3d8147c164f2a86c commit e3537f9235ba237b7f35d88c3d8147c164f2a86c Author: Doug Moore AuthorDate: 2024-06-03 18:07:42 +0000 Commit: Doug Moore CommitDate: 2024-06-03 18:07:42 +0000 Revert "subr_pctrie: use ilog2(x) instead of fls(x)-1" This reverts commit 574ef650695088d56ea12df7da76155370286f9f. --- sys/kern/subr_pctrie.c | 6 +-- sys/vm/_vm_phys.h | 4 +- sys/vm/vm_page.c | 5 +- sys/vm/vm_phys.c | 123 +++++++++++++++++++------------------------------ sys/vm/vm_phys.h | 2 +- sys/vm/vm_reserv.c | 33 ++++++------- 6 files changed, 69 insertions(+), 104 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 76f4ee17a8ca..85df0a9bf9e4 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -350,7 +350,7 @@ pctrie_insert_node(void *parentp, struct pctrie_node *parent, uint64_t *val) "uint64 too wide"); _Static_assert(sizeof(uint64_t) * NBBY <= (1 << (sizeof(parent->pn_clev) * NBBY)), "pn_clev too narrow"); - parent->pn_clev = rounddown(ilog2(index ^ newind), PCTRIE_WIDTH); + parent->pn_clev = rounddown(flsll(index ^ newind) - 1, PCTRIE_WIDTH); parent->pn_owner = PCTRIE_COUNT; parent->pn_owner = index & -(parent->pn_owner << parent->pn_clev); @@ -546,14 +546,14 @@ pctrie_lookup_le(struct pctrie *ptree, uint64_t index) KASSERT((pred->pn_popmap & ((1 << slot) - 1)) != 0, ("%s: no popmap siblings before slot %d in node %p", __func__, slot, pred)); - slot = ilog2(pred->pn_popmap & ((1 << slot) - 1)); + slot = fls(pred->pn_popmap & ((1 << slot) - 1)) - 1; pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); } while (!pctrie_isleaf(pred)) { KASSERT(pred->pn_popmap != 0, ("%s: no popmap children in node %p", __func__, pred)); - slot = ilog2(pred->pn_popmap); + slot = fls(pred->pn_popmap) - 1; pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); } diff --git a/sys/vm/_vm_phys.h b/sys/vm/_vm_phys.h index e3cf09081537..36e1074568e9 100644 --- a/sys/vm/_vm_phys.h +++ b/sys/vm/_vm_phys.h @@ -51,8 +51,6 @@ struct vm_freelist { int lcnt; }; -typedef struct vm_freelist vm_freelist_tbl[VM_NFREEPOOL][VM_NFREEORDER_MAX]; - struct vm_phys_seg { vm_paddr_t start; vm_paddr_t end; @@ -64,7 +62,7 @@ struct vm_phys_seg { void *md_first; #endif int domain; - vm_freelist_tbl *free_queues; + struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; }; extern struct vm_phys_seg vm_phys_segs[]; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 7c2bed8339ed..9ba31cb9e1b3 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -509,7 +509,7 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segind) m->psind = 0; m->segind = segind; m->order = VM_NFREEORDER; - m->pool = VM_NFREEPOOL; + m->pool = VM_FREEPOOL_DEFAULT; m->valid = m->dirty = 0; pmap_page_init(m); } @@ -785,8 +785,7 @@ vm_page_startup(vm_offset_t vaddr) m = seg->first_page + atop(startp - seg->start); vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); - vm_phys_enqueue_contig(m, VM_FREEPOOL_DEFAULT, - pagecount); + vm_phys_enqueue_contig(m, pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 945e018710a1..66ad9c13dceb 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -669,7 +669,6 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, int tail) { vm_page_t m_buddy; - int pool = m->pool; while (oind > order) { oind--; @@ -677,10 +676,6 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, KASSERT(m_buddy->order == VM_NFREEORDER, ("vm_phys_split_pages: page %p has unexpected order %d", m_buddy, m_buddy->order)); - KASSERT(m_buddy->pool == VM_NFREEPOOL, - ("vm_phys_split_pages: page %p has unexpected pool %d", - m_buddy, m_buddy->pool)); - m_buddy->pool = pool; vm_freelist_add(fl, m_buddy, oind, tail); } } @@ -698,8 +693,7 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, * The physical page m's buddy must not be free. */ static void -vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, - int tail) +vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) { int order; @@ -715,7 +709,6 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, order = fls(npages) - 1; KASSERT(order < VM_NFREEORDER, ("%s: order %d is out of range", __func__, order)); - m->pool = pool; vm_freelist_add(fl, m, order, tail); m += 1 << order; npages -= 1 << order; @@ -736,8 +729,7 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, * parameter m. Otherwise, the physical page m's buddy must not be free. */ static vm_page_t -vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, - int tail) +vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) { int order; @@ -753,7 +745,6 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, order = ffs(npages) - 1; KASSERT(order < VM_NFREEORDER, ("vm_phys_enq_range: order %d is out of range", order)); - m->pool = pool; vm_freelist_add(fl, m, order, tail); m += 1 << order; npages -= 1 << order; @@ -761,6 +752,18 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, return (m); } +/* + * Set the pool for a contiguous, power of two-sized set of physical pages. + */ +static void +vm_phys_set_pool(int pool, vm_page_t m, int order) +{ + vm_page_t m_tmp; + + for (m_tmp = m; m_tmp < &m[1 << order]; m_tmp++) + m_tmp->pool = pool; +} + /* * Tries to allocate the specified number of pages from the specified pool * within the specified domain. Returns the actual number of allocated pages @@ -769,8 +772,7 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, * The returned pages may not be physically contiguous. However, in contrast * to performing multiple, back-to-back calls to vm_phys_alloc_pages(..., 0), * calling this function once to allocate the desired number of pages will - * avoid wasted time in vm_phys_split_pages(). Sets the pool field for - * every allocated page. + * avoid wasted time in vm_phys_split_pages(). * * The free page queues for the specified domain must be locked. */ @@ -799,18 +801,14 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) vm_freelist_rem(fl, m, oind); avail = i + (1 << oind); end = imin(npages, avail); - ma[i++] = m++; - while (i < end) { - m->pool = pool; + while (i < end) ma[i++] = m++; - } if (i == npages) { /* * Return excess pages to fl. Its order * [0, oind) queues are empty. */ - vm_phys_enq_range(m, avail - i, fl, - pool, 1); + vm_phys_enq_range(m, avail - i, fl, 1); return (npages); } } @@ -821,12 +819,11 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) while ((m = TAILQ_FIRST(&alt[oind].pl)) != NULL) { vm_freelist_rem(alt, m, oind); + vm_phys_set_pool(pool, m, oind); avail = i + (1 << oind); end = imin(npages, avail); - do { - m->pool = pool; + while (i < end) ma[i++] = m++; - } while (i < end); if (i == npages) { /* * Return excess pages to fl. @@ -834,7 +831,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) * are empty. */ vm_phys_enq_range(m, avail - i, - fl, pool, 1); + fl, 1); return (npages); } } @@ -846,7 +843,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) /* * Allocate a contiguous, power of two-sized set of physical pages - * from the free lists. Sets the pool field in the first page only. + * from the free lists. * * The free page queues must be locked. */ @@ -867,8 +864,7 @@ vm_phys_alloc_pages(int domain, int pool, int order) /* * Allocate a contiguous, power of two-sized set of physical pages from the * specified free list. The free list must be specified using one of the - * manifest constants VM_FREELIST_*. Sets the pool field in the first page - * only. + * manifest constants VM_FREELIST_*. * * The free page queues must be locked. */ @@ -919,7 +915,7 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) m = TAILQ_FIRST(&alt[oind].pl); if (m != NULL) { vm_freelist_rem(alt, m, oind); - m->pool = pool; + vm_phys_set_pool(pool, m, oind); /* The order [order, oind) queues are empty. */ vm_phys_split_pages(m, oind, fl, order, 1); return (m); @@ -1126,8 +1122,7 @@ vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end) } /* - * Free a contiguous, power of two-sized set of physical pages. Assumes that - * only the first page has a valid pool field. + * Free a contiguous, power of two-sized set of physical pages. * * The free page queues must be locked. */ @@ -1138,19 +1133,18 @@ vm_phys_free_pages(vm_page_t m, int order) struct vm_phys_seg *seg; vm_paddr_t pa; vm_page_t m_buddy; - int pool = m->pool; KASSERT(m->order == VM_NFREEORDER, ("vm_phys_free_pages: page %p has unexpected order %d", m, m->order)); - KASSERT(pool < VM_NFREEPOOL, - ("vm_phys_free_pages: page %p has unexpected pool %d", m, pool)); + KASSERT(m->pool < VM_NFREEPOOL, + ("vm_phys_free_pages: page %p has unexpected pool %d", + m, m->pool)); KASSERT(order < VM_NFREEORDER, ("vm_phys_free_pages: order %d is out of range", order)); seg = &vm_phys_segs[m->segind]; vm_domain_free_assert_locked(VM_DOMAIN(seg->domain)); if (order < VM_NFREEORDER - 1) { - vm_page_t m_start = m; pa = VM_PAGE_TO_PHYS(m); do { pa ^= ((vm_paddr_t)1 << (PAGE_SHIFT + order)); @@ -1161,28 +1155,25 @@ vm_phys_free_pages(vm_page_t m, int order) break; fl = (*seg->free_queues)[m_buddy->pool]; vm_freelist_rem(fl, m_buddy, order); - m_buddy->pool = VM_NFREEPOOL; + if (m_buddy->pool != m->pool) + vm_phys_set_pool(m->pool, m_buddy, order); order++; pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1); m = &seg->first_page[atop(pa - seg->start)]; } while (order < VM_NFREEORDER - 1); - if (m != m_start) { - m_start->pool = VM_NFREEPOOL; - m->pool = pool; - } } - fl = (*seg->free_queues)[pool]; + fl = (*seg->free_queues)[m->pool]; vm_freelist_add(fl, m, order, 1); } /* - * Free a contiguous, arbitrarily sized set of physical pages, without merging - * across set boundaries. Assumes no pages have a valid pool field. + * Free a contiguous, arbitrarily sized set of physical pages, without + * merging across set boundaries. * * The free page queues must be locked. */ void -vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) +vm_phys_enqueue_contig(vm_page_t m, u_long npages) { struct vm_freelist *fl; struct vm_phys_seg *seg; @@ -1196,15 +1187,14 @@ vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) */ vm_domain_free_assert_locked(vm_pagequeue_domain(m)); seg = &vm_phys_segs[m->segind]; - fl = (*seg->free_queues)[pool]; + fl = (*seg->free_queues)[m->pool]; m_end = m + npages; /* Free blocks of increasing size. */ lo = atop(VM_PAGE_TO_PHYS(m)); if (m < m_end && (diff = lo ^ (lo + npages - 1)) != 0) { order = min(flsll(diff) - 1, VM_NFREEORDER - 1); - m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, - pool, 1); + m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, 1); } /* Free blocks of maximum size. */ @@ -1213,17 +1203,15 @@ vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) KASSERT(seg == &vm_phys_segs[m->segind], ("%s: page range [%p,%p) spans multiple segments", __func__, m_end - npages, m)); - m->pool = pool; vm_freelist_add(fl, m, order, 1); m += 1 << order; } /* Free blocks of diminishing size. */ - vm_phys_enq_beg(m, m_end - m, fl, pool, 1); + vm_phys_enq_beg(m, m_end - m, fl, 1); } /* * Free a contiguous, arbitrarily sized set of physical pages. - * Assumes that every page has the same, valid, pool field value. * * The free page queues must be locked. */ @@ -1233,22 +1221,17 @@ vm_phys_free_contig(vm_page_t m, u_long npages) vm_paddr_t lo; vm_page_t m_start, m_end; unsigned max_order, order_start, order_end; - int pool = m->pool; - - KASSERT(pool < VM_NFREEPOOL, - ("%s: pool %d is out of range", __func__, pool)); vm_domain_free_assert_locked(vm_pagequeue_domain(m)); lo = atop(VM_PAGE_TO_PHYS(m)); max_order = min(flsll(lo ^ (lo + npages)) - 1, VM_NFREEORDER - 1); - m_end = m + npages; - for (m_start = m; m < m_end; m++) - m->pool = VM_NFREEPOOL; - m = m_start; + + m_start = m; order_start = ffsll(lo) - 1; if (order_start < max_order) m_start += 1 << order_start; + m_end = m + npages; order_end = ffsll(lo + npages) - 1; if (order_end < max_order) m_end -= 1 << order_end; @@ -1257,15 +1240,11 @@ vm_phys_free_contig(vm_page_t m, u_long npages) * end of the range last. */ if (m_start < m_end) - vm_phys_enqueue_contig(m_start, pool, m_end - m_start); - if (order_start < max_order) { - m->pool = pool; + vm_phys_enqueue_contig(m_start, m_end - m_start); + if (order_start < max_order) vm_phys_free_pages(m, order_start); - } - if (order_end < max_order) { - m_end->pool = pool; + if (order_end < max_order) vm_phys_free_pages(m_end, order_end); - } } /* @@ -1313,7 +1292,7 @@ vm_phys_unfree_page(vm_page_t m) struct vm_phys_seg *seg; vm_paddr_t pa, pa_half; vm_page_t m_set, m_tmp; - int order, pool; + int order; /* * First, find the contiguous, power of two-sized set of free @@ -1345,8 +1324,7 @@ vm_phys_unfree_page(vm_page_t m) * is larger than a page, shrink "m_set" by returning the half * of "m_set" that does not contain "m" to the free lists. */ - pool = m_set->pool; - fl = (*seg->free_queues)[pool]; + fl = (*seg->free_queues)[m_set->pool]; order = m_set->order; vm_freelist_rem(fl, m_set, order); while (order > 0) { @@ -1358,10 +1336,8 @@ vm_phys_unfree_page(vm_page_t m) m_tmp = m_set; m_set = &seg->first_page[atop(pa_half - seg->start)]; } - m_tmp->pool = pool; vm_freelist_add(fl, m_tmp, order, 0); } - m_set->pool = pool; KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency")); return (true); } @@ -1501,8 +1477,7 @@ vm_phys_find_queues_contig( * alignment of the first physical page in the set. If the given value * "boundary" is non-zero, then the set of physical pages cannot cross * any physical address boundary that is a multiple of that value. Both - * "alignment" and "boundary" must be a power of two. Sets the pool - * field in every allocated page. + * "alignment" and "boundary" must be a power of two. */ vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, @@ -1561,16 +1536,14 @@ vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, fl = (*queues)[m->pool]; oind = m->order; vm_freelist_rem(fl, m, oind); + if (m->pool != VM_FREEPOOL_DEFAULT) + vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, oind); } /* Return excess pages to the free lists. */ fl = (*queues)[VM_FREEPOOL_DEFAULT]; - vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, - VM_FREEPOOL_DEFAULT, 0); + vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, 0); /* Return page verified to satisfy conditions of request. */ - for (m = m_run; m < &m_run[npages]; m++) - m->pool = VM_FREEPOOL_DEFAULT; - pa_start = VM_PAGE_TO_PHYS(m_run); KASSERT(low <= pa_start, ("memory allocated below minimum requested range")); diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index 8b2d2f7e2251..1f502ad745c4 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -66,7 +66,7 @@ vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); -void vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages); +void vm_phys_enqueue_contig(vm_page_t m, u_long npages); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index 80f62981dee0..a4bbccdfb428 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -889,35 +889,30 @@ out: static void vm_reserv_break(vm_reserv_t rv) { - int pool, pos, pos0, pos1; + int hi, lo, pos; vm_reserv_assert_locked(rv); CTR5(KTR_VM, "%s: rv %p object %p popcnt %d inpartpop %d", __FUNCTION__, rv, rv->object, rv->popcnt, rv->inpartpopq); vm_reserv_remove(rv); rv->pages->psind = 0; - pool = rv->pages->pool; - rv->pages->pool = VM_NFREEPOOL; - pos0 = bit_test(rv->popmap, 0) ? -1 : 0; - pos1 = -1 - pos0; - for (pos = 0; pos < VM_LEVEL_0_NPAGES; ) { - /* Find the first different bit after pos. */ - bit_ff_at(rv->popmap, pos + 1, VM_LEVEL_0_NPAGES, - pos1 < pos0, &pos); - if (pos == -1) - pos = VM_LEVEL_0_NPAGES; - if (pos0 <= pos1) { - /* Set pool for pages from pos1 to pos. */ - pos0 = pos1; - while (pos0 < pos) - rv->pages[pos0++].pool = pool; + hi = lo = -1; + pos = 0; + for (;;) { + bit_ff_at(rv->popmap, pos, VM_LEVEL_0_NPAGES, lo != hi, &pos); + if (lo == hi) { + if (pos == -1) + break; + lo = pos; continue; } - /* Free unused pages from pos0 to pos. */ - pos1 = pos; + if (pos == -1) + pos = VM_LEVEL_0_NPAGES; + hi = pos; vm_domain_free_lock(VM_DOMAIN(rv->domain)); - vm_phys_enqueue_contig(&rv->pages[pos0], pool, pos1 - pos0); + vm_phys_enqueue_contig(&rv->pages[lo], hi - lo); vm_domain_free_unlock(VM_DOMAIN(rv->domain)); + lo = hi; } bit_nclear(rv->popmap, 0, VM_LEVEL_0_NPAGES - 1); rv->popcnt = 0; From nobody Mon Jun 3 18:14:54 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 4VtMML6Xx1z5JlBk; Mon, 03 Jun 2024 18:14:54 +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 4VtMML3kWJz4KQs; Mon, 3 Jun 2024 18:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717438494; 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=yu7ch+RrGJg2UgzEcE5uTiC/S0ut5W5Pw0b8Jgt+VpM=; b=AQtu9rmjz5sVu1b7bzcGlZIo6z0a7cpA4E/JU6RZFMJ6saQWj+HWi0VpWhb6p4EdoS5Mlq rVuovPJIYv66sl+mTun9gTNOvURDmWxJeQN/KQuiYjIXoRZTxRwtYTprDbnM6HPf/GZAiP SHITw1eOLq1DB1HlzyXxxamgGDK4WitSOEwfT6d5dVSR+B0nvFgPbwA2nbSke11Cjm1y8x qREi/Ph6embcvb0NxBekRvkuBvLKCg/K0RdwUVATC3Ka2Zh1WhVU54fesv504jLHoIIqWW 2jL2S6WXil8wIwQ+hKAZC+VgwmKPxoIeU2pKPJJlWSJHIgJteFUFoN2iI3SYWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717438494; a=rsa-sha256; cv=none; b=qBXlG0e0jIRj49mFh2UtsJnd2h0a94AfBQqVttJGQc1oY7I96w5vcokBdk30UXQV/57dde 1fM5NSR99HVu0s3JBxxAK5sDY2nttsjG0wGoiTzwc9ngSyGuPbJ7oOkj/11+UdQEM5QGlj X/+HfNNV6zzWUYib9YRdrYqSMbct35jsZGZQjqdkM+ZO2YRcPzzTZU77Wr/zzkKStknFZ9 WUVU9IXmfxS88V3GIp8xpRNIZrHP4Je3/iXTcTo6rJmTR9h8GFtpTOfPafXWj1JYi/NZLW yrdivzy9sUhly2mg88M/j0eFLJ2n4fsMaz2/D4Bd36OBADgxllAdGpaciannVQ== 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=1717438494; 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=yu7ch+RrGJg2UgzEcE5uTiC/S0ut5W5Pw0b8Jgt+VpM=; b=VnQBj4w5HJUMwriE6ScxsdQiwSQbfQkJ+5mpeQ3U+Fqz+N0wD+1CrawkIAu60B8/xPKuiU K0NJ/n/orv4qhF4Z9dACIoIVkwFbrxfTwfYANiup/YXbRUYFgit0FvX/MnonJrPGrKEdAy QVXVGZoasla4+0+u6vKSW5Gt+zwl3nzhTClUWcakbIiPe8WuheQgldWHoXXgK/ZOVhONal CRySAu38XGd1L8KgphLYV9xebKwEIsWk8L7KmOJmL9528VX9iNVGvT5GQ/2QLbSfei7csW G9935zaI0zKYvFMEemhgS/6rmhk5QKK+LhpYft//D/BtUHM7HxQws4BSQ+7nJA== 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 4VtMML3KtSzm87; Mon, 3 Jun 2024 18:14:54 +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 453IEsnx048616; Mon, 3 Jun 2024 18:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453IEsLL048613; Mon, 3 Jun 2024 18:14:54 GMT (envelope-from git) Date: Mon, 3 Jun 2024 18:14:54 GMT Message-Id: <202406031814.453IEsLL048613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5dda778db634 - main - Use correct function declaration for yyerror 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dda778db63407214394c3cf63fb1312a4981024 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dda778db63407214394c3cf63fb1312a4981024 commit 5dda778db63407214394c3cf63fb1312a4981024 Author: Dapeng Gao AuthorDate: 2024-06-03 17:30:52 +0000 Commit: Warner Losh CommitDate: 2024-06-03 18:14:10 +0000 Use correct function declaration for yyerror According to the POSIX standard at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html `yyerror` should return `int`. Add unreachable since errx never returns. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D45447 --- usr.sbin/config/config.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index a5a9e1546c36..148959fbff2e 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -88,7 +88,7 @@ int maxusers; #define ns(s) strdup(s) int include(const char *, int); -void yyerror(const char *s); +int yyerror(const char *s); int yywrap(void); static void newdev(char *name); @@ -299,11 +299,13 @@ NoDevice: %% -void +int yyerror(const char *s) { errx(1, "%s:%d: %s", yyfile, yyline + 1, s); + __unreachable(); + return (0); } int From nobody Mon Jun 3 18:19:44 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 4VtMT02ycgz5JlL4 for ; Mon, 03 Jun 2024 18:19:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtMT00B71z4LGm for ; Mon, 3 Jun 2024 18:19:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42135a45e2aso17981725e9.3 for ; Mon, 03 Jun 2024 11:19:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717438786; x=1718043586; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vme96Px5D2jJBg/4flwPjpLG/T+xP6FS+GrXVi4xaOM=; b=w+A8DAcgyT2x3ZQfObqCalp/gVOK10pbSo2n4IdIEMw/vZrEhh2wq8YA9fWtqKxpZ7 s3AYVisutre9C/cu0q25s2hsPZp91cfL+PIHwJH0GzyE1ocIvbnJvROG863Pk7Jycy8S RHDTiBqm3cN2PaUUxXtyaxWZ3VCMCSrftIBfVF0iiBpZXIhvhSIGKzpJiXZUqkj8+1Vp Kg5q7Tz89WIOdUU2R+Rrobf0Qgke5ChFWUXT4wT0U42d9Wmxvva6jfHQSwhnQnqF0VOJ /nR0h5tA12ft3k5qTB/D5iZoNJM2Ql+5bTWQti701ozv+Arh0N3YnvQwnMrmmz8bRNSf qjMw== X-Forwarded-Encrypted: i=1; AJvYcCVXLf4SaV9stYgQilVS9Jq5np/JjJC47YT7fq6Xqu8GhdnS6JGJatG2ipGPQjaUpmlUjRpDSYHUkBA1m5u3IggsBNvdSS8e1z3IIHStvAmd X-Gm-Message-State: AOJu0Ywg70WLHwFlsd+1TxgejAXj0skRgSdQB/VjtqtPyA9T/pf+9Ofn Gk0agnV8aO8iVfd4OVu46t+EXnDp1CRhIuX7QtMnXFjCYFfJL/b/lWTiQndyOlo= X-Google-Smtp-Source: AGHT+IGqfSOzn9mD/HVfXpuiuqtL+rnTMVR0o2UINhk64fp9/ZjjG9fVDr0dAY/aRXR+SwwM5PoOYA== X-Received: by 2002:a05:600c:b92:b0:41b:e416:43d3 with SMTP id 5b1f17b1804b1-4212e0bfeb5mr72632265e9.35.1717438786334; Mon, 03 Jun 2024 11:19:46 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421381c650csm82441005e9.27.2024.06.03.11.19.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2024 11:19:45 -0700 (PDT) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: git: 5dda778db634 - main - Use correct function declaration for yyerror From: Jessica Clarke In-Reply-To: <202406031814.453IEsLL048613@gitrepo.freebsd.org> Date: Mon, 3 Jun 2024 19:19:44 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7A3BE5B2-DE9C-4317-8AC6-9CDC398C7318@freebsd.org> References: <202406031814.453IEsLL048613@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3774.500.171.1.1) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4VtMT00B71z4LGm On 3 Jun 2024, at 19:14, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D5dda778db63407214394c3cf63fb1312= a4981024 >=20 > commit 5dda778db63407214394c3cf63fb1312a4981024 > Author: Dapeng Gao > AuthorDate: 2024-06-03 17:30:52 +0000 > Commit: Warner Losh > CommitDate: 2024-06-03 18:14:10 +0000 >=20 > Use correct function declaration for yyerror >=20 > According to the POSIX standard at > = https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html > `yyerror` should return `int`. Add unreachable since errx never = returns. >=20 > Reviewed by: imp, kib > Differential Revision: https://reviews.freebsd.org/D45447 > --- > usr.sbin/config/config.y | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y > index a5a9e1546c36..148959fbff2e 100644 > --- a/usr.sbin/config/config.y > +++ b/usr.sbin/config/config.y > @@ -88,7 +88,7 @@ int maxusers; >=20 > #define ns(s) strdup(s) > int include(const char *, int); > -void yyerror(const char *s); > +int yyerror(const char *s); > int yywrap(void); >=20 > static void newdev(char *name); > @@ -299,11 +299,13 @@ NoDevice: >=20 > %% >=20 > -void > +int > yyerror(const char *s) > { >=20 > errx(1, "%s:%d: %s", yyfile, yyline + 1, s); > + __unreachable(); > + return (0); > } This should just be: int yyerror(const char *s) { errx(1, "%s:%d: %s", yyfile, yyline + 1, s); } errx is __dead2. See bin/expr/expr.y for an example of this in-tree. Jess From nobody Mon Jun 3 18:22:34 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 4VtMXB4r1Hz5Jlnm; Mon, 03 Jun 2024 18:22:34 +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 4VtMXB3rKXz4Lff; Mon, 3 Jun 2024 18:22:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717438954; 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=KEAqHLwqQl/9mnz7ouswTEEdCWPStXD6Ngabayf4PVY=; b=izAv351DABu6R+EV1o21JqC3nVxhWephT7rUm3MyDPXdIHB6a6qVDM1qnBOdB+8MSqO3n9 0k5ZGXA8iIhutz9YjC2kSLZpgwP37h1UsLW+/0Mgy9cLzGrAtht+yL5NVZigpt+dF0FVQQ xBfp5GlPL/8E6Ge67hABRhR9dS6ld00t9mg86bDdZLxxG7GAYpxt92DiIl0FLefL8FeGgZ DJ6FmuOSkqCyP3w/fFi0+DTVS11agaJ911RO8RmYIKDWbYPPKIGtIczz52DZ9tWlUjqzpG lSCb76cfofSO52TNX/Jg5cfyUKQicTNJHmVtMNgCpmN4uHywFppxXDT67GbEfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717438954; a=rsa-sha256; cv=none; b=Och/qxn8JtsHYMZEV8CtvjhfPkjDt/6ZXVw92wLulmLHsJcuStEzVbA0aIhrypSyVLVrXe fJZqS9+8KPEsru6ud9io3qJSiJYhZiEAeY6Ge0XfH7hST/pLuy0WYTja5hLtFpzm6ZJLhG +g7rt4xEP8pi/zFAX3DyStWfh/5V4fW1mysBoyWxwyK5o3zWkV6OKuMFn5NOJ1JElxAEfh je3oVR+b5NLfdUZ/+17nmi7oI7vUT1oObn9YX8tzA8A7Fj0QENSsRFEXDdbiKFYECDmyAT 8KeHXRxmqy7RD5C9Pwoid9Zpu7ExSQ7KKV2SwnOr8qe4jdgOzCI5Ox63FGTx/A== 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=1717438954; 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=KEAqHLwqQl/9mnz7ouswTEEdCWPStXD6Ngabayf4PVY=; b=UN98MZCaDIsRcjy7jLpM0o7lKTKzCLThQDxSJ4lWrlS7PKImiOmr/CV9U4G7sJAmhXSsOq 6Sl+XmeCC2OPbvq4RlSLHmlwGwL/fjcQ5Tc3zQw4nOZX381tK1Sjc0jOpd8ejjHtC6j6MT LX9lpnBSu3Wd3I+DJwKVpft0epiHgUE78KjF1lCflMwQiTmGLFr9XkWzMkbd2hgOtn/xdR W+q92dQB/ZtUU20+b4Sg61snkrspIwb15vJT1pd0QGz9ejsJofKCbS+rQlNloCk54XX0tS c0k/jMRvz910cugc5IxcezpJAQbo2Owe8Zaq2CXK/uEpnHWp7kQwkZFTM0a3LQ== 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 4VtMXB3Pd5zm6v; Mon, 3 Jun 2024 18:22:34 +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 453IMY7l065211; Mon, 3 Jun 2024 18:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453IMYdg065208; Mon, 3 Jun 2024 18:22:34 GMT (envelope-from git) Date: Mon, 3 Jun 2024 18:22:34 GMT Message-Id: <202406031822.453IMYdg065208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 08f6f78f81e2 - main - libkern: don't use MPASS 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08f6f78f81e21b21dd002a9389436b0333cb3488 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=08f6f78f81e21b21dd002a9389436b0333cb3488 commit 08f6f78f81e21b21dd002a9389436b0333cb3488 Author: Doug Moore AuthorDate: 2024-06-03 18:20:00 +0000 Commit: Doug Moore CommitDate: 2024-06-03 18:22:22 +0000 libkern: don't use MPASS Using MPASS in libkern breaks buildworld. Replace MPASS with KASSERT in three places. --- sys/sys/libkern.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 84d982c43a76..afdfe7346b28 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -190,7 +190,7 @@ static __inline __pure2 int ilog2_int(int n) { - MPASS(n != 0); + KASSERT(n != 0, ("ilog argument must be nonzero")); return (8 * sizeof(n) - 1 - __builtin_clz((u_int)n)); } @@ -198,7 +198,7 @@ static __inline __pure2 int ilog2_long(long n) { - MPASS(n != 0); + KASSERT(n != 0, ("ilog argument must be nonzero")); return (8 * sizeof(n) - 1 - __builtin_clzl((u_long)n)); } @@ -206,7 +206,7 @@ static __inline __pure2 int ilog2_long_long(long long n) { - MPASS(n != 0); + KASSERT(n != 0, ("ilog argument must be nonzero")); return (8 * sizeof(n) - 1 - __builtin_clzll((unsigned long long)n)); } From nobody Mon Jun 3 18:32:08 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 4VtMlD6ZBMz5Jmq2; Mon, 03 Jun 2024 18:32:08 +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 4VtMlD68Dfz4N7d; Mon, 3 Jun 2024 18:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717439528; 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=piqRJ0MNyYi6zLnCtGjqZv8OmceaeopFKl3w/Ir8d48=; b=ceKt/5UBGmoWBhImoZo9XKt9P7RRp75rQf9LPHIQ+gZsepBzZHdJF2r56rdJZnKj0si3u8 sKD9pkW6BcPxok6awgTZ29gutYraVpW8icJ1lJRoS0VJKWTuQNENaZJtES+nFja/tOCTq6 EDjqau/sXOM9EHaCoKTH6zAfyqkPMyC0wlOkknZJJRGGslxxPtnGd0ohct5b/Vf03mM/rz 949vxmhSxGP0qNlvB1RqcmRN2zm54N156liRMwOWczjIBEHuGAeHQ3MgZj7cg3gB2LgcbQ Wh8fhP04MYt/ORiqDvHMCvZJfB2pSoewiUbymugVMIfOPBudQICNIIL5ZGtJuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717439528; a=rsa-sha256; cv=none; b=YC0t1DrErP68GQs2nR7yvpUwAvgz/kyDLRDVkVtbvGx5hpOMwhv6jwZB+FJbARSszjpnXj kzgED3XtwTvsTjOFp9RaR6KukY2JOLxoDwEIgEJujBbvFAfXRqGteuKHMFbiFtVCyF8ySB 8VU0Nu+og3STvOSoQppypNYB3YEegQHcAqlg8xe348npXlVGsfORDpNesBbq3QM9aIQPeO pyC6OitHZ2oaEvmw9O8Vuw5+QfEiAMdJjYhT7rWm0JpXIUP8qlPDOXjWg2iz9kkds04mPf pVCZ8BROHmKfthJGiR33fklhMZehjjHeHcuFeIBcVvI+gpa5T+cfUsN1e9Xj3A== 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=1717439528; 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=piqRJ0MNyYi6zLnCtGjqZv8OmceaeopFKl3w/Ir8d48=; b=Yp3b5JcCpgPnPA0i19FHxhcgGiJFvIohmiKu1dfKg85UjTjvOm6qUtUb3Z+4pOhvHuHHrK iMEzvc/SMD8zHC3hIMzbJt7eTjILNVaxSn4J8JsnnlOIcRdCXBcf5OR6clt6qp/8w24IGZ Kbs4evJauTGFCATwUKcVTrxaixPFdXDhb+aTQl73hREpIlXvTA93B2mp7SJ2YBTiniUSj8 EB/Ws2hrISjkM6oLU2wwhyJQjbtf63r58c0wAyPBijINCfYrQDXqIFy0f5LgTfWGWUbZPy e1662BmRIA9KDX/IXyhn2+pxnKgxbiusJod1XPWMiaZUQGzPbR+OHOB74cm8dA== 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 4VtMlD5lYbzlqs; Mon, 3 Jun 2024 18:32:08 +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 453IW8UD080804; Mon, 3 Jun 2024 18:32:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453IW87i080801; Mon, 3 Jun 2024 18:32:08 GMT (envelope-from git) Date: Mon, 3 Jun 2024 18:32:08 GMT Message-Id: <202406031832.453IW87i080801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 749c249dc3b6 - main - subr_pctrie: use ilog2(x) instead of fls(x)-1 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 749c249dc3b656fea69149f8f7ad3e1a7f935986 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=749c249dc3b656fea69149f8f7ad3e1a7f935986 commit 749c249dc3b656fea69149f8f7ad3e1a7f935986 Author: Doug Moore AuthorDate: 2024-06-03 18:31:19 +0000 Commit: Doug Moore CommitDate: 2024-06-03 18:31:19 +0000 subr_pctrie: use ilog2(x) instead of fls(x)-1 In three instances where fls(x)-1 is used, the compiler does not know that x is nonzero and so adds needless zero checks. Using ilog(x) instead saves, in each instance, about 4 instructions, including a conditional, and 16 or so bytes, on an amd64 build. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D45330 --- sys/kern/subr_pctrie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 85df0a9bf9e4..76f4ee17a8ca 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -350,7 +350,7 @@ pctrie_insert_node(void *parentp, struct pctrie_node *parent, uint64_t *val) "uint64 too wide"); _Static_assert(sizeof(uint64_t) * NBBY <= (1 << (sizeof(parent->pn_clev) * NBBY)), "pn_clev too narrow"); - parent->pn_clev = rounddown(flsll(index ^ newind) - 1, PCTRIE_WIDTH); + parent->pn_clev = rounddown(ilog2(index ^ newind), PCTRIE_WIDTH); parent->pn_owner = PCTRIE_COUNT; parent->pn_owner = index & -(parent->pn_owner << parent->pn_clev); @@ -546,14 +546,14 @@ pctrie_lookup_le(struct pctrie *ptree, uint64_t index) KASSERT((pred->pn_popmap & ((1 << slot) - 1)) != 0, ("%s: no popmap siblings before slot %d in node %p", __func__, slot, pred)); - slot = fls(pred->pn_popmap & ((1 << slot) - 1)) - 1; + slot = ilog2(pred->pn_popmap & ((1 << slot) - 1)); pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); } while (!pctrie_isleaf(pred)) { KASSERT(pred->pn_popmap != 0, ("%s: no popmap children in node %p", __func__, pred)); - slot = fls(pred->pn_popmap) - 1; + slot = ilog2(pred->pn_popmap); pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); } From nobody Mon Jun 3 18:38:50 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 4VtMvD45RFz5JmxF for ; Mon, 03 Jun 2024 18:39:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtMvD1g6Gz4Nlk for ; Mon, 3 Jun 2024 18:39:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-702621d8725so1896552b3a.0 for ; Mon, 03 Jun 2024 11:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1717439942; x=1718044742; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FMOngN7rN59iHpbSO6fqkGTVvdlsirZe3DyFj/TwqLk=; b=EMagEniVgROhxh+OpGdwdhoPP9tUzNrIXSIDkRxWwbHREbifsHnTDrXUi4XnuUJ9t7 1tN8Q8sdEt5J6XCTwOUx+s7u8eh436L8/v1uUmQ/rgtAdQVxGptRgdvXX0me2pr9xfHT /aAHXREJq8uxbDoPHA13Cc5Io6wWk9Cca2FacZqu2j6aCmR+L8A9eBcs59xWwYW6v0Cc TFhWRKLGa5eFmDhF7VVb/mlDnXTiuSoxlT5wxpGg9uwAXf08d2WoP3/IFCT0GFmI4hY+ 2JrKp2zIynf5HWMP1meaUT1RJsD/S1psk+W+KQjQ8GYWMzeXdD3LzII6GPb8rwod14tU kSuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717439942; x=1718044742; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FMOngN7rN59iHpbSO6fqkGTVvdlsirZe3DyFj/TwqLk=; b=K/fEBtqtNngZ1kur0mU0X3iA9K9MIfiIw8N5skXbpep93QIlruzo6hkIj1wZndIcGz uw4pJHeYPcr2MMeQleP+FjzfTYg7nLG8QUi58YZk5qJ5O3MxRMBX6KiFnlWKA73pguRn Xrjezai2yCApodVDez3YlkJpZsHYdq+xFWQDCWJp4WkCBPIlSm98iR2lRxcL0napy9On kYBcObknYynKVQWBPCjOY0I++DN84NNQTEUaDqAe7rCJh6+etn6WNGQkou+UG6/qB4Vn HXKsrD43ey8eB5Vit+GCqs/DR0nKo+Oji5v6xDabb5VQysxHBUnhzmvEKF4pCjC7vl3B /yyQ== X-Forwarded-Encrypted: i=1; AJvYcCX1rVOvYBQWIlMn8A7716OsasppZtdIjQoA+YfHoaqgwhTjrEC9Y7p5PNc8bRxIhrUHVgnVqSov4zvHOUmt1GHaCUz/9MLk7QdSQVv6Us5S X-Gm-Message-State: AOJu0YyxGTMn1B+WZ5Ue/zif4fZGz7RWO0h/QoGU0FVhE907XiJDWvAI fBUcGlSIBHmjqOQld+kCMnlRly1RraGZafcVr3UQIvbUBwSIQsJY3wp/y2pQUvQpMamuNOJZXNr 286SJcQisz7r4f5NbJyewAnRs5FOj3Vu9zkkZcA== X-Google-Smtp-Source: AGHT+IE7D3VbgNJNae0x4l3MjgJ9s7izDuKK2rqnXCNaXXX0wf1ie5vEjS5jn3KOGuFDOKF7ibEhHSQcMsEN1S32AxE= X-Received: by 2002:a05:6a20:4391:b0:1b1:f0d4:71b6 with SMTP id adf61e73a8af0-1b26f29ddc7mr11228813637.54.1717439942470; Mon, 03 Jun 2024 11:39:02 -0700 (PDT) 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 References: <202406031814.453IEsLL048613@gitrepo.freebsd.org> <7A3BE5B2-DE9C-4317-8AC6-9CDC398C7318@freebsd.org> In-Reply-To: <7A3BE5B2-DE9C-4317-8AC6-9CDC398C7318@freebsd.org> From: Warner Losh Date: Mon, 3 Jun 2024 12:38:50 -0600 Message-ID: Subject: Re: git: 5dda778db634 - main - Use correct function declaration for yyerror To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000b1cf4d061a00a59f" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4VtMvD1g6Gz4Nlk --000000000000b1cf4d061a00a59f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 3, 2024 at 12:19=E2=80=AFPM Jessica Clarke = wrote: > On 3 Jun 2024, at 19:14, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D5dda778db63407214394c3cf63fb131= 2a4981024 > > > > commit 5dda778db63407214394c3cf63fb1312a4981024 > > Author: Dapeng Gao > > AuthorDate: 2024-06-03 17:30:52 +0000 > > Commit: Warner Losh > > CommitDate: 2024-06-03 18:14:10 +0000 > > > > Use correct function declaration for yyerror > > > > According to the POSIX standard at > > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html > > `yyerror` should return `int`. Add unreachable since errx never > returns. > > > > Reviewed by: imp, kib > > Differential Revision: https://reviews.freebsd.org/D45447 > > --- > > usr.sbin/config/config.y | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y > > index a5a9e1546c36..148959fbff2e 100644 > > --- a/usr.sbin/config/config.y > > +++ b/usr.sbin/config/config.y > > @@ -88,7 +88,7 @@ int maxusers; > > > > #define ns(s) strdup(s) > > int include(const char *, int); > > -void yyerror(const char *s); > > +int yyerror(const char *s); > > int yywrap(void); > > > > static void newdev(char *name); > > @@ -299,11 +299,13 @@ NoDevice: > > > > %% > > > > -void > > +int > > yyerror(const char *s) > > { > > > > errx(1, "%s:%d: %s", yyfile, yyline + 1, s); > > + __unreachable(); > > + return (0); > > } > > This should just be: > > int > yyerror(const char *s) > { > errx(1, "%s:%d: %s", yyfile, yyline + 1, s); > } > > errx is __dead2. See bin/expr/expr.y for an example of this in-tree. > OK. Wasn't sure, but you're comments remove all doubt in my mind. will fix. Warner --000000000000b1cf4d061a00a59f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Jun 3, 2024 at 12:19=E2=80=AFPM J= essica Clarke <jrtc27@freebsd.org<= /a>> wrote:
O= n 3 Jun 2024, at 19:14, Warner Losh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL:
https://= cgit.FreeBSD.org/src/commit/?id=3D5dda778db63407214394c3cf63fb1312a4981024<= /a>
>
> commit 5dda778db63407214394c3cf63fb1312a4981024
> Author:=C2=A0 =C2=A0 =C2=A0Dapeng Gao <
dg612@cam.ac.uk>
> AuthorDate: 2024-06-03 17:30:52 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-06-03 18:14:10 +0000
>
>=C2=A0 =C2=A0 Use correct function declaration for yyerror
>
>=C2=A0 =C2=A0 According to the POSIX standard at
>=C2=A0 =C2=A0 https://pubs.o= pengroup.org/onlinepubs/9699919799/utilities/yacc.html
>=C2=A0 =C2=A0 `yyerror` should return `int`. Add unreachable since errx= never returns.
>
>=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, kib
>=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.fre= ebsd.org/D45447
> ---
> usr.sbin/config/config.y | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
> index a5a9e1546c36..148959fbff2e 100644
> --- a/usr.sbin/config/config.y
> +++ b/usr.sbin/config/config.y
> @@ -88,7 +88,7 @@ int maxusers;
>
> #define ns(s) strdup(s)
> int include(const char *, int);
> -void yyerror(const char *s);
> +int yyerror(const char *s);
> int yywrap(void);
>
> static void newdev(char *name);
> @@ -299,11 +299,13 @@ NoDevice:
>
> %%
>
> -void
> +int
> yyerror(const char *s)
> {
>
> errx(1, "%s:%d: %s", yyfile, yyline + 1, s);
> + __unreachable();
> + return (0);
> }

This should just be:

int
yyerror(const char *s)
{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 errx(1, "%s:%d: %s", yyfile, yyline += 1, s);
}

errx is __dead2. See bin/expr/expr.y for an example of this in-tree.

OK. Wasn't sure, but you're comments = remove all doubt in my mind. will fix.

Warner=C2= =A0
--000000000000b1cf4d061a00a59f-- From nobody Mon Jun 3 18:48:04 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 4VtN5c6Knbz5Jp29; Mon, 03 Jun 2024 18:48:04 +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 4VtN5c5mb9z4Pb9; Mon, 3 Jun 2024 18:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717440484; 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=VDO0Wo6V4mCWeH+DRt2kLj+nKBWdcZ3a4NkBuZfzozw=; b=oWy7JC/ly3rqDoqBQIywrcRAJ7i4oWnChZJDOizkvujZFUGmhujQk0SW8qBU38RABZXNPC nSvGXgTEVOxyfXVvW+Rq+OfcQ8BDuE2S0vZ60+O1DtKeKBTU6TtyQFFuAHGkdNaz+b4Vo9 5A9p9HIB0Y5T/vtIWr5igJOH/ND1sA6L5OFuiHbJ7J7AqK4L1KKayhV+Uvw6UO2VfD8q78 pM5aIOZNoXlHT6mNJ9HkVYFmhxlTaejCWxUl5D7tUn7YgEkUzVS87NVqrL0eYtDWBocwub ECnCRz7HbrEN06Q9y1KR5HdVymdxSJnHyyRIJjO2098IA2QucVAwIkAzf20AvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717440484; a=rsa-sha256; cv=none; b=jY/qwYPPaUhkAj8c5fwsXC1V79XPqzzdk1+CVCFwnkLXtz0wqkR9ySGAn5pfzzoQ0AOv7l GoOLqUj0VYv4QIEoaEddexUQ6QuxcW5s1UdSuolct4fALDOVfxLFMzeCRyxTOEU6Eo+oGJ mPMQo3EE5mO+hwZhucbG6jduKwX9wD8LOMT04UP1UjAUflVas+Z3YxrHP4em8Dg4kXFQnR ybUo0mLCjCH8+BrLbT3KwYVClvn1gG2w/JaiuyG0bTeYT6C/BTp9W7Zk3rnZOei9ii6+gC mRnW282Vpt3y76WEyHXz8vOuHHs/VP7529yPQH4+iHGdtayFiUqZFNZ2pdxngA== 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=1717440484; 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=VDO0Wo6V4mCWeH+DRt2kLj+nKBWdcZ3a4NkBuZfzozw=; b=VmtfmA0cSr0cHvHASL0BUpkoZXb2Lk59RdXw+diTP+dpbFycLa8/Y9+fxAGk4PeiiBMPO+ Q1ZRIw5IeE87KHv3TZQjO1p8kxNIh3QRXMskSYF3IeoijNATfqQNkAKEaP1o8AXZRcUpLv oThy7iAp8r3YOw67a7cEqS9GjyQ/GdSaUlyaizF+ArHMP4JAx6v7jNSLxXIIgR1ArxwydL 5V98XDL+LppV0IPCC8xfWyEkLwmg0kyud0Uf8oImk1pSLRhtmBStfHqrDc1UnKGJbhIPSY yzPdQpe3GlY/S6RgCiQvVWbW0yidU+8hGjUuLIx9fUjyfNakj41x3Yxkt/UFNg== 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 4VtN5c5Mpwzm9n; Mon, 3 Jun 2024 18:48:04 +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 453Im4hj099206; Mon, 3 Jun 2024 18:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453Im4pn099203; Mon, 3 Jun 2024 18:48:04 GMT (envelope-from git) Date: Mon, 3 Jun 2024 18:48:04 GMT Message-Id: <202406031848.453Im4pn099203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 3ca6bf792924 - main - db_show_buffer: minor cleanup 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: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ca6bf7929245ae66c5c0f13776395fea0c2d2c7 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=3ca6bf7929245ae66c5c0f13776395fea0c2d2c7 commit 3ca6bf7929245ae66c5c0f13776395fea0c2d2c7 Author: Ryan Libby AuthorDate: 2024-06-03 18:35:28 +0000 Commit: Ryan Libby CommitDate: 2024-06-03 18:35:28 +0000 db_show_buffer: minor cleanup Do some light cleanup to make the output format more consistent for readability. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D45442 --- sys/kern/vfs_bio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 01057072d991..4d5e3a014050 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -5485,16 +5485,16 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) } db_printf("buf at %p\n", bp); - db_printf("b_flags = 0x%b, b_xflags=0x%b\n", + db_printf("b_flags = 0x%b, b_xflags = 0x%b\n", (u_int)bp->b_flags, PRINT_BUF_FLAGS, (u_int)bp->b_xflags, PRINT_BUF_XFLAGS); - db_printf("b_vflags=0x%b b_ioflags0x%b\n", + db_printf("b_vflags = 0x%b, b_ioflags = 0x%b\n", (u_int)bp->b_vflags, PRINT_BUF_VFLAGS, (u_int)bp->b_ioflags, PRINT_BIO_FLAGS); db_printf( "b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n" - "b_bufobj = (%p), b_data = %p\n, b_blkno = %jd, b_lblkno = %jd, " - "b_vp = %p, b_dep = %p\n", + "b_bufobj = %p, b_data = %p\n" + "b_blkno = %jd, b_lblkno = %jd, b_vp = %p, b_dep = %p\n", bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid, bp->b_bufobj, bp->b_data, (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno, bp->b_vp, bp->b_dep.lh_first); @@ -5531,7 +5531,6 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) #elif defined(BUF_TRACKING) db_printf("b_io_tracking: %s\n", bp->b_io_tracking); #endif - db_printf(" "); } DB_SHOW_COMMAND_FLAGS(bufqueues, bufqueues, DB_CMD_MEMSAFE) From nobody Mon Jun 3 18:48:05 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 4VtN5d72Fcz5Jp6M; Mon, 03 Jun 2024 18:48:05 +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 4VtN5d6cXdz4Pk5; Mon, 3 Jun 2024 18:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717440485; 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=LA3VpBmLa1taIF0eXTQvT7ILC9KXI3bMuqcKy1zyoMo=; b=bXGLTPLdBPucfrRAk62JMIQM3TAeJHtQ7GWYHGlZrfc1Trj3d7o7SPNsoTzAugP+zMeU8N gEAoj/+YgYU8xx4kMCpTrD2V/sTCsPNwwkuquzLqTVIrxjAlkMY/cpG0yZEC7MngvMz3ew Q/j7smNaqZabeLleaxGU9DFDM2hnxApezz/IMtiLjKtOQ8qHf3HffL8dUYr5KtkPjLYm3C t430EA2rhJ7d1GcxFz79tdnG0Re5r5o4/XOhTha+2nBZWkWq/YsR6lv2Ltmxg0TMWHpXvP GX0EWppgUcXTIDx2DIsOfnWKMWckXN8dK4xRCckdOjQLIohx976Dwz80boYW2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717440485; a=rsa-sha256; cv=none; b=T8ZzEa4eMzaznBW1dFr2/UKOcagrbEczHpdooMX4hux1ZgQ2uwwnpe+QArnDFMFTqnvDug 92HSW5HTyCUp2QTDIIWVnv8cGHzVDtqAF8JsXc9oLNMgenwfQ9/knEJhX/lPr5a1OsP1iv VBMRC4uiwhFqBvprvlIvtJEXDlsSo71AmBgQaet/86pY4iAuqhVwYSQpFTKIGBK4JWnrx2 4fQDlYh1g4JUalkz131FRVz4hvUHTKHufHixWVEEIH1hlYcqED9gADhPu4DjmyN644nbQ8 w6XXSt/iEwuq/N7qHNB7iVdCzOTI4L1UpRFp8WvZprvTLpn9xD2L87MRUOqhYQ== 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=1717440485; 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=LA3VpBmLa1taIF0eXTQvT7ILC9KXI3bMuqcKy1zyoMo=; b=lU1ge/4DX/OWspO/WhJJAawcjYvxPKyNqWMwiL8XB/UJfHAq57WGX3D7zhU1ne5xREgvv/ QpIC2qi9ngmXRgPpHBOPuZzuSg6FI0A14BfqXHdzbuHty6+FbYNNL4rDxcWKPaUsj7Ktm0 YuKPmfH32yWNkFSAjTEGaIJKjD2JV4QSYgdTGtYydwFu5hMywTNy/Q/bHWeP9n4Qhu3PdK gEZiAaWVbTJbsjG5Nc+tLonCfbUQktcV23tp6KXBIBqt24J9BGCJvW4lUxR+qYRCtU5R7i E9TaXcuTdW41njvA/n5EIbAWdsppsQkf4J/dVMyXbSeREdbbeRIiDKZCZoTHFw== 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 4VtN5d6DXjzmsp; Mon, 3 Jun 2024 18:48:05 +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 453Im5wf099249; Mon, 3 Jun 2024 18:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453Im5kX099246; Mon, 3 Jun 2024 18:48:05 GMT (envelope-from git) Date: Mon, 3 Jun 2024 18:48:05 GMT Message-Id: <202406031848.453Im5kX099246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 7f1012ff7c8b - main - pctrie: predict successful allocation 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: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f1012ff7c8b8762c247698cb6f84963674d1f55 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=7f1012ff7c8b8762c247698cb6f84963674d1f55 commit 7f1012ff7c8b8762c247698cb6f84963674d1f55 Author: Ryan Libby AuthorDate: 2024-06-03 18:35:28 +0000 Commit: Ryan Libby CommitDate: 2024-06-03 18:35:28 +0000 pctrie: predict successful allocation Reviewed by: dougm Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D45407 --- sys/sys/pctrie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index eec74610587a..38b297899592 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -84,7 +84,7 @@ name##_PCTRIE_INSERT(struct pctrie *ptree, struct type *ptr) \ if (parentp == NULL) \ return (0); \ parent = allocfn(ptree); \ - if (parent == NULL) \ + if (__predict_false(parent == NULL)) \ return (ENOMEM); \ pctrie_insert_node(parentp, parent, val); \ return (0); \ From nobody Mon Jun 3 19:24:47 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 4VtNvz2SvDz5Js5C; Mon, 03 Jun 2024 19:24:47 +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 4VtNvz1sfRz4V9Y; Mon, 3 Jun 2024 19:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442687; 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=C/Jl28HTiXRcN1I3bOHSNxUxLupm5F+aXZNz9MWMrXg=; b=sT2o0M2uj2yWod+UW2bLysjHs3FKo8kP0O7inNV9P2XLY/ooCzurA27yxzf5WccV/KLDV0 Opkfk3S+NAEy9jCAt1XulMusPaJzdaiU6U3/RX5qz5QvJqOTIKUhQxlmPdvj/ScNw150tT 9xFRxeP/dLUEvSKbuNjDZEVcogi43zH+4QiXQOhH6W+slexJ3/JqmKQ429C641fkK+Rmsu qCgTKFKfFQitnoudECpzoSpBtSykj5cqRMzXZahoBAZQLT7/UdNAaCz8wsKRTMlVa2Ytlz GaChjFUoRAbwZwOQ9W8kMHKLVj7mO2kDMgiLO3ZKeje4U2NSYdCXheIxd8Vonw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442687; a=rsa-sha256; cv=none; b=Q56ReaybZdo6tHlY+lgLxjET0EiReD+fHbvxyzJ0Cw/zAbtwOKJOK68QnRZfhc207gdi+P epSSYqPO+JyivCaTPy6De3CzINXxgZIt40hgmIey9Cfo9J3jQfXCVXWfi4X3oEd5y/Wkdi wAhy9Z9n5yigICF3R/H/P/F/Q7oZQqIa7vtLfV3NpVIVjxrUreyFzaUOm2MPuXzd5JQ4tc tMWWl2hTg+uGPk49Va0Ub2CGWPaQCnn46eQ7vJtyJfh0WY8huDdoXL8mBkewBbgwVKIs7E 3gMUsqvTMAsZCTYNjsa0j7/AN3h4ticCYLOquVJPngnjoj/yoflme73LLFKBXQ== 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=1717442687; 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=C/Jl28HTiXRcN1I3bOHSNxUxLupm5F+aXZNz9MWMrXg=; b=jQfSl4J5jg57hYvedgBgZUp3sZqev4tWhnWoXAzzGgSBj44CUE9sEwPdd79HXImLmbeokM AnzEemLczZtUrJ6dCOPy+OOgGoeGEXl+XV+d0VTiIW081govEUYgD6ECIle8AaQIrkHtDB CgXePT6KeRzCm7pxNWHNyqzE2CkiC9VVl7ceZWg83Q1HCRZpsG063Ny7oZ10LelqVHTN+P Khp2q+N0EXySmrqM54SCbSFSb84xU1j3I3upRYUDXfj7q+nhlUe69jvjARTM/oD3hRGURD dTVFf+jHK0gQHLer8wU0ixrtUIkoCPjR9CS+tEOS3tmaI1HXyknWDnBwsPZP1Q== 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 4VtNvz1Kn5zndv; Mon, 3 Jun 2024 19:24:47 +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 453JOlkY067265; Mon, 3 Jun 2024 19:24:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOlBE067262; Mon, 3 Jun 2024 19:24:47 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:47 GMT Message-Id: <202406031924.453JOlBE067262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4083c62d6993 - stable/14 - if_bnxt: Correcting the firmware package version parsing logic 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4083c62d69932a42992fcd235a7cecf610ad9e25 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4083c62d69932a42992fcd235a7cecf610ad9e25 commit 4083c62d69932a42992fcd235a7cecf610ad9e25 Author: Sumit Saxena AuthorDate: 2024-02-23 08:20:26 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:12 +0000 if_bnxt: Correcting the firmware package version parsing logic The firmware package version currently appears as "Unknown" through the sysctl interface. The parsing logic for extracting the firmware package version from the package log has been modified to ensure compatibility with all controllers. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42950 (cherry picked from commit e436cb79666db3c8bb167d47ca9803c36013e32c) --- sys/dev/bnxt/bnxt_sysctl.c | 58 +++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index 893e56b61099..5e92cf8bd756 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "bnxt.h" #include "bnxt_hwrm.h" @@ -720,6 +721,39 @@ static char *bnxt_chip_type[] = { }; #define MAX_CHIP_TYPE 3 +static char *bnxt_parse_pkglog(int desired_field, uint8_t *data, size_t datalen) +{ + char *retval = NULL; + char *p; + char *value; + int field = 0; + + if (datalen < 1) + return NULL; + /* null-terminate the log data (removing last '\n'): */ + data[datalen - 1] = 0; + for (p = data; *p != 0; p++) { + field = 0; + retval = NULL; + while (*p != 0 && *p != '\n') { + value = p; + while (*p != 0 && *p != '\t' && *p != '\n') + p++; + if (field == desired_field) + retval = value; + if (*p != '\t') + break; + *p = 0; + field++; + p++; + } + if (*p == 0) + break; + *p = 0; + } + return retval; +} + static int bnxt_package_ver_sysctl(SYSCTL_HANDLER_ARGS) { @@ -727,11 +761,9 @@ bnxt_package_ver_sysctl(SYSCTL_HANDLER_ARGS) struct iflib_dma_info dma_data; char *pkglog = NULL; char *p; - char *next; char unk[] = ""; char *buf = unk; int rc; - int field; uint16_t ordinal = BNX_DIR_ORDINAL_FIRST; uint16_t index; uint32_t data_len; @@ -749,27 +781,11 @@ bnxt_package_ver_sysctl(SYSCTL_HANDLER_ARGS) &dma_data); if (rc == 0) { pkglog = dma_data.idi_vaddr; - /* NULL terminate (removes last \n) */ - pkglog[data_len-1] = 0; - - /* Set p = start of last line */ - p = strrchr(pkglog, '\n'); - if (p == NULL) - p = pkglog; - - /* Now find the correct tab delimited field */ - for (field = 0, next = p, - p = strsep(&next, "\t"); - field < - BNX_PKG_LOG_FIELD_IDX_PKG_VERSION && p; - p = strsep(&next, "\t")) { - field++; - } - if (field == BNX_PKG_LOG_FIELD_IDX_PKG_VERSION) + p = bnxt_parse_pkglog(BNX_PKG_LOG_FIELD_IDX_PKG_VERSION, pkglog, data_len); + if (p && *p != 0 && isdigit(*p)) buf = p; } - } - else + } else dma_data.idi_vaddr = NULL; } From nobody Mon Jun 3 19:24:48 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 4VtNw03mFbz5Js2f; Mon, 03 Jun 2024 19:24:48 +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 4VtNw02RTdz4TtW; Mon, 3 Jun 2024 19:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442688; 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=N2wa3mLJEfLgabDBTLvaKO5uGfz/qogtaEnUUoir7ic=; b=uW0DHAQWK10XE1kLOTBh2PpgxsfOz9PfsxyfGK6gJ8p0KkqHhMpfY0QPgvZtjFqmKwNLcO /CEvXfCqa111s8YF1nMS7/DucODhRxzs71XX3a5faLNjO+U7cuMPAC6pehxqUr1cGPrhKv nWgO3va2YQbyjFyjZhOx0q6UFbo0Tur+2JoWnJQR54GAHZCFFhFWjyFoX5LdSasrnX9Zbx JqitH90h8syfeGzNGyRdPdKrFArmV0UvSu73/XJ1l3m1Qo+fpJwM7hsyd3+8Ws2qQrWxw8 /rEjBRaDTpM70j6QyzK4n54MorfNiEcvWNmIQsfjHJZR2WLdUyPrn++uK5gViQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442688; a=rsa-sha256; cv=none; b=EN6zFW3QbHYrpHA1KavAzRTKcqhuf7FhItICsyDc9BLT4iIHu6fGYFpP5mhlFltYkML74B maYb3cuNAsURGMkcGsagk28JacnGZURnDu23uanBQxOIz3s2R1ynUCWwbPsehdj3u86TSu cZ8fg9sgFp4j8qyKPfnSRni2AZfzmE+EvP91jXn66CaMHUscbaFmIxitSo+yMBenHTfVAm Ybv5phak0bxPXATYhvYPHkehyZsMCVoI9r4Vt6mT45EOhCdhFg5KRl0YnI/Ji1bR7qMQaa bguhb/WapYnWPmM9cuCml4v14Iy88jQchyGxSN9vum5wnrXU7onMVa6L5blWXA== 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=1717442688; 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=N2wa3mLJEfLgabDBTLvaKO5uGfz/qogtaEnUUoir7ic=; b=N9uFKmIsLYcL8AbDaZ0j8PDNool+X0IA+ToJMHtJ1N/1wHbrn0eAMdyTllh1HKll2kkZt0 HFmce+ooUH19tgHkO4FHk/5pQUTQyt3dRTyHD6CqdtfCMoprQrallno1Zn8eB3bkxN2/WY ycyguWqfVmsdXdW7tzdZVwrFRF2ccG8EYa8aCq/pfjceDoDTNzBJYyhBlqW21tnCbOtRd6 7kBJP9NeDe4KkA/fOIrRiHjUmurFa3nFzh8qysp5JHOXI29eE5DgF2+oadeZedJyCYWqMs l9XRQH6SS/yrOnYpHwC/yuMfx7oal4lgFRMtiy7VYd8pLsdjoqKIRT68wx2Zwg== 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 4VtNw023sVzndw; Mon, 3 Jun 2024 19:24:48 +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 453JOmF1067332; Mon, 3 Jun 2024 19:24:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOm3r067329; Mon, 3 Jun 2024 19:24:48 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:48 GMT Message-Id: <202406031924.453JOm3r067329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6288beb31e0c - stable/14 - if_bnxt: Fix media speed update issue in "ifconfig -m" during PHY hot plug 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6288beb31e0c1bb516ace7b7eeafa412a6642444 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6288beb31e0c1bb516ace7b7eeafa412a6642444 commit 6288beb31e0c1bb516ace7b7eeafa412a6642444 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:13:07 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:12 +0000 if_bnxt: Fix media speed update issue in "ifconfig -m" during PHY hot plug Currently, if a media type (e.g., DAC) is hot-plugged out and another type (e.g., optical cable) is hot-plugged in, the new speed is not reflected in ifconfig. This occurs when the driver fails to update speeds with unchanged tx and rx flow control. To fix, a phy_type check ensures update of phy speeds upon detecting the new phy. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42951 (cherry picked from commit 7cbffbfcd9a5185be61bec65790674159bb7c0a8) --- sys/dev/bnxt/bnxt.h | 1 + sys/dev/bnxt/if_bnxt.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 2b5c16e263d7..4484c8db5430 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -298,6 +298,7 @@ struct bnxt_link_info { uint8_t last_link_up; uint8_t duplex; uint8_t last_duplex; + uint8_t last_phy_type; struct bnxt_flow_ctrl flow_ctrl; struct bnxt_flow_ctrl last_flow_ctrl; uint8_t duplex_setting; diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 70d699d4b419..8dc151121311 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -3072,6 +3072,7 @@ bnxt_report_link(struct bnxt_softc *softc) if (!link_info->link_up) return; if ((link_info->duplex == link_info->last_duplex) && + (link_info->phy_type == link_info->last_phy_type) && (!(BNXT_IS_FLOW_CTRL_CHANGED(link_info)))) return; } @@ -3102,6 +3103,7 @@ bnxt_report_link(struct bnxt_softc *softc) link_info->last_link_up = link_info->link_up; link_info->last_duplex = link_info->duplex; + link_info->last_phy_type = link_info->phy_type; link_info->last_flow_ctrl.tx = link_info->flow_ctrl.tx; link_info->last_flow_ctrl.rx = link_info->flow_ctrl.rx; link_info->last_flow_ctrl.autoneg = link_info->flow_ctrl.autoneg; From nobody Mon Jun 3 19:24:49 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 4VtNw14GBYz5Js2l; Mon, 03 Jun 2024 19:24:49 +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 4VtNw13Blpz4VCX; Mon, 3 Jun 2024 19:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442689; 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=+pKveG5V0Rem3DJ2z9tK5I2Tp3MsBcGP9nwbMtYHlls=; b=KYNgIkoyPxmqjC6PcWH3blidNVoaspJ/cZwhCXVeGmVbkc67fox8bIW43OTztv+ih0055o VeA/xQ1kpQG9Axcswt+vWrtA9kS3zT6qpS6qY8Ye21kCxXGYPVH9twKY7a9ScDp7wA6n76 BxHPF/Z9rMtEjxmYQdP8iSz06D/ckjWpDFUirqdnRUF41JWwxAD3uJUKP2hxqDec+V1ZXK PPZPxzsC9Sh55uSZ7aZ6D98ctleZNwyrCjbnZeCqb281WntckvEW64bFYuAnVTCtIciT/r yjfPYLDWJ2U+nKin6v4gz7tZxxjCWxoYHzUkLVMvrl19EzrI+a2wwViE2xwLjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442689; a=rsa-sha256; cv=none; b=j0KQmGBmvuqxkOYuT/A9FCMfaArj3+RQThk7q3vMHGH6WBHJ5xZRittfdGHCsxQB3piLdV XTJ/0vP3Kpkbg1MUZtHtHtjqGG/LFgF5+0pTH5vHf9CO7ZBrsWk3uRjBqC8ljFGxjCgWsJ F2vTZMeJmfkYNruJEiefoVVtOoZXrmbtuPKYFlWaFsI1E7DWvaUIWP8fC/1H0pqgBANadO nuAQm5lNuW4z4cNfTUsd8YzmFcVF8rOCZaO6ToyQG466fOIILyxmMrjB88f0EJU43vovOT kmFFJ9xSrBohmLAf50xJO7h4GBJ4jdGiz2VjkVt0eD3W34SoarLyM+vZIng14A== 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=1717442689; 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=+pKveG5V0Rem3DJ2z9tK5I2Tp3MsBcGP9nwbMtYHlls=; b=XrnfN1soHpcPTBFizKFLbvChwwF2K9guEePYPw1gAqsirB55FcvAG8iUVlhpCVa7bOjKbA rcLAX5pTiIarx77kFsbGb0J+ryXiISIr+WbijASLOPu7+QqKu0lwePHiKyaN+usnk01SXq et+div4Lvj8iKKsmak59RemP0LZCZBToZPXV4l1anxBDfjkWXI2UltgrNoyAnRMDtDkbYl +aBTTD9MChKzJylBBRbxGRBhU0FWAfUXEQ3+VwAkpnWJFm43suHn6dnEddYgfB/Cu1tS6D 7ZfkljduZAJRcpfhGyCuhsfzxYqFDhQZrMA/Q6PqHqvOuRxaJnDpHLbDpqKXEQ== 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 4VtNw12qKTznPB; Mon, 3 Jun 2024 19:24:49 +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 453JOnR7067392; Mon, 3 Jun 2024 19:24:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOngO067389; Mon, 3 Jun 2024 19:24:49 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:49 GMT Message-Id: <202406031924.453JOngO067389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 30ae347bc109 - stable/14 - if_bnxt: Incorrect Labeling of Supported Medium in `ifconfig -m ` Command 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 30ae347bc1092080780f2a584131f53244ff72d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=30ae347bc1092080780f2a584131f53244ff72d6 commit 30ae347bc1092080780f2a584131f53244ff72d6 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:14:27 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:12 +0000 if_bnxt: Incorrect Labeling of Supported Medium in `ifconfig -m ` Command The 1G speed on DAC medium is incorrectly labeled as 1000baseT, it should be 1000baseCX. Updated the label accordingly. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42952 (cherry picked from commit c5108e37fbf93a538c76325766b8a3d76a72f119) --- sys/dev/bnxt/if_bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 8dc151121311..1432587cbd4a 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -2891,7 +2891,7 @@ bnxt_add_media_types(struct bnxt_softc *softc) BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_CR4); BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_CR); BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_CR1); - BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_T); + BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_CX); break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4: From nobody Mon Jun 3 19:24:50 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 4VtNw304Dhz5JsD1; Mon, 03 Jun 2024 19:24: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 4VtNw24Ygmz4VB4; Mon, 3 Jun 2024 19:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442690; 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=Ir3NpNGvmMm0KfLMGiMxmPJr59SaTLgPYJ6Qe+9XFNY=; b=B3X92EaEFR4FIHPVxMbZuvAP1I+FcPBu2yVKwpAN+6bj16sm7jCRM8hUfP5YQ3evzq1sag EW2QBERzBdY9uXENM+NjXdqB6glQH0wsVWcFrXe1jXtn/CJC/YrF3YCDcxKUEA1m/OxXH0 dJXbI1VEnpSRRettU4H4moRXbTklsrEYUH+6MeqDAy995ZN+fxNqIg62Hw5dnMssP2QU2m VYe0QyQ4ZUOghcIyVkQcl2/5q/SLsgHiNwq+r+ZehzHMCO3HiZhhNgnwJomNN+Ze1Xx0y1 4v4Mov6pIRSgtE58N//h4gWiQc9NSbuunzv7YV+z/YjdxbgxQKrL4pYsLXC3Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442690; a=rsa-sha256; cv=none; b=mZ7knnlZY8Uxqzu9JdQt/Mu4udUQLhCVaORN4CakN7/ozuavSNeZaB4e7tMEtk1KhbZgHm vKXOA1GJAzEZEF6kiil9o6HtbA76kbJr3talBN8dRkuT2zrIOahZTseVmGliiaAW/qPVJ5 v/uP1nRhXHvJgxOte8FZ8t3YxRwbgbZudat2tila1sdXHFJQTW/G09LgI8XbAvFjUG6jgO MO1+fs0jXNfcVdfwp1HM+FhEOiWUIg+0fheo5+xbk5y4Aqk7Zu1NpK1L9C5UdyrLbrObQ9 D8Ussf6lT0JDp+x30dgXmHjfb9A0u/zn9uOq1NGEXUF5lgzSdj4vJEsrBWYQsw== 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=1717442690; 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=Ir3NpNGvmMm0KfLMGiMxmPJr59SaTLgPYJ6Qe+9XFNY=; b=U8rvYUeV7/oE8yj2LErav2nO5K/Fh9yryyp9O4VWsLoP8x4CblmKDDBib1EzMiEX9NzEAz 5QxWU2THXNF5ouKYdvntfZb0u/VHPvhkgmzp/PS8SHcjvoWvmD1uZUE/lSqonrl1G2FtUz KLwDt4o4p85cZVXyztILLI3CULHvHSUNwl/QDoGFE20092WVXYYdMUs482r4rDkzDs7AHB kwYQarVbimt82D8ey8tOPXXUbwFJ3NDVtrc4XQtImtS3Tt8HoW38zP9f3orDwxBDzVBt1W o7Djv643SJEFeqgyJo/l7LjG6evnvgITqszWBtJBrzvjJ/TzY4xW//8GWZXlPg== 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 4VtNw2491pzndx; Mon, 3 Jun 2024 19:24:50 +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 453JOoZj067455; Mon, 3 Jun 2024 19:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOodj067452; Mon, 3 Jun 2024 19:24:50 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:50 GMT Message-Id: <202406031924.453JOodj067452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c75f0a568ef6 - stable/14 - if_bnxt: Enabled support for 1G SX, CX, and LX forced speed settings 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c75f0a568ef6169cd92e15af130f095981fcdaef Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c75f0a568ef6169cd92e15af130f095981fcdaef commit c75f0a568ef6169cd92e15af130f095981fcdaef Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:15:32 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Enabled support for 1G SX, CX, and LX forced speed settings Enabled User Configuration of 1G Speed on Wh+ SFP28 Port with AOC cable. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42953 (cherry picked from commit 0f8d1a9e0cd26bf4dd0b2fe2d28c1ab15d03cce4) --- sys/dev/bnxt/if_bnxt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 1432587cbd4a..5edb678ac444 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -2083,6 +2083,9 @@ bnxt_media_change(if_ctx_t ctx) case IFM_1000_KX: case IFM_1000_T: case IFM_1000_SGMII: + case IFM_1000_CX: + case IFM_1000_SX: + case IFM_1000_LX: softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; softc->link_info.req_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB; From nobody Mon Jun 3 19:24:51 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 4VtNw415t8z5Jrhs; Mon, 03 Jun 2024 19:24:52 +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 4VtNw35ZHvz4VGQ; Mon, 3 Jun 2024 19:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442691; 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=dZ5oMeavB2VyGs2IZ6G67GPJs44142ODeVplBaHPDio=; b=Yw2OVb09/YwD6eL88rCWycBw9euiMVZouNc3IO01c4GkSmU4huAFXHPDWJnhf6DNGC2opl LRBP5wTIF02RGEJ5unZogYxH6mTdVeoNDEDaQpjjFDPHYlB5PRCLqxhUJDmB4hMNrdXhP6 mocY89PnnrHsdavmvohERjQ9lxZkG+vxpUyXY8A6g3Af/+cP27KdJYXctvvVkxpiMtaKkE kVCeoiFnVTMjz4A5CGThrwsnF1yf1SA5HWRb6GuuVEBhkJCPW+f28si/oiLDD2nAO02fQS uDGeVCpoU+B7TbrHL8EJRYjx7oP8P0JOWBMgOJ6ILlJXgnl4mTkNNjE6OpoEOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442691; a=rsa-sha256; cv=none; b=KBdE+45c8Uk9OPti7Qi6fCdEmcxCF0IMUp53ayY2ut+oeXvG2F3xWjWScoaayluxC2p349 aUDEAwQqvy+VRRludRNcIB3tXFbu+8XPNVSjEvpU/U19xQHaYmhDYQvlxDpKe3u4eQxlGn AT21Hkc8oxfbopueuJ7J1tBrxGpp8OcY7ls2/zICMb4XgW2eOFzXW4Dn8NVAth/1DLwKjX cLTkaigYG4nY+hcWKFCu9tUgmpv8zJzpPxEihsajTF1tEKOobffV0AhW/yNe2P+ZBe01RT MAMp5zUcWVekRuchM50yu50WKREDt91PRA40ptGryXwxxC8Op8qjjbY+lYwYaA== 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=1717442691; 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=dZ5oMeavB2VyGs2IZ6G67GPJs44142ODeVplBaHPDio=; b=M/ylxRLsERt36lvtsiZXDSj57redT/IteJFIGso959gHRQ0X04INhy4jythUEe315ffLNf yfCF8QIGZnxZpPlqkSzxlpRocojvslKDVPs5B8CtR6+I4rRXH/GZbiEgzuIeHlAD0q+QFS Di+MNMy4KkLbwVIydARw3e4Sn0HGY49OBIxXJv5mfVeTjq2ykr9z6zpymRYN74XuqW3dtW zqSVY3zTCAmfzmWj2NMTRzLyhSBuytkWl7Kq4qVNdGF5xcearMnsAemJ71g2i2AYaDbS9W JaumzoEMWq6eWyj0fSpUR3qq9J84MFN+WbCymaE6bFIKT+a9ovR0EIEs+qBa5w== 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 4VtNw35Bjgzndy; Mon, 3 Jun 2024 19:24: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 453JOpKG067515; Mon, 3 Jun 2024 19:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOpHC067511; Mon, 3 Jun 2024 19:24:51 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:51 GMT Message-Id: <202406031924.453JOpHC067511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: baa7cf252480 - stable/14 - if_bnxt: Update Maximum Configurable MTU from 9000 to 9600 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: baa7cf252480ae73a72466ea26e5e940d3ffd3df Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=baa7cf252480ae73a72466ea26e5e940d3ffd3df commit baa7cf252480ae73a72466ea26e5e940d3ffd3df Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:16:38 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Update Maximum Configurable MTU from 9000 to 9600 Increasing the maximum configurable MTU from 9000 to 9600 to align with the firmware's capability of handling an MTU up to 9600. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42954 (cherry picked from commit 8a3aab53e335dadb3c95c0eb0664143a955f1ab7) --- sys/dev/bnxt/bnxt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 4484c8db5430..73122f82c7ad 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -98,7 +98,7 @@ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) -#define BNXT_MAX_MTU 9000 +#define BNXT_MAX_MTU 9600 #define BNXT_RSS_HASH_TYPE_TCPV4 0 #define BNXT_RSS_HASH_TYPE_UDPV4 1 From nobody Mon Jun 3 19:24:52 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 4VtNw65PVWz5JsGM; Mon, 03 Jun 2024 19:24:54 +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 4VtNw63KR6z4VSD; Mon, 3 Jun 2024 19:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442694; 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=UAIQM638XfH/oXpVVwN2wsiHmTdhA866+t3c0o7udYk=; b=as9gV3r3d+3X9AbXONkkAoyvecnXy3N756UBnjnRVrp8aS/+C4/JdirbGk6/LjPhkDWkKl TcU/6OD2dDZvWEB78DdB1CgQ11Q9vifsj9TcxI2iWAe07mvYKMgsFiXZDe5oUbwpPf0EwQ oqRAd8H9phvXIAo4c9G/1VLXG1/laiP5d8l6tn4OSpZ8EH04eaoLDF+SGBfqMTMzek8LFn 2tE3goHdEyLkmC/Xrk1eH9cfUem/Icavzg59ndNTIZv16lSvvVXPk36T+a7mVwOag07wV9 3zfoG/pWD8Jz1ob0TcTtI3lXmklMWloxmmPMaAdBH1U5ek7wHs7/hgoL7ArRlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442694; a=rsa-sha256; cv=none; b=dEa7gm9cZ5nxj7VWlk0GjzFtoNUtybekcvWxdd4nnFLM9nIdqBR5zATFMjdMOXcCJ3ZWEC tA5xE8qgSnmQP151bzJCCMe6DgYg2ml/NgfGHZALTuo+VOwFgqfvDiPDt8YrowBzE2Rd9J yYA00M92PIV32G8ppR5ht6cVPbv/FBKoiwsG0lBVf2V9SERCkTT/aBEPmtUS9zhcNE2zOa qXvOCsu71qwx2Kj6cuSmoRVDuRjzOjdy7kn4Ap5Wb0UWAO4wxTXWHhSUherku4CTuHSgml gwxnleIVfBzt5jL3EOkOZOiVux9VztJMDmQM+BP4ypbTQqgHBMjh9ci8vgXV2g== 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=1717442694; 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=UAIQM638XfH/oXpVVwN2wsiHmTdhA866+t3c0o7udYk=; b=BnsopAeieXrDzosGncXW44OeX9Jppe8jgQDTDZgntUplzUIhhygtwY9ClTBj/W/BIshLZK ELrFXCS/roVISl2JQ12fZV7l63x0kqyF/gmyTX6WkoQoDCcdtzUXk6hSEE7vwnq3W2/z5S 9vnMR8m1xehQFUgnO1cuQ/lPcpulDBF/Xd5E8SVQK3Xh1ths77GQ2uRQxsGhUgI3USBxA8 AKJNAF9W33d4bcVzER5JK+ZMVUo2n71QEpx8ddQ2qpDSblUsdIt8sfDuBJ8B8cUT6XYDFo n23v0W4pEPI4sxnTuHt2f9diADpKLzXJcJKqw22wkDg3VAAqKN5RgWPi7z8TzQ== 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 4VtNw62wcbzn1g; Mon, 3 Jun 2024 19:24:54 +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 453JOsKB067567; Mon, 3 Jun 2024 19:24:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOqF5067564; Mon, 3 Jun 2024 19:24:52 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:52 GMT Message-Id: <202406031924.453JOqF5067564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 51f6f533ba29 - stable/14 - if_bnxt: Update Firmware Header to Latest Version 1.10.2.136 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 51f6f533ba29435bd7d23778834f86e66b83f3d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=51f6f533ba29435bd7d23778834f86e66b83f3d3 commit 51f6f533ba29435bd7d23778834f86e66b83f3d3 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:17:50 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Update Firmware Header to Latest Version 1.10.2.136 Update Firmware Header to Latest Version 1.10.2.136. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42955 (cherry picked from commit 25f38d09907fdfcc473fdc53c17b7c2d8c7c09a1) --- sys/dev/bnxt/hsi_struct_def.h | 93714 +++++++++++++++++++++++----------------- 1 file changed, 53950 insertions(+), 39764 deletions(-) diff --git a/sys/dev/bnxt/hsi_struct_def.h b/sys/dev/bnxt/hsi_struct_def.h index 576e1e9a7ed8..d2097ca1ca33 100644 --- a/sys/dev/bnxt/hsi_struct_def.h +++ b/sys/dev/bnxt/hsi_struct_def.h @@ -28,8 +28,10 @@ */ #include +__FBSDID("$FreeBSD$"); + /* - * Copyright(c) 2001-2021, Broadcom. All rights reserved. The + * Copyright(c) 2001-2023, Broadcom. All rights reserved. The * term Broadcom refers to Broadcom Inc. and/or its subsidiaries. * Proprietary and Confidential Information. * @@ -40,8 +42,8 @@ * DO NOT MODIFY!!! This file is automatically generated. */ -#ifndef _HSI_STRUCT_DEF_EXTERNAL_H_ -#define _HSI_STRUCT_DEF_EXTERNAL_H_ +#ifndef _HSI_STRUCT_DEF_H_ +#define _HSI_STRUCT_DEF_H_ /* This is the HWRM command header. */ /* hwrm_cmd_hdr (size:128b/16B) */ @@ -433,6 +435,10 @@ typedef struct hwrm_short_input { ((x) == 0xd7 ? "HWRM_PORT_SFP_SIDEBAND_QCFG": \ ((x) == 0xd8 ? "HWRM_FW_STATE_UNQUIESCE": \ ((x) == 0xd9 ? "HWRM_PORT_DSC_DUMP": \ + ((x) == 0xda ? "HWRM_PORT_EP_TX_QCFG": \ + ((x) == 0xdb ? "HWRM_PORT_EP_TX_CFG": \ + ((x) == 0xdc ? "HWRM_PORT_CFG": \ + ((x) == 0xdd ? "HWRM_PORT_QCFG": \ ((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \ ((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \ ((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \ @@ -450,7 +456,7 @@ typedef struct hwrm_short_input { ((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \ ((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \ ((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \ - "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x180) ? \ ((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \ ((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \ @@ -492,6 +498,8 @@ typedef struct hwrm_short_input { ((x) == 0x125 ? "HWRM_CFA_TFLIB": \ ((x) == 0x126 ? "HWRM_CFA_LAG_GROUP_MEMBER_RGTR": \ ((x) == 0x127 ? "HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR": \ + ((x) == 0x128 ? "HWRM_CFA_TLS_FILTER_ALLOC": \ + ((x) == 0x129 ? "HWRM_CFA_TLS_FILTER_FREE": \ ((x) == 0x12e ? "HWRM_ENGINE_CKV_STATUS": \ ((x) == 0x12f ? "HWRM_ENGINE_CKV_CKEK_ADD": \ ((x) == 0x130 ? "HWRM_ENGINE_CKV_CKEK_DELETE": \ @@ -531,7 +539,7 @@ typedef struct hwrm_short_input { ((x) == 0x163 ? "HWRM_ENGINE_NQ_FREE": \ ((x) == 0x164 ? "HWRM_ENGINE_ON_DIE_RQE_CREDITS": \ ((x) == 0x165 ? "HWRM_ENGINE_FUNC_QCFG": \ - "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x200) ? \ ((x) == 0x190 ? "HWRM_FUNC_RESOURCE_QCAPS": \ ((x) == 0x191 ? "HWRM_FUNC_VF_RESOURCE_CFG": \ @@ -549,7 +557,20 @@ typedef struct hwrm_short_input { ((x) == 0x19d ? "HWRM_FUNC_PTP_PIN_CFG": \ ((x) == 0x19e ? "HWRM_FUNC_PTP_CFG": \ ((x) == 0x19f ? "HWRM_FUNC_PTP_TS_QUERY": \ - "Unknown decode" )))))))))))))))) : \ + ((x) == 0x1a0 ? "HWRM_FUNC_PTP_EXT_CFG": \ + ((x) == 0x1a1 ? "HWRM_FUNC_PTP_EXT_QCFG": \ + ((x) == 0x1a2 ? "HWRM_FUNC_KEY_CTX_ALLOC": \ + ((x) == 0x1a3 ? "HWRM_FUNC_BACKING_STORE_CFG_V2": \ + ((x) == 0x1a4 ? "HWRM_FUNC_BACKING_STORE_QCFG_V2": \ + ((x) == 0x1a5 ? "HWRM_FUNC_DBR_PACING_CFG": \ + ((x) == 0x1a6 ? "HWRM_FUNC_DBR_PACING_QCFG": \ + ((x) == 0x1a7 ? "HWRM_FUNC_DBR_PACING_BROADCAST_EVENT": \ + ((x) == 0x1a8 ? "HWRM_FUNC_BACKING_STORE_QCAPS_V2": \ + ((x) == 0x1a9 ? "HWRM_FUNC_DBR_PACING_NQLIST_QUERY": \ + ((x) == 0x1aa ? "HWRM_FUNC_DBR_RECOVERY_COMPLETED": \ + ((x) == 0x1ab ? "HWRM_FUNC_SYNCE_CFG": \ + ((x) == 0x1ac ? "HWRM_FUNC_SYNCE_QCFG": \ + "Unknown decode" ))))))))))))))))))))))))))))) : \ (((x) < 0x280) ? \ ((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \ ((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \ @@ -568,7 +589,15 @@ typedef struct hwrm_short_input { ((x) == 0x20e ? "HWRM_MFG_PARAM_SEEPROM_SYNC": \ ((x) == 0x20f ? "HWRM_MFG_PARAM_SEEPROM_READ": \ ((x) == 0x210 ? "HWRM_MFG_PARAM_SEEPROM_HEALTH": \ - "Unknown decode" ))))))))))))))))) : \ + ((x) == 0x211 ? "HWRM_MFG_PRVSN_EXPORT_CSR": \ + ((x) == 0x212 ? "HWRM_MFG_PRVSN_IMPORT_CERT": \ + ((x) == 0x213 ? "HWRM_MFG_PRVSN_GET_STATE": \ + ((x) == 0x214 ? "HWRM_MFG_GET_NVM_MEASUREMENT": \ + ((x) == 0x215 ? "HWRM_MFG_PSOC_QSTATUS": \ + ((x) == 0x216 ? "HWRM_MFG_SELFTEST_QLIST": \ + ((x) == 0x217 ? "HWRM_MFG_SELFTEST_EXEC": \ + ((x) == 0x218 ? "HWRM_STAT_GENERIC_QSTATS": \ + "Unknown decode" ))))))))))))))))))))))))) : \ (((x) < 0x300) ? \ ((x) == 0x2bc ? "HWRM_TF": \ ((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \ @@ -583,6 +612,8 @@ typedef struct hwrm_short_input { ((x) == 0x2ce ? "HWRM_TF_SESSION_RESC_FREE": \ ((x) == 0x2cf ? "HWRM_TF_SESSION_RESC_FLUSH": \ ((x) == 0x2d0 ? "HWRM_TF_SESSION_RESC_INFO": \ + ((x) == 0x2d1 ? "HWRM_TF_SESSION_HOTUP_STATE_SET": \ + ((x) == 0x2d2 ? "HWRM_TF_SESSION_HOTUP_STATE_GET": \ ((x) == 0x2da ? "HWRM_TF_TBL_TYPE_GET": \ ((x) == 0x2db ? "HWRM_TF_TBL_TYPE_SET": \ ((x) == 0x2dc ? "HWRM_TF_TBL_TYPE_BULK_GET": \ @@ -606,7 +637,33 @@ typedef struct hwrm_short_input { ((x) == 0x2fd ? "HWRM_TF_GLOBAL_CFG_GET": \ ((x) == 0x2fe ? "HWRM_TF_IF_TBL_SET": \ ((x) == 0x2ff ? "HWRM_TF_IF_TBL_GET": \ - "Unknown decode" )))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))) : \ + (((x) < 0x400) ? \ + ((x) == 0x380 ? "HWRM_TFC_TBL_SCOPE_QCAPS": \ + ((x) == 0x381 ? "HWRM_TFC_TBL_SCOPE_ID_ALLOC": \ + ((x) == 0x382 ? "HWRM_TFC_TBL_SCOPE_CONFIG": \ + ((x) == 0x383 ? "HWRM_TFC_TBL_SCOPE_DECONFIG": \ + ((x) == 0x384 ? "HWRM_TFC_TBL_SCOPE_FID_ADD": \ + ((x) == 0x385 ? "HWRM_TFC_TBL_SCOPE_FID_REM": \ + ((x) == 0x386 ? "HWRM_TFC_TBL_SCOPE_POOL_ALLOC": \ + ((x) == 0x387 ? "HWRM_TFC_TBL_SCOPE_POOL_FREE": \ + ((x) == 0x388 ? "HWRM_TFC_SESSION_ID_ALLOC": \ + ((x) == 0x389 ? "HWRM_TFC_SESSION_FID_ADD": \ + ((x) == 0x38a ? "HWRM_TFC_SESSION_FID_REM": \ + ((x) == 0x38b ? "HWRM_TFC_IDENT_ALLOC": \ + ((x) == 0x38c ? "HWRM_TFC_IDENT_FREE": \ + ((x) == 0x38d ? "HWRM_TFC_IDX_TBL_ALLOC": \ + ((x) == 0x38e ? "HWRM_TFC_IDX_TBL_ALLOC_SET": \ + ((x) == 0x38f ? "HWRM_TFC_IDX_TBL_SET": \ + ((x) == 0x390 ? "HWRM_TFC_IDX_TBL_GET": \ + ((x) == 0x391 ? "HWRM_TFC_IDX_TBL_FREE": \ + ((x) == 0x392 ? "HWRM_TFC_GLOBAL_ID_ALLOC": \ + ((x) == 0x393 ? "HWRM_TFC_TCAM_SET": \ + ((x) == 0x394 ? "HWRM_TFC_TCAM_GET": \ + ((x) == 0x395 ? "HWRM_TFC_TCAM_ALLOC": \ + ((x) == 0x396 ? "HWRM_TFC_TCAM_ALLOC_SET": \ + ((x) == 0x397 ? "HWRM_TFC_TCAM_FREE": \ + "Unknown decode" )))))))))))))))))))))))) : \ (((x) < 0x480) ? \ ((x) == 0x400 ? "HWRM_SV": \ "Unknown decode" ) : \ @@ -641,6 +698,7 @@ typedef struct hwrm_short_input { ((x) == 0xff2b ? "HWRM_DBG_USEQ_RESP_HDR": \ "Unknown decode" )))))))))))))))))))))))))))) : \ (((x) <= 0xffff) ? \ + ((x) == 0xffec ? "HWRM_NVM_DEFRAG": \ ((x) == 0xffed ? "HWRM_NVM_REQ_ARBITRATION": \ ((x) == 0xffee ? "HWRM_NVM_FACTORY_DEFAULTS": \ ((x) == 0xffef ? "HWRM_NVM_VALIDATE_OPTION": \ @@ -660,8 +718,8 @@ typedef struct hwrm_short_input { ((x) == 0xfffd ? "HWRM_NVM_READ": \ ((x) == 0xfffe ? "HWRM_NVM_WRITE": \ ((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \ - "Unknown decode" ))))))))))))))))))) : \ - "Unknown decode" ))))))))) + "Unknown decode" )))))))))))))))))))) : \ + "Unknown decode" )))))))))) /* @@ -864,6 +922,10 @@ typedef struct cmd_nums { #define HWRM_FW_STATE_UNQUIESCE UINT32_C(0xd8) /* Tells the fw to collect dsc dump on a given port and lane. */ #define HWRM_PORT_DSC_DUMP UINT32_C(0xd9) + #define HWRM_PORT_EP_TX_QCFG UINT32_C(0xda) + #define HWRM_PORT_EP_TX_CFG UINT32_C(0xdb) + #define HWRM_PORT_CFG UINT32_C(0xdc) + #define HWRM_PORT_QCFG UINT32_C(0xdd) #define HWRM_TEMP_MONITOR_QUERY UINT32_C(0xe0) #define HWRM_REG_POWER_QUERY UINT32_C(0xe1) #define HWRM_CORE_FREQUENCY_QUERY UINT32_C(0xe2) @@ -902,9 +964,7 @@ typedef struct cmd_nums { #define HWRM_CFA_FLOW_FREE UINT32_C(0x104) /* Experimental */ #define HWRM_CFA_FLOW_FLUSH UINT32_C(0x105) - /* Experimental */ #define HWRM_CFA_FLOW_STATS UINT32_C(0x106) - /* Experimental */ #define HWRM_CFA_FLOW_INFO UINT32_C(0x107) /* Experimental */ #define HWRM_CFA_DECAP_FILTER_ALLOC UINT32_C(0x108) @@ -965,6 +1025,10 @@ typedef struct cmd_nums { #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR UINT32_C(0x126) /* Experimental */ #define HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR UINT32_C(0x127) + /* Experimental */ + #define HWRM_CFA_TLS_FILTER_ALLOC UINT32_C(0x128) + /* Experimental */ + #define HWRM_CFA_TLS_FILTER_FREE UINT32_C(0x129) /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */ #define HWRM_ENGINE_CKV_STATUS UINT32_C(0x12e) /* Engine CKV - Add a new CKEK used to encrypt keys. */ @@ -1075,6 +1139,38 @@ typedef struct cmd_nums { #define HWRM_FUNC_PTP_CFG UINT32_C(0x19e) /* PTP - Queries for PHC timestamps. */ #define HWRM_FUNC_PTP_TS_QUERY UINT32_C(0x19f) + /* PTP - Extended PTP configuration. */ + #define HWRM_FUNC_PTP_EXT_CFG UINT32_C(0x1a0) + /* PTP - Query extended PTP configuration. */ + #define HWRM_FUNC_PTP_EXT_QCFG UINT32_C(0x1a1) + /* The command is used to allocate KTLS or QUIC key contexts. */ + #define HWRM_FUNC_KEY_CTX_ALLOC UINT32_C(0x1a2) + /* The is the new API to configure backing stores. */ + #define HWRM_FUNC_BACKING_STORE_CFG_V2 UINT32_C(0x1a3) + /* The is the new API to query backing store configurations. */ + #define HWRM_FUNC_BACKING_STORE_QCFG_V2 UINT32_C(0x1a4) + /* To support doorbell pacing configuration. */ + #define HWRM_FUNC_DBR_PACING_CFG UINT32_C(0x1a5) + /* To query doorbell pacing configuration. */ + #define HWRM_FUNC_DBR_PACING_QCFG UINT32_C(0x1a6) + /* + * To broadcast the doorbell event to the drivers to + * initiate pacing of doorbells. + */ + #define HWRM_FUNC_DBR_PACING_BROADCAST_EVENT UINT32_C(0x1a7) + /* The is the new API to query backing store capabilities. */ + #define HWRM_FUNC_BACKING_STORE_QCAPS_V2 UINT32_C(0x1a8) + /* To query doorbell pacing NQ id list configuration. */ + #define HWRM_FUNC_DBR_PACING_NQLIST_QUERY UINT32_C(0x1a9) + /* + * To notify the firmware that recovery cycle has been + * completed by host function drivers. + */ + #define HWRM_FUNC_DBR_RECOVERY_COMPLETED UINT32_C(0x1aa) + /* Configures SyncE configurations. */ + #define HWRM_FUNC_SYNCE_CFG UINT32_C(0x1ab) + /* Queries SyncE configurations. */ + #define HWRM_FUNC_SYNCE_QCFG UINT32_C(0x1ac) /* Experimental */ #define HWRM_SELFTEST_QLIST UINT32_C(0x200) /* Experimental */ @@ -1112,6 +1208,40 @@ typedef struct cmd_nums { #define HWRM_MFG_PARAM_SEEPROM_READ UINT32_C(0x20f) /* Tells the fw to get the health of seeprom data */ #define HWRM_MFG_PARAM_SEEPROM_HEALTH UINT32_C(0x210) + /* + * The command is used for certificate provisioning to export a + * Certificate Signing Request (CSR) from the device. + */ + #define HWRM_MFG_PRVSN_EXPORT_CSR UINT32_C(0x211) + /* + * The command is used for certificate provisioning to import a + * CA-signed certificate chain to the device. + */ + #define HWRM_MFG_PRVSN_IMPORT_CERT UINT32_C(0x212) + /* + * The command is used for certificate provisioning to query the + * provisioned state. + */ + #define HWRM_MFG_PRVSN_GET_STATE UINT32_C(0x213) + /* + * The command is used to get the hash of the NVM configuration that is + * calculated during firmware boot. + */ + #define HWRM_MFG_GET_NVM_MEASUREMENT UINT32_C(0x214) + /* Retrieves the PSOC status and provisioning information. */ + #define HWRM_MFG_PSOC_QSTATUS UINT32_C(0x215) + /* + * This command allows manufacturing tool to determine which selftests + * are available to be run. + */ + #define HWRM_MFG_SELFTEST_QLIST UINT32_C(0x216) + /* + * This command allows manufacturing tool to request which selftests + * to run. + */ + #define HWRM_MFG_SELFTEST_EXEC UINT32_C(0x217) + /* Queries the generic stats */ + #define HWRM_STAT_GENERIC_QSTATS UINT32_C(0x218) /* Experimental */ #define HWRM_TF UINT32_C(0x2bc) /* Experimental */ @@ -1139,6 +1269,10 @@ typedef struct cmd_nums { /* Experimental */ #define HWRM_TF_SESSION_RESC_INFO UINT32_C(0x2d0) /* Experimental */ + #define HWRM_TF_SESSION_HOTUP_STATE_SET UINT32_C(0x2d1) + /* Experimental */ + #define HWRM_TF_SESSION_HOTUP_STATE_GET UINT32_C(0x2d2) + /* Experimental */ #define HWRM_TF_TBL_TYPE_GET UINT32_C(0x2da) /* Experimental */ #define HWRM_TF_TBL_TYPE_SET UINT32_C(0x2db) @@ -1184,6 +1318,54 @@ typedef struct cmd_nums { #define HWRM_TF_IF_TBL_SET UINT32_C(0x2fe) /* Experimental */ #define HWRM_TF_IF_TBL_GET UINT32_C(0x2ff) + /* TruFlow command to check firmware table scope capabilities. */ + #define HWRM_TFC_TBL_SCOPE_QCAPS UINT32_C(0x380) + /* TruFlow command to allocate a table scope ID and create the pools. */ + #define HWRM_TFC_TBL_SCOPE_ID_ALLOC UINT32_C(0x381) + /* TruFlow command to configure the table scope memory. */ + #define HWRM_TFC_TBL_SCOPE_CONFIG UINT32_C(0x382) + /* TruFlow command to deconfigure a table scope memory. */ + #define HWRM_TFC_TBL_SCOPE_DECONFIG UINT32_C(0x383) + /* TruFlow command to add a FID to a table scope. */ + #define HWRM_TFC_TBL_SCOPE_FID_ADD UINT32_C(0x384) + /* TruFlow command to remove a FID from a table scope. */ + #define HWRM_TFC_TBL_SCOPE_FID_REM UINT32_C(0x385) + /* TruFlow command to allocate a table scope pool. */ + #define HWRM_TFC_TBL_SCOPE_POOL_ALLOC UINT32_C(0x386) + /* TruFlow command to free a table scope pool. */ + #define HWRM_TFC_TBL_SCOPE_POOL_FREE UINT32_C(0x387) + /* Experimental */ + #define HWRM_TFC_SESSION_ID_ALLOC UINT32_C(0x388) + /* Experimental */ + #define HWRM_TFC_SESSION_FID_ADD UINT32_C(0x389) + /* Experimental */ + #define HWRM_TFC_SESSION_FID_REM UINT32_C(0x38a) + /* Experimental */ + #define HWRM_TFC_IDENT_ALLOC UINT32_C(0x38b) + /* Experimental */ + #define HWRM_TFC_IDENT_FREE UINT32_C(0x38c) + /* TruFlow command to allocate an index table entry */ + #define HWRM_TFC_IDX_TBL_ALLOC UINT32_C(0x38d) + /* TruFlow command to allocate and set an index table entry */ + #define HWRM_TFC_IDX_TBL_ALLOC_SET UINT32_C(0x38e) + /* TruFlow command to set an index table entry */ + #define HWRM_TFC_IDX_TBL_SET UINT32_C(0x38f) + /* TruFlow command to get an index table entry */ + #define HWRM_TFC_IDX_TBL_GET UINT32_C(0x390) + /* TruFlow command to free an index table entry */ + #define HWRM_TFC_IDX_TBL_FREE UINT32_C(0x391) + /* TruFlow command to allocate resources for a global id. */ + #define HWRM_TFC_GLOBAL_ID_ALLOC UINT32_C(0x392) + /* TruFlow command to set TCAM entry. */ + #define HWRM_TFC_TCAM_SET UINT32_C(0x393) + /* TruFlow command to get TCAM entry. */ + #define HWRM_TFC_TCAM_GET UINT32_C(0x394) + /* TruFlow command to allocate a TCAM entry. */ + #define HWRM_TFC_TCAM_ALLOC UINT32_C(0x395) + /* TruFlow command allocate and set TCAM entry. */ + #define HWRM_TFC_TCAM_ALLOC_SET UINT32_C(0x396) + /* TruFlow command to free a TCAM entry. */ + #define HWRM_TFC_TCAM_FREE UINT32_C(0x397) /* Experimental */ #define HWRM_SV UINT32_C(0x400) /* Experimental */ @@ -1241,6 +1423,7 @@ typedef struct cmd_nums { #define HWRM_DBG_USEQ_DELIVERY_REQ UINT32_C(0xff2a) /* Experimental */ #define HWRM_DBG_USEQ_RESP_HDR UINT32_C(0xff2b) + #define HWRM_NVM_DEFRAG UINT32_C(0xffec) #define HWRM_NVM_REQ_ARBITRATION UINT32_C(0xffed) /* Experimental */ #define HWRM_NVM_FACTORY_DEFAULTS UINT32_C(0xffee) @@ -1360,6 +1543,13 @@ typedef struct ret_codes { * by the host is not allowed due to a secure lock violation. */ #define HWRM_ERR_CODE_RESOURCE_LOCKED UINT32_C(0x11) + /* + * This error code is reported by Firmware when an operation requested + * by a VF cannot be forwarded to the parent PF as required, either + * because the PF is down or otherwise doesn't have an appropriate + * async completion ring or associated forwarding buffers configured. + */ + #define HWRM_ERR_CODE_PF_UNAVAILABLE UINT32_C(0x12) /* * This value indicates that the HWRM response is in TLV format and * should be interpreted as one or more TLVs starting with the @@ -1396,7 +1586,8 @@ typedef struct ret_codes { ((x) == 0xf ? "HWRM_ERROR": \ ((x) == 0x10 ? "BUSY": \ ((x) == 0x11 ? "RESOURCE_LOCKED": \ - "Unknown decode" )))))))))))))))))) : \ + ((x) == 0x12 ? "PF_UNAVAILABLE": \ + "Unknown decode" ))))))))))))))))))) : \ (((x) < 0x8080) ? \ ((x) == 0x8000 ? "TLV_ENCAPSULATED_RESPONSE": \ "Unknown decode" ) : \ @@ -1479,8 +1670,8 @@ typedef struct hwrm_err_output { #define HWRM_VERSION_MINOR 10 #define HWRM_VERSION_UPDATE 2 /* non-zero means beta version */ -#define HWRM_VERSION_RSVD 34 -#define HWRM_VERSION_STR "1.10.2.34" +#define HWRM_VERSION_RSVD 136 +#define HWRM_VERSION_STR "1.10.2.136" /**************** * hwrm_ver_get * @@ -1728,6 +1919,7 @@ typedef struct hwrm_ver_get_output { * If set to 1, firmware is capable to support flow aging. * If set to 0, firmware is not capable to support flow aging. * By default, this flag should be 0 for older version of core firmware. + * (deprecated) */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED UINT32_C(0x200) /* @@ -1735,6 +1927,7 @@ typedef struct hwrm_ver_get_output { * Meter drop counters and EEM counters. * If set to 0, firmware is not capable to support advanced flow counters. * By default, this flag should be 0 for older version of core firmware. + * (deprecated) */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED UINT32_C(0x400) /* @@ -1743,6 +1936,7 @@ typedef struct hwrm_ver_get_output { * If set to 0, firmware is not capable to support the use of the * CFA EEM feature. * By default, this flag should be 0 for older version of core firmware. + * (deprecated) */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED UINT32_C(0x800) /* @@ -1767,6 +1961,11 @@ typedef struct hwrm_ver_get_output { * core firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED UINT32_C(0x4000) + /* + * If set to 1, then firmware supports secure boot. + * If set to 0, then firmware doesn't support secure boot. + */ + #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_BOOT_CAPABLE UINT32_C(0x8000) /* * This field represents the major version of RoCE firmware. * A change in major version represents a major release. @@ -1858,7 +2057,7 @@ typedef struct hwrm_ver_get_output { * backing store not been available. * For Example, PCIe hot-plug: * Hot plug timing is system dependent. It generally takes up to - * 600 miliseconds for firmware to clear DEV_NOT_RDY flag. + * 600 milliseconds for firmware to clear DEV_NOT_RDY flag. * If set to 0, device is ready to accept all HWRM commands. */ #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY UINT32_C(0x1) @@ -2019,7 +2218,18 @@ typedef struct hwrm_ver_get_output { * used with the short cmd request format. */ uint16_t max_ext_req_len; - uint8_t unused_1[5]; + /* + * This field returns the maximum request timeout value in seconds. + * For backward compatibility, a value of zero should be interpreted + * as the default value of 40 seconds. Drivers should always honor the + * maximum timeout, but are permitted to warn if a longer duration than + * this default is advertised. Values larger than 40 seconds should + * only be used as a stopgap measure to address a device limitation or + * for the purposes of test and debugging. The long term goal is for + * firmware to significantly reduce this value in the passage of time. + */ + uint16_t max_req_timeout; + uint8_t unused_1[3]; /* * This field is used in Output records to indicate that the output * is completely written to RAM. This field should be read as '1' @@ -2341,7 +2551,7 @@ typedef struct cfa_bds_event_collect_cmd_data_msg { uint64_t host_address; } cfa_bds_event_collect_cmd_data_msg_t, *pcfa_bds_event_collect_cmd_data_msg_t; -/* ce_bds_add_data_msg (size:512b/64B) */ +/* ce_bds_add_data_msg (size:576b/72B) */ typedef struct ce_bds_add_data_msg { uint32_t version_algorithm_kid_opcode; @@ -2377,9 +2587,8 @@ typedef struct ce_bds_add_data_msg { /* * Version number of TLS connection. HW will provide registers that * converts the 4b encoded version number to 16b of actual version - * number in the TLS Header. * Initialized --> By mid-path command * - * Updated --> Never though another mid-path command will result in an - * update. + * number in the TLS Header. This field is initialized/updated by + * this "KTLS crypto add" mid-path command. */ #define CE_BDS_ADD_DATA_MSG_VERSION_MASK UINT32_C(0xf0000000) #define CE_BDS_ADD_DATA_MSG_VERSION_SFT 28 @@ -2388,18 +2597,15 @@ typedef struct ce_bds_add_data_msg { /* TLS1.3 Version */ #define CE_BDS_ADD_DATA_MSG__TLS1_3 (UINT32_C(0x1) << 28) #define CE_BDS_ADD_DATA_MSG__LAST CE_BDS_ADD_DATA_MSG__TLS1_3 - /* - * Command Type in the TLS header. HW will provide registers that - * converts the 3b encoded command type to 8b of actual command type in - * the TLS Header. * Initialized --> By mid-path command * Updated --> - * Never though another mid-path command will result in an update - */ - uint8_t cmd_type; - #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_MASK UINT32_C(0x7) - #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_SFT 0 - /* Application */ - #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP UINT32_C(0x0) - #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_LAST CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP + uint8_t ctx_kind; + /* This field selects the context kind for the request. */ + #define CE_BDS_ADD_DATA_MSG_CTX_KIND_MASK UINT32_C(0x1f) + #define CE_BDS_ADD_DATA_MSG_CTX_KIND_SFT 0 + /* Crypto key transmit context */ + #define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_TX UINT32_C(0x11) + /* Crypto key receive context */ + #define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX UINT32_C(0x12) + #define CE_BDS_ADD_DATA_MSG_CTX_KIND_LAST CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX uint8_t unused0[3]; /* * Salt is part of the nonce that is used as the Initial Vector (IV) in @@ -2411,8 +2617,8 @@ typedef struct ce_bds_add_data_msg { * is zero padded to 12B and then xor'ed with the 4B of salt to generate * the 12B of IV. This value is initialized by this mid-path command. */ - uint32_t salt; - uint32_t unused1; + uint8_t salt[4]; + uint8_t unused1[4]; /* * This field keeps track of the TCP sequence number that is expected as * the first byte in the next TCP packet. This field is calculated by HW @@ -2445,19 +2651,24 @@ typedef struct ce_bds_add_data_msg { * exchanged during the hand-shake protocol by the client-server and * provided to HW through this mid-path BD. */ - uint32_t session_key[8]; + uint8_t session_key[32]; + /* + * Additional IV that is exchanged as part of sessions setup between + * the two end points. This field is used for TLS1.3 only. + */ + uint8_t addl_iv[8]; } ce_bds_add_data_msg_t, *pce_bds_add_data_msg_t; -/* ce_bds_delete_data_msg (size:64b/8B) */ +/* ce_bds_delete_data_msg (size:32b/4B) */ typedef struct ce_bds_delete_data_msg { - uint32_t kid_opcode; + uint32_t kid_opcode_ctx_kind; /* * This value selects the operation for the mid-path command for the * crypto blocks. */ - #define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK UINT32_C(0xf) - #define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT 0 + #define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK UINT32_C(0xf) + #define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT 0 /* * This is the delete command. Using this opcode, the host Driver * can remove a key context from the CFCK. If context is deleted @@ -2467,15 +2678,26 @@ typedef struct ce_bds_delete_data_msg { * receive packets, no crypto operation will be performed, * payload will be unmodified. */ - #define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE UINT32_C(0x2) - #define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE + #define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE UINT32_C(0x2) + #define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE /* * This field is the Crypto Context ID. The KID is used to store * information used by the associated kTLS offloaded connection. */ #define CE_BDS_DELETE_DATA_MSG_KID_MASK UINT32_C(0xfffff0) #define CE_BDS_DELETE_DATA_MSG_KID_SFT 4 - uint32_t unused0; + /* This field selects the context kind for the request. */ + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_MASK UINT32_C(0x1f000000) + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_SFT 24 + /* Crypto Key Transmit Context. */ + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_TX (UINT32_C(0x11) << 24) + /* Crypto Key Receive Context. */ + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_RX (UINT32_C(0x12) << 24) + /* QUIC Key Transmit Context. */ + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_TX (UINT32_C(0x14) << 24) + /* QUIC Key Receive Context. */ + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX (UINT32_C(0x15) << 24) + #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_LAST CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX } ce_bds_delete_data_msg_t, *pce_bds_delete_data_msg_t; /* ce_bds_resync_resp_ack_msg (size:128b/16B) */ @@ -2596,6 +2818,18 @@ typedef struct crypto_presync_bd_cmd { * associated with the presync BD. */ #define CRYPTO_PRESYNC_BD_CMD_FLAGS_UPDATE_IN_ORDER_VAR UINT32_C(0x1) + /* + * When packet with an authentication TAG is lost in the network, + * During retransmission Device driver will post the entire record for + * the hardware to recalculate the TAG. Hardware is set to retransmit + * only portions of the record, it does so by looking at the Header + * TCP Sequence Number and Start TCP Sequence Number. However, there + * is a case where the header packet gets dropped in the stack for ex + * BPF packet filter and it is impossible for the Hardware to + * determine if this is a case of full replay for only the TAG + * generation. + */ + #define CRYPTO_PRESYNC_BD_CMD_FLAGS_FULL_REPLAY_RETRAN UINT32_C(0x2) uint8_t unused0; uint16_t unused1; /* @@ -2631,7 +2865,7 @@ typedef struct crypto_presync_bd_cmd { uint32_t end_tcp_seq_num; /* * For TLS1.2, an explicit nonce is used as part of the IV (concatenated - * with the SALT). For retans packets, this field is extracted from the + * with the SALT). For retrans packets, this field is extracted from the * TLS record, field right after the TLS Header and stored in the * context. This field needs to be stored in context as TCP segmentation * could have split the field into multiple TCP packets. This value is @@ -2639,7 +2873,7 @@ typedef struct crypto_presync_bd_cmd { * the first TLS header. When subsequent TLS Headers are detected, the * value is extracted from packet. */ - uint64_t explicit_nonce; + uint8_t explicit_nonce[8]; /* * This is sequence number for the TLS record in a particular session. In * TLS1.2, record sequence number is part of the Associated Data (AD) in @@ -2654,6 +2888,93 @@ typedef struct crypto_presync_bd_cmd { uint64_t record_seq_num; } crypto_presync_bd_cmd_t, *pcrypto_presync_bd_cmd_t; +/* ce_bds_quic_add_data_msg (size:832b/104B) */ + +typedef struct ce_bds_quic_add_data_msg { + uint32_t ver_algo_kid_opcode; + /* + * This value selects the operation for the mid-path command for the + * crypto blocks. + */ + #define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_MASK UINT32_C(0xf) + #define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_SFT 0 + /* + * This is the add command. Using this opcode, Host Driver can add + * information required for QUIC processing. The information is + * updated in the CFCK context. + */ + #define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_ADD UINT32_C(0x1) + #define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_LAST CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_ADD + /* + * This field is the Crypto Context ID. The KID is used to store + * information used by the associated QUIC offloaded connection. + */ + #define CE_BDS_QUIC_ADD_DATA_MSG_KID_MASK UINT32_C(0xfffff0) + #define CE_BDS_QUIC_ADD_DATA_MSG_KID_SFT 4 + /* Algorithm used for encryption and decryption. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_MASK UINT32_C(0xf000000) + #define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_SFT 24 + /* AES_GCM_128 Algorithm. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_AES_GCM_128 (UINT32_C(0x1) << 24) + /* AES_GCM_256 Algorithm. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_AES_GCM_256 (UINT32_C(0x2) << 24) + /* Chacha20 Algorithm. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_CHACHA20 (UINT32_C(0x3) << 24) + #define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_LAST CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_CHACHA20 + /* Version number of QUIC connection. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_VERSION_MASK UINT32_C(0xf0000000) + #define CE_BDS_QUIC_ADD_DATA_MSG_VERSION_SFT 28 + /* TLS1.2 Version */ + #define CE_BDS_QUIC_ADD_DATA_MSG__TLS1_2 (UINT32_C(0x0) << 28) + /* TLS1.3 Version */ + #define CE_BDS_QUIC_ADD_DATA_MSG__TLS1_3 (UINT32_C(0x1) << 28) + /* DTLS1.2 Version */ + #define CE_BDS_QUIC_ADD_DATA_MSG__DTLS1_2 (UINT32_C(0x2) << 28) + /* DTLS1.2 for RoCE Version */ + #define CE_BDS_QUIC_ADD_DATA_MSG__DTLS1_2_ROCE (UINT32_C(0x3) << 28) + /* QUIC Version */ + #define CE_BDS_QUIC_ADD_DATA_MSG__QUIC (UINT32_C(0x4) << 28) + #define CE_BDS_QUIC_ADD_DATA_MSG__LAST CE_BDS_QUIC_ADD_DATA_MSG__QUIC + uint32_t ctx_kind_dcid_width_key_phase; + /* Key phase. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_KEY_PHASE UINT32_C(0x1) + /* Destination connection ID width. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_DCID_WIDTH_MASK UINT32_C(0x3e) + #define CE_BDS_QUIC_ADD_DATA_MSG_DCID_WIDTH_SFT 1 + /* This field selects the context kind for the request. */ + #define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_MASK UINT32_C(0x7c0) + #define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_SFT 6 + /* QUIC key transmit context */ + #define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_TX (UINT32_C(0x14) << 6) + /* QUIC key receive context */ + #define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_RX (UINT32_C(0x15) << 6) + #define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_LAST CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_RX + uint64_t unused_0; + /* + * Least-significant 64 bits (of 96) of additional IV that is + * exchanged as part of sessions setup between the two end + * points for QUIC operations. + */ + uint64_t quic_iv_lo; + /* + * Most-significant 32 bits (of 96) of additional IV that is + * exchanged as part of sessions setup between the two end + * points for QUIC operations. + */ + uint32_t quic_iv_hi; + uint32_t unused_1; + /* + * Key used for encrypting or decrypting records. The Key is exchanged + * as part of sessions setup between the two end points through this + * mid-path BD. + */ + uint32_t session_key[8]; + /* Header protection key. */ + uint32_t hp_key[8]; + /* Packet number associated with the QUIC connection. */ + uint64_t pkt_number; +} ce_bds_quic_add_data_msg_t, *pce_bds_quic_add_data_msg_t; + /* bd_base (size:64b/8B) */ typedef struct bd_base { @@ -2696,6 +3017,12 @@ typedef struct bd_base { * sync command through the fast path and destined for TCE. */ #define BD_BASE_TYPE_TX_BD_PRESYNC_CMD UINT32_C(0x9) + /* + * Indicates a timed transmit BD. This is a 16b BD that is inserted + * into a packet BD chain immediately after the first BD. It is used + * to control the flow in a timed transmit operation. + */ + #define BD_BASE_TYPE_TX_BD_TIMEDTX UINT32_C(0xa) /* * Indicates that this BD is 32B long and is used for * normal L2 packet transmission. @@ -2979,10 +3306,22 @@ typedef struct tx_bd_long_hi { */ #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4) /* - * If set to 1, the device will record the time at which the packet - * was actually transmitted at the TX MAC for 2-step time sync. + * This bit, in conjunction with the stamp_1step bit, controls whether + * a TX packet timestamp is collected and the type of timestamp that + * is collected. * * This bit must be valid on the first BD of a packet. + * + * Enumerations of the concatenation { stamp, stamp_1step } are + * as follows: + * + * - 2'b00: ts_none - no timestamp + * - 2'b01: ts_ptp_1step - 1-step PTP + * - 2'b10: ts_2cmpl - 2-step PTP timestamp or PA timestamp + * - 2'b11: ts_rsvd - reserved, same behavior as ts_none + * For the ts_2cmpl enumeration, an additional completion is returned. + * This additional completion may carry a 2-step PTP timestamp or a PA + * timestamp, depending on parsing of the transmitted packet. */ #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8) /* @@ -2991,15 +3330,15 @@ typedef struct tx_bd_long_hi { * of the packet associated with this descriptor. * * For outer UDP checksum, global outer UDP checksum TE_NIC register - * needs to be enabled. If the global outer UDP checksum TE_NIC register - * bit is set, outer UDP checksum will be calculated for the following - * cases: - * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner - * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for - * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP - * checksum will not be calculated. - * 2. Packets with lso flag set which implies inner TCP checksum calculation - * as part of LSO operation. + * needs to be enabled. If the global outer UDP checksum TE_NIC + * register bit is set, outer UDP checksum will be calculated for + * the following cases: + * 1. Packets with tcp_udp_chksum flag set to offload checksum for + * inner packet AND the inner packet is TCP/UDP. If the inner packet + * is ICMP for example (non-TCP/UDP), even if the tcp_udp_chksum is + * set, the outer UDP checksum will not be calculated. + * 2. Packets with lso flag set which implies inner TCP checksum + * calculation as part of LSO operation. */ #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10) /* @@ -3050,6 +3389,11 @@ typedef struct tx_bd_long_hi { * If set to '1', then the timestamp from the BD is used. If cleared * to 0, then TWE provides the timestamp. */ + /* + * The BD timestamp feature cannot be enabled concurrently with + * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en + * shall never both be set in a BD. + */ #define TX_BD_LONG_LFLAGS_BD_TS_EN UINT32_C(0x400) /* * If set to '1', this operation will cause a trace capture in each @@ -3057,26 +3401,32 @@ typedef struct tx_bd_long_hi { */ #define TX_BD_LONG_LFLAGS_DEBUG_TRACE UINT32_C(0x800) /* - * If set to '1', the device will record the time at which the packet - * was actually transmitted at the TX MAC for 1-step time sync. This - * bit must be valid on the first BD of a packet. + * This bit, in conjunction with the stamp bit, controls whether a + * TX packet timestamp is collected and the type of timestamp that + * is collected. + * + * See the stamp field for a description of the valid combinations of + * stamp and stamp_1step. + * + * This bit must be valid on the first BD of a packet. */ #define TX_BD_LONG_LFLAGS_STAMP_1STEP UINT32_C(0x1000) /* * If set to '1', the controller replaces the Outer-tunnel IP checksum * field with hardware calculated IP checksum for the IP header of the * packet associated with this descriptor. For outer UDP checksum, it - * will be the following behavior for all cases independent of settings - * of inner LSO and checksum offload BD flags. If outer UDP checksum - * is 0, then do not update it. If outer UDP checksum is non zero, then - * the hardware should compute and update it. + * will be the following behavior for all cases independent of + * settings of inner LSO and checksum offload BD flags. + * If outer UDP checksum is 0, then do not update it. + * If outer UDP checksum is non zero, then the hardware should + * compute and update it. */ #define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM UINT32_C(0x2000) /* - * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP - * header will not be modified during LSO operations. If set to one - * when LSO is '1', then the IPID of the Outer-tunnel IP header will be - * incremented for each subsequent segment of an LSO operation. The + * If set to zero when LSO is '1', then the IPID of the Outer-tunnel + * IP header will not be modified during LSO operations. If set to one + * when LSO is '1', then the IPID of the Outer-tunnel IP header will + * be incremented for each subsequent segment of an LSO operation. The * flag is ignored if the LSO packet is a normal (non-tunneled) TCP * packet. */ @@ -3085,6 +3435,11 @@ typedef struct tx_bd_long_hi { * If set to '1', When set to 1, KTLS encryption will be enabled for * the packet. */ + /* + * The BD timestamp feature cannot be enabled concurrently with + * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en + * shall never both be set in a BD. + */ #define TX_BD_LONG_LFLAGS_CRYPTO_EN UINT32_C(0x8000) uint16_t kid_or_ts_low_hdr_size; /* @@ -3100,8 +3455,13 @@ typedef struct tx_bd_long_hi { #define TX_BD_LONG_HDR_SIZE_SFT 0 /* * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit - * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of the - * 20-bit KID. + * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of + * the 20-bit KID. + */ + /* + * The KID value of all-ones is reserved for non-KTLS packets, which + * only implies that this value must not be used when filling this + * field for crypto packets. */ #define TX_BD_LONG_KID_OR_TS_LOW_MASK UINT32_C(0xfe00) #define TX_BD_LONG_KID_OR_TS_LOW_SFT 9 @@ -3120,6 +3480,11 @@ typedef struct tx_bd_long_hi { * timestamp. If lflags.crypto_en is 1, the least significant 13 bits * of this field contain the upper 13 bits of the 20-bit KID. */ + /* + * The KID value of all-ones is reserved for non-KTLS packets, which + * only implies that this value must not be used when filling this + * field for crypto packets. + */ #define TX_BD_LONG_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000) #define TX_BD_LONG_KID_OR_TS_HIGH_SFT 15 /* @@ -3197,11 +3562,11 @@ typedef struct tx_bd_long_hi { } tx_bd_long_hi_t, *ptx_bd_long_hi_t; /* - * This structure is used to inform the NIC of packet data that needs to be - * transmitted with additional processing that requires extra data such as - * VLAN insertion plus attached inline data. This BD type may be used to - * improve latency for small packets needing the additional extended features - * supported by long BDs. + * This structure is used to inform the NIC of packet data that needs to + * be transmitted with additional processing that requires extra data + * such as VLAN insertion plus attached inline data. + * This BD type may be used to improve latency for small packets needing + * the additional extended features supported by long BDs. */ /* tx_bd_long_inline (size:256b/32B) */ @@ -3266,16 +3631,21 @@ typedef struct tx_bd_long_inline { * * This field must be valid on all BDs of a packet. */ + /* + * A fatal error will be generated if the value of this field + * does not correspond with the value of flags.bd_cnt. For example, if + * this field carries a value of 20, then bd_cnt must equal 4. + */ uint16_t len; /* * The opaque data field is passed through to the completion and can be - * used for any data that the driver wants to associate with the transmit - * BD. This field must be valid on the first BD of a packet. If - * completion coalescing is enabled on the TX ring, it is suggested that - * the driver populate the opaque field to indicate the specific TX ring - * with which the completion is associated, then utilize the opaque and - * sq_cons_idx fields in the coalesced completion record to determine - * the specific packets that are to be completed on that ring. + * used for any data that the driver wants to associate with the + * transmit BD. This field must be valid on the first BD of a packet. + * If completion coalescing is enabled on the TX ring, it is suggested + * that the driver populate the opaque field to indicate the specific + * TX ring with which the completion is associated, then utilize the + * opaque and sq_cons_idx fields in the coalesced completion record to + * determine the specific packets that are to be completed on that ring. * * This field must be valid on the first BD of a packet. */ @@ -3347,6 +3717,11 @@ typedef struct tx_bd_long_inline { * If set to '1', then the timestamp from the BD is used. If cleared * to 0, then TWE provides the timestamp. */ + /* + * The BD timestamp feature cannot be enabled concurrently with + * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en + * shall never both be set in a BD. + */ #define TX_BD_LONG_INLINE_LFLAGS_BD_TS_EN UINT32_C(0x400) /* * If set to '1', this operation will cause a trace capture in each @@ -3382,6 +3757,11 @@ typedef struct tx_bd_long_inline { * If set to '1', When set to 1, KTLS encryption will be enabled for * the packet. */ + /* + * The BD timestamp feature cannot be enabled concurrently with + * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en + * shall never both be set in a BD. + */ #define TX_BD_LONG_INLINE_LFLAGS_CRYPTO_EN UINT32_C(0x8000) uint8_t unused2; uint8_t kid_or_ts_low; @@ -3391,6 +3771,11 @@ typedef struct tx_bd_long_inline { * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of * the 20-bit KID. */ + /* + * The KID value of all-ones is reserved for non-KTLS packets, which + * only implies that this value must not be used when filling this + * field for crypto packets. + */ #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_MASK UINT32_C(0xfe) #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_SFT 1 uint32_t kid_or_ts_high; @@ -3401,6 +3786,11 @@ typedef struct tx_bd_long_inline { * timestamp. If lflags.crypto_en is 1, the least significant 13 bits * of this field contain the upper 13 bits of the 20-bit KID. */ + /* + * The KID value of all-ones is reserved for non-KTLS packets, which + * only implies that this value must not be used when filling this + * field for crypto packets. + */ #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000) #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_SFT 15 /* @@ -3525,6 +3915,11 @@ typedef struct tx_bd_mp_cmd { * This value defines the length of command field in bytes. The maximum * value shall be 496. */ + /* + * Note that a fatal error will be generated if the value of this field *** 106644 LINES SKIPPED *** From nobody Mon Jun 3 19:24:55 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 4VtNw81gYwz5JsGS; Mon, 03 Jun 2024 19:24:56 +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 4VtNw74L7rz4VKF; Mon, 3 Jun 2024 19:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442695; 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=yPOzDGCV4gj/9bD5x+kJT4iGYPJKgXMiFGcHKY3L0VM=; b=V+UWcV2PI5XmzUl/fBinJZj53Y+CXC4JnXf4OLPMub+zE152hZGxK2c2M1H6P2eUgFdWcA XOk3oyCTNftD2DD1d1JHg5TciQEA7eQ9YkKFRmB2rXI3sAkYGwNf1PxCiB6EhWRCiniZSa UfeQoajpSqrxKVe5IkPao6SOaa3FAQ6M/zDnCwBcfDUBWlRXBrNOKpzLdl+sp6BacO+xay XRtW0hSxeZe8jUwZ6FRVTTrJL2mZ1tSRIidKrHnQzzqDakI6xAHx/0Osik/hynA5tG1UIz /GRBT40mnZK6M/ZyPEszGnZOQ50JsZ7ulUhAM94Cwo5YNxodBDk9ndLUV2307A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442695; a=rsa-sha256; cv=none; b=jK0MdD0/4WOMcvF+JBOWghkIbq5QpU/LXJFDNBjnSTUabPYA2OYecDbb7govfRfOIQ2FLl mVmVqSNFcCKNeDObkYCFtQQLGIqWZBdZIApsTVho+WcgbR+ogT1A5si5FG3ouO4Bet9nmG Lo+EIHD8QJeWW84C7Ylgwxyvbr2+JiNt5CYOpP0bH8ZtxQFQedcuXuDMUIYM5nhJYCfqs+ s1nNR3m7Di7EVm20lGOmZ7vnDUJhL4Q3T3/fwkESSSKvzPI7ikgeHJZcNREt9UOWTSIijD aF3gGhRa4AJ3wnKZgnMBG11dQJfi+dcmejZiRV5oRzj7531nDs7DtayfF9fBHg== 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=1717442695; 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=yPOzDGCV4gj/9bD5x+kJT4iGYPJKgXMiFGcHKY3L0VM=; b=Dd+tNJk7AEQE2XZHWqkUHdJhG+jQHumnIlrFVs717NuY59jaolrLmEUr88AsuBEVP4aTns t3n2zu20VERetaekxfZ/CvLMcwbDqmyjKxQA9KWSNT70Iaq/pOK3U4GRm5QwKIkqds0s7y gqbA2xwMujxnt9+ggC0fiQJDnX6S/bYYYXleH3XDN1Ob11coQraD961QkiWAaCRVJdun+P 3kiKtuo7oQKe8tQRrxQNg1Q7b/zG/MP6vZtdy744U3B8VTXHbgRo800QD8JGthJGka+17p NHp66ejwGt65Y0Mje1ujwaJuq9CGPwlWx9VUUwxjtx8EoKPpKD7mGR7nHtoPBQ== 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 4VtNw73yc3znPC; Mon, 3 Jun 2024 19:24:55 +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 453JOteW067624; Mon, 3 Jun 2024 19:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOtWt067621; Mon, 3 Jun 2024 19:24:55 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:55 GMT Message-Id: <202406031924.453JOtWt067621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1b5ff4b14dfa - stable/14 - if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b5ff4b14dfa8b49664b56c4c5d44faa129f36ba Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1b5ff4b14dfa8b49664b56c4c5d44faa129f36ba commit 1b5ff4b14dfa8b49664b56c4c5d44faa129f36ba Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:18:41 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D429506 (cherry picked from commit 816abba22efcf1ba51f61b1d89320ca8b576274e) --- sys/dev/bnxt/if_bnxt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 5edb678ac444..872ffbb21e82 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -2121,6 +2121,8 @@ bnxt_media_change(if_ctx_t ctx) case IFM_40G_KR4: case IFM_40G_LR4: case IFM_40G_SR4: + case IFM_40G_XLAUI: + case IFM_40G_XLAUI_AC: softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; softc->link_info.req_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB; @@ -2937,6 +2939,8 @@ bnxt_add_media_types(struct bnxt_softc *softc) case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE: BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_ACC); BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_AOC); + BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_XLAUI); + BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_XLAUI_AC); break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX: From nobody Mon Jun 3 19:24:56 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 4VtNw86xzhz5Js2y; Mon, 03 Jun 2024 19:24:56 +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 4VtNw85Yvfz4VDv; Mon, 3 Jun 2024 19:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442696; 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=WAkRNPtZB9Tt5f774Umf1Fr1sEAWBup73eZK1rlHrmI=; b=UkA66OrnZvu5CMP89UMI4IA2+85DTzLoa3MjMjjRqhqRE8TDlp6vK5kjdWs1WT+wubN/on kK859O0i+njZ/KGOk6McVKFcHaFRncKlxEYeZWxvEJPYvEPgvvNHulemJhayThWCssOBdm jAOwX3d+0y2Y2aak+rPFNE0rX//F5OnfZN0XCdU35+bqBn6r2QnsqKmbikROvaMcSb7MK6 QCKqQR72pucE0Q8quFwutiaYmhFKGFuCt0n2WXGIk5MM8WeqlHmeFjNlJskuv1fo6JYRJf tIusrZEh/wL5wxTkhfXo6au6Oaqj8WytS2Ri8Hg5N3/YTBZLu+uDy9U2Zy3o/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442696; a=rsa-sha256; cv=none; b=Nd02hujzmO/2BMuJdB6kSwg1keIFf9kStNgE/3PDmI8wuSKCYigWkbz+ZvPUhRWcfXfKUu BIOG5TPuTl84xaZxd0Lf7EErebuhqKnQ7rq6pZsgPUzgUSiYtb6mzLp2DADL54hMVwRjgw 3GLa0dEZkFRRnGv5u2XMpd/L4CnV940e5NCY3d7FdYb7CPIQRXDb7Lu01QglJ/P74u0hQq C/8tFsNbotjWubrnPOqYvTt84ft2SVTtyyiYd6mlvALxrKJ/+OZWB1gXAvyI1oSTADH2VW gVNEcd7bTkVEk9aKAsaq6xo0ae2iz34WjHDMZ9dPdVV0pNensGZpHH11h8J1rA== 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=1717442696; 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=WAkRNPtZB9Tt5f774Umf1Fr1sEAWBup73eZK1rlHrmI=; b=F4hyjE7YmTZfYx7MRhLp8fqMsK0kxrg7o6wfokhxrFoo24B0HqSG4tLTOr0oRrv7hTKA9f vmP3zv7O9NTRrwlHLjLasMN5uZyhicL2Y7/6QzZqYzt3B32MbvGqzuG1S6robOhyWzwWsn H74w7+cJ6lzNVZz2tH8ZBaYVN8/pYcy4D4A672N3nQ3PnNKbtTJ9rT9pfmpZDwwps+nBWj Zyz+EYaeSf5LbagwhXiNKCXdhYqpxJUeyXRGhYKxHyFPLEPS/YqJEcsi1E6Atl+FRNgy1r Z36igxds/cXwDnHQ5bUeGOItsXgaDBGTT5Ez322JdW3RW6UMMrvOHXUBaTRhVA== 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 4VtNw857x1znf0; Mon, 3 Jun 2024 19:24:56 +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 453JOuhm067686; Mon, 3 Jun 2024 19:24:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOuSn067683; Mon, 3 Jun 2024 19:24:56 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:56 GMT Message-Id: <202406031924.453JOuSn067683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 9b5383c53eac - stable/14 - if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9b5383c53eac5610c34c59fb77abeba77203b104 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9b5383c53eac5610c34c59fb77abeba77203b104 commit 9b5383c53eac5610c34c59fb77abeba77203b104 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:20:28 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller The newly added port extended hardware statistics are now accessible to users through the sysctl interface. Also, Few obsolete stats are removed and few stats are renamed. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42957 (cherry picked from commit d36b36621a9c0f785ebea495c57e975b8a526b67) --- sys/dev/bnxt/bnxt.h | 20 +- sys/dev/bnxt/bnxt_hwrm.c | 28 ++- sys/dev/bnxt/bnxt_hwrm.h | 1 + sys/dev/bnxt/bnxt_sysctl.c | 457 +++++++++++++++++++++++++++++++----------- sys/dev/bnxt/hsi_struct_def.h | 2 +- sys/dev/bnxt/if_bnxt.c | 48 ++++- 6 files changed, 419 insertions(+), 137 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 73122f82c7ad..a5c607dbe247 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -671,13 +671,14 @@ struct bnxt_softc { struct bnxt_bar_info hwrm_bar; struct bnxt_bar_info doorbell_bar; struct bnxt_link_info link_info; -#define BNXT_FLAG_VF 0x0001 -#define BNXT_FLAG_NPAR 0x0002 -#define BNXT_FLAG_WOL_CAP 0x0004 -#define BNXT_FLAG_SHORT_CMD 0x0008 -#define BNXT_FLAG_FW_CAP_NEW_RM 0x0010 -#define BNXT_FLAG_CHIP_P5 0x0020 -#define BNXT_FLAG_TPA 0x0040 +#define BNXT_FLAG_VF 0x0001 +#define BNXT_FLAG_NPAR 0x0002 +#define BNXT_FLAG_WOL_CAP 0x0004 +#define BNXT_FLAG_SHORT_CMD 0x0008 +#define BNXT_FLAG_FW_CAP_NEW_RM 0x0010 +#define BNXT_FLAG_CHIP_P5 0x0020 +#define BNXT_FLAG_TPA 0x0040 +#define BNXT_FLAG_FW_CAP_EXT_STATS 0x0080 uint32_t flags; #define BNXT_STATE_LINK_CHANGE (0) #define BNXT_STATE_MAX (BNXT_STATE_LINK_CHANGE + 1) @@ -714,6 +715,11 @@ struct bnxt_softc { struct rx_port_stats *rx_port_stats; struct tx_port_stats *tx_port_stats; + struct iflib_dma_info hw_tx_port_stats_ext; + struct iflib_dma_info hw_rx_port_stats_ext; + struct tx_port_stats_ext *tx_port_stats_ext; + struct rx_port_stats_ext *rx_port_stats_ext; + int num_cp_rings; struct bnxt_cp_ring *nq_rings; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 88ba185e2c27..38e6c0db670f 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -550,7 +550,7 @@ bnxt_hwrm_passthrough(struct bnxt_softc *softc, void *req, uint32_t req_len, input->resp_addr = htole64(softc->hwrm_cmd_resp.idi_paddr); BNXT_HWRM_LOCK(softc); old_timeo = softc->hwrm_cmd_timeo; - if (input->req_type == HWRM_NVM_INSTALL_UPDATE) + if (input->req_type == HWRM_NVM_INSTALL_UPDATE) softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO; else softc->hwrm_cmd_timeo = max(app_timeout, softc->hwrm_cmd_timeo); @@ -694,7 +694,8 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout); if (!softc->hwrm_cmd_timeo) softc->hwrm_cmd_timeo = DFLT_HWRM_CMD_TIMEOUT; - + + dev_caps_cfg = le32toh(resp->dev_caps_cfg); if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) && (dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED)) @@ -777,6 +778,9 @@ bnxt_hwrm_func_qcaps(struct bnxt_softc *softc) if (resp->flags & htole32(HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED)) softc->flags |= BNXT_FLAG_WOL_CAP; + if (resp->flags & + htole32(HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED)) + softc->flags |= BNXT_FLAG_FW_CAP_EXT_STATS; func->fw_fid = le16toh(resp->fid); memcpy(func->mac_addr, resp->mac_address, ETHER_ADDR_LEN); @@ -1408,6 +1412,26 @@ bnxt_hwrm_port_qstats(struct bnxt_softc *softc) return rc; } +void +bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc) +{ + struct hwrm_port_qstats_ext_input req = {0}; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_QSTATS_EXT); + + req.port_id = htole16(softc->pf.port_id); + req.tx_stat_size = htole16(sizeof(struct tx_port_stats_ext)); + req.rx_stat_size = htole16(sizeof(struct rx_port_stats_ext)); + req.rx_stat_host_addr = htole64(softc->hw_rx_port_stats_ext.idi_paddr); + req.tx_stat_host_addr = htole64(softc->hw_tx_port_stats_ext.idi_paddr); + + BNXT_HWRM_LOCK(softc); + _hwrm_send_message(softc, &req, sizeof(req)); + BNXT_HWRM_UNLOCK(softc); + + return; +} + int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index e016677707ce..6dd015a15d40 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -64,6 +64,7 @@ int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, uint64_t paddr); int bnxt_hwrm_stat_ctx_free(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr); int bnxt_hwrm_port_qstats(struct bnxt_softc *softc); +void bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc); int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp); int bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *gr); diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index 5e92cf8bd756..f1a49ee51328 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -234,17 +234,17 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) &softc->tx_port_stats->tx_512b_1023b_frames, "Transmitted 512b 1023b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_1024b_1518_frames", CTLFLAG_RD, + "tx_1024b_1518b_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_1024b_1518b_frames, - "Transmitted 1024b 1518 frames"); + "Transmitted 1024b 1518b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_good_vlan_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_good_vlan_frames, "Transmitted good vlan frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_1519b_2047_frames", CTLFLAG_RD, + "tx_1519b_2047b_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_1519b_2047b_frames, - "Transmitted 1519b 2047 frames"); + "Transmitted 1519b 2047b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_2048b_4095b_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_2048b_4095b_frames, @@ -285,53 +285,9 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "tx_fcs_err_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_fcs_err_frames, "Transmitted fcs err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_control_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_control_frames, - "Transmitted control frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_oversz_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_oversz_frames, "Transmitted oversz frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_single_dfrl_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_single_dfrl_frames, - "Transmitted single dfrl frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_multi_dfrl_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_multi_dfrl_frames, - "Transmitted multi dfrl frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_single_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_single_coll_frames, - "Transmitted single coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_multi_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_multi_coll_frames, - "Transmitted multi coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_late_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_late_coll_frames, - "Transmitted late coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_excessive_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_excessive_coll_frames, - "Transmitted excessive coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_frag_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_frag_frames, "Transmitted frag frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_err", CTLFLAG_RD, &softc->tx_port_stats->tx_err, "Transmitted err"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_tagged_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_tagged_frames, "Transmitted tagged frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_dbl_tagged_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_dbl_tagged_frames, - "Transmitted dbl tagged frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_runt_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_runt_frames, "Transmitted runt frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_fifo_underruns", CTLFLAG_RD, &softc->tx_port_stats->tx_fifo_underruns, @@ -418,7 +374,7 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) &softc->rx_port_stats->rx_512b_1023b_frames, "Received 512b 1023b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_1024b_1518_frames", CTLFLAG_RD, + "rx_1024b_1518b_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_1024b_1518b_frames, "Received 1024b 1518 frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -465,34 +421,10 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_pfc_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_pfc_frames, "Received pfc frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_unsupported_opcode_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_unsupported_opcode_frames, - "Received unsupported opcode frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_unsupported_da_pausepfc_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_unsupported_da_pausepfc_frames, - "Received unsupported da pausepfc frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_wrong_sa_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_wrong_sa_frames, - "Received wrong sa frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_align_err_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_align_err_frames, "Received align err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_oor_len_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_oor_len_frames, - "Received oor len frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_code_err_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_code_err_frames, - "Received code err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_false_carrier_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_false_carrier_frames, - "Received false carrier frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_ovrsz_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_ovrsz_frames, @@ -505,14 +437,6 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_mtu_err_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_mtu_err_frames, "Received mtu err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_match_crc_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_match_crc_frames, - "Received match crc frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_promiscuous_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_promiscuous_frames, - "Received promiscuous frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_tagged_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_tagged_frames, @@ -521,46 +445,10 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_double_tagged_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_double_tagged_frames, "Received double tagged frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_trunc_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_trunc_frames, - "Received trunc frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_good_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_good_frames, "Received good frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri0", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri0, - "Received pfc xon2xoff frames pri0"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri1", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri1, - "Received pfc xon2xoff frames pri1"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri2", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri2, - "Received pfc xon2xoff frames pri2"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri3", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri3, - "Received pfc xon2xoff frames pri3"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri4", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri4, - "Received pfc xon2xoff frames pri4"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri5", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri5, - "Received pfc xon2xoff frames pri5"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri6", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri6, - "Received pfc xon2xoff frames pri6"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri7", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri7, - "Received pfc xon2xoff frames pri7"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_pfc_ena_frames_pri0", CTLFLAG_RD, &softc->rx_port_stats->rx_pfc_ena_frames_pri0, @@ -600,9 +488,6 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_undrsz_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_undrsz_frames, "Received undrsz frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_frag_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_frag_frames, "Received frag frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_eee_lpi_events", CTLFLAG_RD, &softc->rx_port_stats->rx_eee_lpi_events, "Received eee lpi events"); @@ -645,6 +530,338 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_stat_err", CTLFLAG_RD, &softc->rx_port_stats->rx_stat_err, "Received stat err"); + if (BNXT_CHIP_P5(softc) && + (softc->flags & BNXT_FLAG_FW_CAP_EXT_STATS)) { + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos0", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos0, "Transmitted bytes count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos0", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos0, "Transmitted packets count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos1", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos1, "Transmitted bytes count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos1", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos1, "Transmitted packets count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos2", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos2, "Transmitted bytes count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos2", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos2, "Transmitted packets count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos3", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos3, "Transmitted bytes count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos3", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos3, "Transmitted packets count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos4", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos4, "Transmitted bytes count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos4", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos4, "Transmitted packets count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos5", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos5, "Transmitted bytes count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos5", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos5, "Transmitted packets count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos6", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos6, "Transmitted bytes count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos6", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos6, "Transmitted packets count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos7", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos7, "Transmitted bytes count cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos7", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos7, "Transmitted packets count cos7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri0_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri0_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri1_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri1_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri2_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri2_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri3_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri3_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri4_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri4_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri5_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri5_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri6_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri6_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri7_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri7_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "link_down_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->link_down_events, "Num times link states down"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "continuous_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->continuous_pause_events, "Num times pause events"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "resume_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->resume_pause_events, "Num times pause events" + "resumes"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "continuous_roce_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->continuous_roce_pause_events, "Num times roce" + "pause events"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "resume_roce_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->resume_roce_pause_events, "Num times roce pause" + "events resumes"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos0, "Received bytes count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos0, "Received packets count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos1, "Received bytes count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos1, "Received packets count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos2, "Received bytes count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos2, "Received packets count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos3, "Received bytes count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos3, "Received packets count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos4, "Received bytes count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos4, "Received packets count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos5, "Received bytes count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos5, "Received packets count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos6, "Received bytes count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos6, "Received packets count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos7, "Received bytes count cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos7, "Received packets count cos7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri0_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri0_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri1_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri1_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri2_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri2_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri3_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri3_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri4_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri4_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri5_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri5_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri6_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri6_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri7_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri7_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bits", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bits, "total number of received bits"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_buffer_passed_threshold", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_buffer_passed_threshold, "num of events port" + "buffer" + "was over 85%"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pcs_symbol_err", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_pcs_symbol_err, "num of symbol errors wasn't" + "corrected by FEC"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_corrected_bits", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_corrected_bits, "num of bits corrected by FEC"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos0, "num of rx discard bytes" + "count on cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos0, "num of rx discard packets" + "count on cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos1, "num of rx discard bytes" + "count on cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos1, "num of rx discard packets" + "count on cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos2, "num of rx discard bytes" + "count on cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos2, "num of rx discard packets" + "count on cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos3, "num of rx discard bytes" + "count on cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos3, "num of rx discard packets" + "count on cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos4, "num of rx discard bytes" + "count on cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos4, "num of rx discard packets" + "count on cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos5, "num of rx discard bytes" + "count on cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos5, "num of rx discard packets" + "count on cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos6, "num of rx discard bytes" + "count on cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos6, "num of rx discard packets" + "count on cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos7, "num of rx discard bytes" + "count on cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos7, "num of rx discard packets" + "count on cos7"); + } + + return 0; } diff --git a/sys/dev/bnxt/hsi_struct_def.h b/sys/dev/bnxt/hsi_struct_def.h index d2097ca1ca33..12b112c42ca7 100644 --- a/sys/dev/bnxt/hsi_struct_def.h +++ b/sys/dev/bnxt/hsi_struct_def.h @@ -800,7 +800,7 @@ typedef struct cmd_nums { #define HWRM_FUNC_VLAN_QCFG UINT32_C(0x34) #define HWRM_QUEUE_PFCENABLE_QCFG UINT32_C(0x35) #define HWRM_QUEUE_PFCENABLE_CFG UINT32_C(0x36) - #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) + #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) #define HWRM_QUEUE_PRI2COS_CFG UINT32_C(0x38) #define HWRM_QUEUE_COS2BW_QCFG UINT32_C(0x39) #define HWRM_QUEUE_COS2BW_CFG UINT32_C(0x3a) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 872ffbb21e82..0de1ffe78db1 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -500,6 +500,8 @@ bnxt_queues_free(if_ctx_t ctx) iflib_dma_free(&softc->rx_stats[i]); iflib_dma_free(&softc->hw_tx_port_stats); iflib_dma_free(&softc->hw_rx_port_stats); + iflib_dma_free(&softc->hw_tx_port_stats_ext); + iflib_dma_free(&softc->hw_rx_port_stats_ext); free(softc->grp_info, M_DEVBUF); free(softc->ag_rings, M_DEVBUF); free(softc->rx_rings, M_DEVBUF); @@ -574,9 +576,9 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, bus_dmamap_sync(softc->hw_rx_port_stats.idi_tag, softc->hw_rx_port_stats.idi_map, BUS_DMASYNC_PREREAD); + rc = iflib_dma_alloc(ctx, sizeof(struct tx_port_stats) + BNXT_PORT_STAT_PADDING, &softc->hw_tx_port_stats, 0); - if (rc) goto hw_port_tx_stats_alloc_fail; @@ -586,6 +588,26 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc->rx_port_stats = (void *) softc->hw_rx_port_stats.idi_vaddr; softc->tx_port_stats = (void *) softc->hw_tx_port_stats.idi_vaddr; + + rc = iflib_dma_alloc(ctx, sizeof(struct rx_port_stats_ext), + &softc->hw_rx_port_stats_ext, 0); + if (rc) + goto hw_port_rx_stats_ext_alloc_fail; + + bus_dmamap_sync(softc->hw_rx_port_stats_ext.idi_tag, + softc->hw_rx_port_stats_ext.idi_map, BUS_DMASYNC_PREREAD); + + rc = iflib_dma_alloc(ctx, sizeof(struct tx_port_stats_ext), + &softc->hw_tx_port_stats_ext, 0); + if (rc) + goto hw_port_tx_stats_ext_alloc_fail; + + bus_dmamap_sync(softc->hw_tx_port_stats_ext.idi_tag, + softc->hw_tx_port_stats_ext.idi_map, BUS_DMASYNC_PREREAD); + + softc->rx_port_stats_ext = (void *) softc->hw_rx_port_stats_ext.idi_vaddr; + softc->tx_port_stats_ext = (void *) softc->hw_tx_port_stats_ext.idi_vaddr; + for (i = 0; i < nrxqsets; i++) { /* Allocation the completion ring */ softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; @@ -654,7 +676,7 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, * HWRM every sec with which firmware timeouts can happen */ if (BNXT_PF(softc)) - bnxt_create_port_stats_sysctls(softc); + bnxt_create_port_stats_sysctls(softc); /* And finally, the VNIC */ softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; @@ -700,16 +722,24 @@ rss_grp_alloc_fail: iflib_dma_free(&softc->vnic_info.rss_hash_key_tbl); rss_hash_alloc_fail: iflib_dma_free(&softc->vnic_info.mc_list); -tpa_alloc_fail: mc_list_alloc_fail: - for (i = i - 1; i >= 0; i--) - free(softc->rx_rings[i].tpa_start, M_DEVBUF); + for (i = i - 1; i >= 0; i--) { + if (softc->rx_rings[i].tpa_start) + free(softc->rx_rings[i].tpa_start, M_DEVBUF); + } +tpa_alloc_fail: + iflib_dma_free(&softc->hw_tx_port_stats_ext); +hw_port_tx_stats_ext_alloc_fail: + iflib_dma_free(&softc->hw_rx_port_stats_ext); +hw_port_rx_stats_ext_alloc_fail: iflib_dma_free(&softc->hw_tx_port_stats); hw_port_tx_stats_alloc_fail: iflib_dma_free(&softc->hw_rx_port_stats); hw_port_rx_stats_alloc_fail: - for (i = i - 1; i >= 0; i--) - iflib_dma_free(&softc->rx_stats[i]); + for (i=0; i < nrxqsets; i++) { + if (softc->rx_stats[i].idi_vaddr) + iflib_dma_free(&softc->rx_stats[i]); + } hw_stats_alloc_fail: free(softc->grp_info, M_DEVBUF); grp_alloc_fail: @@ -2208,6 +2238,10 @@ bnxt_update_admin_status(if_ctx_t ctx) bnxt_hwrm_port_qstats(softc); + if (BNXT_CHIP_P5(softc) && + (softc->flags & BNXT_FLAG_FW_CAP_EXT_STATS)) + bnxt_hwrm_port_qstats_ext(softc); + if (BNXT_CHIP_P5(softc)) { struct ifmediareq ifmr; From nobody Mon Jun 3 19:24:57 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 4VtNwB2GDYz5Js30; Mon, 03 Jun 2024 19:24:58 +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 4VtNw96BKbz4VWQ; Mon, 3 Jun 2024 19:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442697; 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=w/yPAK0jMzz62O/xFTPwFtPAD97xplCyK96l2fOxG2s=; b=DDPAWtWiJPfWKGRuyfhNguhqc2GRgc544lJkJLxKd8shiYzIpaa3p2f/B/uv8+TpE6KrA3 O4tpagh+K0O1WoADRcmwHNkDK+MOEVX3pZqKHyfk30R7DMzlG46mv3Kpeq3jtwXIrarXq6 E26HGBsE1UO2USb/SgCWOVJcL16q5PB0Y7w9E1OjyG7FaecjSQpmd3KhO/ySWwBKP3ARjF BM3W+RTjE5st3HIOHauu025PbG0i0zPA0iJhjJnj3mq0bPA7vTJ7GjfdDrTq9jSNyh/u5y Yzo1MFl61/szd8e4e7ypAbMGUmLrQQ/S1PL4O/je0OQACQWb2HKX8x/iRv0S6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442697; a=rsa-sha256; cv=none; b=q07AnbT1QPB03SqUxTxNQzN7i5wcf9QOYrEPMKVcavmLPsXDXWzNMjFF/qrbTmPCx0igAs o6SzwrDw+dRtqBBVb6fs+/t09MZZLEvG+ZkhVvRw2U3iMotn1e2l/DhKzXeCOy0Y/PAvGZ iZTXgI62x2VmOsVzpOdl6d5oXdhb8uOo1V8Y726y2mHI4J/sLhPqQjf/PrYlu3O39TT6rW oZ6u3w179eIKjO6whKxv2sf1nOcs+7dWZrYQ4stDDyrLjmEEW2WhfDnW7lnYz4CVx91qUC c6GdnBBqF4x7FxFTo8Z/XQbd7kegb7vDzZ7yTQZC2fjsiuEQ3tlla4Po9iukMw== 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=1717442697; 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=w/yPAK0jMzz62O/xFTPwFtPAD97xplCyK96l2fOxG2s=; b=qrgcoT6lGDHVWpPkE1ZdvMLoKi9/P7oGyRe6hwVZl8f/II/6BoeWUFsilrsSnDlV4bANwX Y6FMshd5xndtvZsll677enIcgx/tbfjc9ZhxXTCfwnS3kNPngn1H6kvoVi2OKxvmOg5/p5 PWrRMMGEAe5oG1CKH5VNsBDkMsH3MFN2twQMN8vR+p4H3j5fujrMh5NEe6EBloo618ODRs 3Q3AqF2iWVrD9ZjpfGWb4K5MYr4akNydyLocS3WOVKAZhmxlcxfcdy2spGQDpaSYeJzWEc wMhyR7CobC2NYg8K0B9PYlYbnjyT/wI0ZD6V/ijHJc8wayzYm6rdRNvwGEUhGw== 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 4VtNw95n6Dzn1h; Mon, 3 Jun 2024 19:24:57 +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 453JOvLa067734; Mon, 3 Jun 2024 19:24:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOv3e067731; Mon, 3 Jun 2024 19:24:57 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:57 GMT Message-Id: <202406031924.453JOv3e067731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 43d9017a2fcd - stable/14 - if_bnxt: Pluggable Module Display Support 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 43d9017a2fcdb62682af401a142d2731df2e10a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=43d9017a2fcdb62682af401a142d2731df2e10a0 commit 43d9017a2fcdb62682af401a142d2731df2e10a0 Author: Sumit Saxena AuthorDate: 2024-03-06 13:21:21 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Pluggable Module Display Support This update enables the display of pluggable module information to users via the ifconfig utility. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42958 (cherry picked from commit 3320f0f69f06df5c36daa8ff71e0c07908ff0f1a) --- sys/dev/bnxt/bnxt.h | 8 +++++++ sys/dev/bnxt/bnxt_hwrm.c | 40 ++++++++++++++++++++++++++++++++ sys/dev/bnxt/if_bnxt.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index a5c607dbe247..4397e0478a0c 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -319,6 +319,8 @@ struct bnxt_link_info { #define BNXT_AUTONEG_FLOW_CTRL 2 uint8_t req_duplex; uint16_t req_link_speed; + uint8_t module_status; + struct hwrm_port_phy_qcfg_output phy_qcfg_resp; }; enum bnxt_cp_type { @@ -802,9 +804,15 @@ struct bnxt_filter_info { uint64_t l2_filter_id_hint; }; +#define I2C_DEV_ADDR_A0 0xa0 +#define BNXT_MAX_PHY_I2C_RESP_SIZE 64 + /* Function declarations */ void bnxt_report_link(struct bnxt_softc *softc); bool bnxt_check_hwrm_version(struct bnxt_softc *softc); struct bnxt_softc *bnxt_find_dev(uint32_t domain, uint32_t bus, uint32_t dev_fn, char *name); +int bnxt_read_sfp_module_eeprom_info(struct bnxt_softc *bp, uint16_t i2c_addr, + uint16_t page_number, uint8_t bank, bool bank_sel_en, uint16_t start_addr, + uint16_t data_length, uint8_t *buf); #endif /* _BNXT_H */ diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 38e6c0db670f..97574c768235 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -2184,6 +2184,44 @@ bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, uint16_t year, uint8_t month, return hwrm_send_message(softc, &req, sizeof(req)); } +int bnxt_read_sfp_module_eeprom_info(struct bnxt_softc *softc, uint16_t i2c_addr, + uint16_t page_number, uint8_t bank,bool bank_sel_en, uint16_t start_addr, + uint16_t data_length, uint8_t *buf) +{ + struct hwrm_port_phy_i2c_read_output *output = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_port_phy_i2c_read_input req = {0}; + int rc = 0, byte_offset = 0; + + BNXT_HWRM_LOCK(softc); + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_PHY_I2C_READ); + + req.i2c_slave_addr = i2c_addr; + req.page_number = htole16(page_number); + req.port_id = htole16(softc->pf.port_id); + do { + uint16_t xfer_size; + + xfer_size = min_t(uint16_t, data_length, BNXT_MAX_PHY_I2C_RESP_SIZE); + data_length -= xfer_size; + req.page_offset = htole16(start_addr + byte_offset); + req.data_length = xfer_size; + req.bank_number = bank; + req.enables = htole32((start_addr + byte_offset ? + HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_PAGE_OFFSET : 0) | + (bank_sel_en ? + HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_BANK_NUMBER : 0)); + rc = hwrm_send_message(softc, &req, sizeof(req)); + if (!rc) + memcpy(buf + byte_offset, output->data, xfer_size); + byte_offset += xfer_size; + } while (!rc && data_length > 0); + + BNXT_HWRM_UNLOCK(softc); + + return rc; +} + int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) { @@ -2200,6 +2238,7 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) if (rc) goto exit; + memcpy(&link_info->phy_qcfg_resp, resp, sizeof(*resp)); link_info->phy_link_status = resp->link; link_info->duplex = resp->duplex_cfg; link_info->auto_mode = resp->auto_mode; @@ -2264,6 +2303,7 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) link_info->transceiver = resp->xcvr_pkg_type; link_info->phy_addr = resp->eee_config_phy_addr & HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK; + link_info->module_status = resp->module_status; exit: BNXT_HWRM_UNLOCK(softc); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 0de1ffe78db1..4bd9af19d660 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -225,6 +225,8 @@ static uint64_t bnxt_get_baudrate(struct bnxt_link_info *link); static void bnxt_get_wol_settings(struct bnxt_softc *softc); static int bnxt_wol_config(if_ctx_t ctx); static bool bnxt_if_needs_restart(if_ctx_t, enum iflib_restart_event); +static int bnxt_i2c_req(if_ctx_t ctx, struct ifi2creq *i2c); +static void bnxt_get_port_module_status(struct bnxt_softc *softc); /* * Device Interface Declaration @@ -288,6 +290,7 @@ static device_method_t bnxt_iflib_methods[] = { DEVMETHOD(ifdi_suspend, bnxt_suspend), DEVMETHOD(ifdi_shutdown, bnxt_shutdown), DEVMETHOD(ifdi_resume, bnxt_resume), + DEVMETHOD(ifdi_i2c_req, bnxt_i2c_req), DEVMETHOD(ifdi_needs_restart, bnxt_if_needs_restart), @@ -1808,6 +1811,33 @@ bnxt_rss_grp_tbl_init(struct bnxt_softc *softc) } } +static void bnxt_get_port_module_status(struct bnxt_softc *softc) +{ + struct bnxt_link_info *link_info = &softc->link_info; + struct hwrm_port_phy_qcfg_output *resp = &link_info->phy_qcfg_resp; + uint8_t module_status; + + if (bnxt_update_link(softc, false)) + return; + + module_status = link_info->module_status; + switch (module_status) { + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX: + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN: + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG: + device_printf(softc->dev, "Unqualified SFP+ module detected on port %d\n", + softc->pf.port_id); + if (softc->hwrm_spec_code >= 0x10201) { + device_printf(softc->dev, "Module part number %s\n", + resp->phy_vendor_partnumber); + } + if (module_status == HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX) + device_printf(softc->dev, "TX is disabled\n"); + if (module_status == HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN) + device_printf(softc->dev, "SFP+ module is shutdown\n"); + } +} + /* Device configuration */ static void bnxt_init(if_ctx_t ctx) @@ -1970,6 +2000,7 @@ skip_def_cp_ring: } bnxt_do_enable_intr(&softc->def_cp_ring); + bnxt_get_port_module_status(softc); bnxt_media_status(softc->ctx, &ifmr); bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); return; @@ -2875,6 +2906,33 @@ exit: return rc; } +static int +bnxt_i2c_req(if_ctx_t ctx, struct ifi2creq *i2c) +{ + struct bnxt_softc *softc = iflib_get_softc(ctx); + uint8_t *data = i2c->data; + int rc; + + /* No point in going further if phy status indicates + * module is not inserted or if it is powered down or + * if it is of type 10GBase-T + */ + if (softc->link_info.module_status > + HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG) + return -EOPNOTSUPP; + + /* This feature is not supported in older firmware versions */ + if (!BNXT_CHIP_P5(softc) || + (softc->hwrm_spec_code < 0x10202)) + return -EOPNOTSUPP; + + + rc = bnxt_read_sfp_module_eeprom_info(softc, I2C_DEV_ADDR_A0, 0, 0, 0, + i2c->offset, i2c->len, data); + + return rc; +} + /* * Support functions */ @@ -2891,6 +2949,7 @@ bnxt_probe_phy(struct bnxt_softc *softc) return (rc); } + bnxt_get_port_module_status(softc); /*initialize the ethool setting copy with NVM settings */ if (link_info->auto_mode != HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE) link_info->autoneg |= BNXT_AUTONEG_SPEED; From nobody Mon Jun 3 19:24:58 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 4VtNwC1p5kz5Js1B; Mon, 03 Jun 2024 19:24:59 +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 4VtNwB6fk4z4VKx; Mon, 3 Jun 2024 19:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442698; 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=/SxBJo3RdTQXnFqoS7k0hvAl+IGKz3YqvI3A6NXXE1M=; b=FAWD/p/kM9bU/FSZB0xcQPluiXPosKGB3+G1oRzOWqaGcDl1RuCOZjUH1nZJ8FevL6xP/j nlliiDmdJSqkhQjjcbUzrOyyHbvzD9mDavkbKg90gCXbOjwZnCECawsuU15tMwvyCwNAcp BvAY6U9cdQ3kRSNs0u2ECQqto0JHzeRf2LOKwHuGplVbFZpdSPeDvE/pqAamShbfTKtbPc IvFGbMTbzzDcW2IPAUplbaSRRqI6wV8u0kqnSh+1ADi0J+C3sC+m35CXXJ4jJJt2HdVbNr EHHi4jTe6WVfRC/ipdy/wDF8J+zW2VcQbtOd3CLOGf5GWzJyIdgx8CdR3Hn7rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442698; a=rsa-sha256; cv=none; b=eymxFI2kpYQoL2EETJNbewURKQbrKLfD+WUjlkzl2z0IRZpDLBV+IsRlI2fvN8/kcbNMfD 5/lapzz3C2BHxU6fX/xNLvF4qe5afAdEITYu5AAwRKT2C6kGAJHi2LeZQnWRyT2E9xEYLZ vy0I1GK/hLAxkQL6e7/aT6yGBzOkz4fj8+g4WsNxqWr2WUhhpDYOAw2LKAJZDqIGEtjNDQ OHKNVIKmNqkhVdPjSaerqbalLACeg3eW3zc7YU9EnBe2kSpsJcbZq5CoPwmFRBUfFYyWjc ePtiT+8jkbHKcvYDcpwX7AY0kv/bfAuqc9aR7wabHINkez8UuG+Ucc/uNk6roA== 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=1717442698; 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=/SxBJo3RdTQXnFqoS7k0hvAl+IGKz3YqvI3A6NXXE1M=; b=Qg5htrRjtjQkCS5Ce0oww2R/flUoxYLn9zYxVPs1EB7FHGpueUfa7t1DAA+tFOvZc07+qm Ds8EM2EVQ7fYVsrKIO1kupoYxHnupjkxcEv/BntMT9d5EvEa7dUxVQO0oTZtavmjtvh7PA GagmgtiTdBBUIAcyYAOQzEftGsU/UEd+4M0e1rjjR0YDAmgLkspWna4CBocKVtEzc+LQGH N/MtyVYKNzJt/s7tODZwnFWCqb90fhbagNF+kmb4rRy3bqWyO/9j+z136+0kqo/9rp4vTt OUB1Tfv/XZP8DxfmKMDgpEo9AQpNcz0aGlhnkNpoBQBWeNe6Ak7lhbIFe0bx8Q== 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 4VtNwB6DLsznPD; Mon, 3 Jun 2024 19:24:58 +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 453JOwei067783; Mon, 3 Jun 2024 19:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOwek067780; Mon, 3 Jun 2024 19:24:58 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:58 GMT Message-Id: <202406031924.453JOwek067780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: def6e322834b - stable/14 - if_bnxt: 50G, 100G and 200G PAM4 support 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: def6e322834b80443cc4424938c4f7d2cb750274 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=def6e322834b80443cc4424938c4f7d2cb750274 commit def6e322834b80443cc4424938c4f7d2cb750274 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:21:52 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: 50G, 100G and 200G PAM4 support Add support for 50G, 100G and 200G PAM4 support Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42959 (cherry picked from commit c63d67e137f353f4bc4d0d56bd793f83204a3e1e) --- sys/dev/bnxt/bnxt.h | 31 ++++++- sys/dev/bnxt/bnxt_hwrm.c | 78 ++++++++++++++++- sys/dev/bnxt/bnxt_hwrm.h | 1 + sys/dev/bnxt/if_bnxt.c | 213 +++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 284 insertions(+), 39 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 4397e0478a0c..204284d45428 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -306,12 +306,33 @@ struct bnxt_link_info { #define PHY_VER_LEN 3 uint8_t phy_ver[PHY_VER_LEN]; uint8_t phy_type; +#define BNXT_PHY_STATE_ENABLED 0 +#define BNXT_PHY_STATE_DISABLED 1 + uint8_t phy_state; + uint16_t link_speed; uint16_t support_speeds; + uint16_t support_pam4_speeds; uint16_t auto_link_speeds; - uint16_t auto_link_speed; + uint16_t auto_pam4_link_speeds; uint16_t force_link_speed; + uint16_t force_pam4_link_speed; + bool force_pam4_speed_set_by_user; + + uint16_t advertising; + uint16_t advertising_pam4; + uint32_t preemphasis; + uint16_t support_auto_speeds; + uint16_t support_force_speeds; + uint16_t support_pam4_auto_speeds; + uint16_t support_pam4_force_speeds; +#define BNXT_SIG_MODE_NRZ HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ +#define BNXT_SIG_MODE_PAM4 HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4 + uint8_t req_signal_mode; + + uint8_t active_fec_sig_mode; + uint8_t sig_mode; /* copy of requested setting */ uint8_t autoneg; @@ -323,6 +344,14 @@ struct bnxt_link_info { struct hwrm_port_phy_qcfg_output phy_qcfg_resp; }; +enum bnxt_phy_type { + BNXT_MEDIA_CR = 0, + BNXT_MEDIA_LR, + BNXT_MEDIA_SR, + BNXT_MEDIA_KR, + BNXT_MEDIA_END +}; + enum bnxt_cp_type { BNXT_DEFAULT, BNXT_TX, diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 97574c768235..481d45350488 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -857,6 +857,7 @@ static void bnxt_hwrm_set_link_common(struct bnxt_softc *softc, struct hwrm_port_phy_cfg_input *req) { + struct bnxt_link_info *link_info = &softc->link_info; uint8_t autoneg = softc->link_info.autoneg; uint16_t fw_link_speed = softc->link_info.req_link_speed; @@ -869,8 +870,15 @@ bnxt_hwrm_set_link_common(struct bnxt_softc *softc, req->flags |= htole32(HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG); } else { - req->force_link_speed = htole16(fw_link_speed); req->flags |= htole32(HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE); + + if (link_info->force_pam4_speed_set_by_user) { + req->force_pam4_link_speed = htole16(fw_link_speed); + req->enables |= htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAM4_LINK_SPEED); + link_info->force_pam4_speed_set_by_user = false; + } else { + req->force_link_speed = htole16(fw_link_speed); + } } /* tell chimp that the setting takes effect immediately */ @@ -2284,7 +2292,7 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) else link_info->link_speed = 0; link_info->force_link_speed = le16toh(resp->force_link_speed); - link_info->auto_link_speed = le16toh(resp->auto_link_speed); + link_info->auto_link_speeds = le16toh(resp->auto_link_speed); link_info->support_speeds = le16toh(resp->support_speeds); link_info->auto_link_speeds = le16toh(resp->auto_link_speed_mask); link_info->preemphasis = le32toh(resp->preemphasis); @@ -2304,6 +2312,72 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc) link_info->phy_addr = resp->eee_config_phy_addr & HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK; link_info->module_status = resp->module_status; + link_info->support_pam4_speeds = le16toh(resp->support_pam4_speeds); + link_info->auto_pam4_link_speeds = le16toh(resp->auto_pam4_link_speed_mask); + link_info->force_pam4_link_speed = le16toh(resp->force_pam4_link_speed); + + if (softc->hwrm_spec_code >= 0x10504) + link_info->active_fec_sig_mode = resp->active_fec_signal_mode; + +exit: + BNXT_HWRM_UNLOCK(softc); + return rc; +} + +static bool +bnxt_phy_qcaps_no_speed(struct hwrm_port_phy_qcaps_output *resp) +{ + if (!resp->supported_speeds_auto_mode && + !resp->supported_speeds_force_mode && + !resp->supported_pam4_speeds_auto_mode && + !resp->supported_pam4_speeds_force_mode) + return true; + + return false; +} + +int bnxt_hwrm_phy_qcaps(struct bnxt_softc *softc) +{ + struct bnxt_link_info *link_info = &softc->link_info; + struct hwrm_port_phy_qcaps_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_port_phy_qcaps_input req = {}; + int rc; + + if (softc->hwrm_spec_code < 0x10201) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_PHY_QCAPS); + + BNXT_HWRM_LOCK(softc); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto exit; + + if (softc->hwrm_spec_code >= 0x10a01) { + if (bnxt_phy_qcaps_no_speed(resp)) { + link_info->phy_state = BNXT_PHY_STATE_DISABLED; + device_printf(softc->dev, "Ethernet link disabled\n"); + } else if (link_info->phy_state == BNXT_PHY_STATE_DISABLED) { + link_info->phy_state = BNXT_PHY_STATE_ENABLED; + device_printf(softc->dev, "Ethernet link enabled\n"); + /* Phy re-enabled, reprobe the speeds */ + link_info->support_auto_speeds = 0; + link_info->support_pam4_auto_speeds = 0; + } + } + if (resp->supported_speeds_auto_mode) + link_info->support_auto_speeds = + le16toh(resp->supported_speeds_auto_mode); + if (resp->supported_speeds_force_mode) + link_info->support_force_speeds = + le16toh(resp->supported_speeds_force_mode); + if (resp->supported_pam4_speeds_auto_mode) + link_info->support_pam4_auto_speeds = + le16toh(resp->supported_pam4_speeds_auto_mode); + if (resp->supported_pam4_speeds_force_mode) + link_info->support_pam4_force_speeds = + le16toh(resp->supported_pam4_speeds_force_mode); exit: BNXT_HWRM_UNLOCK(softc); diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index 6dd015a15d40..930ff424ecb8 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -116,6 +116,7 @@ int bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint16_t millisecond, uint16_t zone); int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc); +int bnxt_hwrm_phy_qcaps(struct bnxt_softc *softc); uint16_t bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle); int bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc); int bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 4bd9af19d660..87e0d6cd9354 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -2135,6 +2135,9 @@ bnxt_media_change(if_ctx_t ctx) if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) return EINVAL; + softc->link_info.req_signal_mode = + HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4; + switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_100_T: softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; @@ -2190,10 +2193,22 @@ bnxt_media_change(if_ctx_t ctx) break; case IFM_50G_CR2: case IFM_50G_KR2: + case IFM_50G_SR2: softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; softc->link_info.req_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB; break; + case IFM_50G_CP: + case IFM_50G_LR: + case IFM_50G_SR: + case IFM_50G_KR_PAM4: + softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; + softc->link_info.req_link_speed = + HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB; + softc->link_info.req_signal_mode = + HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4; + softc->link_info.force_pam4_speed_set_by_user = true; + break; case IFM_100G_CR4: case IFM_100G_KR4: case IFM_100G_LR4: @@ -2202,6 +2217,30 @@ bnxt_media_change(if_ctx_t ctx) softc->link_info.req_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB; break; + case IFM_100G_CP2: + case IFM_100G_SR2: + case IFM_100G_KR_PAM4: + case IFM_100G_KR2_PAM4: + softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; + softc->link_info.req_link_speed = + HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB; + softc->link_info.req_signal_mode = + HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4; + softc->link_info.force_pam4_speed_set_by_user = true; + break; + case IFM_200G_SR4: + case IFM_200G_FR4: + case IFM_200G_LR4: + case IFM_200G_DR4: + case IFM_200G_CR4_PAM4: + case IFM_200G_KR4_PAM4: + softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; + softc->link_info.req_link_speed = + HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB; + softc->link_info.force_pam4_speed_set_by_user = true; + softc->link_info.req_signal_mode = + HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4; + break; default: device_printf(softc->dev, "Unsupported media type! Using auto\n"); @@ -2942,6 +2981,13 @@ bnxt_probe_phy(struct bnxt_softc *softc) struct bnxt_link_info *link_info = &softc->link_info; int rc = 0; + rc = bnxt_hwrm_phy_qcaps(softc); + if (rc) { + device_printf(softc->dev, + "Probe phy can't get phy capabilities (rc: %x)\n", rc); + return rc; + } + rc = bnxt_update_link(softc, false); if (rc) { device_printf(softc->dev, @@ -2950,26 +2996,99 @@ bnxt_probe_phy(struct bnxt_softc *softc) } bnxt_get_port_module_status(softc); + /*initialize the ethool setting copy with NVM settings */ if (link_info->auto_mode != HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE) link_info->autoneg |= BNXT_AUTONEG_SPEED; link_info->req_duplex = link_info->duplex_setting; + + /* NRZ link speed */ if (link_info->autoneg & BNXT_AUTONEG_SPEED) - link_info->req_link_speed = link_info->auto_link_speed; + link_info->req_link_speed = link_info->auto_link_speeds; else link_info->req_link_speed = link_info->force_link_speed; + + /* PAM4 link speed */ + if (link_info->auto_pam4_link_speeds) + link_info->req_link_speed = link_info->auto_pam4_link_speeds; + if (link_info->force_pam4_link_speed) + link_info->req_link_speed = link_info->force_pam4_link_speed; + return (rc); } +static void +add_media(struct bnxt_softc *softc, uint8_t media_type, uint16_t supported, + uint16_t supported_pam4) +{ + switch (media_type) { + case BNXT_MEDIA_CR: + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_50G, IFM_50G_CP); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_100G, IFM_100G_CP2); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_200G, IFM_200G_CR4_PAM4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_CR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_CR2); + BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_CR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_CR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_CR1); + BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_CX); + break; + + case BNXT_MEDIA_LR: + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_50G, IFM_50G_LR); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_200G, IFM_200G_LR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_LR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_LR2); + BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_LR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_LR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_LR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_LX); + break; + + case BNXT_MEDIA_SR: + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_50G, IFM_50G_SR); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_100G, IFM_100G_SR2); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_200G, IFM_200G_SR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_SR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_SR2); + BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_SR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_SR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_SR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_SX); + break; + + case BNXT_MEDIA_KR: + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_50G, IFM_50G_KR_PAM4); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_100G, IFM_100G_KR2_PAM4); + BNXT_IFMEDIA_ADD(supported_pam4, PAM4_SPEEDS_200G, IFM_200G_KR4_PAM4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_KR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_KR2); + BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_KR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_KR4); + BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_KR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_20GB, IFM_20G_KR2); + BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_KR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_KX); + break; + + default: + break; + + } + return; + +} + static void bnxt_add_media_types(struct bnxt_softc *softc) { struct bnxt_link_info *link_info = &softc->link_info; - uint16_t supported; - uint8_t phy_type = get_phy_type(softc); + uint16_t supported = 0, supported_pam4 = 0; + uint8_t phy_type = get_phy_type(softc), media_type; supported = link_info->support_speeds; + supported_pam4 = link_info->support_pam4_speeds; /* Auto is always supported */ ifmedia_add(softc->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -2978,55 +3097,44 @@ bnxt_add_media_types(struct bnxt_softc *softc) return; switch (phy_type) { + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4: + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR2: + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASECR: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR: - BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_CR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_CR2); - BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_CR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_CR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_CR1); - BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_CX); + media_type = BNXT_MEDIA_CR; break; + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4: + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASELR: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR: - BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_LR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_LR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_LR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_LR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_LX); + media_type = BNXT_MEDIA_LR; break; + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4: + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASESR: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4: + case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX: - BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_SR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_SR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_SR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_SR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_SX); + media_type = BNXT_MEDIA_SR; break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: - BNXT_IFMEDIA_ADD(supported, SPEEDS_100GB, IFM_100G_KR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_50GB, IFM_50G_KR2); - BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_KR4); - BNXT_IFMEDIA_ADD(supported, SPEEDS_25GB, IFM_25G_KR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_20GB, IFM_20G_KR2); - BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_KR); - BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_KX); + media_type = BNXT_MEDIA_KR; break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE: @@ -3034,11 +3142,11 @@ bnxt_add_media_types(struct bnxt_softc *softc) BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_AOC); BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_XLAUI); BNXT_IFMEDIA_ADD(supported, SPEEDS_40GB, IFM_40G_XLAUI_AC); - break; + return; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX: BNXT_IFMEDIA_ADD(supported, SPEEDS_1GBHD, IFM_1000_CX); - break; + return; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: @@ -3048,27 +3156,39 @@ bnxt_add_media_types(struct bnxt_softc *softc) BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_T); BNXT_IFMEDIA_ADD(supported, SPEEDS_100MB, IFM_100_T); BNXT_IFMEDIA_ADD(supported, SPEEDS_10MB, IFM_10_T); - break; + return; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_KR); BNXT_IFMEDIA_ADD(supported, SPEEDS_2_5GB, IFM_2500_KX); BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_KX); - break; + return; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY: BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_SGMII); - break; + return; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN: /* Only Autoneg is supported for TYPE_UNKNOWN */ - device_printf(softc->dev, "Unknown phy type\n"); - break; + return; default: /* Only Autoneg is supported for new phy type values */ device_printf(softc->dev, "phy type %d not supported by driver\n", phy_type); - break; + return; + } + + /* add_media is invoked twice, once with a firmware speed mask of 0 and a valid + * value for both NRZ and PAM4 sig mode. This ensures accurate display of all + * supported medias and currently configured media in the "ifconfig -m" output + */ + + if (link_info->sig_mode == BNXT_SIG_MODE_PAM4) { + add_media(softc, media_type, supported, 0); + add_media(softc, media_type, 0, supported_pam4); + } else { + add_media(softc, media_type, 0, supported_pam4); + add_media(softc, media_type, supported, 0); } return; @@ -3167,6 +3287,7 @@ bnxt_report_link(struct bnxt_softc *softc) { struct bnxt_link_info *link_info = &softc->link_info; const char *duplex = NULL, *flow_ctrl = NULL; + const char *signal_mode = ""; if (link_info->link_up == link_info->last_link_up) { if (!link_info->link_up) @@ -3191,9 +3312,27 @@ bnxt_report_link(struct bnxt_softc *softc) flow_ctrl = "FC - receive"; else flow_ctrl = "FC - none"; + + if (softc->link_info.phy_qcfg_resp.option_flags & + HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SIGNAL_MODE_KNOWN) { + uint8_t sig_mode = softc->link_info.active_fec_sig_mode & + HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_MASK; + switch (sig_mode) { + case BNXT_SIG_MODE_NRZ: + signal_mode = "(NRZ) "; + break; + case BNXT_SIG_MODE_PAM4: + signal_mode = "(PAM4) "; + break; + default: + break; + } + link_info->sig_mode = sig_mode; + } + iflib_link_state_change(softc->ctx, LINK_STATE_UP, IF_Gbps(100)); - device_printf(softc->dev, "Link is UP %s, %s - %d Mbps \n", duplex, + device_printf(softc->dev, "Link is UP %s %s, %s - %d Mbps \n", duplex, signal_mode, flow_ctrl, (link_info->link_speed * 100)); } else { iflib_link_state_change(softc->ctx, LINK_STATE_DOWN, @@ -3379,7 +3518,7 @@ bnxt_def_cp_task(void *context) softc->db_ops.bnxt_db_rx_cq(cpr, 1); } -static uint8_t +uint8_t get_phy_type(struct bnxt_softc *softc) { struct bnxt_link_info *link_info = &softc->link_info; @@ -3472,6 +3611,8 @@ bnxt_get_baudrate(struct bnxt_link_info *link) return IF_Gbps(100); case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB: return IF_Mbps(10); + case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB: + return IF_Gbps(200); } return IF_Gbps(100); } From nobody Mon Jun 3 19:24:59 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 4VtNwD2cCDz5JsDP; Mon, 03 Jun 2024 19:25:00 +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 4VtNwD0v5Pz4VMx; Mon, 3 Jun 2024 19:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442700; 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=hwWZmFbN2ot4HFZ2uMIBrKiewDQl+55j9EGg/ffRLy8=; b=TJN5FCNGKaDyqHOdOA/2NJ2I5DHBYlqSRPV/S84wS9YDzSECk48ZC+2p0Y3diplXYGdOUs +gfgK801zN9wsQ7wBpXG+BKk7S+yvCl50fuktUEyqqHGA4QaA8M9dUHyPhOvcQ17A0WXZ4 xw232YjiHCPqos/n+RJZBnQiE55YIvdtragtezRIFNBqGxVa+duH1dHGdr3sKoOfjGvvIv gge2pAPXwtMcDuNx022rIdjXKQ2/rY3ocDKz4Jv/VV3LVpczfXna7WOojvagCd0o9xcTcW gdG4UWfIUk33uNNbHOgHnKzUB+eqVxEJJoH+uzvnJOu2yT3x/LB+4sRgnU73Sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442700; a=rsa-sha256; cv=none; b=kMFpnafdeVexW/arf36b+NyMA0DUK5JFJ2RR5wTc9ANZHPSToABO1meobLjICC8sNwi10M YOw3WLTENw9WUxzDnkuZ/4hjxem8180g+vr4j2lciypyRr4Jh7iwRQkf7oPt4z4l+xsq0U hGlfxOzO02SxHdR/pycHifxMJg2zooWYVaor2qKSH85XRfdc4t7YyOWN7c5dgB1E2hrN/3 LJGi9cV3N4i5kIUEUuJjvm55xHfnzee1ayllSt2uXUthKDJTs6c3blam2f8PogFkxTZPKe vmSPc2xFL0XMH5LH6BczsEt0ZhtAIJJHeq9dZjZN5eIUmpECsNvIWteFjeos4g== 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=1717442700; 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=hwWZmFbN2ot4HFZ2uMIBrKiewDQl+55j9EGg/ffRLy8=; b=lqmXxmUDvtJSPr0vhzEjGHo2cTr/wrGoY5L95MNdbJHKtEWmSAx8zhqH0VNJG7rXNAXRti aTMtgJJpC6s0ldOw2JP8OXGYzBbtePwFm5tE726c7yxiOU7svvDFNKamCQ2CBEAqEGLUYR NiENpxagf7idkx30m71kqDAsgBBsO0kt9VELZsHFUSAXg44QHSJu/rYUTtN3vhMPNo9aDX ClUKvHcwHVIy0qXVx4+YgtNW5Me5oKyaHU23UZg3TXLqV/FDZwi9T/HNPI+PUjqMaI8GdQ IM2MvSoNT71WG+NwgOs0bKDCJ7rxLHTpk9bnK9ck1BRanwgZMPDHedJSwd4Lzw== 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 4VtNwD0CSvznn2; Mon, 3 Jun 2024 19:25:00 +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 453JOxJe067838; Mon, 3 Jun 2024 19:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOx7W067835; Mon, 3 Jun 2024 19:24:59 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:59 GMT Message-Id: <202406031924.453JOx7W067835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e7b0af020cbc - stable/14 - if_bnxt: Set 1G/10G baseT force speed as auto speeds 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7b0af020cbc13d1cbede5c7c82edeae64548137 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e7b0af020cbc13d1cbede5c7c82edeae64548137 commit e7b0af020cbc13d1cbede5c7c82edeae64548137 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:23:04 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 if_bnxt: Set 1G/10G baseT force speed as auto speeds The firmware lacks support for manually setting 1G and 10G baseT speeds. However, the driver can enable auto speed masks to achieve automatic configuration at these speeds. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42960 (cherry picked from commit 770e7ba3ebe87ba7ffc872c87de72707757b4e25) --- sys/dev/bnxt/bnxt.h | 1 + sys/dev/bnxt/bnxt_hwrm.c | 16 ++++++++++++++-- sys/dev/bnxt/if_bnxt.c | 11 ++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 204284d45428..0547bae91e09 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -843,5 +843,6 @@ struct bnxt_softc *bnxt_find_dev(uint32_t domain, uint32_t bus, uint32_t dev_fn, int bnxt_read_sfp_module_eeprom_info(struct bnxt_softc *bp, uint16_t i2c_addr, uint16_t page_number, uint8_t bank, bool bank_sel_en, uint16_t start_addr, uint16_t data_length, uint8_t *buf); +uint8_t get_phy_type(struct bnxt_softc *softc); #endif /* _BNXT_H */ diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 481d45350488..37238b857ef5 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -862,8 +862,20 @@ bnxt_hwrm_set_link_common(struct bnxt_softc *softc, uint16_t fw_link_speed = softc->link_info.req_link_speed; if (autoneg & BNXT_AUTONEG_SPEED) { - req->auto_mode |= - HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS; + uint8_t phy_type = get_phy_type(softc); + + if (phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET || + phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET || + phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE) { + + req->auto_mode |= htole32(HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK); + if (link_info->advertising) { + req->enables |= htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK); + req->auto_link_speed_mask = htole16(link_info->advertising); + } + } else { + req->auto_mode |= HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS; + } req->enables |= htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE); diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 87e0d6cd9354..d9273718873b 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -220,7 +220,6 @@ static void bnxt_mark_cpr_invalid(struct bnxt_cp_ring *cpr); static void bnxt_def_cp_task(void *context); static void bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl); -static uint8_t get_phy_type(struct bnxt_softc *softc); static uint64_t bnxt_get_baudrate(struct bnxt_link_info *link); static void bnxt_get_wol_settings(struct bnxt_softc *softc); static int bnxt_wol_config(if_ctx_t ctx); @@ -2145,7 +2144,6 @@ bnxt_media_change(if_ctx_t ctx) HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB; break; case IFM_1000_KX: - case IFM_1000_T: case IFM_1000_SGMII: case IFM_1000_CX: case IFM_1000_SX: @@ -2164,7 +2162,6 @@ bnxt_media_change(if_ctx_t ctx) case IFM_10G_KR: case IFM_10G_LR: case IFM_10G_SR: - case IFM_10G_T: softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; softc->link_info.req_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB; @@ -2241,6 +2238,14 @@ bnxt_media_change(if_ctx_t ctx) softc->link_info.req_signal_mode = HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4; break; + case IFM_1000_T: + softc->link_info.advertising = HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB; + softc->link_info.autoneg |= BNXT_AUTONEG_SPEED; + break; + case IFM_10G_T: + softc->link_info.advertising = HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB; + softc->link_info.autoneg |= BNXT_AUTONEG_SPEED; + break; default: device_printf(softc->dev, "Unsupported media type! Using auto\n"); From nobody Mon Jun 3 19:25:02 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 4VtNwG5Sbfz5Jrj8; Mon, 03 Jun 2024 19:25: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 4VtNwG3S7Cz4Vbg; Mon, 3 Jun 2024 19:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442702; 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=rYbYT38tms5/M4L+XMg7tKb7c8dIG5bUuYEydN5/Erk=; b=OPa4ceVDbhbIzV6RIv6jCRrlxSNsY97Gi4v6Gl45/CYafEzJKRlvo5nfXrwXcIUPQs79FE aHMRLNiXfHyEYgb5RONA2coE9opoyi5rYYt3fxt4wVrq03JhUn3vFeZ8ZMg6ErEfEvuJOJ 4UYUN1kiZVFxauihWfxDuqI+pgKfur+iOq/TxRDvk21N3QAk19V2WJrhPmqCIgzjx6Qk9A OoACP+4CT5qiUoWsF5B86NdXo8W+A59LV7khOrhFvSOryjSsC1kjJGlplT9ZQK2Kk7qTP+ nCi9PyooSyl1pGCW6wYqvKgTNJp0SiIUIOyvdyb1oJBCXY74RDHLQMYG254D9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442702; a=rsa-sha256; cv=none; b=KbzdncEiv6dvbYQ/vTJBDj+qUmKNP8uPSMx8gBgJtHF0E2pKE9TWaYWk+5+J6PmbDLbU1G Hx8jaKRhoCpfZkWlDX6a2UKcB1DY3L6BbioycxngJPvCCOYcEXIi3Bt+wGI5KPrsqeMUXM PweLwO1nLbhoYLJp4DYaM/+C3pZU7OQ0668cc3F05kStwxK/g5Lsj8NdwCHzjmSyS9pz6Y JJPql3uswLb01uqU1w0fhBGs5NYwwhVq2X1jVjBoH3t8BnVrM6XgEl466eqTFw+AT7u2L3 MFIShTUiuYPX5lnNVNQ4JamukXoh0ZWtJH1xBOgRVB5r002EFafoLljKfWpZmw== 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=1717442702; 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=rYbYT38tms5/M4L+XMg7tKb7c8dIG5bUuYEydN5/Erk=; b=Bbj6T7RWO0NRDXiAcMoOIgAf4hnBVNXP79uYUQXMEqcT/GwQlUAmhkR+sACFnH8PewAtTn dpxS5F7QPj5Os/4lcdSyCgNMxb/qdZ5V9vckZiiwUaqxxlFbLFbezHMw3m5N1lc0icUGB+ bQI6tmbuK2LVrtts7nhpI6AqFhzi2AfozKrnLvAd/WtVoQsczcgIZgHopBO6rL33cIdZJd wqzhmgVfQpzz2LCK9YiGVCd7RdflSRNvI2FZsVMhEc60E6PN/KyHvHul24qZnzwGrkl6rW XwZDSTiBJ47fupIGyjypcocznNDhf1pSHTdIEmWudWUrkMIUr90CADhOwHts2g== 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 4VtNwG2mkSznRC; Mon, 3 Jun 2024 19:25:02 +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 453JP2mW067951; Mon, 3 Jun 2024 19:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP2IC067948; Mon, 3 Jun 2024 19:25:02 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:02 GMT Message-Id: <202406031925.453JP2IC067948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 107e02d70619 - stable/14 - bnxt_en: L2-RoCE driver communication interface 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 107e02d70619c9f660deb67fba7f4525ad100ef2 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=107e02d70619c9f660deb67fba7f4525ad100ef2 commit 107e02d70619c9f660deb67fba7f4525ad100ef2 Author: Chandrakanth patil AuthorDate: 2024-04-28 12:29:34 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 bnxt_en: L2-RoCE driver communication interface - Added Aux bus support for RoCE. - Implemented the ulp ops that are required by RoCE driver. - Restructure context memory data structures - DBR pacing support Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45006 (cherry picked from commit 050d28e13cdede7528944c0abf8d0455729c63fd) --- sys/dev/bnxt/bnxt_en/bnxt.h | 252 +++++++++++--- sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.c | 194 +++++++++++ sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h | 75 ++++ sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 488 +++++++++++++++++--------- sys/dev/bnxt/bnxt_en/bnxt_hwrm.h | 7 +- sys/dev/bnxt/bnxt_en/bnxt_sysctl.c | 3 - sys/dev/bnxt/bnxt_en/bnxt_ulp.c | 524 ++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_ulp.h | 161 +++++++++ sys/dev/bnxt/bnxt_en/hsi_struct_def.h | 7 +- sys/dev/bnxt/bnxt_en/if_bnxt.c | 551 +++++++++++++++++++++++------- sys/modules/bnxt/bnxt_en/Makefile | 6 +- 11 files changed, 1928 insertions(+), 340 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index e68943fd6286..ab60ddf74672 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -42,9 +42,13 @@ #include #include #include +#include #include "hsi_struct_def.h" #include "bnxt_dcb.h" +#include "bnxt_auxbus_compat.h" + +#define DFLT_HWRM_CMD_TIMEOUT 500 /* PCI IDs */ #define BROADCOM_VENDOR_ID 0x14E4 @@ -90,6 +94,58 @@ #define NETXTREME_E_VF2 0x16d3 #define NETXTREME_E_VF3 0x16dc +#define EVENT_DATA1_RESET_NOTIFY_FATAL(data1) \ + (((data1) & \ + HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK) ==\ + HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL) + +#define BNXT_EVENT_ERROR_REPORT_TYPE(data1) \ + (((data1) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK) >> \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT) + +#define BNXT_EVENT_INVALID_SIGNAL_DATA(data2) \ + (((data2) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_MASK) >> \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_SFT) + +#define BNXT_EVENT_DBR_EPOCH(data) \ + (((data) & HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_MASK) >> \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_SFT) + +#define BNXT_EVENT_THERMAL_THRESHOLD_TEMP(data2) \ + (((data2) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK) >> \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT) + +#define EVENT_DATA2_NVM_ERR_ADDR(data2) \ + (((data2) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_MASK) >> \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_SFT) + +#define EVENT_DATA1_THERMAL_THRESHOLD_DIR_INCREASING(data1) \ + (((data1) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR) == \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING) + +#define EVENT_DATA1_NVM_ERR_TYPE_WRITE(data1) \ + (((data1) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_MASK) == \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_WRITE) + +#define EVENT_DATA1_NVM_ERR_TYPE_ERASE(data1) \ + (((data1) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_MASK) == \ + HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_ERASE) + +#define EVENT_DATA1_THERMAL_THRESHOLD_TYPE(data1) \ + ((data1) & HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK) + +#define BNXT_EVENT_THERMAL_CURRENT_TEMP(data2) \ + ((data2) & HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK) + +#define INVALID_STATS_CTX_ID -1 + /* Maximum numbers of RX and TX descriptors. iflib requires this to be a power * of two. The hardware has no particular limitation. */ #define BNXT_MAX_RXD ((INT32_MAX >> 1) + 1) @@ -139,16 +195,20 @@ #define DBR_TYPE_PUSH_END (0xdULL << 60) #define DBR_TYPE_NULL (0xfULL << 60) -#define BNXT_MAX_NUM_QUEUES 32 +#define BNXT_MAX_L2_QUEUES 128 +#define BNXT_ROCE_IRQ_COUNT 9 + +#define BNXT_MAX_NUM_QUEUES (BNXT_MAX_L2_QUEUES + BNXT_ROCE_IRQ_COUNT) /* Completion related defines */ #define CMP_VALID(cmp, v_bit) \ ((!!(((struct cmpl_base *)(cmp))->info3_v & htole32(CMPL_BASE_V))) == !!(v_bit) ) /* Chip class phase 5 */ -#define BNXT_CHIP_P5(sc) ((softc->flags & BNXT_FLAG_CHIP_P5)) +#define BNXT_CHIP_P5(sc) ((sc->flags & BNXT_FLAG_CHIP_P5)) #define DB_PF_OFFSET_P5 0x10000 +#define DB_VF_OFFSET_P5 0x4000 #define NQ_VALID(cmp, v_bit) \ ((!!(((nq_cn_t *)(cmp))->v & htole32(NQ_CN_V))) == !!(v_bit) ) @@ -509,10 +569,9 @@ struct bnxt_ver_info { uint8_t hwrm_if_update; char hwrm_if_ver[BNXT_VERSTR_SIZE]; char driver_hwrm_if_ver[BNXT_VERSTR_SIZE]; - char hwrm_fw_ver[BNXT_VERSTR_SIZE]; - char mgmt_fw_ver[BNXT_VERSTR_SIZE]; - char netctrl_fw_ver[BNXT_VERSTR_SIZE]; - char roce_fw_ver[BNXT_VERSTR_SIZE]; + char mgmt_fw_ver[FW_VER_STR_LEN]; + char netctrl_fw_ver[FW_VER_STR_LEN]; + char roce_fw_ver[FW_VER_STR_LEN]; char fw_ver_str[FW_VER_STR_LEN]; char phy_ver[BNXT_VERSTR_SIZE]; char pkg_ver[64]; @@ -589,19 +648,22 @@ struct bnxt_hw_lro { #define MAX_CTX_PAGES (BNXT_PAGE_SIZE / 8) #define MAX_CTX_TOTAL_PAGES (MAX_CTX_PAGES * MAX_CTX_PAGES) + struct bnxt_ring_mem_info { - int nr_pages; - int page_size; - uint16_t flags; + int nr_pages; + int page_size; + uint16_t flags; #define BNXT_RMEM_VALID_PTE_FLAG 1 #define BNXT_RMEM_RING_PTE_FLAG 2 #define BNXT_RMEM_USE_FULL_PAGE_FLAG 4 - uint16_t depth; - uint8_t init_val; - struct iflib_dma_info *pg_arr; - struct iflib_dma_info pg_tbl; - int vmem_size; - void **vmem; + uint16_t depth; + struct bnxt_ctx_mem_type *ctx_mem; + + struct iflib_dma_info *pg_arr; + struct iflib_dma_info pg_tbl; + + int vmem_size; + void **vmem; }; struct bnxt_ctx_pg_info { @@ -612,43 +674,85 @@ struct bnxt_ctx_pg_info { struct bnxt_ctx_pg_info **ctx_pg_tbl; }; +#define BNXT_MAX_TQM_SP_RINGS 1 +#define BNXT_MAX_TQM_FP_LEGACY_RINGS 8 +#define BNXT_MAX_TQM_FP_RINGS 9 +#define BNXT_MAX_TQM_LEGACY_RINGS \ + (BNXT_MAX_TQM_SP_RINGS + BNXT_MAX_TQM_FP_LEGACY_RINGS) +#define BNXT_MAX_TQM_RINGS \ + (BNXT_MAX_TQM_SP_RINGS + BNXT_MAX_TQM_FP_RINGS) + +#define BNXT_BACKING_STORE_CFG_LEGACY_LEN 256 +#define BNXT_BACKING_STORE_CFG_LEN \ + sizeof(struct hwrm_func_backing_store_cfg_input) + +#define BNXT_SET_CTX_PAGE_ATTR(attr) \ +do { \ + if (BNXT_PAGE_SIZE == 0x2000) \ + attr = HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_SRQ_PG_SIZE_PG_8K; \ + else if (BNXT_PAGE_SIZE == 0x10000) \ + attr = HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_QPC_PG_SIZE_PG_64K; \ + else \ + attr = HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_QPC_PG_SIZE_PG_4K; \ +} while (0) + +struct bnxt_ctx_mem_type { + u16 type; + u16 entry_size; + u32 flags; +#define BNXT_CTX_MEM_TYPE_VALID HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID + u32 instance_bmap; + u8 init_value; + u8 entry_multiple; + u16 init_offset; +#define BNXT_CTX_INIT_INVALID_OFFSET 0xffff + u32 max_entries; + u32 min_entries; + u8 split_entry_cnt; +#define BNXT_MAX_SPLIT_ENTRY 4 + union { + struct { + u32 qp_l2_entries; + u32 qp_qp1_entries; + }; + u32 srq_l2_entries; + u32 cq_l2_entries; + u32 vnic_entries; + struct { + u32 mrav_av_entries; + u32 mrav_num_entries_units; + }; + u32 split[BNXT_MAX_SPLIT_ENTRY]; + }; + struct bnxt_ctx_pg_info *pg_info; +}; + +#define BNXT_CTX_QP HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QP +#define BNXT_CTX_SRQ HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ +#define BNXT_CTX_CQ HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ +#define BNXT_CTX_VNIC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_VNIC +#define BNXT_CTX_STAT HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_STAT +#define BNXT_CTX_STQM HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SP_TQM_RING +#define BNXT_CTX_FTQM HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_FP_TQM_RING +#define BNXT_CTX_MRAV HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MRAV +#define BNXT_CTX_TIM HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TIM +#define BNXT_CTX_TKC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TKC +#define BNXT_CTX_RKC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RKC +#define BNXT_CTX_MTQM HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MP_TQM_RING +#define BNXT_CTX_SQDBS HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SQ_DB_SHADOW +#define BNXT_CTX_RQDBS HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RQ_DB_SHADOW +#define BNXT_CTX_SRQDBS HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ_DB_SHADOW +#define BNXT_CTX_CQDBS HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ_DB_SHADOW +#define BNXT_CTX_QTKC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_TKC +#define BNXT_CTX_QRKC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_RKC +#define BNXT_CTX_MAX (BNXT_CTX_QRKC + 1) + struct bnxt_ctx_mem_info { - uint32_t qp_max_entries; - uint16_t qp_min_qp1_entries; - uint16_t qp_max_l2_entries; - uint16_t qp_entry_size; - uint16_t srq_max_l2_entries; - uint32_t srq_max_entries; - uint16_t srq_entry_size; - uint16_t cq_max_l2_entries; - uint32_t cq_max_entries; - uint16_t cq_entry_size; - uint16_t vnic_max_vnic_entries; - uint16_t vnic_max_ring_table_entries; - uint16_t vnic_entry_size; - uint32_t stat_max_entries; - uint16_t stat_entry_size; - uint16_t tqm_entry_size; - uint32_t tqm_min_entries_per_ring; - uint32_t tqm_max_entries_per_ring; - uint32_t mrav_max_entries; - uint16_t mrav_entry_size; - uint16_t tim_entry_size; - uint32_t tim_max_entries; - uint8_t tqm_entries_multiple; - uint8_t ctx_kind_initializer; + u8 tqm_fp_rings_count; - uint32_t flags; + u32 flags; #define BNXT_CTX_FLAG_INITED 0x01 - - struct bnxt_ctx_pg_info qp_mem; - struct bnxt_ctx_pg_info srq_mem; - struct bnxt_ctx_pg_info cq_mem; - struct bnxt_ctx_pg_info vnic_mem; - struct bnxt_ctx_pg_info stat_mem; - struct bnxt_ctx_pg_info mrav_mem; - struct bnxt_ctx_pg_info tim_mem; - struct bnxt_ctx_pg_info *tqm_mem[9]; + struct bnxt_ctx_mem_type ctx_arr[BNXT_CTX_MAX]; }; struct bnxt_hw_resc { @@ -678,7 +782,7 @@ struct bnxt_hw_resc { uint16_t max_nqs; uint16_t max_irqs; uint16_t resv_irqs; -} +}; enum bnxt_type_ets { BNXT_TYPE_ETS_TSA = 0, @@ -710,11 +814,23 @@ struct bnxt_softc_list { #define BIT_ULL(nr) (1ULL << (nr)) #endif +struct bnxt_aux_dev { + struct auxiliary_device aux_dev; + struct bnxt_en_dev *edev; + int id; +}; + +struct bnxt_msix_tbl { + uint32_t entry; + uint32_t vector; +}; + struct bnxt_softc { device_t dev; if_ctx_t ctx; if_softc_ctx_t scctx; if_shared_ctx_t sctx; + if_t ifp; uint32_t domain; uint32_t bus; uint32_t slot; @@ -738,11 +854,16 @@ struct bnxt_softc { #define BNXT_FLAG_FW_CAP_EXT_STATS 0x0080 #define BNXT_FLAG_MULTI_HOST 0x0100 #define BNXT_FLAG_MULTI_ROOT 0x0200 +#define BNXT_FLAG_ROCEV1_CAP 0x0400 +#define BNXT_FLAG_ROCEV2_CAP 0x0800 +#define BNXT_FLAG_ROCE_CAP (BNXT_FLAG_ROCEV1_CAP | BNXT_FLAG_ROCEV2_CAP) uint32_t flags; #define BNXT_STATE_LINK_CHANGE (0) #define BNXT_STATE_MAX (BNXT_STATE_LINK_CHANGE + 1) bitstr_t *state_bv; - uint32_t total_msix; + + uint32_t total_irqs; + struct bnxt_msix_tbl *irq_tbl; struct bnxt_func_info func; struct bnxt_func_qcfg fn_qcfg; @@ -812,6 +933,8 @@ struct bnxt_softc { struct iflib_dma_info def_cp_ring_mem; struct iflib_dma_info def_nq_ring_mem; struct grouptask def_cp_task; + int db_size; + int legacy_db_size; struct bnxt_doorbell_ops db_ops; struct sysctl_ctx_list hw_stats; @@ -908,6 +1031,33 @@ struct bnxt_softc { #define BNXT_PHY_FL_NO_PAUSE (HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PAUSE_UNSUPPORTED << 8) #define BNXT_PHY_FL_NO_PFC (HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PFC_UNSUPPORTED << 8) #define BNXT_PHY_FL_BANK_SEL (HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_BANK_ADDR_SUPPORTED << 8) + struct bnxt_aux_dev *aux_dev; + struct net_device *net_dev; + struct mtx en_ops_lock; + uint8_t port_partition_type; + struct bnxt_en_dev *edev; + unsigned long state; +#define BNXT_STATE_OPEN 0 +#define BNXT_STATE_IN_SP_TASK 1 +#define BNXT_STATE_READ_STATS 2 +#define BNXT_STATE_FW_RESET_DET 3 +#define BNXT_STATE_IN_FW_RESET 4 +#define BNXT_STATE_ABORT_ERR 5 +#define BNXT_STATE_FW_FATAL_COND 6 +#define BNXT_STATE_DRV_REGISTERED 7 +#define BNXT_STATE_PCI_CHANNEL_IO_FROZEN 8 +#define BNXT_STATE_NAPI_DISABLED 9 +#define BNXT_STATE_L2_FILTER_RETRY 10 +#define BNXT_STATE_FW_ACTIVATE 11 +#define BNXT_STATE_RECOVER 12 +#define BNXT_STATE_FW_NON_FATAL_COND 13 +#define BNXT_STATE_FW_ACTIVATE_RESET 14 +#define BNXT_STATE_HALF_OPEN 15 +#define BNXT_NO_FW_ACCESS(bp) \ + test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) + struct pci_dev *pdev; + + int fw_reset_state; }; struct bnxt_filter_info { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.c b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.c new file mode 100644 index 000000000000..1014d360015a --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.c @@ -0,0 +1,194 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2024 Broadcom, All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include "bnxt_auxbus_compat.h" + +static struct list_head bnxt_aux_bus_dev_list = LINUX_LIST_HEAD_INIT(bnxt_aux_bus_dev_list); +static struct list_head bnxt_aux_bus_drv_list = LINUX_LIST_HEAD_INIT(bnxt_aux_bus_drv_list); +static DEFINE_MUTEX(bnxt_auxbus_lock); + +static const struct auxiliary_device_id *auxiliary_match_id(const struct auxiliary_device_id *id, + const struct auxiliary_device *auxdev) +{ + for (; id->name[0]; id++) { + const char *p = strrchr(dev_name(&auxdev->dev), '.'); + int match_size; + + if (!p) + continue; + match_size = p - dev_name(&auxdev->dev); + + if (strlen(id->name) == match_size && + !strncmp(dev_name(&auxdev->dev), id->name, match_size)) + return id; + } + return NULL; +} + +int auxiliary_device_init(struct auxiliary_device *auxdev) +{ + struct device *dev = &auxdev->dev; + char *modname = KBUILD_MODNAME; + int ret; + + if (!dev->parent) { + pr_err("auxiliary_device has a NULL dev->parent\n"); + return -EINVAL; + } + + if (!auxdev->name) { + pr_err("auxiliary_device has a NULL name\n"); + return -EINVAL; + } + + ret = dev_set_name(dev, "%s.%s.%d", modname, auxdev->name, auxdev->id); + if (ret) { + dev_err(dev, "auxiliary device dev_set_name failed: %d\n", ret); + return ret; + } + + return 0; +} + +int auxiliary_device_add(struct auxiliary_device *auxdev) +{ + const struct auxiliary_device_id *id; + struct auxiliary_driver *auxdrv = NULL; + bool found = true; + int ret = 0; + + mutex_lock(&bnxt_auxbus_lock); + list_for_each_entry(auxdrv, &bnxt_aux_bus_drv_list, list) { + if (auxdrv) { + msleep(2 * 1000); + + id = auxiliary_match_id(auxdrv->id_table, auxdev); + if (id) { + ret = auxdrv->probe(auxdev, id); + if (!ret) + auxdev->dev.driver = &auxdrv->driver; + else + found = false; + break; + } + } + } + + if (found) + list_add_tail(&auxdev->list, &bnxt_aux_bus_dev_list); + mutex_unlock(&bnxt_auxbus_lock); + + return ret; +} + +void auxiliary_device_uninit(struct auxiliary_device *auxdev) +{ + return; +} + +void auxiliary_device_delete(struct auxiliary_device *auxdev) +{ + struct auxiliary_driver *auxdrv; + + mutex_lock(&bnxt_auxbus_lock); + list_for_each_entry(auxdrv, &bnxt_aux_bus_drv_list, list) { + if (auxdev->dev.driver != &auxdrv->driver) + continue; + if (auxdrv->remove) + auxdrv->remove(auxdev); + auxdev->dev.driver = NULL; + } + list_del(&auxdev->list); + mutex_unlock(&bnxt_auxbus_lock); +} + +int auxiliary_driver_register(struct auxiliary_driver *auxdrv) +{ + const struct auxiliary_device_id *id; + struct auxiliary_device *auxdev; + int ret = 0; + + if (WARN_ON(!auxdrv->probe) || WARN_ON(!auxdrv->id_table)) + return -EINVAL; + + if (auxdrv->name) + auxdrv->driver.name = kasprintf(GFP_KERNEL, "%s.%s", KBUILD_MODNAME, + auxdrv->name); + else + auxdrv->driver.name = kasprintf(GFP_KERNEL, "%s", KBUILD_MODNAME); + if (!auxdrv->driver.name) + return -ENOMEM; + + mutex_lock(&bnxt_auxbus_lock); + list_for_each_entry(auxdev, &bnxt_aux_bus_dev_list, list) { + if (auxdev->dev.driver) + continue; + + id = auxiliary_match_id(auxdrv->id_table, auxdev); + if (id) { + ret = auxdrv->probe(auxdev, id); + if (ret) + continue; + auxdev->dev.driver = &auxdrv->driver; + } + } + list_add_tail(&auxdrv->list, &bnxt_aux_bus_drv_list); + mutex_unlock(&bnxt_auxbus_lock); + return 0; +} +EXPORT_SYMBOL(auxiliary_driver_register); + +void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv) +{ + struct auxiliary_device *auxdev; + + /* PF auxiliary devices are added to the list first and then VF devices. + * If we remove PF aux device driver first, it causes failures while + * removing VF driver. + * We need to remove VF auxiliary drivers first, so walk backwards. + */ + mutex_lock(&bnxt_auxbus_lock); + list_for_each_entry_reverse(auxdev, &bnxt_aux_bus_dev_list, list) { + if (auxdev->dev.driver != &auxdrv->driver) + continue; + if (auxdrv->remove) + auxdrv->remove(auxdev); + auxdev->dev.driver = NULL; + } + kfree(auxdrv->driver.name); + list_del(&auxdrv->list); + mutex_unlock(&bnxt_auxbus_lock); +} +EXPORT_SYMBOL(auxiliary_driver_unregister); diff --git a/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h new file mode 100644 index 000000000000..1d844a67c928 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h @@ -0,0 +1,75 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2024 Broadcom, All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _BNXT_AUXILIARY_COMPAT_H_ +#define _BNXT_AUXILIARY_COMPAT_H_ + +#include +#include + +#define KBUILD_MODNAME "if_bnxt" +#define AUXILIARY_NAME_SIZE 32 + +struct auxiliary_device_id { + char name[AUXILIARY_NAME_SIZE]; + uint64_t driver_data; +}; + +struct auxiliary_device { + struct device dev; + const char *name; + uint32_t id; + struct list_head list; +}; + +struct auxiliary_driver { + int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id); + void (*remove)(struct auxiliary_device *auxdev); + const char *name; + struct device_driver driver; + const struct auxiliary_device_id *id_table; + struct list_head list; +}; + +int auxiliary_device_init(struct auxiliary_device *auxdev); +int auxiliary_device_add(struct auxiliary_device *auxdev); +void auxiliary_device_uninit(struct auxiliary_device *auxdev); +void auxiliary_device_delete(struct auxiliary_device *auxdev); +int auxiliary_driver_register(struct auxiliary_driver *auxdrv); +void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv); + +static inline void *auxiliary_get_drvdata(struct auxiliary_device *auxdev) +{ + return dev_get_drvdata(&auxdev->dev); +} + +static inline void auxiliary_set_drvdata(struct auxiliary_device *auxdev, void *data) +{ + dev_set_drvdata(&auxdev->dev, data); +} +#endif /* _BNXT_AUXILIARY_COMPAT_H_ */ diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c index 6bc56aeb69a0..07834aeca363 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c @@ -28,6 +28,7 @@ #include #include +#include #include "bnxt.h" #include "bnxt_hwrm.h" @@ -122,6 +123,10 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len) req->seq_id = htole16(softc->hwrm_cmd_seq++); memset(resp, 0, PAGE_SIZE); + if (BNXT_NO_FW_ACCESS(softc) && + (req->req_type != HWRM_FUNC_RESET && req->req_type != HWRM_VER_GET)) + return -EINVAL; + if ((softc->flags & BNXT_FLAG_SHORT_CMD) || msg_len > BNXT_HWRM_MAX_REQ_LEN) { void *short_cmd_req = softc->hwrm_short_cmd_req_addr.idi_vaddr; @@ -313,6 +318,39 @@ qportcfg_exit: return rc; } +static int bnxt_alloc_all_ctx_pg_info(struct bnxt_softc *softc) +{ + struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; + u16 type; + + for (type = 0; type < BNXT_CTX_MAX; type++) { + struct bnxt_ctx_mem_type *ctxm = &ctx->ctx_arr[type]; + int n = 1; + + if (!ctxm->max_entries || ctxm->pg_info) + continue; + + if (ctxm->instance_bmap) + n = hweight32(ctxm->instance_bmap); + ctxm->pg_info = kcalloc(n, sizeof(*ctxm->pg_info), GFP_KERNEL); + if (!ctxm->pg_info) + return -ENOMEM; + } + return 0; +} + +static void bnxt_init_ctx_initializer(struct bnxt_ctx_mem_type *ctxm, + u8 init_val, u8 init_offset, + bool init_mask_set) +{ + ctxm->init_value = init_val; + ctxm->init_offset = BNXT_CTX_INIT_INVALID_OFFSET; + if (init_mask_set) + ctxm->init_offset = init_offset * 4; + else + ctxm->init_value = 0; +} + int bnxt_hwrm_func_backing_store_qcaps(struct bnxt_softc *softc) { struct hwrm_func_backing_store_qcaps_input req = {0}; @@ -320,63 +358,110 @@ int bnxt_hwrm_func_backing_store_qcaps(struct bnxt_softc *softc) (void *)softc->hwrm_cmd_resp.idi_vaddr; int rc; - if (softc->hwrm_spec_code < 0x10902 || BNXT_VF(softc) || softc->ctx_mem) + if (softc->hwrm_spec_code < 0x10902 || softc->ctx_mem) + return 0; + + if (BNXT_VF(softc)) return 0; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_BACKING_STORE_QCAPS); BNXT_HWRM_LOCK(softc); rc = _hwrm_send_message(softc, &req, sizeof(req)); if (!rc) { - struct bnxt_ctx_pg_info *ctx_pg; + struct bnxt_ctx_mem_type *ctxm; struct bnxt_ctx_mem_info *ctx; - int i; + u8 init_val, init_idx = 0; + u16 init_mask; - ctx = malloc(sizeof(*ctx), M_DEVBUF, M_NOWAIT | M_ZERO); + ctx = softc->ctx_mem; if (!ctx) { - rc = -ENOMEM; - goto ctx_err; + ctx = malloc(sizeof(*ctx), M_DEVBUF, M_NOWAIT | M_ZERO); + if (!ctx) { + rc = -ENOMEM; + goto ctx_err; + } + softc->ctx_mem = ctx; } - ctx_pg = malloc(sizeof(*ctx_pg) * (softc->rx_max_q + 1), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (!ctx_pg) { - free(ctx, M_DEVBUF); - rc = -ENOMEM; - goto ctx_err; + init_val = resp->ctx_kind_initializer; + init_mask = le16_to_cpu(resp->ctx_init_mask); + + ctxm = &ctx->ctx_arr[BNXT_CTX_QP]; + ctxm->max_entries = le32_to_cpu(resp->qp_max_entries); + ctxm->qp_qp1_entries = le16_to_cpu(resp->qp_min_qp1_entries); + ctxm->qp_l2_entries = le16_to_cpu(resp->qp_max_l2_entries); + ctxm->entry_size = le16_to_cpu(resp->qp_entry_size); + bnxt_init_ctx_initializer(ctxm, init_val, resp->qp_init_offset, + (init_mask & (1 << init_idx++)) != 0); + + ctxm = &ctx->ctx_arr[BNXT_CTX_SRQ]; + ctxm->srq_l2_entries = le16_to_cpu(resp->srq_max_l2_entries); + ctxm->max_entries = le32_to_cpu(resp->srq_max_entries); + ctxm->entry_size = le16_to_cpu(resp->srq_entry_size); + bnxt_init_ctx_initializer(ctxm, init_val, resp->srq_init_offset, + (init_mask & (1 << init_idx++)) != 0); + + ctxm = &ctx->ctx_arr[BNXT_CTX_CQ]; + ctxm->cq_l2_entries = le16_to_cpu(resp->cq_max_l2_entries); + ctxm->max_entries = le32_to_cpu(resp->cq_max_entries); + ctxm->entry_size = le16_to_cpu(resp->cq_entry_size); + bnxt_init_ctx_initializer(ctxm, init_val, resp->cq_init_offset, + (init_mask & (1 << init_idx++)) != 0); + + ctxm = &ctx->ctx_arr[BNXT_CTX_VNIC]; + ctxm->vnic_entries = le32_to_cpu(resp->vnic_max_vnic_entries); + ctxm->max_entries = ctxm->vnic_entries + + le16_to_cpu(resp->vnic_max_ring_table_entries); + ctxm->entry_size = le16_to_cpu(resp->vnic_entry_size); + bnxt_init_ctx_initializer(ctxm, init_val, + resp->vnic_init_offset, + (init_mask & (1 << init_idx++)) != 0); + + ctxm = &ctx->ctx_arr[BNXT_CTX_STAT]; + ctxm->max_entries = le32_to_cpu(resp->stat_max_entries); + ctxm->entry_size = le16_to_cpu(resp->stat_entry_size); + bnxt_init_ctx_initializer(ctxm, init_val, + resp->stat_init_offset, + (init_mask & (1 << init_idx++)) != 0); + + ctxm = &ctx->ctx_arr[BNXT_CTX_STQM]; + ctxm->entry_size = le16_to_cpu(resp->tqm_entry_size); + ctxm->min_entries = le32_to_cpu(resp->tqm_min_entries_per_ring); + ctxm->max_entries = le32_to_cpu(resp->tqm_max_entries_per_ring); + ctxm->entry_multiple = resp->tqm_entries_multiple; + if (!ctxm->entry_multiple) + ctxm->entry_multiple = 1; + + memcpy(&ctx->ctx_arr[BNXT_CTX_FTQM], ctxm, sizeof(*ctxm)); + + ctxm = &ctx->ctx_arr[BNXT_CTX_MRAV]; + ctxm->max_entries = le32_to_cpu(resp->mrav_max_entries); + ctxm->entry_size = le16_to_cpu(resp->mrav_entry_size); + ctxm->mrav_num_entries_units = + le16_to_cpu(resp->mrav_num_entries_units); + bnxt_init_ctx_initializer(ctxm, init_val, + resp->mrav_init_offset, + (init_mask & (1 << init_idx++)) != 0); + + ctxm = &ctx->ctx_arr[BNXT_CTX_TIM]; + ctxm->entry_size = le16_to_cpu(resp->tim_entry_size); + ctxm->max_entries = le32_to_cpu(resp->tim_max_entries); + + ctx->tqm_fp_rings_count = resp->tqm_fp_rings_count; + if (!ctx->tqm_fp_rings_count) + ctx->tqm_fp_rings_count = softc->tx_max_q; + else if (ctx->tqm_fp_rings_count > BNXT_MAX_TQM_FP_LEGACY_RINGS) + ctx->tqm_fp_rings_count = BNXT_MAX_TQM_FP_LEGACY_RINGS; + if (ctx->tqm_fp_rings_count == BNXT_MAX_TQM_FP_LEGACY_RINGS && + softc->hwrm_max_ext_req_len >= BNXT_BACKING_STORE_CFG_LEN) { + ctx->tqm_fp_rings_count += resp->tqm_fp_rings_count_ext; + if (ctx->tqm_fp_rings_count > BNXT_MAX_TQM_FP_RINGS) + ctx->tqm_fp_rings_count = BNXT_MAX_TQM_FP_RINGS; } - for (i = 0; i < softc->rx_max_q + 1; i++, ctx_pg++) - ctx->tqm_mem[i] = ctx_pg; - - softc->ctx_mem = ctx; - ctx->qp_max_entries = le32toh(resp->qp_max_entries); - ctx->qp_min_qp1_entries = le16toh(resp->qp_min_qp1_entries); - ctx->qp_max_l2_entries = le16toh(resp->qp_max_l2_entries); - ctx->qp_entry_size = le16toh(resp->qp_entry_size); - ctx->srq_max_l2_entries = le16toh(resp->srq_max_l2_entries); - ctx->srq_max_entries = le32toh(resp->srq_max_entries); - ctx->srq_entry_size = le16toh(resp->srq_entry_size); - ctx->cq_max_l2_entries = le16toh(resp->cq_max_l2_entries); - ctx->cq_max_entries = le32toh(resp->cq_max_entries); - ctx->cq_entry_size = le16toh(resp->cq_entry_size); - ctx->vnic_max_vnic_entries = - le16toh(resp->vnic_max_vnic_entries); - ctx->vnic_max_ring_table_entries = - le16toh(resp->vnic_max_ring_table_entries); - ctx->vnic_entry_size = le16toh(resp->vnic_entry_size); - ctx->stat_max_entries = le32toh(resp->stat_max_entries); - ctx->stat_entry_size = le16toh(resp->stat_entry_size); - ctx->tqm_entry_size = le16toh(resp->tqm_entry_size); - ctx->tqm_min_entries_per_ring = - le32toh(resp->tqm_min_entries_per_ring); - ctx->tqm_max_entries_per_ring = - le32toh(resp->tqm_max_entries_per_ring); - ctx->tqm_entries_multiple = resp->tqm_entries_multiple; - if (!ctx->tqm_entries_multiple) - ctx->tqm_entries_multiple = 1; - ctx->mrav_max_entries = le32toh(resp->mrav_max_entries); - ctx->mrav_entry_size = le16toh(resp->mrav_entry_size); - ctx->tim_entry_size = le16toh(resp->tim_entry_size); - ctx->tim_max_entries = le32toh(resp->tim_max_entries); - ctx->ctx_kind_initializer = resp->ctx_kind_initializer; + ctxm = &ctx->ctx_arr[BNXT_CTX_FTQM]; + memcpy(ctxm, &ctx->ctx_arr[BNXT_CTX_STQM], sizeof(*ctxm)); + ctxm->instance_bmap = (1 << ctx->tqm_fp_rings_count) - 1; + + rc = bnxt_alloc_all_ctx_pg_info(softc); } else { rc = 0; } @@ -419,150 +504,213 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) struct hwrm_func_backing_store_cfg_input req = {0}; struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; struct bnxt_ctx_pg_info *ctx_pg; - uint32_t *num_entries, req_len = sizeof(req); - uint64_t *pg_dir; - uint8_t *pg_attr; - int i, rc; - uint32_t ena; + struct bnxt_ctx_mem_type *ctxm; + u32 req_len = sizeof(req); + __le32 *num_entries; + u32 ena, flags = 0; + __le64 *pg_dir; + u8 *pg_attr; + int i; if (!ctx) return 0; + if (req_len > softc->hwrm_max_ext_req_len) + req_len = BNXT_BACKING_STORE_CFG_LEGACY_LEN; + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_BACKING_STORE_CFG); req.enables = htole32(enables); if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP) { - ctx_pg = &ctx->qp_mem; - req.qp_num_entries = htole32(ctx_pg->entries); - req.qp_num_qp1_entries = htole16(ctx->qp_min_qp1_entries); - req.qp_num_l2_entries = htole16(ctx->qp_max_l2_entries); - req.qp_entry_size = htole16(ctx->qp_entry_size); + ctxm = &ctx->ctx_arr[BNXT_CTX_QP]; + ctx_pg = ctxm->pg_info; + req.qp_num_entries = cpu_to_le32(ctx_pg->entries); + req.qp_num_qp1_entries = cpu_to_le16(ctxm->qp_qp1_entries); + req.qp_num_l2_entries = cpu_to_le16(ctxm->qp_l2_entries); + req.qp_entry_size = cpu_to_le16(ctxm->entry_size); bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.qpc_pg_size_qpc_lvl, &req.qpc_page_dir); } if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ) { - ctx_pg = &ctx->srq_mem; - req.srq_num_entries = htole32(ctx_pg->entries); - req.srq_num_l2_entries = htole16(ctx->srq_max_l2_entries); - req.srq_entry_size = htole16(ctx->srq_entry_size); + ctxm = &ctx->ctx_arr[BNXT_CTX_SRQ]; + ctx_pg = ctxm->pg_info; + req.srq_num_entries = cpu_to_le32(ctx_pg->entries); + req.srq_num_l2_entries = cpu_to_le16(ctxm->srq_l2_entries); + req.srq_entry_size = cpu_to_le16(ctxm->entry_size); bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.srq_pg_size_srq_lvl, &req.srq_page_dir); } if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ) { - ctx_pg = &ctx->cq_mem; - req.cq_num_entries = htole32(ctx_pg->entries); - req.cq_num_l2_entries = htole16(ctx->cq_max_l2_entries); - req.cq_entry_size = htole16(ctx->cq_entry_size); - bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.cq_pg_size_cq_lvl, + ctxm = &ctx->ctx_arr[BNXT_CTX_CQ]; + ctx_pg = ctxm->pg_info; + req.cq_num_entries = cpu_to_le32(ctx_pg->entries); + req.cq_num_l2_entries = cpu_to_le16(ctxm->cq_l2_entries); + req.cq_entry_size = cpu_to_le16(ctxm->entry_size); + bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, + &req.cq_pg_size_cq_lvl, &req.cq_page_dir); } if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV) { - ctx_pg = &ctx->mrav_mem; - req.mrav_num_entries = htole32(ctx_pg->entries); - req.mrav_entry_size = htole16(ctx->mrav_entry_size); + ctxm = &ctx->ctx_arr[BNXT_CTX_MRAV]; + ctx_pg = ctxm->pg_info; + req.mrav_num_entries = cpu_to_le32(ctx_pg->entries); + if (ctxm->mrav_num_entries_units) + flags |= + HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT; + req.mrav_entry_size = cpu_to_le16(ctxm->entry_size); bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.mrav_pg_size_mrav_lvl, &req.mrav_page_dir); } if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM) { - ctx_pg = &ctx->tim_mem; - req.tim_num_entries = htole32(ctx_pg->entries); *** 2040 LINES SKIPPED *** From nobody Mon Jun 3 19:25: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 4VtNwF3Ds5z5JsBT; Mon, 03 Jun 2024 19:25:01 +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 4VtNwF1sYqz4VkS; Mon, 3 Jun 2024 19:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442701; 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=2b7anlykzJlAf46RaWgQP9QHs2lYfteEBlxEl1AJYz0=; b=oK/pbnow+NiMmEUsBIzudHlTIsER8//XDjz2mr8eQU0P1g4d9mXUzArRIrhnIKLuIT4bxF roG4/J6aNPbp3MFwiSUC9faRzI2eB6U55ptCPUamIh/ueTnj2bcLvshYA/p26MlBy+3Mqh rPHD6tXZ3G1dBpe8pdn1v+Bskkl/zI++3vS+flKxFdoMFedSz3RBP79smrta7z96X2pda9 HJYOauZMHmpwPwQz9reVNaZxVqeDt3Y3Nu0ZX8VAg3r9p+BwRIgZgC/nbtmt+1pQnCZy3Q oGDdGmTcWiNB4zM+1YB5F572EbHM7Zuj9d6dIXOqxOFK5NNtcqtyHnlqDgU6+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442701; a=rsa-sha256; cv=none; b=bzlKR5kaH4Vc0vJntDpApTNb+d0dwRh+IZVf1TtzwNZHD5Csn0PGVIa2PusUmQLHeOS+Rm RWqm03dhYTniOG9uXLQArDv40UVfPD4eIh1SuLr7uGalM9yPWkA/04oiNavTLClQcSDWXe ZA1tJutC/7DcpCZfdjZdk1nasWjv1Mui3cY3p9VoVzMYFlX7AZnO/OU1qU1ZqoKWRJrCD0 V+J8hXuu1cX3N/KR2z5POqnde/V00h5ywAcSBa25ze8I9nCvCnyO4QnwnsXMiow0CnwK7O FnqPE4NgFARAaK8Gp/EwiAEQFuQ66G7U0X4yKou4W1hBCLp7A5j0W5J4LoJ0fw== 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=1717442701; 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=2b7anlykzJlAf46RaWgQP9QHs2lYfteEBlxEl1AJYz0=; b=ECl1yCfJwMXJ4Jk06fhHvPy7UfJHcLxN+iMSg8AkhZtRu+jU95EXz27TH6UvTo4rhn4GP5 wMRRw1+1hT8xs9THFKB+HTGdqhxnucvsJlC9ZwMPegyHqmkcW8bc+2h5PT6nUxlwtUP42X JHsxVkmeL1DqA8you57SnacmlO7PUbfiA1b5tv9aBbb/toUXfChqaAQmBGakdlhJMedK3G A9kNaaiaXPWhiNWvcGT5Ua/vVLS4IW0eKLETBh1c7IAWlWIEsNmo47fgM0gDy2PjdIat4a za1yQMZAjDuTbRPH1jL+BTxvEqQv8mCE8aE3frE01BvA+PFz0clpPuC5119dRg== 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 4VtNwF1TSGznPF; Mon, 3 Jun 2024 19:25: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 453JP1gf067908; Mon, 3 Jun 2024 19:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP10h067905; Mon, 3 Jun 2024 19:25:01 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:01 GMT Message-Id: <202406031925.453JP10h067905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ac940a8b92ac - stable/14 - bnxt_en: Add PFC, ETS & App TLVs protocols support 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ac940a8b92ac79df7bab71f50ae3b9aa7cff145d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ac940a8b92ac79df7bab71f50ae3b9aa7cff145d commit ac940a8b92ac79df7bab71f50ae3b9aa7cff145d Author: Chandrakanth patil AuthorDate: 2024-04-28 09:24:30 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 bnxt_en: Add PFC, ETS & App TLVs protocols support Created new directory "bnxt_en" in /dev/bnxt and /modules/bnxt and moved source files and Makefile into respective directory. ETS support: - Added new files bnxt_dcb.c & bnxt_dcb.h - Added sysctl node 'dcb' and created handlers 'ets' and 'dcbx_cap' - Add logic to validate user input and configure ETS in the firmware - Updated makefile to include bnxt_dcb.c & bnxt_dcb.h PFC support: - Created sysctl handlers 'pfc' under node 'dcb' - Added logic to validate user input and configure PFC in the firmware. App TLV support: - Created 3 new sysctl handlers under node 'dcb' - set_apptlv (write only): Sets a specified TLV - del_apptlv (write only): Deletes a specified TLV - list_apptlv (read only): Lists all APP TLVs configured - Added logic to validate user input and configure APP TLVs in the firmware. Added Below DCB ops for management interface: - Set PFC, Get PFC, Set ETS, Get ETS, Add App_TLV, Del App_TLV Lst App_TLV Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45005 (cherry picked from commit 35b53f8c989f62286aad075ef2e97bba358144f8) --- sys/dev/bnxt/{ => bnxt_en}/bnxt.h | 196 +++++-- sys/dev/bnxt/bnxt_en/bnxt_dcb.c | 861 ++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_dcb.h | 127 ++++ sys/dev/bnxt/{ => bnxt_en}/bnxt_hwrm.c | 408 ++++++++----- sys/dev/bnxt/{ => bnxt_en}/bnxt_hwrm.h | 7 +- sys/dev/bnxt/{ => bnxt_en}/bnxt_ioctl.h | 0 sys/dev/bnxt/{ => bnxt_en}/bnxt_mgmt.c | 69 ++- sys/dev/bnxt/{ => bnxt_en}/bnxt_mgmt.h | 31 +- sys/dev/bnxt/{ => bnxt_en}/bnxt_sysctl.c | 429 +++++++++++++- sys/dev/bnxt/{ => bnxt_en}/bnxt_sysctl.h | 2 + sys/dev/bnxt/{ => bnxt_en}/bnxt_txrx.c | 0 sys/dev/bnxt/{ => bnxt_en}/convert_hsi.pl | 0 sys/dev/bnxt/{ => bnxt_en}/hsi_struct_def.h | 0 sys/dev/bnxt/{ => bnxt_en}/if_bnxt.c | 48 +- sys/modules/bnxt/{ => bnxt_en}/Makefile | 4 +- 15 files changed, 1978 insertions(+), 204 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h similarity index 78% rename from sys/dev/bnxt/bnxt.h rename to sys/dev/bnxt/bnxt_en/bnxt.h index 0547bae91e09..e68943fd6286 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -44,6 +44,7 @@ #include #include "hsi_struct_def.h" +#include "bnxt_dcb.h" /* PCI IDs */ #define BROADCOM_VENDOR_ID 0x14E4 @@ -359,9 +360,9 @@ enum bnxt_cp_type { BNXT_SHARED }; -struct bnxt_cos_queue { - uint8_t id; - uint8_t profile; +struct bnxt_queue_info { + uint8_t queue_id; + uint8_t queue_profile; }; struct bnxt_func_info { @@ -532,6 +533,13 @@ struct bnxt_ver_info { uint8_t hwrm_min_major; uint8_t hwrm_min_minor; uint8_t hwrm_min_update; + uint64_t fw_ver_code; +#define BNXT_FW_VER_CODE(maj, min, bld, rsv) \ + ((uint64_t)(maj) << 48 | (uint64_t)(min) << 32 | (uint64_t)(bld) << 16 | (rsv)) +#define BNXT_FW_MAJ(softc) ((softc)->ver_info->fw_ver_code >> 48) +#define BNXT_FW_MIN(softc) (((softc)->ver_info->fw_ver_code >> 32) & 0xffff) +#define BNXT_FW_BLD(softc) (((softc)->ver_info->fw_ver_code >> 16) & 0xffff) +#define BNXT_FW_RSV(softc) (((softc)->ver_info->fw_ver_code) & 0xffff) struct sysctl_ctx_list ver_ctx; struct sysctl_oid *ver_oid; @@ -644,38 +652,52 @@ struct bnxt_ctx_mem_info { }; struct bnxt_hw_resc { - uint16_t min_rsscos_ctxs; - uint16_t max_rsscos_ctxs; - uint16_t min_cp_rings; - uint16_t max_cp_rings; - uint16_t resv_cp_rings; - uint16_t min_tx_rings; - uint16_t max_tx_rings; - uint16_t resv_tx_rings; - uint16_t max_tx_sch_inputs; - uint16_t min_rx_rings; - uint16_t max_rx_rings; - uint16_t resv_rx_rings; - uint16_t min_hw_ring_grps; - uint16_t max_hw_ring_grps; - uint16_t resv_hw_ring_grps; - uint16_t min_l2_ctxs; - uint16_t max_l2_ctxs; - uint16_t min_vnics; - uint16_t max_vnics; - uint16_t resv_vnics; - uint16_t min_stat_ctxs; - uint16_t max_stat_ctxs; - uint16_t resv_stat_ctxs; - uint16_t max_nqs; - uint16_t max_irqs; - uint16_t resv_irqs; + uint16_t min_rsscos_ctxs; + uint16_t max_rsscos_ctxs; + uint16_t min_cp_rings; + uint16_t max_cp_rings; + uint16_t resv_cp_rings; + uint16_t min_tx_rings; + uint16_t max_tx_rings; + uint16_t resv_tx_rings; + uint16_t max_tx_sch_inputs; + uint16_t min_rx_rings; + uint16_t max_rx_rings; + uint16_t resv_rx_rings; + uint16_t min_hw_ring_grps; + uint16_t max_hw_ring_grps; + uint16_t resv_hw_ring_grps; + uint16_t min_l2_ctxs; + uint16_t max_l2_ctxs; + uint16_t min_vnics; + uint16_t max_vnics; + uint16_t resv_vnics; + uint16_t min_stat_ctxs; + uint16_t max_stat_ctxs; + uint16_t resv_stat_ctxs; + uint16_t max_nqs; + uint16_t max_irqs; + uint16_t resv_irqs; +} + +enum bnxt_type_ets { + BNXT_TYPE_ETS_TSA = 0, + BNXT_TYPE_ETS_PRI2TC, + BNXT_TYPE_ETS_TCBW, + BNXT_TYPE_ETS_MAX }; -#define BNXT_LLQ(q_profile) \ - ((q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE) -#define BNXT_CNPQ(q_profile) \ - ((q_profile) == HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP) +static const char *const BNXT_ETS_TYPE_STR[] = { + "tsa", + "pri2tc", + "tcbw", +}; + +static const char *const BNXT_ETS_HELP_STR[] = { + "X is 1 (strict), 0 (ets)", + "TC values for pri 0 to 7", + "TC BW values for pri 0 to 7, Sum should be 100", +}; #define BNXT_HWRM_MAX_REQ_LEN (softc->hwrm_max_req_len) @@ -684,6 +706,10 @@ struct bnxt_softc_list { struct bnxt_softc *softc; }; +#ifndef BIT_ULL +#define BIT_ULL(nr) (1ULL << (nr)) +#endif + struct bnxt_softc { device_t dev; if_ctx_t ctx; @@ -710,6 +736,8 @@ struct bnxt_softc { #define BNXT_FLAG_CHIP_P5 0x0020 #define BNXT_FLAG_TPA 0x0040 #define BNXT_FLAG_FW_CAP_EXT_STATS 0x0080 +#define BNXT_FLAG_MULTI_HOST 0x0100 +#define BNXT_FLAG_MULTI_ROOT 0x0200 uint32_t flags; #define BNXT_STATE_LINK_CHANGE (0) #define BNXT_STATE_MAX (BNXT_STATE_LINK_CHANGE + 1) @@ -732,13 +760,23 @@ struct bnxt_softc { uint16_t hwrm_max_ext_req_len; uint32_t hwrm_spec_code; -#define BNXT_MAX_COS_QUEUE 8 +#define BNXT_MAX_QUEUE 8 uint8_t max_tc; - uint8_t max_lltc; /* lossless TCs */ - struct bnxt_cos_queue q_info[BNXT_MAX_COS_QUEUE]; - uint8_t tc_to_qidx[BNXT_MAX_COS_QUEUE]; - uint8_t q_ids[BNXT_MAX_COS_QUEUE]; - uint8_t max_q; + uint8_t max_lltc; + struct bnxt_queue_info tx_q_info[BNXT_MAX_QUEUE]; + struct bnxt_queue_info rx_q_info[BNXT_MAX_QUEUE]; + uint8_t tc_to_qidx[BNXT_MAX_QUEUE]; + uint8_t tx_q_ids[BNXT_MAX_QUEUE]; + uint8_t rx_q_ids[BNXT_MAX_QUEUE]; + uint8_t tx_max_q; + uint8_t rx_max_q; + uint8_t is_asym_q; + + struct bnxt_ieee_ets *ieee_ets; + struct bnxt_ieee_pfc *ieee_pfc; + uint8_t dcbx_cap; + uint8_t default_pri; + uint8_t max_dscp_value; uint64_t admin_ticks; struct iflib_dma_info hw_rx_port_stats; @@ -782,6 +820,8 @@ struct bnxt_softc { struct sysctl_oid *hw_lro_oid; struct sysctl_ctx_list flow_ctrl_ctx; struct sysctl_oid *flow_ctrl_oid; + struct sysctl_ctx_list dcb_ctx; + struct sysctl_oid *dcb_oid; struct bnxt_ver_info *ver_info; struct bnxt_nvram_info *nvm_info; @@ -796,13 +836,78 @@ struct bnxt_softc { uint16_t tx_coal_usecs; uint16_t tx_coal_usecs_irq; uint16_t tx_coal_frames; - uint16_t tx_coal_frames_irq; + uint16_t tx_coal_frames_irq; #define BNXT_USEC_TO_COAL_TIMER(x) ((x) * 25 / 2) #define BNXT_DEF_STATS_COAL_TICKS 1000000 #define BNXT_MIN_STATS_COAL_TICKS 250000 #define BNXT_MAX_STATS_COAL_TICKS 1000000 + uint64_t fw_cap; + #define BNXT_FW_CAP_SHORT_CMD BIT_ULL(0) + #define BNXT_FW_CAP_LLDP_AGENT BIT_ULL(1) + #define BNXT_FW_CAP_DCBX_AGENT BIT_ULL(2) + #define BNXT_FW_CAP_NEW_RM BIT_ULL(3) + #define BNXT_FW_CAP_IF_CHANGE BIT_ULL(4) + #define BNXT_FW_CAP_LINK_ADMIN BIT_ULL(5) + #define BNXT_FW_CAP_VF_RES_MIN_GUARANTEED BIT_ULL(6) + #define BNXT_FW_CAP_KONG_MB_CHNL BIT_ULL(7) + #define BNXT_FW_CAP_ADMIN_MTU BIT_ULL(8) + #define BNXT_FW_CAP_ADMIN_PF BIT_ULL(9) + #define BNXT_FW_CAP_OVS_64BIT_HANDLE BIT_ULL(10) + #define BNXT_FW_CAP_TRUSTED_VF BIT_ULL(11) + #define BNXT_FW_CAP_VF_VNIC_NOTIFY BIT_ULL(12) + #define BNXT_FW_CAP_ERROR_RECOVERY BIT_ULL(13) + #define BNXT_FW_CAP_PKG_VER BIT_ULL(14) + #define BNXT_FW_CAP_CFA_ADV_FLOW BIT_ULL(15) + #define BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V2 BIT_ULL(16) + #define BNXT_FW_CAP_PCIE_STATS_SUPPORTED BIT_ULL(17) + #define BNXT_FW_CAP_EXT_STATS_SUPPORTED BIT_ULL(18) + #define BNXT_FW_CAP_SECURE_MODE BIT_ULL(19) + #define BNXT_FW_CAP_ERR_RECOVER_RELOAD BIT_ULL(20) + #define BNXT_FW_CAP_HOT_RESET BIT_ULL(21) + #define BNXT_FW_CAP_CRASHDUMP BIT_ULL(23) + #define BNXT_FW_CAP_VLAN_RX_STRIP BIT_ULL(24) + #define BNXT_FW_CAP_VLAN_TX_INSERT BIT_ULL(25) + #define BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED BIT_ULL(26) + #define BNXT_FW_CAP_CFA_EEM BIT_ULL(27) + #define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(29) + #define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30) + #define BNXT_FW_CAP_ECN_STATS BIT_ULL(31) + #define BNXT_FW_CAP_TRUFLOW BIT_ULL(32) + #define BNXT_FW_CAP_VF_CFG_FOR_PF BIT_ULL(33) + #define BNXT_FW_CAP_PTP_PPS BIT_ULL(34) + #define BNXT_FW_CAP_HOT_RESET_IF BIT_ULL(35) + #define BNXT_FW_CAP_LIVEPATCH BIT_ULL(36) + #define BNXT_FW_CAP_NPAR_1_2 BIT_ULL(37) + #define BNXT_FW_CAP_RSS_HASH_TYPE_DELTA BIT_ULL(38) + #define BNXT_FW_CAP_PTP_RTC BIT_ULL(39) + #define BNXT_FW_CAP_TRUFLOW_EN BIT_ULL(40) + #define BNXT_TRUFLOW_EN(bp) ((bp)->fw_cap & BNXT_FW_CAP_TRUFLOW_EN) + #define BNXT_FW_CAP_RX_ALL_PKT_TS BIT_ULL(41) + #define BNXT_FW_CAP_BACKING_STORE_V2 BIT_ULL(42) + #define BNXT_FW_CAP_DBR_SUPPORTED BIT_ULL(43) + #define BNXT_FW_CAP_GENERIC_STATS BIT_ULL(44) + #define BNXT_FW_CAP_DBR_PACING_SUPPORTED BIT_ULL(45) + #define BNXT_FW_CAP_PTP_PTM BIT_ULL(46) + #define BNXT_FW_CAP_CFA_NTUPLE_RX_EXT_IP_PROTO BIT_ULL(47) + #define BNXT_FW_CAP_ENABLE_RDMA_SRIOV BIT_ULL(48) + #define BNXT_FW_CAP_RSS_TCAM BIT_ULL(49) + uint32_t lpi_tmr_lo; + uint32_t lpi_tmr_hi; + /* copied from flags and flags2 in hwrm_port_phy_qcaps_output */ + uint16_t phy_flags; +#define BNXT_PHY_FL_EEE_CAP HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED +#define BNXT_PHY_FL_EXT_LPBK HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED +#define BNXT_PHY_FL_AN_PHY_LPBK HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED +#define BNXT_PHY_FL_SHARED_PORT_CFG HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED +#define BNXT_PHY_FL_PORT_STATS_NO_RESET HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET +#define BNXT_PHY_FL_NO_PHY_LPBK HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED +#define BNXT_PHY_FL_FW_MANAGED_LKDN HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_FW_MANAGED_LINK_DOWN +#define BNXT_PHY_FL_NO_FCS HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_NO_FCS +#define BNXT_PHY_FL_NO_PAUSE (HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PAUSE_UNSUPPORTED << 8) +#define BNXT_PHY_FL_NO_PFC (HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PFC_UNSUPPORTED << 8) +#define BNXT_PHY_FL_BANK_SEL (HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_BANK_ADDR_SUPPORTED << 8) }; struct bnxt_filter_info { @@ -843,6 +948,17 @@ struct bnxt_softc *bnxt_find_dev(uint32_t domain, uint32_t bus, uint32_t dev_fn, int bnxt_read_sfp_module_eeprom_info(struct bnxt_softc *bp, uint16_t i2c_addr, uint16_t page_number, uint8_t bank, bool bank_sel_en, uint16_t start_addr, uint16_t data_length, uint8_t *buf); +void bnxt_dcb_init(struct bnxt_softc *softc); +void bnxt_dcb_free(struct bnxt_softc *softc); +uint8_t bnxt_dcb_setdcbx(struct bnxt_softc *softc, uint8_t mode); +uint8_t bnxt_dcb_getdcbx(struct bnxt_softc *softc); +int bnxt_dcb_ieee_getets(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets); +int bnxt_dcb_ieee_setets(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets); uint8_t get_phy_type(struct bnxt_softc *softc); +int bnxt_dcb_ieee_getpfc(struct bnxt_softc *softc, struct bnxt_ieee_pfc *pfc); +int bnxt_dcb_ieee_setpfc(struct bnxt_softc *softc, struct bnxt_ieee_pfc *pfc); +int bnxt_dcb_ieee_setapp(struct bnxt_softc *softc, struct bnxt_dcb_app *app); +int bnxt_dcb_ieee_delapp(struct bnxt_softc *softc, struct bnxt_dcb_app *app); +int bnxt_dcb_ieee_listapp(struct bnxt_softc *softc, struct bnxt_dcb_app *app, int *num_inputs); #endif /* _BNXT_H */ diff --git a/sys/dev/bnxt/bnxt_en/bnxt_dcb.c b/sys/dev/bnxt/bnxt_en/bnxt_dcb.c new file mode 100644 index 000000000000..e1e0581d3c24 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_dcb.c @@ -0,0 +1,861 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2024 Broadcom, All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include "bnxt.h" +#include "bnxt_hwrm.h" +#include "bnxt_dcb.h" +#include "hsi_struct_def.h" + +static int +bnxt_tx_queue_to_tc(struct bnxt_softc *softc, uint8_t queue_id) +{ + int i, j; + + for (i = 0; i < softc->max_tc; i++) { + if (softc->tx_q_info[i].queue_id == queue_id) { + for (j = 0; j < softc->max_tc; j++) { + if (softc->tc_to_qidx[j] == i) + return j; + } + } + } + return -EINVAL; +} + +static int +bnxt_hwrm_queue_pri2cos_cfg(struct bnxt_softc *softc, + struct bnxt_ieee_ets *ets, + uint32_t path_dir) +{ + struct hwrm_queue_pri2cos_cfg_input req = {0}; + struct bnxt_queue_info *q_info; + uint8_t *pri2cos; + int i; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_PRI2COS_CFG); + + req.flags = htole32(path_dir | HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN); + if (path_dir == HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR || + path_dir == HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX) + q_info = softc->tx_q_info; + else + q_info = softc->rx_q_info; + pri2cos = &req.pri0_cos_queue_id; + for (i = 0; i < BNXT_IEEE_8021QAZ_MAX_TCS; i++) { + uint8_t qidx; + + req.enables |= htole32(HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID << i); + + qidx = softc->tc_to_qidx[ets->prio_tc[i]]; + pri2cos[i] = q_info[qidx].queue_id; + } + return _hwrm_send_message(softc, &req, sizeof(req)); +} + +static int +bnxt_hwrm_queue_pri2cos_qcfg(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets) +{ + struct hwrm_queue_pri2cos_qcfg_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_queue_pri2cos_qcfg_input req = {0}; + int rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_PRI2COS_QCFG); + + req.flags = htole32(HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (!rc) { + uint8_t *pri2cos = &resp->pri0_cos_queue_id; + int i; + + for (i = 0; i < BNXT_IEEE_8021QAZ_MAX_TCS; i++) { + uint8_t queue_id = pri2cos[i]; + int tc; + + tc = bnxt_tx_queue_to_tc(softc, queue_id); + if (tc >= 0) + ets->prio_tc[i] = tc; + } + } + return rc; +} + +static int +bnxt_hwrm_queue_cos2bw_cfg(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets, + uint8_t max_tc) +{ + struct hwrm_queue_cos2bw_cfg_input req = {0}; + struct bnxt_cos2bw_cfg cos2bw; + void *data; + int i; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_COS2BW_CFG); + + for (i = 0; i < max_tc; i++) { + uint8_t qidx = softc->tc_to_qidx[i]; + + req.enables |= + htole32(HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID << qidx); + + memset(&cos2bw, 0, sizeof(cos2bw)); + cos2bw.queue_id = softc->tx_q_info[qidx].queue_id; + if (ets->tc_tsa[i] == BNXT_IEEE_8021QAZ_TSA_STRICT) { + cos2bw.tsa = + HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP; + cos2bw.pri_lvl = i; + } else { + cos2bw.tsa = + HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS; + cos2bw.bw_weight = ets->tc_tx_bw[i]; + /* older firmware requires min_bw to be set to the + * same weight value in percent. + */ + if (BNXT_FW_MAJ(softc) < 218) { + cos2bw.min_bw = + htole32((ets->tc_tx_bw[i] * 100) | + BW_VALUE_UNIT_PERCENT1_100); + } + } + data = &req.unused_0 + qidx * (sizeof(cos2bw) - 4); + memcpy(data, &cos2bw.queue_id, sizeof(cos2bw) - 4); + if (qidx == 0) { + req.queue_id0 = cos2bw.queue_id; + req.unused_0 = 0; + } + } + return _hwrm_send_message(softc, &req, sizeof(req)); +} + +static int +bnxt_hwrm_queue_cos2bw_qcfg(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets) +{ + struct hwrm_queue_cos2bw_qcfg_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_queue_cos2bw_qcfg_input req = {0}; + struct bnxt_cos2bw_cfg cos2bw; + uint8_t *data; + int rc, i; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_COS2BW_QCFG); + + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) { + return rc; + } + + data = &resp->queue_id0 + offsetof(struct bnxt_cos2bw_cfg, queue_id); + for (i = 0; i < softc->max_tc; i++, data += sizeof(cos2bw.cfg)) { + int tc; + + memcpy(&cos2bw.cfg, data, sizeof(cos2bw.cfg)); + if (i == 0) + cos2bw.queue_id = resp->queue_id0; + + tc = bnxt_tx_queue_to_tc(softc, cos2bw.queue_id); + if (tc < 0) + continue; + + if (cos2bw.tsa == HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP) { + ets->tc_tsa[tc] = BNXT_IEEE_8021QAZ_TSA_STRICT; + } else { + ets->tc_tsa[tc] = BNXT_IEEE_8021QAZ_TSA_ETS; + ets->tc_tx_bw[tc] = cos2bw.bw_weight; + } + } + return 0; +} + +static int +bnxt_queue_remap(struct bnxt_softc *softc, unsigned int lltc_mask) +{ + unsigned long qmap = 0; + int max = softc->max_tc; + int i, j, rc; + + /* Assign lossless TCs first */ + for (i = 0, j = 0; i < max; ) { + if (lltc_mask & (1 << i)) { + if (BNXT_LLQ(softc->rx_q_info[j].queue_profile)) { + softc->tc_to_qidx[i] = j; + __set_bit(j, &qmap); + i++; + } + j++; + continue; + } + i++; + } + + for (i = 0, j = 0; i < max; i++) { + if (lltc_mask & (1 << i)) + continue; + j = find_next_zero_bit(&qmap, max, j); + softc->tc_to_qidx[i] = j; + __set_bit(j, &qmap); + j++; + } + + if (softc->ieee_ets) { + rc = bnxt_hwrm_queue_cos2bw_cfg(softc, softc->ieee_ets, softc->max_tc); + if (rc) { + device_printf(softc->dev, "failed to config BW, rc = %d\n", rc); + return rc; + } + rc = bnxt_hwrm_queue_pri2cos_cfg(softc, softc->ieee_ets, + HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR); + if (rc) { + device_printf(softc->dev, "failed to config prio, rc = %d\n", rc); + return rc; + } + } + return 0; +} + +static int +bnxt_hwrm_queue_pfc_cfg(struct bnxt_softc *softc, struct bnxt_ieee_pfc *pfc) +{ + struct hwrm_queue_pfcenable_cfg_input req = {0}; + struct bnxt_ieee_ets *my_ets = softc->ieee_ets; + unsigned int tc_mask = 0, pri_mask = 0; + uint8_t i, pri, lltc_count = 0; + bool need_q_remap = false; + + if (!my_ets) + return -EINVAL; + + for (i = 0; i < softc->max_tc; i++) { + for (pri = 0; pri < BNXT_IEEE_8021QAZ_MAX_TCS; pri++) { + if ((pfc->pfc_en & (1 << pri)) && + (my_ets->prio_tc[pri] == i)) { + pri_mask |= 1 << pri; + tc_mask |= 1 << i; + } + } + if (tc_mask & (1 << i)) + lltc_count++; + } + + if (lltc_count > softc->max_lltc) { + device_printf(softc->dev, + "Hardware doesn't support %d lossless queues " + "to configure PFC (cap %d)\n", lltc_count, softc->max_lltc); + return -EINVAL; + } + + for (i = 0; i < softc->max_tc; i++) { + if (tc_mask & (1 << i)) { + uint8_t qidx = softc->tc_to_qidx[i]; + + if (!BNXT_LLQ(softc->rx_q_info[qidx].queue_profile)) { + need_q_remap = true; + break; + } + } + } + + if (need_q_remap) + bnxt_queue_remap(softc, tc_mask); + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_PFCENABLE_CFG); + + req.flags = htole32(pri_mask); + return _hwrm_send_message(softc, &req, sizeof(req)); +} + +static int +bnxt_hwrm_queue_pfc_qcfg(struct bnxt_softc *softc, struct bnxt_ieee_pfc *pfc) +{ + struct hwrm_queue_pfcenable_qcfg_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_queue_pfcenable_qcfg_input req = {0}; + uint8_t pri_mask; + int rc; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_PFCENABLE_QCFG); + + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (rc) { + return rc; + } + + pri_mask = le32toh(resp->flags); + pfc->pfc_en = pri_mask; + return 0; +} + +static int +bnxt_hwrm_get_dcbx_app(struct bnxt_softc *softc, struct bnxt_dcb_app *app, int *num_inputs) +{ + struct hwrm_fw_get_structured_data_input get = {0}; + struct hwrm_struct_data_dcbx_app *fw_app; + struct hwrm_struct_hdr *data; + struct iflib_dma_info dma_data; + size_t data_len; + int rc, n, i; + + if (softc->hwrm_spec_code < 0x10601) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &get, HWRM_FW_GET_STRUCTURED_DATA); + + n = BNXT_IEEE_8021QAZ_MAX_TCS; + data_len = sizeof(*data) + sizeof(*fw_app) * n; + rc = iflib_dma_alloc(softc->ctx, data_len, &dma_data, + BUS_DMA_NOWAIT); + if (rc) + return ENOMEM; + get.dest_data_addr = htole64(dma_data.idi_paddr); + get.structure_id = htole16(HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP); + get.subtype = htole16(HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL); + get.count = 0; + rc = _hwrm_send_message(softc, &get, sizeof(get)); + if (rc) + goto set_app_exit; + + data = (void *)dma_data.idi_vaddr; + fw_app = (struct hwrm_struct_data_dcbx_app *)(data + 1); + + if (data->struct_id != htole16(HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP)) { + rc = -ENODEV; + goto set_app_exit; + } + + n = data->count; + for (i = 0; i < n; i++, fw_app++) { + app[*num_inputs].priority = fw_app->priority; + app[*num_inputs].protocol = htobe16(fw_app->protocol_id); + app[*num_inputs].selector = fw_app->protocol_selector; + (*num_inputs)++; + } + +set_app_exit: + iflib_dma_free(&dma_data); + return rc; +} + +static int +bnxt_hwrm_set_dcbx_app(struct bnxt_softc *softc, struct bnxt_dcb_app *app, + bool add) +{ + struct hwrm_fw_set_structured_data_input set = {0}; + struct hwrm_fw_get_structured_data_input get = {0}; + struct hwrm_struct_data_dcbx_app *fw_app; + struct hwrm_struct_hdr *data; + struct iflib_dma_info dma_data; + size_t data_len; + int rc, n, i; + + if (softc->hwrm_spec_code < 0x10601) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &get, HWRM_FW_GET_STRUCTURED_DATA); + + n = BNXT_IEEE_8021QAZ_MAX_TCS; + data_len = sizeof(*data) + sizeof(*fw_app) * n; + rc = iflib_dma_alloc(softc->ctx, data_len, &dma_data, + BUS_DMA_NOWAIT); + if (rc) + return ENOMEM; + get.dest_data_addr = htole64(dma_data.idi_paddr); + get.structure_id = htole16(HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP); + get.subtype = htole16(HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL); + get.count = 0; + rc = _hwrm_send_message(softc, &get, sizeof(get)); + if (rc) + goto set_app_exit; + + data = (void *)dma_data.idi_vaddr; + fw_app = (struct hwrm_struct_data_dcbx_app *)(data + 1); + + if (data->struct_id != htole16(HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP)) { + rc = -ENODEV; + goto set_app_exit; + } + + n = data->count; + for (i = 0; i < n; i++, fw_app++) { + if (fw_app->protocol_id == htobe16(app->protocol) && + fw_app->protocol_selector == app->selector && + fw_app->priority == app->priority) { + if (add) + goto set_app_exit; + else + break; + } + } + if (add) { + /* append */ + n++; + fw_app->protocol_id = htobe16(app->protocol); + fw_app->protocol_selector = app->selector; + fw_app->priority = app->priority; + fw_app->valid = 1; + } else { + size_t len = 0; + + /* not found, nothing to delete */ + if (n == i) + goto set_app_exit; + + len = (n - 1 - i) * sizeof(*fw_app); + if (len) + memmove(fw_app, fw_app + 1, len); + n--; + memset(fw_app + n, 0, sizeof(*fw_app)); + } + data->count = n; + data->len = htole16(sizeof(*fw_app) * n); + data->subtype = htole16(HWRM_STRUCT_DATA_SUBTYPE_HOST_OPERATIONAL); + + bnxt_hwrm_cmd_hdr_init(softc, &set, HWRM_FW_SET_STRUCTURED_DATA); + + set.src_data_addr = htole64(dma_data.idi_paddr); + set.data_len = htole16(sizeof(*data) + sizeof(*fw_app) * n); + set.hdr_cnt = 1; + rc = _hwrm_send_message(softc, &set, sizeof(set)); + +set_app_exit: + iflib_dma_free(&dma_data); + return rc; +} + +static int +bnxt_hwrm_queue_dscp_qcaps(struct bnxt_softc *softc) +{ + struct hwrm_queue_dscp_qcaps_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct hwrm_queue_dscp_qcaps_input req = {0}; + int rc; + + softc->max_dscp_value = 0; + if (softc->hwrm_spec_code < 0x10800 || BNXT_VF(softc)) + return 0; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_DSCP_QCAPS); + + rc = _hwrm_send_message(softc, &req, sizeof(req)); + if (!rc) { + softc->max_dscp_value = (1 << resp->num_dscp_bits) - 1; + if (softc->max_dscp_value < 0x3f) + softc->max_dscp_value = 0; + } + return rc; +} + +static int +bnxt_hwrm_queue_dscp2pri_qcfg(struct bnxt_softc *softc, struct bnxt_dcb_app *app, int *num_inputs) +{ + struct hwrm_queue_dscp2pri_qcfg_input req = {0}; + struct hwrm_queue_dscp2pri_qcfg_output *resp = + (void *)softc->hwrm_cmd_resp.idi_vaddr; + struct bnxt_dscp2pri_entry *dscp2pri; + struct iflib_dma_info dma_data; + int rc, entry_cnt; + int i; + + if (softc->hwrm_spec_code < 0x10800) + return 0; + + rc = iflib_dma_alloc(softc->ctx, sizeof(*dscp2pri) * 128, &dma_data, + BUS_DMA_NOWAIT); + if (rc) + return ENOMEM; + + dscp2pri = (void *)dma_data.idi_vaddr; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_DSCP2PRI_QCFG); + + req.dest_data_addr = htole64(dma_data.idi_paddr); + req.dest_data_buffer_size = htole16(sizeof(*dscp2pri) * 64); + req.port_id = htole16(softc->pf.port_id); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + + if (rc) + goto end; + + entry_cnt = le16toh(resp->entry_cnt); + for (i = 0; i < entry_cnt; i++) { + app[*num_inputs].priority = dscp2pri[i].pri; + app[*num_inputs].protocol = dscp2pri[i].dscp; + app[*num_inputs].selector = BNXT_IEEE_8021QAZ_APP_SEL_DSCP; + (*num_inputs)++; + } + +end: + iflib_dma_free(&dma_data); + return rc; +} + +static int +bnxt_hwrm_queue_dscp2pri_cfg(struct bnxt_softc *softc, struct bnxt_dcb_app *app, + bool add) +{ + struct hwrm_queue_dscp2pri_cfg_input req = {0}; + struct bnxt_dscp2pri_entry *dscp2pri; + struct iflib_dma_info dma_data; + int rc; + + if (softc->hwrm_spec_code < 0x10800) + return 0; + + rc = iflib_dma_alloc(softc->ctx, sizeof(*dscp2pri), &dma_data, + BUS_DMA_NOWAIT); + if (rc) + return ENOMEM; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_DSCP2PRI_CFG); + + req.src_data_addr = htole64(dma_data.idi_paddr); + dscp2pri = (void *)dma_data.idi_vaddr; + dscp2pri->dscp = app->protocol; + if (add) + dscp2pri->mask = 0x3f; + else + dscp2pri->mask = 0; + dscp2pri->pri = app->priority; + req.entry_cnt = htole16(1); + req.port_id = htole16(softc->pf.port_id); + rc = _hwrm_send_message(softc, &req, sizeof(req)); + + iflib_dma_free(&dma_data); + return rc; +} + +static int +bnxt_ets_validate(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets, uint8_t *tc) +{ + int total_ets_bw = 0; + bool zero = false; + uint8_t max_tc = 0; + int i; + + for (i = 0; i < BNXT_IEEE_8021QAZ_MAX_TCS; i++) { + if (ets->prio_tc[i] > softc->max_tc) { + device_printf(softc->dev, "priority to TC mapping exceeds TC count %d\n", + ets->prio_tc[i]); + return -EINVAL; + } + if (ets->prio_tc[i] > max_tc) + max_tc = ets->prio_tc[i]; + + if ((ets->tc_tx_bw[i] || ets->tc_tsa[i]) && i > softc->max_tc) + return -EINVAL; + + switch (ets->tc_tsa[i]) { + case BNXT_IEEE_8021QAZ_TSA_STRICT: + break; + case BNXT_IEEE_8021QAZ_TSA_ETS: + total_ets_bw += ets->tc_tx_bw[i]; + zero = zero || !ets->tc_tx_bw[i]; + break; + default: + return -ENOTSUPP; + } + } + if (total_ets_bw > 100) { + device_printf(softc->dev, "rejecting ETS config exceeding available bandwidth\n"); + return -EINVAL; + } + if (zero && total_ets_bw == 100) { + device_printf(softc->dev, "rejecting ETS config starving a TC\n"); + return -EINVAL; + } + + if (max_tc >= softc->max_tc) + *tc = softc->max_tc; + else + *tc = max_tc + 1; + return 0; +} + +int +bnxt_dcb_ieee_getets(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets) +{ + struct bnxt_ieee_ets *my_ets = softc->ieee_ets; + int rc; + + if (!my_ets) + return 0; + + rc = bnxt_hwrm_queue_cos2bw_qcfg(softc, my_ets); + if (rc) + goto error; + rc = bnxt_hwrm_queue_pri2cos_qcfg(softc, my_ets); + if (rc) + goto error; + + if (ets) { + ets->cbs = my_ets->cbs; + ets->ets_cap = softc->max_tc; + memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw)); + memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw)); + memcpy(ets->tc_tsa, my_ets->tc_tsa, sizeof(ets->tc_tsa)); + memcpy(ets->prio_tc, my_ets->prio_tc, sizeof(ets->prio_tc)); + } + return 0; +error: + return rc; +} + +int +bnxt_dcb_ieee_setets(struct bnxt_softc *softc, struct bnxt_ieee_ets *ets) +{ *** 1823 LINES SKIPPED *** From nobody Mon Jun 3 19:25:03 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 4VtNwH6XGkz5Js8J; Mon, 03 Jun 2024 19:25:03 +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 4VtNwH472Pz4Vqb; Mon, 3 Jun 2024 19:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442703; 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=U2Qiw6gf+pfSo30fExqUGQuRMCerdih/FXzs8Y3G0EE=; b=M2JYIMq8DVSDO97kw8bfDUHqqQCVCvHMrnFHMDGbjRCntxcLn+jiyQWCTgyiyZYfhxprhe YVBVYKuixdBJyQwIX6s6YfmWtDMRyQIvD3NfItz3QnTZBNANY4hi0CIErXc8B59zMY2M6V Dund+aK3StB+xn6YNCqckziu7sltKkVBfFYVBwsC0PTHgbInsP9ZLoznThzcRB+VTKUIZ7 y2PKLRwUFOtbJ9HZvUb2Q3BVXQ8DP8bYjys43z8OCZ8oTw7eVx3DfBtm9qo6j7SOX1VJ1H qxmvvTgFk0fIFty9hDh/RBfsHeS44R1xQnD/KcjZ2ytt7f/+++ydhtdtsVwhww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442703; a=rsa-sha256; cv=none; b=moTwRUwKCIK7J68Cbll/2ciwdKANqRCJxxMpcTuTH03fGRXK5G1CCa+KdemFrdRuGG70Y+ ZCV5sfPDs6gOTF23RFlsY5Sq9N/Wmm9u0JyrItkZrWan2KYIl070Q5Htmeq5m31xK/uV5l AUS8rHdYIkugtJChWPF1LgZU0ivWrmSm2XIYtuphh2xcHpmgVqQAPQ318ZQVIIiLqQQVZ9 oPqwbvvNZt9P/S88qI+F39JGE6CfwxSeQZzbBEMk023W5IBtYXgFmmBYQT0uShxuElntnD Y0OJydRwXn8Ayt/S/i5B1Y2adIuxJ7JjamjI0oGfpBhOdum4sohubtbZE++zgw== 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=1717442703; 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=U2Qiw6gf+pfSo30fExqUGQuRMCerdih/FXzs8Y3G0EE=; b=wX54hNHN7q0UMoSkjvBJDw5u3qqM1YKdeiYFJ4yCuHjlMYItnv1iNUoomPW0NVxq1NMDqa ZLen284hKtVTntB8LlWMMyHvceB6f4pFySfqJ96uNm8jWe6Ap3AK1klhYUQGyNfpfHHl2+ IHZK30Ao5BtRvxOK6/LqKxrmK+Xt7mDtUMMs0TmsPTA5RWlxVONMv0clkwUinfNya6plPr rkcMNMVvoQT11Q1ZL+5wngKKV2FS1Qew/I8oXNnYjBvrFZj72DticfUugkENA+TqMg/NBj sxD0BX0MO7luauECWgPUtSlZCZkjOM1X/a6aCavkL0FO4Z/0ryhxoB0D1PnjTg== 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 4VtNwH3YF8znRD; Mon, 3 Jun 2024 19:25:03 +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 453JP3YX068008; Mon, 3 Jun 2024 19:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP39n068005; Mon, 3 Jun 2024 19:25:03 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:03 GMT Message-Id: <202406031925.453JP39n068005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: fba2468e1633 - stable/14 - bnxt_en: Added support for priority queues extended stats 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fba2468e163370224c4c1ee28328a39cde28986f Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fba2468e163370224c4c1ee28328a39cde28986f commit fba2468e163370224c4c1ee28328a39cde28986f Author: Chandrakanth patil AuthorDate: 2024-04-27 16:26:35 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 bnxt_en: Added support for priority queues extended stats Below priority queues extended stats are exposed to sysctl: tx_bytes_pri{0-7} rx_bytes_pri{0-7} tx_packets_pri{0-7} rx_packets_pri{0-7} Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45007 (cherry picked from commit 032899b59c25389e60a0a092a0dad347102a6edc) --- sys/dev/bnxt/bnxt_en/bnxt.h | 23 ++++++ sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 161 +++++++++++++++++++++++++++++++++++-- sys/dev/bnxt/bnxt_en/bnxt_hwrm.h | 2 +- sys/dev/bnxt/bnxt_en/bnxt_sysctl.c | 98 ++++++++++++++++++++++ 4 files changed, 277 insertions(+), 7 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index ab60ddf74672..d6fe2ce8ddb1 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -267,6 +267,15 @@ #define BNXT_MIN_FRAME_SIZE 52 /* Frames must be padded to this size for some A0 chips */ +#define BNXT_RX_STATS_EXT_OFFSET(counter) \ + (offsetof(struct rx_port_stats_ext, counter) / 8) + +#define BNXT_RX_STATS_EXT_NUM_LEGACY \ + BNXT_RX_STATS_EXT_OFFSET(rx_fec_corrected_blocks) + +#define BNXT_TX_STATS_EXT_OFFSET(counter) \ + (offsetof(struct tx_port_stats_ext, counter) / 8) + extern const char bnxt_driver_version[]; typedef void (*bnxt_doorbell_tx)(void *, uint16_t idx); typedef void (*bnxt_doorbell_rx)(void *, uint16_t idx); @@ -910,6 +919,20 @@ struct bnxt_softc { struct tx_port_stats_ext *tx_port_stats_ext; struct rx_port_stats_ext *rx_port_stats_ext; + uint16_t fw_rx_stats_ext_size; + uint16_t fw_tx_stats_ext_size; + uint16_t hw_ring_stats_size; + + uint8_t tx_pri2cos_idx[8]; + uint8_t rx_pri2cos_idx[8]; + bool pri2cos_valid; + + uint64_t tx_bytes_pri[8]; + uint64_t tx_packets_pri[8]; + uint64_t rx_bytes_pri[8]; + uint64_t rx_packets_pri[8]; + + uint8_t port_count; int num_cp_rings; struct bnxt_cp_ring *nq_rings; diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c index 07834aeca363..677869484ace 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c @@ -47,6 +47,38 @@ static void bnxt_hwrm_set_eee(struct bnxt_softc *softc, /* NVRam stuff has a five minute timeout */ #define BNXT_NVM_TIMEO (5 * 60 * 1000) +#define BNXT_RX_STATS_PRI_ENTRY(counter, n) \ + BNXT_RX_STATS_EXT_OFFSET(counter##_cos0) + +#define BNXT_TX_STATS_PRI_ENTRY(counter, n) \ + BNXT_TX_STATS_EXT_OFFSET(counter##_cos0) + +#define BNXT_RX_STATS_PRI_ENTRIES(counter) \ + BNXT_RX_STATS_PRI_ENTRY(counter, 0), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 1), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 2), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 3), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 4), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 5), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 6), \ + BNXT_RX_STATS_PRI_ENTRY(counter, 7) + +#define BNXT_TX_STATS_PRI_ENTRIES(counter) \ + BNXT_TX_STATS_PRI_ENTRY(counter, 0), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 1), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 2), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 3), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 4), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 5), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 6), \ + BNXT_TX_STATS_PRI_ENTRY(counter, 7) + + +long bnxt_rx_bytes_pri_arr_base_off[] = {BNXT_RX_STATS_PRI_ENTRIES(rx_bytes)}; +long bnxt_rx_pkts_pri_arr_base_off[] = {BNXT_RX_STATS_PRI_ENTRIES(rx_packets)}; +long bnxt_tx_bytes_pri_arr_base_off[] = {BNXT_TX_STATS_PRI_ENTRIES(tx_bytes)}; +long bnxt_tx_pkts_pri_arr_base_off[] = {BNXT_TX_STATS_PRI_ENTRIES(tx_packets)}; + static int bnxt_hwrm_err_map(uint16_t err) { @@ -1734,25 +1766,142 @@ bnxt_hwrm_port_qstats(struct bnxt_softc *softc) return rc; } +static int bnxt_hwrm_pri2cos_idx(struct bnxt_softc *softc, uint32_t path_dir) +{ + struct hwrm_queue_pri2cos_qcfg_input req = {0}; + struct hwrm_queue_pri2cos_qcfg_output *resp; + uint8_t *pri2cos_idx, *q_ids, max_q; + int rc, i, j; + uint8_t *pri2cos; -void + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_PRI2COS_QCFG); + resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; + + req.flags = htole32(HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN | + path_dir); + rc = hwrm_send_message(softc, &req, sizeof(req)); + + if (rc) + return rc; + + if (path_dir == HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX) { + pri2cos_idx = softc->tx_pri2cos_idx; + q_ids = softc->tx_q_ids; + max_q = softc->tx_max_q; + } else { + pri2cos_idx = softc->rx_pri2cos_idx; + q_ids = softc->rx_q_ids; + max_q = softc->rx_max_q; + } + + pri2cos = &resp->pri0_cos_queue_id; + + for (i = 0; i < BNXT_MAX_QUEUE; i++) { + uint8_t queue_id = pri2cos[i]; + uint8_t queue_idx; + + /* Per port queue IDs start from 0, 10, 20, etc */ + queue_idx = queue_id % 10; + if (queue_idx > BNXT_MAX_QUEUE) { + softc->pri2cos_valid = false; + rc = -EINVAL; + return rc; + } + + for (j = 0; j < max_q; j++) { + if (q_ids[j] == queue_id) + pri2cos_idx[i] = queue_idx; + } + } + + softc->pri2cos_valid = true; + + return rc; +} + +int bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc) { struct hwrm_port_qstats_ext_input req = {0}; + struct hwrm_port_qstats_ext_output *resp; + int rc = 0, i; + uint32_t tx_stat_size; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_QSTATS_EXT); + resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; + tx_stat_size = sizeof(struct tx_port_stats_ext); req.port_id = htole16(softc->pf.port_id); - req.tx_stat_size = htole16(sizeof(struct tx_port_stats_ext)); + req.tx_stat_size = htole16(tx_stat_size); req.rx_stat_size = htole16(sizeof(struct rx_port_stats_ext)); req.rx_stat_host_addr = htole64(softc->hw_rx_port_stats_ext.idi_paddr); req.tx_stat_host_addr = htole64(softc->hw_tx_port_stats_ext.idi_paddr); - BNXT_HWRM_LOCK(softc); - _hwrm_send_message(softc, &req, sizeof(req)); - BNXT_HWRM_UNLOCK(softc); + rc = hwrm_send_message(softc, &req, sizeof(req)); - return; + if (!rc) { + softc->fw_rx_stats_ext_size = + le16toh(resp->rx_stat_size) / 8; + if (BNXT_FW_MAJ(softc) < 220 && + softc->fw_rx_stats_ext_size > BNXT_RX_STATS_EXT_NUM_LEGACY) + softc->fw_rx_stats_ext_size = BNXT_RX_STATS_EXT_NUM_LEGACY; + + softc->fw_tx_stats_ext_size = tx_stat_size ? + le16toh(resp->tx_stat_size) / 8 : 0; + } else { + softc->fw_rx_stats_ext_size = 0; + softc->fw_tx_stats_ext_size = 0; + } + + if (softc->fw_tx_stats_ext_size <= + offsetof(struct tx_port_stats_ext, pfc_pri0_tx_duration_us) / 8) { + softc->pri2cos_valid = false; + return rc; + } + + rc = bnxt_hwrm_pri2cos_idx(softc, HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX); + if (rc) + return rc; + + if (softc->is_asym_q) { + rc = bnxt_hwrm_pri2cos_idx(softc, HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX); + if (rc) + return rc; + } else { + memcpy(softc->rx_pri2cos_idx, softc->tx_pri2cos_idx, sizeof(softc->rx_pri2cos_idx)); + } + + u64 *rx_port_stats_ext = (u64 *)softc->hw_rx_port_stats_ext.idi_vaddr; + u64 *tx_port_stats_ext = (u64 *)softc->hw_tx_port_stats_ext.idi_vaddr; + + if (softc->pri2cos_valid) { + for (i = 0; i < 8; i++) { + long n = bnxt_rx_bytes_pri_arr_base_off[i] + + softc->rx_pri2cos_idx[i]; + + softc->rx_bytes_pri[i] = *(rx_port_stats_ext + n); + } + for (i = 0; i < 8; i++) { + long n = bnxt_rx_pkts_pri_arr_base_off[i] + + softc->rx_pri2cos_idx[i]; + + softc->rx_packets_pri[i] = *(rx_port_stats_ext + n); + } + for (i = 0; i < 8; i++) { + long n = bnxt_tx_bytes_pri_arr_base_off[i] + + softc->tx_pri2cos_idx[i]; + + softc->tx_bytes_pri[i] = *(tx_port_stats_ext + n); + } + for (i = 0; i < 8; i++) { + long n = bnxt_tx_pkts_pri_arr_base_off[i] + + softc->tx_pri2cos_idx[i]; + + softc->tx_packets_pri[i] = *(tx_port_stats_ext + n); + } + } + + return rc; } int diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h index 35a974fe3438..766556f9904c 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h @@ -66,7 +66,7 @@ int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, uint64_t paddr); int bnxt_hwrm_stat_ctx_free(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr); int bnxt_hwrm_port_qstats(struct bnxt_softc *softc); -void bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc); +int bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc); int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp); int bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *gr); diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c index 9ee555dac72f..b850a4d47f9c 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c @@ -599,6 +599,55 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "tx_packets_cos7", CTLFLAG_RD, &softc->tx_port_stats_ext->tx_packets_cos7, "Transmitted packets count cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri0", CTLFLAG_RD, + &softc->tx_bytes_pri[0], "Transmitted bytes count pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri0", CTLFLAG_RD, + &softc->tx_packets_pri[0], "Transmitted packets count pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri1", CTLFLAG_RD, + &softc->tx_bytes_pri[1], "Transmitted bytes count pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri1", CTLFLAG_RD, + &softc->tx_packets_pri[1], "Transmitted packets count pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri2", CTLFLAG_RD, + &softc->tx_bytes_pri[2], "Transmitted bytes count pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri2", CTLFLAG_RD, + &softc->tx_packets_pri[2], "Transmitted packets count pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri3", CTLFLAG_RD, + &softc->tx_bytes_pri[3], "Transmitted bytes count pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri3", CTLFLAG_RD, + &softc->tx_packets_pri[3], "Transmitted packets count pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri4", CTLFLAG_RD, + &softc->tx_bytes_pri[4], "Transmitted bytes count pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri4", CTLFLAG_RD, + &softc->tx_packets_pri[4], "Transmitted packets count pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri5", CTLFLAG_RD, + &softc->tx_bytes_pri[5], "Transmitted bytes count pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri5", CTLFLAG_RD, + &softc->tx_packets_pri[5], "Transmitted packets count pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri6", CTLFLAG_RD, + &softc->tx_bytes_pri[6], "Transmitted bytes count pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri6", CTLFLAG_RD, + &softc->tx_packets_pri[6], "Transmitted packets count pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_pri7", CTLFLAG_RD, + &softc->tx_bytes_pri[7], "Transmitted bytes count pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_pri7", CTLFLAG_RD, + &softc->tx_packets_pri[7], "Transmitted packets count pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "pfc_pri0_tx_duration_us", CTLFLAG_RD, &softc->tx_port_stats_ext->pfc_pri0_tx_duration_us, "Time duration between" @@ -732,6 +781,55 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_packets_cos7", CTLFLAG_RD, &softc->rx_port_stats_ext->rx_packets_cos7, "Received packets count cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri0", CTLFLAG_RD, + &softc->rx_bytes_pri[0], "Received bytes count pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri0", CTLFLAG_RD, + &softc->rx_packets_pri[0], "Received packets count pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri1", CTLFLAG_RD, + &softc->rx_bytes_pri[1], "Received bytes count pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri1", CTLFLAG_RD, + &softc->rx_packets_pri[1], "Received packets count pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri2", CTLFLAG_RD, + &softc->rx_bytes_pri[2], "Received bytes count pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri2", CTLFLAG_RD, + &softc->rx_packets_pri[2], "Received packets count pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri3", CTLFLAG_RD, + &softc->rx_bytes_pri[3], "Received bytes count pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri3", CTLFLAG_RD, + &softc->rx_packets_pri[3], "Received packets count pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri4", CTLFLAG_RD, + &softc->rx_bytes_pri[4], "Received bytes count pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri4", CTLFLAG_RD, + &softc->rx_packets_pri[4], "Received packets count pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri5", CTLFLAG_RD, + &softc->rx_bytes_pri[5], "Received bytes count pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri5", CTLFLAG_RD, + &softc->rx_packets_pri[5], "Received packets count pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri6", CTLFLAG_RD, + &softc->rx_bytes_pri[6], "Received bytes count pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri6", CTLFLAG_RD, + &softc->rx_packets_pri[6], "Received packets count pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_pri7", CTLFLAG_RD, + &softc->rx_bytes_pri[7], "Received bytes count pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_pri7", CTLFLAG_RD, + &softc->rx_packets_pri[7], "Received packets count pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "pfc_pri0_rx_duration_us", CTLFLAG_RD, &softc->rx_port_stats_ext->pfc_pri0_rx_duration_us, "Time duration in receiving" From nobody Mon Jun 3 19:25:04 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 4VtNwK1KW6z5Js35; Mon, 03 Jun 2024 19:25:05 +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 4VtNwJ52VQz4Vhk; Mon, 3 Jun 2024 19:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442704; 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=Qp1vNQOYmB38OTNVmEHSpHKuntQX2odCHepY/1I+WOw=; b=qWXpROXJqv+kzbQ7LXXuqqI+RQ8ny+G/IJ7fytCZ0llXstwI1BOdMbgRA9eJjfez/GaHJ3 Nv5DP0YykYaBjKNrw5y9+YHAVai1UvegsEN1I8dxXgDkFxBCi/l5bIRRon+/YXxYK/LhCA MnOs6kADs8JBpIElqA3jNQm9wOOblfqqEuu+Vmtp8SmCV5AmYFZfK7XUGtHDtgHtt/z2Ij JIz93TuC+RyRePFeoM8v4rTj/jKgAZmaQgmX/pIuH7VSFEvUnLCTQ2ELPukvS4/MsiNcm1 4S7FtaEdqJ5jwATpvycJTuNapyloZRlfYMZ+CP8xNyt2jakO4oa6iFrsYnmyuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442704; a=rsa-sha256; cv=none; b=OLscneyXgIRJuhNYGd7cHtXyPmOFutVrhbRFx54RtgvOd4tfFKNDEqoQUJWv78PNWEbV5s UjGirbcqi3E/ha/j8z827lMasM+EoXZun9WZbzPuO3sFuprj6R2/jH4GH3A5VfhkJ3QZb9 VQymYxpf3wqHOniUZjoQRrDeF+KCjhZNcQih/XInV5foTyLKyY7zslN36OtSFquCx4BP/x rexinZuEfpOG1Skgy+dNhDYg948Dqrzpj9lV7su94w2QZmc75G/VwhtKSm7H3w9yjklZEB YfwJg1BbpqI1DE7wo6pctOnvXNTnlbhspwQdu7fM7CJn+8dg2HRWzrnTl8nn2A== 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=1717442704; 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=Qp1vNQOYmB38OTNVmEHSpHKuntQX2odCHepY/1I+WOw=; b=gHXUwE2JhRc6jsMqEKplAUhKf0dT3KcjpCjC2t1tsZkPhWtAi3Rl+IIb8NpRjfLVp0Vr5e ZHDHXrRjEMEW/Wx0wRN0mB4KTwgOEHwQsFTOQhMi0H9uqPPOWRaur8+aNixbiipabksGj8 FclvLwyz+gvGMasQB/N6V1G4AJIGc29qdih72okvknrxPZ+1r08Uoy3Iva/Xx6QYel82Mb pJyyxqbEWrMgLrNxuZ171/L5j2l7T3uJ0fmei7eGDqNrc7mNcWXBi4uk3LW/vzou0yLz/i WUO53M0Vzjh4XkbgMyQcb0gV440yniB9GiHS5Azl/OYXqve0xgwEaPoFb7BqdA== 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 4VtNwJ4MpzznRF; Mon, 3 Jun 2024 19:25:04 +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 453JP4Qs068050; Mon, 3 Jun 2024 19:25:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP40v068047; Mon, 3 Jun 2024 19:25:04 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:04 GMT Message-Id: <202406031925.453JP40v068047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 9464f91b31d7 - stable/14 - bnxt_en: Firmware error recovery support 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9464f91b31d72264bc37ab9b992c22d38357d0f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9464f91b31d72264bc37ab9b992c22d38357d0f5 commit 9464f91b31d72264bc37ab9b992c22d38357d0f5 Author: Chandrakanth patil AuthorDate: 2024-04-28 12:53:58 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 bnxt_en: Firmware error recovery support Implement firmware error recovery support for Thor adapters. This entails enabling the capability for the firmware to initiate error recovery. Specifically, the firmware will send the reset notify asynchronous event to notify the driver of an error and impending reset. Subsequently, the driver will queue a task to execute the following steps. 1. Deactivate the allocated resources. 2. Await completion of the firmware's recovery process. 3. Configure the resources and reactivate the network interface. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45008 (cherry picked from commit c9965974a52b5dfad1737706b7f2623d999fb569) --- sys/dev/bnxt/bnxt_en/bnxt.h | 179 +++++++- sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 147 ++++--- sys/dev/bnxt/bnxt_en/bnxt_hwrm.h | 8 +- sys/dev/bnxt/bnxt_en/bnxt_sysctl.c | 50 +++ sys/dev/bnxt/bnxt_en/bnxt_ulp.c | 6 +- sys/dev/bnxt/bnxt_en/if_bnxt.c | 834 ++++++++++++++++++++++++++++++++++++- 6 files changed, 1141 insertions(+), 83 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index d6fe2ce8ddb1..2faea00e4266 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -144,6 +144,23 @@ #define BNXT_EVENT_THERMAL_CURRENT_TEMP(data2) \ ((data2) & HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK) +#define EVENT_DATA1_RESET_NOTIFY_FW_ACTIVATION(data1) \ + (((data1) & \ + HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK) ==\ + HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION) + +#define EVENT_DATA2_RESET_NOTIFY_FW_STATUS_CODE(data2) \ + ((data2) & \ + HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_MASK) + +#define EVENT_DATA1_RECOVERY_ENABLED(data1) \ + !!((data1) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED) + +#define EVENT_DATA1_RECOVERY_MASTER_FUNC(data1) \ + !!((data1) & \ + HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC) + #define INVALID_STATS_CTX_ID -1 /* Maximum numbers of RX and TX descriptors. iflib requires this to be a power @@ -834,6 +851,124 @@ struct bnxt_msix_tbl { uint32_t vector; }; +enum bnxt_health_severity { + SEVERITY_NORMAL = 0, + SEVERITY_WARNING, + SEVERITY_RECOVERABLE, + SEVERITY_FATAL, +}; + +enum bnxt_health_remedy { + REMEDY_DEVLINK_RECOVER, + REMEDY_POWER_CYCLE_DEVICE, + REMEDY_POWER_CYCLE_HOST, + REMEDY_FW_UPDATE, + REMEDY_HW_REPLACE, +}; + +struct bnxt_fw_health { + u32 flags; + u32 polling_dsecs; + u32 master_func_wait_dsecs; + u32 normal_func_wait_dsecs; + u32 post_reset_wait_dsecs; + u32 post_reset_max_wait_dsecs; + u32 regs[4]; + u32 mapped_regs[4]; +#define BNXT_FW_HEALTH_REG 0 +#define BNXT_FW_HEARTBEAT_REG 1 +#define BNXT_FW_RESET_CNT_REG 2 +#define BNXT_FW_RESET_INPROG_REG 3 + u32 fw_reset_inprog_reg_mask; + u32 last_fw_heartbeat; + u32 last_fw_reset_cnt; + u8 enabled:1; + u8 primary:1; + u8 status_reliable:1; + u8 resets_reliable:1; + u8 tmr_multiplier; + u8 tmr_counter; + u8 fw_reset_seq_cnt; + u32 fw_reset_seq_regs[16]; + u32 fw_reset_seq_vals[16]; + u32 fw_reset_seq_delay_msec[16]; + u32 echo_req_data1; + u32 echo_req_data2; + struct devlink_health_reporter *fw_reporter; + struct mutex lock; + enum bnxt_health_severity severity; + enum bnxt_health_remedy remedy; + u32 arrests; + u32 discoveries; + u32 survivals; + u32 fatalities; + u32 diagnoses; +}; + +#define BNXT_FW_HEALTH_REG_TYPE_MASK 3 +#define BNXT_FW_HEALTH_REG_TYPE_CFG 0 +#define BNXT_FW_HEALTH_REG_TYPE_GRC 1 +#define BNXT_FW_HEALTH_REG_TYPE_BAR0 2 +#define BNXT_FW_HEALTH_REG_TYPE_BAR1 3 + +#define BNXT_FW_HEALTH_REG_TYPE(reg) ((reg) & BNXT_FW_HEALTH_REG_TYPE_MASK) +#define BNXT_FW_HEALTH_REG_OFF(reg) ((reg) & ~BNXT_FW_HEALTH_REG_TYPE_MASK) + +#define BNXT_FW_HEALTH_WIN_BASE 0x3000 +#define BNXT_FW_HEALTH_WIN_MAP_OFF 8 + +#define BNXT_FW_HEALTH_WIN_OFF(reg) (BNXT_FW_HEALTH_WIN_BASE + \ + ((reg) & BNXT_GRC_OFFSET_MASK)) + +#define BNXT_FW_STATUS_HEALTH_MSK 0xffff +#define BNXT_FW_STATUS_HEALTHY 0x8000 +#define BNXT_FW_STATUS_SHUTDOWN 0x100000 +#define BNXT_FW_STATUS_RECOVERING 0x400000 + +#define BNXT_FW_IS_HEALTHY(sts) (((sts) & BNXT_FW_STATUS_HEALTH_MSK) ==\ + BNXT_FW_STATUS_HEALTHY) + +#define BNXT_FW_IS_BOOTING(sts) (((sts) & BNXT_FW_STATUS_HEALTH_MSK) < \ + BNXT_FW_STATUS_HEALTHY) + +#define BNXT_FW_IS_ERR(sts) (((sts) & BNXT_FW_STATUS_HEALTH_MSK) > \ + BNXT_FW_STATUS_HEALTHY) + +#define BNXT_FW_IS_RECOVERING(sts) (BNXT_FW_IS_ERR(sts) && \ + ((sts) & BNXT_FW_STATUS_RECOVERING)) + +#define BNXT_FW_RETRY 5 +#define BNXT_FW_IF_RETRY 10 +#define BNXT_FW_SLOT_RESET_RETRY 4 + +#define BNXT_GRCPF_REG_CHIMP_COMM 0x0 +#define BNXT_GRCPF_REG_CHIMP_COMM_TRIGGER 0x100 +#define BNXT_GRCPF_REG_WINDOW_BASE_OUT 0x400 +#define BNXT_GRCPF_REG_SYNC_TIME 0x480 +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ 0x488 +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ_PER_MSK 0xffffffUL +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ_PER_SFT 0 +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ_VAL_MSK 0x1f000000UL +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ_VAL_SFT 24 +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ_SIGN_MSK 0x20000000UL +#define BNXT_GRCPF_REG_SYNC_TIME_ADJ_SIGN_SFT 29 + +#define BNXT_GRC_REG_STATUS_P5 0x520 + +#define BNXT_GRCPF_REG_KONG_COMM 0xA00 +#define BNXT_GRCPF_REG_KONG_COMM_TRIGGER 0xB00 + +#define BNXT_CAG_REG_LEGACY_INT_STATUS 0x4014 +#define BNXT_CAG_REG_BASE 0x300000 + +#define BNXT_GRC_REG_CHIP_NUM 0x48 +#define BNXT_GRC_REG_BASE 0x260000 + +#define BNXT_TS_REG_TIMESYNC_TS0_LOWER 0x640180c +#define BNXT_TS_REG_TIMESYNC_TS0_UPPER 0x6401810 + +#define BNXT_GRC_BASE_MASK 0xfffff000 +#define BNXT_GRC_OFFSET_MASK 0x00000ffc struct bnxt_softc { device_t dev; if_ctx_t ctx; @@ -1080,7 +1215,49 @@ struct bnxt_softc { test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) struct pci_dev *pdev; - int fw_reset_state; + struct work_struct sp_task; + unsigned long sp_event; +#define BNXT_RX_MASK_SP_EVENT 0 +#define BNXT_RX_NTP_FLTR_SP_EVENT 1 +#define BNXT_LINK_CHNG_SP_EVENT 2 +#define BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT 3 +#define BNXT_VXLAN_ADD_PORT_SP_EVENT 4 +#define BNXT_VXLAN_DEL_PORT_SP_EVENT 5 +#define BNXT_RESET_TASK_SP_EVENT 6 +#define BNXT_RST_RING_SP_EVENT 7 +#define BNXT_HWRM_PF_UNLOAD_SP_EVENT 8 +#define BNXT_PERIODIC_STATS_SP_EVENT 9 +#define BNXT_HWRM_PORT_MODULE_SP_EVENT 10 +#define BNXT_RESET_TASK_SILENT_SP_EVENT 11 +#define BNXT_GENEVE_ADD_PORT_SP_EVENT 12 +#define BNXT_GENEVE_DEL_PORT_SP_EVENT 13 +#define BNXT_LINK_SPEED_CHNG_SP_EVENT 14 +#define BNXT_FLOW_STATS_SP_EVENT 15 +#define BNXT_UPDATE_PHY_SP_EVENT 16 +#define BNXT_RING_COAL_NOW_SP_EVENT 17 +#define BNXT_FW_RESET_NOTIFY_SP_EVENT 18 +#define BNXT_FW_EXCEPTION_SP_EVENT 19 +#define BNXT_VF_VNIC_CHANGE_SP_EVENT 20 +#define BNXT_LINK_CFG_CHANGE_SP_EVENT 21 +#define BNXT_PTP_CURRENT_TIME_EVENT 22 +#define BNXT_FW_ECHO_REQUEST_SP_EVENT 23 +#define BNXT_VF_CFG_CHNG_SP_EVENT 24 + + struct delayed_work fw_reset_task; + int fw_reset_state; +#define BNXT_FW_RESET_STATE_POLL_VF 1 +#define BNXT_FW_RESET_STATE_RESET_FW 2 +#define BNXT_FW_RESET_STATE_ENABLE_DEV 3 +#define BNXT_FW_RESET_STATE_POLL_FW 4 +#define BNXT_FW_RESET_STATE_OPENING 5 +#define BNXT_FW_RESET_STATE_POLL_FW_DOWN 6 + u16 fw_reset_min_dsecs; +#define BNXT_DFLT_FW_RST_MIN_DSECS 20 + u16 fw_reset_max_dsecs; +#define BNXT_DFLT_FW_RST_MAX_DSECS 60 + unsigned long fw_reset_timestamp; + + struct bnxt_fw_health *fw_health; }; struct bnxt_filter_info { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c index 677869484ace..9252964900ff 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c @@ -933,22 +933,99 @@ fail: return rc; } -int -bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc) -{ +static const u16 bnxt_async_events_arr[] = { + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT, + HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE, +}; + +int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *bp, unsigned long *bmap, int bmap_size, + bool async_only) +{ + DECLARE_BITMAP(async_events_bmap, 256); + u32 *events = (u32 *)async_events_bmap; + struct hwrm_func_drv_rgtr_output *resp = + (void *)bp->hwrm_cmd_resp.idi_vaddr; struct hwrm_func_drv_rgtr_input req = {0}; + u32 flags = 0; + int rc; + int i; - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR); - - req.enables = htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER | - HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE); - req.os_type = htole16(HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD); - + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_DRV_RGTR); req.ver_maj = HWRM_VERSION_MAJOR; req.ver_min = HWRM_VERSION_MINOR; req.ver_upd = HWRM_VERSION_UPDATE; - return hwrm_send_message(softc, &req, sizeof(req)); + req.enables = htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE | + HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER | + HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD); + + if (bp->fw_cap & BNXT_FW_CAP_HOT_RESET) + flags |= HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT; + if (bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY) + flags |= HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT | + HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT; + if (bp->fw_cap & BNXT_FW_CAP_NPAR_1_2) + flags |= HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_NPAR_1_2_SUPPORT; + flags |= HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ASYM_QUEUE_CFG_SUPPORT; + req.flags = htole32(flags); + req.os_type = htole16(HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD); + + if (BNXT_PF(bp)) { + req.enables |= + htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD); + } + + if (bp->fw_cap & BNXT_FW_CAP_OVS_64BIT_HANDLE) + req.flags |= cpu_to_le32(HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE); + + memset(async_events_bmap, 0, sizeof(async_events_bmap)); + for (i = 0; i < ARRAY_SIZE(bnxt_async_events_arr); i++) { + u16 event_id = bnxt_async_events_arr[i]; + + if (event_id == HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY && + !(bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY)) { + continue; + } + __set_bit(bnxt_async_events_arr[i], async_events_bmap); + } + if (bmap && bmap_size) { + for (i = 0; i < bmap_size; i++) { + if (test_bit(i, bmap)) + __set_bit(i, async_events_bmap); + } + } + for (i = 0; i < 8; i++) + req.async_event_fwd[i] |= htole32(events[i]); + + if (async_only) + req.enables = + htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD); + + rc = hwrm_send_message(bp, &req, sizeof(req)); + + if (!rc) { + if (resp->flags & + le32toh(HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED)) + bp->fw_cap |= BNXT_FW_CAP_IF_CHANGE; + } + + + return rc; } int @@ -2994,56 +3071,6 @@ int bnxt_hwrm_set_coal(struct bnxt_softc *softc) return rc; } -int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap, - int bmap_size) -{ - struct hwrm_func_drv_rgtr_input req = {0}; - struct hwrm_func_drv_rgtr_output *resp = - (void *)softc->hwrm_cmd_resp.idi_vaddr; - bitstr_t *async_events_bmap; - uint32_t *events; - int i, rc = 0; - -#define BNXT_MAX_NUM_ASYNC_EVENTS 256 - async_events_bmap = bit_alloc(BNXT_MAX_NUM_ASYNC_EVENTS, M_DEVBUF, - M_WAITOK|M_ZERO); - events = (uint32_t *)async_events_bmap; - - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR); - - req.enables = - htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD); - - memset(async_events_bmap, 0, sizeof(BNXT_MAX_NUM_ASYNC_EVENTS / 8)); - - bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE); - bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD); - bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED); - bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE); - bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE); - - if (bmap && bmap_size) { - for (i = 0; i < bmap_size; i++) { - if (bit_test(bmap, i)) - bit_set(async_events_bmap, i); - } - } - - for (i = 0; i < 8; i++) - req.async_event_fwd[i] |= htole32(events[i]); - - free(async_events_bmap, M_DEVBUF); - - rc = hwrm_send_message(softc, &req, sizeof(req)); - if (!rc) { - if (resp->flags & - le32toh(HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED)) - softc->fw_cap |= BNXT_FW_CAP_IF_CHANGE; - } - - return rc; -} - void bnxt_hwrm_ring_info_get(struct bnxt_softc *softc, uint8_t ring_type, uint32_t ring_id, uint32_t *prod, uint32_t *cons) { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h index 766556f9904c..126cad977c82 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.h @@ -32,10 +32,11 @@ #define BNXT_PAUSE_TX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX) #define BNXT_PAUSE_RX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX) -#define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \ - (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE) +#define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \ + (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE) #define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input) #define BNXT_BACKING_STORE_CFG_LEGACY_LEN 256 +#define SHORT_HWRM_CMD_TIMEOUT 500 /* HWRM Function Prototypes */ int @@ -48,7 +49,8 @@ int bnxt_hwrm_ring_free(struct bnxt_softc *softc, uint32_t type, struct bnxt_ring *ring, int cmpl_ring_id); int bnxt_hwrm_ver_get(struct bnxt_softc *softc); int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc, uint32_t path_dir); -int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc); +int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *bp, unsigned long *bmap, int bmap_size, + bool async_only); int bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown); int bnxt_hwrm_func_qcaps(struct bnxt_softc *softc); int bnxt_hwrm_func_qcfg(struct bnxt_softc *softc); diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c index b850a4d47f9c..cf4e995e1aba 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c @@ -30,11 +30,17 @@ #include #include #include +#include #include "bnxt.h" #include "bnxt_hwrm.h" #include "bnxt_sysctl.h" +DEFINE_MUTEX(tmp_mutex); /* mutex lock for driver */ +extern void bnxt_fw_reset(struct bnxt_softc *bp); +extern void bnxt_queue_sp_work(struct bnxt_softc *bp); +extern void +process_nq(struct bnxt_softc *softc, uint16_t nqid); /* * We want to create: * dev.bnxt.0.hwstats.txq0 @@ -1550,6 +1556,46 @@ bnxt_set_coal_tx_frames_irq(SYSCTL_HANDLER_ARGS) { return rc; } +static +void simulate_reset(struct bnxt_softc *bp, char *fwcli_string) +{ + struct hwrm_dbg_fw_cli_input req = {0}; + int rc = 0; + + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_DBG_FW_CLI); + req.cmpl_ring = -1; + req.target_id = -1; + req.cli_cmd_len = strlen(fwcli_string); + req.host_buf_len = 64 * 1024; + strcpy((char *)req.cli_cmd, fwcli_string); + + BNXT_HWRM_LOCK(bp); + rc = _hwrm_send_message(bp, &req, sizeof(req)); + if (rc) { + device_printf(bp->dev, " Manual FW fault failed, rc:%x\n", rc); + } + BNXT_HWRM_UNLOCK(bp); +} + +static int +bnxt_reset_ctrl(SYSCTL_HANDLER_ARGS) { + struct bnxt_softc *softc = arg1; + int rc = 0; + char buf[50] = {0}; + + if (softc == NULL) + return EBUSY; + + rc = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (rc || req->newptr == NULL) + return rc; + + if (BNXT_CHIP_P5(softc)) + simulate_reset(softc, buf); + + return rc; +} + int bnxt_create_config_sysctls_pre(struct bnxt_softc *softc) { @@ -1607,6 +1653,10 @@ bnxt_create_config_sysctls_pre(struct bnxt_softc *softc) SYSCTL_ADD_U64(ctx, children, OID_AUTO, "fw_cap", CTLFLAG_RD, &softc->fw_cap, 0, "FW caps"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "reset_ctrl", CTLTYPE_STRING | CTLFLAG_RWTUN, softc, + 0, bnxt_reset_ctrl, "A", + "Issue controller reset: 0 / 1"); return 0; } diff --git a/sys/dev/bnxt/bnxt_en/bnxt_ulp.c b/sys/dev/bnxt/bnxt_en/bnxt_ulp.c index 90253b0f5e9f..17ae916052f4 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_ulp.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_ulp.c @@ -49,6 +49,8 @@ #include "bnxt_hwrm.h" #include "bnxt_ulp.h" +void bnxt_destroy_irq(struct bnxt_softc *softc); + static int bnxt_register_dev(struct bnxt_en_dev *edev, int ulp_id, struct bnxt_ulp_ops *ulp_ops, void *handle) { @@ -379,12 +381,12 @@ static int bnxt_register_async_events(struct bnxt_en_dev *edev, int ulp_id, ulp->async_events_bmap = events_bmap; wmb(); ulp->max_async_event_id = max_id; - bnxt_hwrm_func_drv_rgtr(bp); + bnxt_hwrm_func_drv_rgtr(bp, events_bmap, max_id + 1, true); mtx_unlock(&bp->en_ops_lock); return 0; } -static void bnxt_destroy_irq(struct bnxt_softc *softc) +void bnxt_destroy_irq(struct bnxt_softc *softc) { kfree(softc->irq_tbl); } diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index f6323d0623cb..e13585a0c52c 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -170,6 +170,8 @@ static const pci_vendor_info_t bnxt_vendor_info_array[] = SLIST_HEAD(softc_list, bnxt_softc_list) pf_list; int bnxt_num_pfs = 0; +void +process_nq(struct bnxt_softc *softc, uint16_t nqid); static void *bnxt_register(device_t dev); /* Soft queue setup and teardown */ @@ -237,7 +239,10 @@ static int bnxt_i2c_req(if_ctx_t ctx, struct ifi2creq *i2c); static void bnxt_get_port_module_status(struct bnxt_softc *softc); static void bnxt_rdma_aux_device_init(struct bnxt_softc *softc); static void bnxt_rdma_aux_device_uninit(struct bnxt_softc *softc); +static void bnxt_queue_fw_reset_work(struct bnxt_softc *bp, unsigned long delay); +void bnxt_queue_sp_work(struct bnxt_softc *bp); +void bnxt_fw_reset(struct bnxt_softc *bp); /* * Device Interface Declaration */ @@ -269,6 +274,27 @@ MODULE_VERSION(if_bnxt, 1); IFLIB_PNP_INFO(pci, bnxt, bnxt_vendor_info_array); +void writel_fbsd(struct bnxt_softc *bp, u32, u8, u32); +u32 readl_fbsd(struct bnxt_softc *bp, u32, u8); + +u32 readl_fbsd(struct bnxt_softc *bp, u32 reg_off, u8 bar_idx) +{ + + if (!bar_idx) + return bus_space_read_4(bp->doorbell_bar.tag, bp->doorbell_bar.handle, reg_off); + else + return bus_space_read_4(bp->hwrm_bar.tag, bp->hwrm_bar.handle, reg_off); +} + +void writel_fbsd(struct bnxt_softc *bp, u32 reg_off, u8 bar_idx, u32 val) +{ + + if (!bar_idx) + bus_space_write_4(bp->doorbell_bar.tag, bp->doorbell_bar.handle, reg_off, htole32(val)); + else + bus_space_write_4(bp->hwrm_bar.tag, bp->hwrm_bar.handle, reg_off, htole32(val)); +} + static DEFINE_IDA(bnxt_aux_dev_ids); static device_method_t bnxt_iflib_methods[] = { @@ -357,6 +383,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_driver_version = bnxt_driver_version, }; +#define PCI_SUBSYSTEM_ID 0x2e +static struct workqueue_struct *bnxt_pf_wq; + +extern void bnxt_destroy_irq(struct bnxt_softc *softc); + /* * Device Methods */ @@ -666,7 +697,6 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, "Unable to allocate space for TPA\n"); goto tpa_alloc_fail; } - /* Allocate the AG ring */ softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; softc->ag_rings[i].softc = softc; @@ -1041,7 +1071,7 @@ static void bnxt_free_ctx_mem(struct bnxt_softc *softc) ctx->flags &= ~BNXT_CTX_FLAG_INITED; kfree(ctx); - softc->ctx = NULL; + softc->ctx_mem = NULL; } static int bnxt_alloc_ctx_mem(struct bnxt_softc *softc) @@ -1352,6 +1382,685 @@ static void bnxt_verify_asym_queues(struct bnxt_softc *softc) softc->max_lltc = min(softc->max_lltc, lltc); } +static int bnxt_hwrm_poll(struct bnxt_softc *bp) +{ + struct hwrm_ver_get_output *resp = + (void *)bp->hwrm_cmd_resp.idi_vaddr; + struct hwrm_ver_get_input req = {0}; + int rc; + + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_VER_GET); + + req.hwrm_intf_maj = HWRM_VERSION_MAJOR; + req.hwrm_intf_min = HWRM_VERSION_MINOR; + req.hwrm_intf_upd = HWRM_VERSION_UPDATE; + + rc = _hwrm_send_message(bp, &req, sizeof(req)); + if (rc) + return rc; + + if (resp->flags & HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY) + rc = -EAGAIN; + + return rc; +} + +static void bnxt_rtnl_lock_sp(struct bnxt_softc *bp) +{ + /* We are called from bnxt_sp_task which has BNXT_STATE_IN_SP_TASK + * set. If the device is being closed, bnxt_close() may be holding + * rtnl() and waiting for BNXT_STATE_IN_SP_TASK to clear. So we + * must clear BNXT_STATE_IN_SP_TASK before holding rtnl(). + */ + clear_bit(BNXT_STATE_IN_SP_TASK, &bp->state); + rtnl_lock(); +} + +static void bnxt_rtnl_unlock_sp(struct bnxt_softc *bp) +{ + set_bit(BNXT_STATE_IN_SP_TASK, &bp->state); + rtnl_unlock(); +} + +static void bnxt_fw_fatal_close(struct bnxt_softc *softc) +{ + bnxt_disable_intr(softc->ctx); + if (pci_is_enabled(softc->pdev)) + pci_disable_device(softc->pdev); +} + +static u32 bnxt_fw_health_readl(struct bnxt_softc *bp, int reg_idx) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + u32 reg = fw_health->regs[reg_idx]; + u32 reg_type, reg_off, val = 0; + + reg_type = BNXT_FW_HEALTH_REG_TYPE(reg); + reg_off = BNXT_FW_HEALTH_REG_OFF(reg); + switch (reg_type) { + case BNXT_FW_HEALTH_REG_TYPE_CFG: + pci_read_config_dword(bp->pdev, reg_off, &val); + break; + case BNXT_FW_HEALTH_REG_TYPE_GRC: + reg_off = fw_health->mapped_regs[reg_idx]; + fallthrough; + case BNXT_FW_HEALTH_REG_TYPE_BAR0: + val = readl_fbsd(bp, reg_off, 0); + break; + case BNXT_FW_HEALTH_REG_TYPE_BAR1: + val = readl_fbsd(bp, reg_off, 2); + break; + } + if (reg_idx == BNXT_FW_RESET_INPROG_REG) + val &= fw_health->fw_reset_inprog_reg_mask; + return val; +} + +static void bnxt_fw_reset_close(struct bnxt_softc *bp) +{ + int i; + bnxt_ulp_stop(bp); + /* When firmware is in fatal state, quiesce device and disable + * bus master to prevent any potential bad DMAs before freeing + * kernel memory. + */ + if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state)) { + u16 val = 0; + + val = pci_read_config(bp->dev, PCI_SUBSYSTEM_ID, 2); + if (val == 0xffff) { + bp->fw_reset_min_dsecs = 0; + } + bnxt_fw_fatal_close(bp); + } + + iflib_request_reset(bp->ctx); + bnxt_stop(bp->ctx); + bnxt_hwrm_func_drv_unrgtr(bp, false); + + for (i = bp->nrxqsets-1; i>=0; i--) { + if (BNXT_CHIP_P5(bp)) + iflib_irq_free(bp->ctx, &bp->nq_rings[i].irq); + else + iflib_irq_free(bp->ctx, &bp->rx_cp_rings[i].irq); + + } + if (pci_is_enabled(bp->pdev)) + pci_disable_device(bp->pdev); + pci_disable_busmaster(bp->dev); + bnxt_free_ctx_mem(bp); +} + +static bool is_bnxt_fw_ok(struct bnxt_softc *bp) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + bool no_heartbeat = false, has_reset = false; + u32 val; + + val = bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG); + if (val == fw_health->last_fw_heartbeat) + no_heartbeat = true; + + val = bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG); + if (val != fw_health->last_fw_reset_cnt) + has_reset = true; + + if (!no_heartbeat && has_reset) + return true; + + return false; +} + +void bnxt_fw_reset(struct bnxt_softc *bp) +{ + bnxt_rtnl_lock_sp(bp); + if (test_bit(BNXT_STATE_OPEN, &bp->state) && + !test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) { + int tmo; + set_bit(BNXT_STATE_IN_FW_RESET, &bp->state); + bnxt_fw_reset_close(bp); + + if ((bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD)) { + bp->fw_reset_state = BNXT_FW_RESET_STATE_POLL_FW_DOWN; + tmo = HZ / 10; + } else { + bp->fw_reset_state = BNXT_FW_RESET_STATE_ENABLE_DEV; + tmo = bp->fw_reset_min_dsecs * HZ /10; + } + bnxt_queue_fw_reset_work(bp, tmo); + } + bnxt_rtnl_unlock_sp(bp); +} + +static void bnxt_queue_fw_reset_work(struct bnxt_softc *bp, unsigned long delay) +{ + if (!(test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))) + return; + + if (BNXT_PF(bp)) + queue_delayed_work(bnxt_pf_wq, &bp->fw_reset_task, delay); + else + schedule_delayed_work(&bp->fw_reset_task, delay); +} + +void bnxt_queue_sp_work(struct bnxt_softc *bp) +{ + if (BNXT_PF(bp)) + queue_work(bnxt_pf_wq, &bp->sp_task); + else + schedule_work(&bp->sp_task); +} + +static void bnxt_fw_reset_writel(struct bnxt_softc *bp, int reg_idx) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + u32 reg = fw_health->fw_reset_seq_regs[reg_idx]; + u32 val = fw_health->fw_reset_seq_vals[reg_idx]; + u32 reg_type, reg_off, delay_msecs; + + delay_msecs = fw_health->fw_reset_seq_delay_msec[reg_idx]; + reg_type = BNXT_FW_HEALTH_REG_TYPE(reg); + reg_off = BNXT_FW_HEALTH_REG_OFF(reg); + switch (reg_type) { + case BNXT_FW_HEALTH_REG_TYPE_CFG: + pci_write_config_dword(bp->pdev, reg_off, val); + break; + case BNXT_FW_HEALTH_REG_TYPE_GRC: + writel_fbsd(bp, BNXT_GRCPF_REG_WINDOW_BASE_OUT + 4, 0, reg_off & BNXT_GRC_BASE_MASK); + reg_off = (reg_off & BNXT_GRC_OFFSET_MASK) + 0x2000; + fallthrough; + case BNXT_FW_HEALTH_REG_TYPE_BAR0: + writel_fbsd(bp, reg_off, 0, val); + break; + case BNXT_FW_HEALTH_REG_TYPE_BAR1: + writel_fbsd(bp, reg_off, 2, val); + break; + } + if (delay_msecs) { + pci_read_config_dword(bp->pdev, 0, &val); + msleep(delay_msecs); + } +} + +static void bnxt_reset_all(struct bnxt_softc *bp) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + int i, rc; + + if (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD) { + bp->fw_reset_timestamp = jiffies; + return; + } + + if (fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST) { + for (i = 0; i < fw_health->fw_reset_seq_cnt; i++) + bnxt_fw_reset_writel(bp, i); + } else if (fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU) { + struct hwrm_fw_reset_input req = {0}; + + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FW_RESET); + req.target_id = htole16(HWRM_TARGET_ID_KONG); + req.embedded_proc_type = HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP; + req.selfrst_status = HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP; + req.flags = HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL; + rc = hwrm_send_message(bp, &req, sizeof(req)); + + if (rc != -ENODEV) + device_printf(bp->dev, "Unable to reset FW rc=%d\n", rc); + } + bp->fw_reset_timestamp = jiffies; +} + +static int __bnxt_alloc_fw_health(struct bnxt_softc *bp) +{ + if (bp->fw_health) + return 0; + + bp->fw_health = kzalloc(sizeof(*bp->fw_health), GFP_KERNEL); + if (!bp->fw_health) + return -ENOMEM; + + mutex_init(&bp->fw_health->lock); + return 0; +} + +static int bnxt_alloc_fw_health(struct bnxt_softc *bp) +{ + int rc; + + if (!(bp->fw_cap & BNXT_FW_CAP_HOT_RESET) && + !(bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY)) + return 0; + + rc = __bnxt_alloc_fw_health(bp); + if (rc) { + bp->fw_cap &= ~BNXT_FW_CAP_HOT_RESET; + bp->fw_cap &= ~BNXT_FW_CAP_ERROR_RECOVERY; + return rc; + } + + return 0; +} + +static inline void __bnxt_map_fw_health_reg(struct bnxt_softc *bp, u32 reg) +{ + writel_fbsd(bp, BNXT_GRCPF_REG_WINDOW_BASE_OUT + BNXT_FW_HEALTH_WIN_MAP_OFF, 0, reg & BNXT_GRC_BASE_MASK); +} + +static int bnxt_map_fw_health_regs(struct bnxt_softc *bp) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + u32 reg_base = 0xffffffff; + int i; + + bp->fw_health->status_reliable = false; + bp->fw_health->resets_reliable = false; + /* Only pre-map the monitoring GRC registers using window 3 */ + for (i = 0; i < 4; i++) { + u32 reg = fw_health->regs[i]; + + if (BNXT_FW_HEALTH_REG_TYPE(reg) != BNXT_FW_HEALTH_REG_TYPE_GRC) + continue; + if (reg_base == 0xffffffff) + reg_base = reg & BNXT_GRC_BASE_MASK; + if ((reg & BNXT_GRC_BASE_MASK) != reg_base) + return -ERANGE; + fw_health->mapped_regs[i] = BNXT_FW_HEALTH_WIN_OFF(reg); + } + bp->fw_health->status_reliable = true; + bp->fw_health->resets_reliable = true; + if (reg_base == 0xffffffff) + return 0; + + __bnxt_map_fw_health_reg(bp, reg_base); + return 0; +} + +static void bnxt_inv_fw_health_reg(struct bnxt_softc *bp) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + u32 reg_type; + + if (!fw_health) + return; + + reg_type = BNXT_FW_HEALTH_REG_TYPE(fw_health->regs[BNXT_FW_HEALTH_REG]); + if (reg_type == BNXT_FW_HEALTH_REG_TYPE_GRC) + fw_health->status_reliable = false; + + reg_type = BNXT_FW_HEALTH_REG_TYPE(fw_health->regs[BNXT_FW_RESET_CNT_REG]); + if (reg_type == BNXT_FW_HEALTH_REG_TYPE_GRC) + fw_health->resets_reliable = false; +} + +static int bnxt_hwrm_error_recovery_qcfg(struct bnxt_softc *bp) +{ + struct bnxt_fw_health *fw_health = bp->fw_health; + struct hwrm_error_recovery_qcfg_output *resp = + (void *)bp->hwrm_cmd_resp.idi_vaddr; + struct hwrm_error_recovery_qcfg_input req = {0}; + int rc, i; + + if (!(bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY)) + return 0; + + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_ERROR_RECOVERY_QCFG); + rc = _hwrm_send_message(bp, &req, sizeof(req)); + + if (rc) + goto err_recovery_out; + fw_health->flags = le32toh(resp->flags); + if ((fw_health->flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU) && + !(bp->fw_cap & BNXT_FW_CAP_KONG_MB_CHNL)) { + rc = -EINVAL; + goto err_recovery_out; + } + fw_health->polling_dsecs = le32toh(resp->driver_polling_freq); + fw_health->master_func_wait_dsecs = + le32toh(resp->master_func_wait_period); + fw_health->normal_func_wait_dsecs = + le32toh(resp->normal_func_wait_period); + fw_health->post_reset_wait_dsecs = + le32toh(resp->master_func_wait_period_after_reset); + fw_health->post_reset_max_wait_dsecs = + le32toh(resp->max_bailout_time_after_reset); + fw_health->regs[BNXT_FW_HEALTH_REG] = + le32toh(resp->fw_health_status_reg); + fw_health->regs[BNXT_FW_HEARTBEAT_REG] = + le32toh(resp->fw_heartbeat_reg); + fw_health->regs[BNXT_FW_RESET_CNT_REG] = + le32toh(resp->fw_reset_cnt_reg); + fw_health->regs[BNXT_FW_RESET_INPROG_REG] = + le32toh(resp->reset_inprogress_reg); + fw_health->fw_reset_inprog_reg_mask = + le32toh(resp->reset_inprogress_reg_mask); + fw_health->fw_reset_seq_cnt = resp->reg_array_cnt; + if (fw_health->fw_reset_seq_cnt >= 16) { *** 533 LINES SKIPPED *** From nobody Mon Jun 3 19:25:05 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 4VtNwM0xl0z5JsJs; Mon, 03 Jun 2024 19:25:07 +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 4VtNwL6LYdz4VjM; Mon, 3 Jun 2024 19:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442706; 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=cMv940iSXhBBzDg+S1Doq1CmVm+IE7INzonKYusc2kQ=; b=fb5LQGoNX8cbBzYA9asHM9cVEQl11gFfmDI2kdXxxAM5oqfP2xE2v1JcKVOQHxNCh6Rskj VhGwatWr/OaeZsM+yXmF6vj6mcaTAddxeuid/keZp0Hhy0T0zPQCpN4dQsePPiZI8tfn9C b6Bg+gksFiZtsm2jFHEsjEjIk/YVuoks6f8Pu5cNdIvh0gJJpVxbTnyqxxZ3SHHVFEGg0e KpAkWAutHK1hScaM96bGZoCTT6wMqpUXKmgtTVNmd6AciuY9hxiU3QnpTwsaCuYflMjUEW Nsl7KcI4QwoOeEry7yGuQ3OrcWd1F3vM6CHQP4mvBs6uYi+3usX7O6/A4lMOCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442706; a=rsa-sha256; cv=none; b=CadCCaP9/CgQE5efzyjRP+iHpUl8FvMHVNaa2EPQrxmamiietX0JHKd/Kxm7LqWEHSkR22 mdH8pT1hlomkbNkXSvyUGMa/RiZk8nhxj/ICyGwk0XOzTXWL7q3nAHDXXcgmsg6MwTP7mL w7SrHN9IRo6tkDuptoHF3MzriwOWSPuW2TZ+jYJx78IneN1HrZIOcFba/NRozfN2txyekN rQkPOSR67G1jvETz3lP9/WADXdy+zvZVVr7V6TpY+JYpzHEXMYF9KPmnspYBbhuEztSNfl VTeUVoL6tvWH8iaEVFB3nOM2CDG6TcSU0+jDSJp0MTEWMs5SwGGgxntjl4o2vA== 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=1717442706; 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=cMv940iSXhBBzDg+S1Doq1CmVm+IE7INzonKYusc2kQ=; b=fZZLdNuqe/cGLPLHYJFIJX8vrnEW3WhjLJOZMFPG0ONaOuUSxfKn2BGZr+Y23HtsgCXZCX rQ6cdetUvdpqkMnJpC9qn/Y+7wqpBB32QyBVhq5izmQqXAQxd9L3N2A6Kk0H+Ru5WmGwEO soL/EG5nre2HSpqwwMdYrs3ecdX9fnqYQ7lzFFbjl+//BX3WMAzHvaemQPwcZKvyNmDfzR waGamxBkNAR6gIuXlnY+l7bZeNT8+fOYA4ws2Bewx0KfNsJi+5PgDiuSqyhx1HHjbjGpvz 3YGCCiVRkzrTda456o3x3CpT6vGWMQbfv6GtqcqD014IMI26EtrSh1ibI6uq3A== 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 4VtNwL5yG2znRG; Mon, 3 Jun 2024 19:25:06 +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 453JP6NF068098; Mon, 3 Jun 2024 19:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP5ax068095; Mon, 3 Jun 2024 19:25:05 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:05 GMT Message-Id: <202406031925.453JP5ax068095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7f352c7d5f09 - stable/14 - bnxt_en: Firmware header version update to 1.10.3.42 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f352c7d5f0945c17a5f507285e3eaf891b668e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7f352c7d5f0945c17a5f507285e3eaf891b668e4 commit 7f352c7d5f0945c17a5f507285e3eaf891b668e4 Author: Chandrakanth patil AuthorDate: 2024-04-27 18:23:05 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 bnxt_en: Firmware header version update to 1.10.3.42 This file is automatically generated from the firmware code to export the driver interfaces. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45009 (cherry picked from commit 3d8bbe001115f3e9742c128716335e654729ce1a) --- sys/dev/bnxt/bnxt_en/bnxt.h | 2 +- sys/dev/bnxt/bnxt_en/hsi_struct_def.h | 69997 +++++++++++++++++++------------- 2 files changed, 41564 insertions(+), 28435 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index 2faea00e4266..cf4f99077b58 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -771,7 +771,7 @@ struct bnxt_ctx_mem_type { #define BNXT_CTX_CQDBS HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ_DB_SHADOW #define BNXT_CTX_QTKC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_TKC #define BNXT_CTX_QRKC HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_RKC -#define BNXT_CTX_MAX (BNXT_CTX_QRKC + 1) +#define BNXT_CTX_MAX (BNXT_CTX_TIM + 1) struct bnxt_ctx_mem_info { u8 tqm_fp_rings_count; diff --git a/sys/dev/bnxt/bnxt_en/hsi_struct_def.h b/sys/dev/bnxt/bnxt_en/hsi_struct_def.h index 4aec765e1b26..baecfc8f659c 100644 --- a/sys/dev/bnxt/bnxt_en/hsi_struct_def.h +++ b/sys/dev/bnxt/bnxt_en/hsi_struct_def.h @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2016 Broadcom, All Rights Reserved. + * Copyright (c) 2024 Broadcom, All Rights Reserved. * The term Broadcom refers to Broadcom Limited and/or its subsidiaries * * Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); /* - * Copyright(c) 2001-2023, Broadcom. All rights reserved. The + * Copyright(c) 2001-2024, Broadcom. All rights reserved. The * term Broadcom refers to Broadcom Inc. and/or its subsidiaries. * Proprietary and Confidential Information. * @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #ifndef _HSI_STRUCT_DEF_H_ #define _HSI_STRUCT_DEF_H_ +#if defined(HAVE_STDINT_H) +#include +#endif + /* This is the HWRM command header. */ /* hwrm_cmd_hdr (size:128b/16B) */ @@ -76,7 +80,7 @@ typedef struct hwrm_cmd_hdr { * physical address (HPA) or a guest physical address (GPA) and must * point to a physically contiguous block of memory. */ - uint64_t resp_addr; + uint64_t resp_addr; } hwrm_cmd_hdr_t, *phwrm_cmd_hdr_t; /* This is the HWRM response header. */ @@ -111,6 +115,10 @@ typedef struct hwrm_resp_hdr { #define TLV_TYPE_QUERY_ROCE_CC_GEN1 UINT32_C(0x4) /* RoCE slow path command to modify CC Gen1 support. */ #define TLV_TYPE_MODIFY_ROCE_CC_GEN1 UINT32_C(0x5) +/* RoCE slow path command to query CC Gen2 support. */ +#define TLV_TYPE_QUERY_ROCE_CC_GEN2 UINT32_C(0x6) +/* RoCE slow path command to modify CC Gen2 support. */ +#define TLV_TYPE_MODIFY_ROCE_CC_GEN2 UINT32_C(0x7) /* Engine CKV - The Alias key EC curve and ECC public key information. */ #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001) /* Engine CKV - Initialization vector. */ @@ -193,14 +201,14 @@ typedef struct tlv { typedef struct input { /* - * This value indicates what type of request this is. The format + * This value indicates what type of request this is. The format * for the rest of the command is determined by this field. */ uint16_t req_type; /* * This value indicates the what completion ring the request will - * be optionally completed on. If the value is -1, then no - * CR completion will be generated. Any other value must be a + * be optionally completed on. If the value is -1, then no + * CR completion will be generated. Any other value must be a * valid CR ring_id value for this function. */ uint16_t cmpl_ring; @@ -216,7 +224,7 @@ typedef struct input { uint16_t target_id; /* * This is the host address where the response will be written - * when the request is complete. This area must be 16B aligned + * when the request is complete. This area must be 16B aligned * and must be cleared to zero before the request is made. */ uint64_t resp_addr; @@ -238,7 +246,7 @@ typedef struct output { /* This field provides original sequence number of the command. */ uint16_t seq_id; /* - * This field is the length of the response in bytes. The + * This field is the length of the response in bytes. The * last byte of the response is a valid flag that will read * as '1' when the command has been completely written to * memory. @@ -374,6 +382,14 @@ typedef struct hwrm_short_input { ((x) == 0x85 ? "HWRM_QUEUE_VLANPRI2PRI_CFG": \ ((x) == 0x86 ? "HWRM_QUEUE_GLOBAL_CFG": \ ((x) == 0x87 ? "HWRM_QUEUE_GLOBAL_QCFG": \ + ((x) == 0x88 ? "HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG": \ + ((x) == 0x89 ? "HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG": \ + ((x) == 0x8a ? "HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG": \ + ((x) == 0x8b ? "HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG": \ + ((x) == 0x8c ? "HWRM_QUEUE_QCAPS": \ + ((x) == 0x8d ? "HWRM_QUEUE_ADPTV_QOS_RX_TUNING_QCFG": \ + ((x) == 0x8e ? "HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG": \ + ((x) == 0x8f ? "HWRM_QUEUE_ADPTV_QOS_TX_TUNING_QCFG": \ ((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \ ((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \ ((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \ @@ -392,6 +408,7 @@ typedef struct hwrm_short_input { ((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \ ((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \ ((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \ + ((x) == 0xa3 ? "HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG": \ ((x) == 0xaf ? "HWRM_STAT_CTX_ENG_QUERY": \ ((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \ ((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \ @@ -439,6 +456,7 @@ typedef struct hwrm_short_input { ((x) == 0xdb ? "HWRM_PORT_EP_TX_CFG": \ ((x) == 0xdc ? "HWRM_PORT_CFG": \ ((x) == 0xdd ? "HWRM_PORT_QCFG": \ + ((x) == 0xdf ? "HWRM_PORT_MAC_QCAPS": \ ((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \ ((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \ ((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \ @@ -456,7 +474,7 @@ typedef struct hwrm_short_input { ((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \ ((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \ ((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \ - "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x180) ? \ ((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \ ((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \ @@ -500,6 +518,7 @@ typedef struct hwrm_short_input { ((x) == 0x127 ? "HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR": \ ((x) == 0x128 ? "HWRM_CFA_TLS_FILTER_ALLOC": \ ((x) == 0x129 ? "HWRM_CFA_TLS_FILTER_FREE": \ + ((x) == 0x12a ? "HWRM_CFA_RELEASE_AFM_FUNC": \ ((x) == 0x12e ? "HWRM_ENGINE_CKV_STATUS": \ ((x) == 0x12f ? "HWRM_ENGINE_CKV_CKEK_ADD": \ ((x) == 0x130 ? "HWRM_ENGINE_CKV_CKEK_DELETE": \ @@ -539,7 +558,7 @@ typedef struct hwrm_short_input { ((x) == 0x163 ? "HWRM_ENGINE_NQ_FREE": \ ((x) == 0x164 ? "HWRM_ENGINE_ON_DIE_RQE_CREDITS": \ ((x) == 0x165 ? "HWRM_ENGINE_FUNC_QCFG": \ - "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x200) ? \ ((x) == 0x190 ? "HWRM_FUNC_RESOURCE_QCAPS": \ ((x) == 0x191 ? "HWRM_FUNC_VF_RESOURCE_CFG": \ @@ -570,7 +589,14 @@ typedef struct hwrm_short_input { ((x) == 0x1aa ? "HWRM_FUNC_DBR_RECOVERY_COMPLETED": \ ((x) == 0x1ab ? "HWRM_FUNC_SYNCE_CFG": \ ((x) == 0x1ac ? "HWRM_FUNC_SYNCE_QCFG": \ - "Unknown decode" ))))))))))))))))))))))))))))) : \ + ((x) == 0x1ad ? "HWRM_FUNC_KEY_CTX_FREE": \ + ((x) == 0x1ae ? "HWRM_FUNC_LAG_MODE_CFG": \ + ((x) == 0x1af ? "HWRM_FUNC_LAG_MODE_QCFG": \ + ((x) == 0x1b0 ? "HWRM_FUNC_LAG_CREATE": \ + ((x) == 0x1b1 ? "HWRM_FUNC_LAG_UPDATE": \ + ((x) == 0x1b2 ? "HWRM_FUNC_LAG_FREE": \ + ((x) == 0x1b3 ? "HWRM_FUNC_LAG_QCFG": \ + "Unknown decode" )))))))))))))))))))))))))))))))))))) : \ (((x) < 0x280) ? \ ((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \ ((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \ @@ -586,9 +612,9 @@ typedef struct hwrm_short_input { ((x) == 0x20b ? "HWRM_MFG_FRU_EEPROM_READ": \ ((x) == 0x20c ? "HWRM_MFG_SOC_IMAGE": \ ((x) == 0x20d ? "HWRM_MFG_SOC_QSTATUS": \ - ((x) == 0x20e ? "HWRM_MFG_PARAM_SEEPROM_SYNC": \ - ((x) == 0x20f ? "HWRM_MFG_PARAM_SEEPROM_READ": \ - ((x) == 0x210 ? "HWRM_MFG_PARAM_SEEPROM_HEALTH": \ + ((x) == 0x20e ? "HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE": \ + ((x) == 0x20f ? "HWRM_MFG_PARAM_CRITICAL_DATA_READ": \ + ((x) == 0x210 ? "HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH": \ ((x) == 0x211 ? "HWRM_MFG_PRVSN_EXPORT_CSR": \ ((x) == 0x212 ? "HWRM_MFG_PRVSN_IMPORT_CERT": \ ((x) == 0x213 ? "HWRM_MFG_PRVSN_GET_STATE": \ @@ -597,12 +623,22 @@ typedef struct hwrm_short_input { ((x) == 0x216 ? "HWRM_MFG_SELFTEST_QLIST": \ ((x) == 0x217 ? "HWRM_MFG_SELFTEST_EXEC": \ ((x) == 0x218 ? "HWRM_STAT_GENERIC_QSTATS": \ - "Unknown decode" ))))))))))))))))))))))))) : \ + ((x) == 0x219 ? "HWRM_MFG_PRVSN_EXPORT_CERT": \ + ((x) == 0x21a ? "HWRM_STAT_DB_ERROR_QSTATS": \ + ((x) == 0x258 ? "HWRM_UDCC_QCAPS": \ + ((x) == 0x259 ? "HWRM_UDCC_CFG": \ + ((x) == 0x25a ? "HWRM_UDCC_QCFG": \ + ((x) == 0x25b ? "HWRM_UDCC_SESSION_CFG": \ + ((x) == 0x25c ? "HWRM_UDCC_SESSION_QCFG": \ + ((x) == 0x25d ? "HWRM_UDCC_SESSION_QUERY": \ + ((x) == 0x25e ? "HWRM_UDCC_COMP_CFG": \ + ((x) == 0x25f ? "HWRM_UDCC_COMP_QCFG": \ + ((x) == 0x260 ? "HWRM_UDCC_COMP_QUERY": \ + "Unknown decode" )))))))))))))))))))))))))))))))))))) : \ (((x) < 0x300) ? \ ((x) == 0x2bc ? "HWRM_TF": \ ((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \ ((x) == 0x2c6 ? "HWRM_TF_SESSION_OPEN": \ - ((x) == 0x2c7 ? "HWRM_TF_SESSION_ATTACH": \ ((x) == 0x2c8 ? "HWRM_TF_SESSION_REGISTER": \ ((x) == 0x2c9 ? "HWRM_TF_SESSION_UNREGISTER": \ ((x) == 0x2ca ? "HWRM_TF_SESSION_CLOSE": \ @@ -617,14 +653,6 @@ typedef struct hwrm_short_input { ((x) == 0x2da ? "HWRM_TF_TBL_TYPE_GET": \ ((x) == 0x2db ? "HWRM_TF_TBL_TYPE_SET": \ ((x) == 0x2dc ? "HWRM_TF_TBL_TYPE_BULK_GET": \ - ((x) == 0x2e2 ? "HWRM_TF_CTXT_MEM_ALLOC": \ - ((x) == 0x2e3 ? "HWRM_TF_CTXT_MEM_FREE": \ - ((x) == 0x2e4 ? "HWRM_TF_CTXT_MEM_RGTR": \ - ((x) == 0x2e5 ? "HWRM_TF_CTXT_MEM_UNRGTR": \ - ((x) == 0x2e6 ? "HWRM_TF_EXT_EM_QCAPS": \ - ((x) == 0x2e7 ? "HWRM_TF_EXT_EM_OP": \ - ((x) == 0x2e8 ? "HWRM_TF_EXT_EM_CFG": \ - ((x) == 0x2e9 ? "HWRM_TF_EXT_EM_QCFG": \ ((x) == 0x2ea ? "HWRM_TF_EM_INSERT": \ ((x) == 0x2eb ? "HWRM_TF_EM_DELETE": \ ((x) == 0x2ec ? "HWRM_TF_EM_HASH_INSERT": \ @@ -637,7 +665,13 @@ typedef struct hwrm_short_input { ((x) == 0x2fd ? "HWRM_TF_GLOBAL_CFG_GET": \ ((x) == 0x2fe ? "HWRM_TF_IF_TBL_SET": \ ((x) == 0x2ff ? "HWRM_TF_IF_TBL_GET": \ - "Unknown decode" )))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" ))))))))))))))))))))))))))))) : \ + (((x) < 0x380) ? \ + ((x) == 0x300 ? "HWRM_TF_RESC_USAGE_SET": \ + ((x) == 0x301 ? "HWRM_TF_RESC_USAGE_QUERY": \ + ((x) == 0x302 ? "HWRM_TF_TBL_TYPE_ALLOC": \ + ((x) == 0x303 ? "HWRM_TF_TBL_TYPE_FREE": \ + "Unknown decode" )))) : \ (((x) < 0x400) ? \ ((x) == 0x380 ? "HWRM_TFC_TBL_SCOPE_QCAPS": \ ((x) == 0x381 ? "HWRM_TFC_TBL_SCOPE_ID_ALLOC": \ @@ -663,11 +697,19 @@ typedef struct hwrm_short_input { ((x) == 0x395 ? "HWRM_TFC_TCAM_ALLOC": \ ((x) == 0x396 ? "HWRM_TFC_TCAM_ALLOC_SET": \ ((x) == 0x397 ? "HWRM_TFC_TCAM_FREE": \ - "Unknown decode" )))))))))))))))))))))))) : \ + ((x) == 0x398 ? "HWRM_TFC_IF_TBL_SET": \ + ((x) == 0x399 ? "HWRM_TFC_IF_TBL_GET": \ + ((x) == 0x39a ? "HWRM_TFC_TBL_SCOPE_CONFIG_GET": \ + ((x) == 0x39b ? "HWRM_TFC_RESC_USAGE_QUERY": \ + ((x) == 0x39c ? "HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS": \ + ((x) == 0x39d ? "HWRM_QUEUE_PFCWD_TIMEOUT_CFG": \ + ((x) == 0x39e ? "HWRM_QUEUE_PFCWD_TIMEOUT_QCFG": \ + "Unknown decode" ))))))))))))))))))))))))))))))) : \ (((x) < 0x480) ? \ ((x) == 0x400 ? "HWRM_SV": \ "Unknown decode" ) : \ (((x) < 0xff80) ? \ + ((x) == 0xff0f ? "HWRM_DBG_LOG_BUFFER_FLUSH": \ ((x) == 0xff10 ? "HWRM_DBG_READ_DIRECT": \ ((x) == 0xff11 ? "HWRM_DBG_READ_INDIRECT": \ ((x) == 0xff12 ? "HWRM_DBG_WRITE_DIRECT": \ @@ -696,8 +738,10 @@ typedef struct hwrm_short_input { ((x) == 0xff29 ? "HWRM_DBG_USEQ_RUN": \ ((x) == 0xff2a ? "HWRM_DBG_USEQ_DELIVERY_REQ": \ ((x) == 0xff2b ? "HWRM_DBG_USEQ_RESP_HDR": \ - "Unknown decode" )))))))))))))))))))))))))))) : \ + "Unknown decode" ))))))))))))))))))))))))))))) : \ (((x) <= 0xffff) ? \ + ((x) == 0xffea ? "HWRM_NVM_GET_VPD_FIELD_INFO": \ + ((x) == 0xffeb ? "HWRM_NVM_SET_VPD_FIELD_INFO": \ ((x) == 0xffec ? "HWRM_NVM_DEFRAG": \ ((x) == 0xffed ? "HWRM_NVM_REQ_ARBITRATION": \ ((x) == 0xffee ? "HWRM_NVM_FACTORY_DEFAULTS": \ @@ -718,8 +762,8 @@ typedef struct hwrm_short_input { ((x) == 0xfffd ? "HWRM_NVM_READ": \ ((x) == 0xfffe ? "HWRM_NVM_WRITE": \ ((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \ - "Unknown decode" )))))))))))))))))))) : \ - "Unknown decode" )))))))))) + "Unknown decode" )))))))))))))))))))))) : \ + "Unknown decode" ))))))))))) /* @@ -800,7 +844,7 @@ typedef struct cmd_nums { #define HWRM_FUNC_VLAN_QCFG UINT32_C(0x34) #define HWRM_QUEUE_PFCENABLE_QCFG UINT32_C(0x35) #define HWRM_QUEUE_PFCENABLE_CFG UINT32_C(0x36) - #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) + #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) #define HWRM_QUEUE_PRI2COS_CFG UINT32_C(0x38) #define HWRM_QUEUE_COS2BW_QCFG UINT32_C(0x39) #define HWRM_QUEUE_COS2BW_CFG UINT32_C(0x3a) @@ -848,6 +892,14 @@ typedef struct cmd_nums { #define HWRM_QUEUE_VLANPRI2PRI_CFG UINT32_C(0x85) #define HWRM_QUEUE_GLOBAL_CFG UINT32_C(0x86) #define HWRM_QUEUE_GLOBAL_QCFG UINT32_C(0x87) + #define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG UINT32_C(0x88) + #define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG UINT32_C(0x89) + #define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG UINT32_C(0x8a) + #define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG UINT32_C(0x8b) + #define HWRM_QUEUE_QCAPS UINT32_C(0x8c) + #define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_QCFG UINT32_C(0x8d) + #define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG UINT32_C(0x8e) + #define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_QCFG UINT32_C(0x8f) #define HWRM_CFA_L2_FILTER_ALLOC UINT32_C(0x90) #define HWRM_CFA_L2_FILTER_FREE UINT32_C(0x91) #define HWRM_CFA_L2_FILTER_CFG UINT32_C(0x92) @@ -871,6 +923,7 @@ typedef struct cmd_nums { #define HWRM_TUNNEL_DST_PORT_QUERY UINT32_C(0xa0) #define HWRM_TUNNEL_DST_PORT_ALLOC UINT32_C(0xa1) #define HWRM_TUNNEL_DST_PORT_FREE UINT32_C(0xa2) + #define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG UINT32_C(0xa3) #define HWRM_STAT_CTX_ENG_QUERY UINT32_C(0xaf) #define HWRM_STAT_CTX_ALLOC UINT32_C(0xb0) #define HWRM_STAT_CTX_FREE UINT32_C(0xb1) @@ -926,6 +979,8 @@ typedef struct cmd_nums { #define HWRM_PORT_EP_TX_CFG UINT32_C(0xdb) #define HWRM_PORT_CFG UINT32_C(0xdc) #define HWRM_PORT_QCFG UINT32_C(0xdd) + /* Queries MAC capabilities for the specified port */ + #define HWRM_PORT_MAC_QCAPS UINT32_C(0xdf) #define HWRM_TEMP_MONITOR_QUERY UINT32_C(0xe0) #define HWRM_REG_POWER_QUERY UINT32_C(0xe1) #define HWRM_CORE_FREQUENCY_QUERY UINT32_C(0xe2) @@ -1029,7 +1084,12 @@ typedef struct cmd_nums { #define HWRM_CFA_TLS_FILTER_ALLOC UINT32_C(0x128) /* Experimental */ #define HWRM_CFA_TLS_FILTER_FREE UINT32_C(0x129) - /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */ + /* Release an AFM function for TF control */ + #define HWRM_CFA_RELEASE_AFM_FUNC UINT32_C(0x12a) + /* + * Engine CKV - Get the current allocation status of keys provisioned in + * the key vault. + */ #define HWRM_ENGINE_CKV_STATUS UINT32_C(0x12e) /* Engine CKV - Add a new CKEK used to encrypt keys. */ #define HWRM_ENGINE_CKV_CKEK_ADD UINT32_C(0x12f) @@ -1089,7 +1149,10 @@ typedef struct cmd_nums { #define HWRM_ENGINE_STATS_CLEAR UINT32_C(0x156) /* Engine - Query the statistics accumulator for an Engine. */ #define HWRM_ENGINE_STATS_QUERY UINT32_C(0x157) - /* Engine - Query statistics counters for continuous errors from all CDDIP Engines. */ + /* + * Engine - Query statistics counters for continuous errors from all CDDIP + * Engines. + */ #define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR UINT32_C(0x158) /* Engine - Allocate an Engine RQ. */ #define HWRM_ENGINE_RQ_ALLOC UINT32_C(0x15e) @@ -1171,6 +1234,20 @@ typedef struct cmd_nums { #define HWRM_FUNC_SYNCE_CFG UINT32_C(0x1ab) /* Queries SyncE configurations. */ #define HWRM_FUNC_SYNCE_QCFG UINT32_C(0x1ac) + /* The command is used to deallocate KTLS or QUIC key contexts. */ + #define HWRM_FUNC_KEY_CTX_FREE UINT32_C(0x1ad) + /* The command is used to configure link aggr group mode. */ + #define HWRM_FUNC_LAG_MODE_CFG UINT32_C(0x1ae) + /* The command is used to query link aggr group mode. */ + #define HWRM_FUNC_LAG_MODE_QCFG UINT32_C(0x1af) + /* The command is used to create a link aggr group. */ + #define HWRM_FUNC_LAG_CREATE UINT32_C(0x1b0) + /* The command is used to update a link aggr group. */ + #define HWRM_FUNC_LAG_UPDATE UINT32_C(0x1b1) + /* The command is used to free a link aggr group. */ + #define HWRM_FUNC_LAG_FREE UINT32_C(0x1b2) + /* The command is used to query a link aggr group. */ + #define HWRM_FUNC_LAG_QCFG UINT32_C(0x1b3) /* Experimental */ #define HWRM_SELFTEST_QLIST UINT32_C(0x200) /* Experimental */ @@ -1202,12 +1279,12 @@ typedef struct cmd_nums { #define HWRM_MFG_SOC_IMAGE UINT32_C(0x20c) /* Retrieves the SoC status and image provisioning information */ #define HWRM_MFG_SOC_QSTATUS UINT32_C(0x20d) - /* Tells the fw to program the seeprom memory */ - #define HWRM_MFG_PARAM_SEEPROM_SYNC UINT32_C(0x20e) - /* Tells the fw to read the seeprom memory */ - #define HWRM_MFG_PARAM_SEEPROM_READ UINT32_C(0x20f) - /* Tells the fw to get the health of seeprom data */ - #define HWRM_MFG_PARAM_SEEPROM_HEALTH UINT32_C(0x210) + /* Tells the fw to finalize the critical data (store and lock it) */ + #define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE UINT32_C(0x20e) + /* Tells the fw to read the critical data */ + #define HWRM_MFG_PARAM_CRITICAL_DATA_READ UINT32_C(0x20f) + /* Tells the fw to get the health of critical data */ + #define HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH UINT32_C(0x210) /* * The command is used for certificate provisioning to export a * Certificate Signing Request (CSR) from the device. @@ -1242,6 +1319,37 @@ typedef struct cmd_nums { #define HWRM_MFG_SELFTEST_EXEC UINT32_C(0x217) /* Queries the generic stats */ #define HWRM_STAT_GENERIC_QSTATS UINT32_C(0x218) + /* + * The command is used for certificate provisioning to export a + * certificate chain from the device. + */ + #define HWRM_MFG_PRVSN_EXPORT_CERT UINT32_C(0x219) + /* Query the statistics for doorbell drops due to various error conditions. */ + #define HWRM_STAT_DB_ERROR_QSTATS UINT32_C(0x21a) + /* + * This command returns the capabilities related to User Defined + * Congestion Control on a function. + */ + #define HWRM_UDCC_QCAPS UINT32_C(0x258) + /* This command configures User Defined Congestion Control on a function. */ + #define HWRM_UDCC_CFG UINT32_C(0x259) + /* + * This command queries the configuration of User Defined Congestion + * Control on a function. + */ + #define HWRM_UDCC_QCFG UINT32_C(0x25a) + /* This command configures an existing UDCC session. */ + #define HWRM_UDCC_SESSION_CFG UINT32_C(0x25b) + /* This command queries the configuration of a UDCC session. */ + #define HWRM_UDCC_SESSION_QCFG UINT32_C(0x25c) + /* This command queries the UDCC session. */ + #define HWRM_UDCC_SESSION_QUERY UINT32_C(0x25d) + /* This command configures the computation unit. */ + #define HWRM_UDCC_COMP_CFG UINT32_C(0x25e) + /* This command queries the configuration of the computation unit. */ + #define HWRM_UDCC_COMP_QCFG UINT32_C(0x25f) + /* This command queries the status and statistics of the computation unit. */ + #define HWRM_UDCC_COMP_QUERY UINT32_C(0x260) /* Experimental */ #define HWRM_TF UINT32_C(0x2bc) /* Experimental */ @@ -1249,8 +1357,6 @@ typedef struct cmd_nums { /* Experimental */ #define HWRM_TF_SESSION_OPEN UINT32_C(0x2c6) /* Experimental */ - #define HWRM_TF_SESSION_ATTACH UINT32_C(0x2c7) - /* Experimental */ #define HWRM_TF_SESSION_REGISTER UINT32_C(0x2c8) /* Experimental */ #define HWRM_TF_SESSION_UNREGISTER UINT32_C(0x2c9) @@ -1279,22 +1385,6 @@ typedef struct cmd_nums { /* Experimental */ #define HWRM_TF_TBL_TYPE_BULK_GET UINT32_C(0x2dc) /* Experimental */ - #define HWRM_TF_CTXT_MEM_ALLOC UINT32_C(0x2e2) - /* Experimental */ - #define HWRM_TF_CTXT_MEM_FREE UINT32_C(0x2e3) - /* Experimental */ - #define HWRM_TF_CTXT_MEM_RGTR UINT32_C(0x2e4) - /* Experimental */ - #define HWRM_TF_CTXT_MEM_UNRGTR UINT32_C(0x2e5) - /* Experimental */ - #define HWRM_TF_EXT_EM_QCAPS UINT32_C(0x2e6) - /* Experimental */ - #define HWRM_TF_EXT_EM_OP UINT32_C(0x2e7) - /* Experimental */ - #define HWRM_TF_EXT_EM_CFG UINT32_C(0x2e8) - /* Experimental */ - #define HWRM_TF_EXT_EM_QCFG UINT32_C(0x2e9) - /* Experimental */ #define HWRM_TF_EM_INSERT UINT32_C(0x2ea) /* Experimental */ #define HWRM_TF_EM_DELETE UINT32_C(0x2eb) @@ -1318,6 +1408,14 @@ typedef struct cmd_nums { #define HWRM_TF_IF_TBL_SET UINT32_C(0x2fe) /* Experimental */ #define HWRM_TF_IF_TBL_GET UINT32_C(0x2ff) + /* Experimental */ + #define HWRM_TF_RESC_USAGE_SET UINT32_C(0x300) + /* Experimental */ + #define HWRM_TF_RESC_USAGE_QUERY UINT32_C(0x301) + /* Truflow command to allocate a table */ + #define HWRM_TF_TBL_TYPE_ALLOC UINT32_C(0x302) + /* Truflow command to free a table */ + #define HWRM_TF_TBL_TYPE_FREE UINT32_C(0x303) /* TruFlow command to check firmware table scope capabilities. */ #define HWRM_TFC_TBL_SCOPE_QCAPS UINT32_C(0x380) /* TruFlow command to allocate a table scope ID and create the pools. */ @@ -1330,9 +1428,9 @@ typedef struct cmd_nums { #define HWRM_TFC_TBL_SCOPE_FID_ADD UINT32_C(0x384) /* TruFlow command to remove a FID from a table scope. */ #define HWRM_TFC_TBL_SCOPE_FID_REM UINT32_C(0x385) - /* TruFlow command to allocate a table scope pool. */ + /* DEPRECATED */ #define HWRM_TFC_TBL_SCOPE_POOL_ALLOC UINT32_C(0x386) - /* TruFlow command to free a table scope pool. */ + /* DEPRECATED */ #define HWRM_TFC_TBL_SCOPE_POOL_FREE UINT32_C(0x387) /* Experimental */ #define HWRM_TFC_SESSION_ID_ALLOC UINT32_C(0x388) @@ -1366,8 +1464,30 @@ typedef struct cmd_nums { #define HWRM_TFC_TCAM_ALLOC_SET UINT32_C(0x396) /* TruFlow command to free a TCAM entry. */ #define HWRM_TFC_TCAM_FREE UINT32_C(0x397) + /* Truflow command to set an interface table entry */ + #define HWRM_TFC_IF_TBL_SET UINT32_C(0x398) + /* Truflow command to get an interface table entry */ + #define HWRM_TFC_IF_TBL_GET UINT32_C(0x399) + /* TruFlow command to get configured info about a table scope. */ + #define HWRM_TFC_TBL_SCOPE_CONFIG_GET UINT32_C(0x39a) + /* TruFlow command to query the resource usage state. */ + #define HWRM_TFC_RESC_USAGE_QUERY UINT32_C(0x39b) + /* + * This command is used to query the pfc watchdog max configurable + * timeout value. + */ + #define HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS UINT32_C(0x39c) + /* This command is used to set the PFC watchdog timeout value. */ + #define HWRM_QUEUE_PFCWD_TIMEOUT_CFG UINT32_C(0x39d) + /* + * This command is used to query the current configured pfc watchdog + * timeout value. + */ + #define HWRM_QUEUE_PFCWD_TIMEOUT_QCFG UINT32_C(0x39e) /* Experimental */ #define HWRM_SV UINT32_C(0x400) + /* Flush any trace buffer data that has not been sent to the host. */ + #define HWRM_DBG_LOG_BUFFER_FLUSH UINT32_C(0xff0f) /* Experimental */ #define HWRM_DBG_READ_DIRECT UINT32_C(0xff10) /* Experimental */ @@ -1423,6 +1543,8 @@ typedef struct cmd_nums { #define HWRM_DBG_USEQ_DELIVERY_REQ UINT32_C(0xff2a) /* Experimental */ #define HWRM_DBG_USEQ_RESP_HDR UINT32_C(0xff2b) + #define HWRM_NVM_GET_VPD_FIELD_INFO UINT32_C(0xffea) + #define HWRM_NVM_SET_VPD_FIELD_INFO UINT32_C(0xffeb) #define HWRM_NVM_DEFRAG UINT32_C(0xffec) #define HWRM_NVM_REQ_ARBITRATION UINT32_C(0xffed) /* Experimental */ @@ -1518,14 +1640,14 @@ typedef struct ret_codes { #define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc) /* * This error code is only reported by firmware when the registered - * driver instances requested to offloaded a flow but was unable to because - * the requested key's hash collides with the installed keys. + * driver instances requested to offloaded a flow but was unable to + * because the requested key's hash collides with the installed keys. */ #define HWRM_ERR_CODE_KEY_HASH_COLLISION UINT32_C(0xd) /* * This error code is only reported by firmware when the registered - * driver instances requested to offloaded a flow but was unable to because - * the same key has already been installed. + * driver instances requested to offloaded a flow but was unable to + * because the same key has already been installed. */ #define HWRM_ERR_CODE_KEY_ALREADY_EXISTS UINT32_C(0xe) /* @@ -1534,8 +1656,8 @@ typedef struct ret_codes { */ #define HWRM_ERR_CODE_HWRM_ERROR UINT32_C(0xf) /* - * Firmware is unable to service the request at the present time. Caller - * may try again later. + * Firmware is unable to service the request at the present time. + * Caller may try again later. */ #define HWRM_ERR_CODE_BUSY UINT32_C(0x10) /* @@ -1550,6 +1672,11 @@ typedef struct ret_codes { * async completion ring or associated forwarding buffers configured. */ #define HWRM_ERR_CODE_PF_UNAVAILABLE UINT32_C(0x12) + /* + * This error code is reported by Firmware when the specific entity + * requested by the host is not present or does not exist. + */ + #define HWRM_ERR_CODE_ENTITY_NOT_PRESENT UINT32_C(0x13) /* * This value indicates that the HWRM response is in TLV format and * should be interpreted as one or more TLVs starting with the @@ -1587,7 +1714,8 @@ typedef struct ret_codes { ((x) == 0x10 ? "BUSY": \ ((x) == 0x11 ? "RESOURCE_LOCKED": \ ((x) == 0x12 ? "PF_UNAVAILABLE": \ - "Unknown decode" ))))))))))))))))))) : \ + ((x) == 0x13 ? "ENTITY_NOT_PRESENT": \ + "Unknown decode" )))))))))))))))))))) : \ (((x) < 0x8080) ? \ ((x) == 0x8000 ? "TLV_ENCAPSULATED_RESPONSE": \ "Unknown decode" ) : \ @@ -1614,7 +1742,7 @@ typedef struct hwrm_err_output { /* This field provides original sequence number of the command. */ uint16_t seq_id; /* - * This field is the length of the response in bytes. The + * This field is the length of the response in bytes. The * last byte of the response is a valid flag that will read * as '1' when the command has been completely written to * memory. @@ -1631,9 +1759,9 @@ typedef struct hwrm_err_output { uint8_t cmd_err; /* * This field is used in Output records to indicate that the output - * is completely written to RAM. This field should be read as '1' - * to indicate that the output has been completely written. - * When writing a command completion or response to an internal processor, + * is completely written to RAM. This field should be read as '1' + * to indicate that the output has been completely written. When + * writing a command completion or response to an internal processor, * the order of writes has to be such that this field is written last. */ uint8_t valid; @@ -1644,7 +1772,12 @@ typedef struct hwrm_err_output { * applicable (All F's). Need to cast it the size of the field if needed. */ #define HWRM_NA_SIGNATURE ((uint32_t)(-1)) -/* hwrm_func_buf_rgtr */ +/* + * This is reflecting the size of the PF mailbox and not the maximum + * command size for any of the HWRM command structures. To determine + * the maximum size of an HWRM command supported by the firmware, see + * the max_ext_req_len field in the response of the HWRM_VER_GET command. + */ #define HWRM_MAX_REQ_LEN 128 /* hwrm_cfa_flow_info */ #define HWRM_MAX_RESP_LEN 704 @@ -1668,10 +1801,10 @@ typedef struct hwrm_err_output { #define HWRM_TARGET_ID_TOOLS 0xFFFD #define HWRM_VERSION_MAJOR 1 #define HWRM_VERSION_MINOR 10 -#define HWRM_VERSION_UPDATE 2 +#define HWRM_VERSION_UPDATE 3 /* non-zero means beta version */ -#define HWRM_VERSION_RSVD 136 -#define HWRM_VERSION_STR "1.10.2.136" +#define HWRM_VERSION_RSVD 42 +#define HWRM_VERSION_STR "1.10.3.42" /**************** * hwrm_ver_get * @@ -1887,47 +2020,52 @@ typedef struct hwrm_ver_get_output { /* * If set to 1, then the KONG host mailbox channel is supported. * If set to 0, then the KONG host mailbox channel is not supported. - * By default, this flag should be 0 for older version of core firmware. + * By default, this flag should be 0 for older version of core + * firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED UINT32_C(0x10) /* - * If set to 1, then the 64bit flow handle is supported in addition to the - * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not - * supported. By default, this flag should be 0 for older version of core firmware. + * If set to 1, then the 64bit flow handle is supported in addition + * to the legacy 16bit flow handle. If set to 0, then the 64bit flow + * handle is not supported. By default, this flag should be 0 for + * older version of core firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED UINT32_C(0x20) /* - * If set to 1, then filter type can be provided in filter_alloc or filter_cfg - * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic. - * If set to 0, then filter types not supported. - * By default, this flag should be 0 for older version of core firmware. + * If set to 1, then filter type can be provided in filter_alloc or + * filter_cfg filter types like L2 for l2 traffic and ROCE for roce & + * l2 traffic. If set to 0, then filter types not supported. By + * default, this flag should be 0 for older version of core firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED UINT32_C(0x40) /* - * If set to 1, firmware is capable to support virtio vSwitch offload model. - * If set to 0, firmware can't supported virtio vSwitch offload model. - * By default, this flag should be 0 for older version of core firmware. + * If set to 1, firmware is capable to support virtio vSwitch offload + * model. If set to 0, firmware can't supported virtio vSwitch + * offload model. + * By default, this flag should be 0 for older version of core + * firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED UINT32_C(0x80) /* * If set to 1, firmware is capable to support trusted VF. * If set to 0, firmware is not capable to support trusted VF. - * By default, this flag should be 0 for older version of core firmware. + * By default, this flag should be 0 for older version of core + * firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED UINT32_C(0x100) /* * If set to 1, firmware is capable to support flow aging. * If set to 0, firmware is not capable to support flow aging. - * By default, this flag should be 0 for older version of core firmware. - * (deprecated) + * By default, this flag should be 0 for older version of core + * firmware. (deprecated) */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED UINT32_C(0x200) /* - * If set to 1, firmware is capable to support advanced flow counters like, - * Meter drop counters and EEM counters. - * If set to 0, firmware is not capable to support advanced flow counters. - * By default, this flag should be 0 for older version of core firmware. - * (deprecated) + * If set to 1, firmware is capable to support advanced flow counters + * like, Meter drop counters and EEM counters. + * If set to 0, firmware is not capable to support advanced flow + * counters. By default, this flag should be 0 for older version of + * core firmware. (deprecated) */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED UINT32_C(0x400) /* @@ -1935,28 +2073,30 @@ typedef struct hwrm_ver_get_output { * Extended Exact Match(EEM) feature. * If set to 0, firmware is not capable to support the use of the * CFA EEM feature. - * By default, this flag should be 0 for older version of core firmware. - * (deprecated) + * By default, this flag should be 0 for older version of core + * firmware. (deprecated) */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED UINT32_C(0x800) /* - * If set to 1, the firmware is able to support advance CFA flow management - * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS. - * If set to 0, then the firmware doesn’t support the advance CFA flow management - * features. - * By default, this flag should be 0 for older version of core firmware. + * If set to 1, the firmware is able to support advance CFA flow + * management features reported in the HWRM_CFA_FLOW_MGNT_QCAPS. + * If set to 0, then the firmware doesn't support the advance CFA + * flow management features. + * By default, this flag should be 0 for older version of core + * firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED UINT32_C(0x1000) /* * Deprecated and replaced with cfa_truflow_supported. * If set to 1, the firmware is able to support TFLIB features. - * If set to 0, then the firmware doesn’t support TFLIB features. - * By default, this flag should be 0 for older version of core firmware. + * If set to 0, then the firmware doesn't support TFLIB features. + * By default, this flag should be 0 for older version of core + * firmware. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED UINT32_C(0x2000) /* * If set to 1, the firmware is able to support TruFlow features. - * If set to 0, then the firmware doesn’t support TruFlow features. + * If set to 0, then the firmware doesn't support TruFlow features. * By default, this flag should be 0 for older version of * core firmware. */ @@ -1966,6 +2106,13 @@ typedef struct hwrm_ver_get_output { * If set to 0, then firmware doesn't support secure boot. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_BOOT_CAPABLE UINT32_C(0x8000) + /* + * If set to 1, then firmware is able to support the secure solution + * feature. + * If set to 0, then firmware does not support the secure solution + * feature. + */ + #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_SOC_CAPABLE UINT32_C(0x10000) /* * This field represents the major version of RoCE firmware. * A change in major version represents a major release. @@ -2018,7 +2165,10 @@ typedef struct hwrm_ver_get_output { uint8_t chip_metal; /* This field returns the bond id of the chip. */ uint8_t chip_bond_id; - /* This value indicates the type of platform used for chip implementation. */ + /* + * This value indicates the type of platform used for chip + * implementation. + */ uint8_t chip_platform_type; /* ASIC */ #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC UINT32_C(0x0) @@ -2071,8 +2221,8 @@ typedef struct hwrm_ver_get_output { * host drivers that it has not completed resource initialization * required for data path operations. Host drivers should not send * any HWRM command that requires data path resources. Firmware will - * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can retry - * those commands once both the flags are cleared. + * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can + * retry those commands once both the flags are cleared. * If this flag and dev_not_rdy flag are set to 0, device is ready * to accept all HWRM commands. */ @@ -2232,9 +2382,9 @@ typedef struct hwrm_ver_get_output { uint8_t unused_1[3]; /* * This field is used in Output records to indicate that the output - * is completely written to RAM. This field should be read as '1' - * to indicate that the output has been completely written. - * When writing a command completion or response to an internal processor, + * is completely written to RAM. This field should be read as '1' + * to indicate that the output has been completely written. When + * writing a command completion or response to an internal processor, * the order of writes has to be such that this field is written last. */ uint8_t valid; @@ -2801,11 +2951,11 @@ typedef struct crypto_presync_bd_cmd { * Typically, presync BDs are used for packet retransmissions. Source * port sends all the packets in order over the network to destination * port and packets get dropped in the network. The destination port - * will request retranmission of dropped packets and source port driver - * will send presync BD to setup the transmitter appropriately. It will - * provide the start and end TCP sequence number of the data to be - * transmitted. HW keeps two sets of context variable, one for in order - * traffic and one for retransmission traffic. HW is designed to + * will request retransmission of dropped packets and source port + * driver will send presync BD to setup the transmitter appropriately. + * It will provide the start and end TCP sequence number of the data to + * be transmitted. HW keeps two sets of context variable, one for in + * order traffic and one for retransmission traffic. HW is designed to * transmit everything posted in the presync BD and return to in order * mode after that. No inorder context variables are updated in the * process. There is a special case where packets can be dropped @@ -2955,22 +3105,22 @@ typedef struct ce_bds_quic_add_data_msg { * exchanged as part of sessions setup between the two end * points for QUIC operations. */ - uint64_t quic_iv_lo; + uint8_t quic_iv_lo[8]; /* * Most-significant 32 bits (of 96) of additional IV that is * exchanged as part of sessions setup between the two end * points for QUIC operations. */ - uint32_t quic_iv_hi; + uint8_t quic_iv_hi[4]; uint32_t unused_1; /* * Key used for encrypting or decrypting records. The Key is exchanged * as part of sessions setup between the two end points through this * mid-path BD. */ - uint32_t session_key[8]; + uint8_t session_key[32]; /* Header protection key. */ - uint32_t hp_key[8]; + uint8_t hp_key[32]; /* Packet number associated with the QUIC connection. */ uint64_t pkt_number; } ce_bds_quic_add_data_msg_t, *pce_bds_quic_add_data_msg_t; @@ -3149,7 +3299,8 @@ typedef struct tx_bd_short { * * This value must be valid on all BDs of a packet. */ - uint64_t addr; + uint32_t addr_lo; + uint32_t addr_hi; } tx_bd_short_t, *ptx_bd_short_t; /* tx_bd_long (size:128b/16B) */ @@ -3359,7 +3510,7 @@ typedef struct tx_bd_long_hi { * 0xffff. * * If set to one when LSO is '1', then the IPID will be treated - * as a 15b number and will be wrapped if it exceeds a value 0f + * as a 15b number and will be wrapped if it exceeds a value of * 0x7fff. */ #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40) @@ -3418,7 +3569,7 @@ typedef struct tx_bd_long_hi { * will be the following behavior for all cases independent of * settings of inner LSO and checksum offload BD flags. * If outer UDP checksum is 0, then do not update it. - * If outer UDP checksum is non zero, then the hardware should + * If outer UDP checksum is non zero, then the hardware should * compute and update it. */ #define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM UINT32_C(0x2000) @@ -3554,7 +3705,7 @@ typedef struct tx_bd_long_hi { * - Wh+/SR - this option is not supported. * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta * is set in the Lookup Table. - * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if + * - SR2 - {4'd0, cfa_meta[27:0]} is used for metadata output if * en_bd_meta is set in the Lookup Table. */ #define TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER (UINT32_C(0x2) << 28) @@ -3650,7 +3801,8 @@ typedef struct tx_bd_long_inline { * This field must be valid on the first BD of a packet. */ uint32_t opaque; - uint64_t unused1; + uint32_t unused1_lo; + uint32_t unused1_hi; /* * All bits in this field must be valid on the first BD of a packet. * Their value on other BDs of the packet is ignored. @@ -3859,7 +4011,7 @@ typedef struct tx_bd_long_inline { * - Wh+/SR - this option is not supported. * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta * is set in the Lookup Table. - * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if + * - SR2 - {4'd0, cfa_meta[27:0]} is used for metadata output if * en_bd_meta is set in the Lookup Table. */ #define TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER (UINT32_C(0x2) << 28) @@ -3927,7 +4079,8 @@ typedef struct tx_bd_mp_cmd { * Tx mid-path command. */ uint32_t opaque; - uint64_t unused1; + uint32_t unused1_lo; + uint32_t unused1_hi; } tx_bd_mp_cmd_t, *ptx_bd_mp_cmd_t; /* tx_bd_presync_cmd (size:128b/16B) */ @@ -3987,6 +4140,96 @@ typedef struct tx_bd_presync_cmd { uint32_t unused_1; } tx_bd_presync_cmd_t, *ptx_bd_presync_cmd_t; +/* + * This structure is used to send additional information for transmitting + * packets using timed transmit scheduling. It must only to be applied as + * the second BD of a BD chain that represents a packet. Any subsequent + * BDs will follow the timed transmit BD. + */ +/* tx_bd_timedtx (size:128b/16B) */ + +typedef struct tx_bd_timedtx { + uint16_t flags_type; + /* This value identifies the type of buffer descriptor. */ + #define TX_BD_TIMEDTX_TYPE_MASK UINT32_C(0x3f) + #define TX_BD_TIMEDTX_TYPE_SFT 0 + /* + * Indicates a timed transmit BD. This is a 16b BD that is inserted + * into a packet BD chain immediately after the first BD. It is used + * to control the flow in a timed transmit operation. + */ + #define TX_BD_TIMEDTX_TYPE_TX_BD_TIMEDTX UINT32_C(0xa) + #define TX_BD_TIMEDTX_TYPE_LAST TX_BD_TIMEDTX_TYPE_TX_BD_TIMEDTX + /* Unless otherwise stated, sub-fields of this field are always valid. */ + #define TX_BD_TIMEDTX_FLAGS_MASK UINT32_C(0xffc0) + #define TX_BD_TIMEDTX_FLAGS_SFT 6 + /* + * This value identifies the kind of buffer timed transmit mode that + * is to be enabled for the packet. + */ + #define TX_BD_TIMEDTX_FLAGS_KIND_MASK UINT32_C(0x1c0) + #define TX_BD_TIMEDTX_FLAGS_KIND_SFT 6 + /* + * This timed transmit mode indicates that the packet will be + * scheduled and send immediately (or as soon as possible), once + * it is scheduled in the transmitter. + * Note: This mode is similar to regular (non-timed transmit) + * operation. Its main purpose is to cancel pace mode timed + * transmit. + */ + #define TX_BD_TIMEDTX_FLAGS_KIND_ASAP (UINT32_C(0x0) << 6) + /* + * This timed transmit mode is used to schedule transmission of + * the packet no earlier than the time given in the tx_time + * field of the BD. + * Note: In case subsequent packets don't include a timed transmit + * BD, they will be scheduled subsequently for transmission + * without any timed transmit constraint. + */ + #define TX_BD_TIMEDTX_FLAGS_KIND_SO_TXTIME (UINT32_C(0x1) << 6) + /* + * This timed transmit mode is used to enable rate control for the + * flow (QP) at a rate as defined by the rate field of this BD. + * Note: In case subsequent, adjacent packets on the same flow *** 82442 LINES SKIPPED *** From nobody Mon Jun 3 19:25:07 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 4VtNwN2B1Cz5JsBj; Mon, 03 Jun 2024 19:25:08 +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 4VtNwN0Zhvz4Vx7; Mon, 3 Jun 2024 19:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442708; 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=y/UMJdlwQqFzugo9wFF1V2oti/iN67+h2Su8kAw2+cc=; b=E9NTemFEacIWlwYB/uBN0xY9M1mhYk/GU/Rf5HDCqWI8qz0JOQiTprgs5jpPtCRUdmq9V1 1zoGmJEg7JsKbBmhzl24tBorYqP5MBT5/oYILZlrbWHju7ZW8BBGURojvkoukhh2QWtXS1 JvJcs7Vy6+xJMPVvZnEW1a/KzqGYN3QZDmwa8qmZ2nV7P2I9EceGIZ5fC+wWLfU12DygZb vxY2E13UNfLV/IjQQKJj5Dj4ykLOJ80WJAtluhdGNYCDgpSyGL56HiOPsDKFxGMO8JZShx NcxYJ9KUn2OWAREMsjMgP2GOKpZnplhd+hpymvIGu4XkpwUmRGuZMMoR98vMSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442708; a=rsa-sha256; cv=none; b=GnM7cApxr2C1/rfpKpibW9uC8Zy28XBL0kOuwFGpASYcVrnOQO/5vJ7z0IohEGKVftPnYX 9maLtV+SmkUaEJRxt3I0rfWIWOHk4e3JhTNuU8PYX2OMI6q6WCtP3lv1i0cVUK3Q5Bifst OGrgyK2IL0zWcZ6VQqbFJqM2iY/oQ/xsdBCgewwsyfoJcIBuyuaaPsE/OxIAa0+5yzjFBa XZ0VW3oA+E4ftk+/2H5I9nsuWWoMOridTF7VMvlpu8bRlzcInE+0gKpiJEG51MTW5ThL/2 HbmHXM60ZWLRcLBl2gnneabaWBYDchr6AEYkSJ5p+I0NSgXzv5mueF6fDgefUw== 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=1717442708; 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=y/UMJdlwQqFzugo9wFF1V2oti/iN67+h2Su8kAw2+cc=; b=WAC/lHEB05lnPYvPvdkYbgN0qT1z4cDIkDJafFpnyY8hPGEDvlW4DIlMSe9LPDU5bFF4LQ 171TEKd1PpjXugqY5VWMBd63/TafWNmjPHN23h1lHH8dB8NxaD//THIBWErivj5zBVkBT2 1EzmNkK+222Ce+VrEe/7GZCwxhDHV7CAYFNJxAQfKVWORD3Osy/LstaXMr6CZOOz2y/gTF 5qy9r580wYYTisN+b/hvagJFcksSa/SP9mBtSnCTF9VyDhunZGVGtBrolfg1aNFLE5VqY9 H4Lg8S9rIxlmR3vQBzX4z7/9jzxLoe7qSwLgUnJZYND6hdmlSCCOS9BAI3QTMw== 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 4VtNwN09QfznMK; Mon, 3 Jun 2024 19:25:08 +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 453JP7oc068143; Mon, 3 Jun 2024 19:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP7cb068140; Mon, 3 Jun 2024 19:25:07 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:07 GMT Message-Id: <202406031925.453JP7cb068140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7a63abf952c6 - stable/14 - bnxt_en: Driver version update to 230.0.133.0 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a63abf952c6abd6dddf08051a4e2fc93adbb9d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a63abf952c6abd6dddf08051a4e2fc93adbb9d2 commit 7a63abf952c6abd6dddf08051a4e2fc93adbb9d2 Author: Chandrakanth patil AuthorDate: 2024-04-28 14:10:36 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:14 +0000 bnxt_en: Driver version update to 230.0.133.0 Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45010 (cherry picked from commit 862af86f4b7d2aec0623d19796e79cf96b4c7af6) --- sys/dev/bnxt/bnxt_en/if_bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index e13585a0c52c..8ca929828709 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -346,7 +346,7 @@ static driver_t bnxt_iflib_driver = { * iflib shared context */ -#define BNXT_DRIVER_VERSION "2.20.0.1" +#define BNXT_DRIVER_VERSION "230.0.133.0" const char bnxt_driver_version[] = BNXT_DRIVER_VERSION; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { From nobody Mon Jun 3 19:25:08 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 4VtNwP4tW5z5Js5s; Mon, 03 Jun 2024 19:25:09 +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 4VtNwP2GHPz4Vgf; Mon, 3 Jun 2024 19:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442709; 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=h9KgYjmdVlnmuQ3Lume410oZ785+KlknRuBzglwwtrg=; b=WO+w5A6+LU83QSwdRST8cX6GOZwng6dr9mlM+QfSAShlBJpIBmfMsWH6Kdsx8HLbYrlPg6 nfoJ6vij2xw73q+saupCWN96iV08sjQNgMvFI9BkQ2zWEc1pU/q7bxhYnnllQaz0qhaP/A 561/XD/uIH/iBLOZLlYkCDXb2Od0MJJcxQdW8VP3Vt/xgnqYfjtKBp3j5uYTaikHK9HFj/ 79g/JmlqAsKtOvUB6M89EOOUWPdt1tbj0Nykgrpo8+Qzq/UbOVmAXAB0L8wigvdxf8LGFr J4Xx4j2PzQf3IhxwsA8gdkVXfs+K3hQLmFkCyoJBkZlzZnae+FG+ApUVwA8CIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442709; a=rsa-sha256; cv=none; b=EKzOoOworqjALtH+B5M9N+crLcaHyc5MspZHz7Vg9SK5Kagbum1QuwyKKvyvptysJ+bUKR z9bdWKhmxBwU+HcnqAepnRhLDbxZxNGRblW0O9zDeXSASmF7vWz6gMneGdAXxRr6jmw4x5 0JZaKPrSCOtEOuM9vuIDBHmw2JKoX5fRZA9923uTdtmE6+kcFPaet1MqdU6CQzbUKD2CQq q9hcXP4vGehS6QS/Vb+TjCsveiWGcdWnWOhEr64KbLgJ80A5CpWii/dw4tNhtXOZctMFDi VaHq2QYtWM/7X7AbPt8kpfy/9gX+tVkerli366EDdDx7lHGHtkFGd2sNAuOU7A== 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=1717442709; 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=h9KgYjmdVlnmuQ3Lume410oZ785+KlknRuBzglwwtrg=; b=IIcnzHhp4m1aqKj4P3yjf20O6276cbwSzfSf/epwdmu/T8w1hrr3Vxugr1ESuz/O74wUTp lkAPvvrpGo9dBd0CWq9vBaHI0r8VkhWCCOB8tLR9F8qCZUREBvTGjLbyjp1lTM3m8acTXq jfDxQqQT+e5VtIWUVwHvjXhQWe9pSrG9s5WkJj704OjO3+QvguJT8YZfFoHRoXCKPuBZke Pxg3YgAQL6orhoSpZAfdKLjk8VABHq3+mht/ez51kJsnbROSE4NUt1SOM481oo62nd7F5W +cPngw5VSI+xawFUzTVNcQlAIanmRCwwjnMBchJnDiC/63o8eB15Lg0jK+aKqg== 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 4VtNwP1prmzn1j; Mon, 3 Jun 2024 19:25:09 +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 453JP9j8068195; Mon, 3 Jun 2024 19:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JP8pQ068191; Mon, 3 Jun 2024 19:25:08 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:08 GMT Message-Id: <202406031925.453JP8pQ068191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 93265fb21c8d - stable/14 - RDMA/bnxt_re: Add bnxt_re RoCE driver 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 93265fb21c8daa8a512fd16dee3de85f21e46b4b Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=93265fb21c8daa8a512fd16dee3de85f21e46b4b commit 93265fb21c8daa8a512fd16dee3de85f21e46b4b Author: Sumit Saxena AuthorDate: 2024-05-28 10:31:59 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 RDMA/bnxt_re: Add bnxt_re RoCE driver This patch introduces the RoCE driver for the Broadcom NetXtreme-E 10/25/50/100/200G RoCE HCAs. The RoCE driver is a two part driver that relies on the bnxt_en NIC driver to operate. The changes needed in the bnxt_en driver is included through another patch "L2-RoCE driver communication interface" in this set. Presently, There is no user space support, Hence recommendation to use the krping kernel module for testing. User space support will be incorporated in subsequent patch submissions. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45011 (cherry picked from commit acd884dec99adcf8c4cdd0aa8a50be79c216f8e8) --- sys/dev/bnxt/bnxt_re/bnxt_re-abi.h | 177 ++ sys/dev/bnxt/bnxt_re/bnxt_re.h | 1075 +++++++ sys/dev/bnxt/bnxt_re/ib_verbs.c | 5498 ++++++++++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_re/ib_verbs.h | 632 +++++ sys/dev/bnxt/bnxt_re/main.c | 4467 +++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_re/qplib_fp.c | 3544 +++++++++++++++++++++++ sys/dev/bnxt/bnxt_re/qplib_fp.h | 638 +++++ sys/dev/bnxt/bnxt_re/qplib_rcfw.c | 1338 +++++++++ sys/dev/bnxt/bnxt_re/qplib_rcfw.h | 354 +++ sys/dev/bnxt/bnxt_re/qplib_res.c | 1226 ++++++++ sys/dev/bnxt/bnxt_re/qplib_res.h | 840 ++++++ sys/dev/bnxt/bnxt_re/qplib_sp.c | 1234 ++++++++ sys/dev/bnxt/bnxt_re/qplib_sp.h | 432 +++ sys/dev/bnxt/bnxt_re/qplib_tlv.h | 187 ++ sys/dev/bnxt/bnxt_re/stats.c | 773 +++++ sys/dev/bnxt/bnxt_re/stats.h | 353 +++ sys/modules/bnxt/bnxt_re/Makefile | 22 + 17 files changed, 22790 insertions(+) diff --git a/sys/dev/bnxt/bnxt_re/bnxt_re-abi.h b/sys/dev/bnxt/bnxt_re/bnxt_re-abi.h new file mode 100644 index 000000000000..8f48609e7f6f --- /dev/null +++ b/sys/dev/bnxt/bnxt_re/bnxt_re-abi.h @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2015-2024, Broadcom. All rights reserved. The term + * Broadcom refers to Broadcom Limited and/or its subsidiaries. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Description: Uverbs ABI header file + */ + +#ifndef __BNXT_RE_UVERBS_ABI_H__ +#define __BNXT_RE_UVERBS_ABI_H__ + +#include +#include + +#define BNXT_RE_ABI_VERSION 6 + +enum { + BNXT_RE_COMP_MASK_UCNTX_WC_DPI_ENABLED = 0x01, + BNXT_RE_COMP_MASK_UCNTX_POW2_DISABLED = 0x02, + BNXT_RE_COMP_MASK_UCNTX_RSVD_WQE_DISABLED = 0x04, + BNXT_RE_COMP_MASK_UCNTX_MQP_EX_SUPPORTED = 0x08, + BNXT_RE_COMP_MASK_UCNTX_DBR_PACING_ENABLED = 0x10, + BNXT_RE_COMP_MASK_UCNTX_DBR_RECOVERY_ENABLED = 0x20, + BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED = 0x40 +}; + +enum { + BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT = 0x01, + BNXT_RE_COMP_MASK_REQ_UCNTX_RSVD_WQE = 0x02 +}; + +struct bnxt_re_uctx_req { + __aligned_u64 comp_mask; +}; + +#define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT 0x00 +#define BNXT_RE_CHIP_ID0_CHIP_REV_SFT 0x10 +#define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18 +struct bnxt_re_uctx_resp { + __u32 dev_id; + __u32 max_qp; + __u32 pg_size; + __u32 cqe_sz; + __u32 max_cqd; + __u32 chip_id0; + __u32 chip_id1; + __u32 modes; + __aligned_u64 comp_mask; +} __attribute__((packed)); + +enum { + BNXT_RE_COMP_MASK_PD_HAS_WC_DPI = 0x01, + BNXT_RE_COMP_MASK_PD_HAS_DBR_BAR_ADDR = 0x02, +}; + +struct bnxt_re_pd_resp { + __u32 pdid; + __u32 dpi; + __u64 dbr; + __u64 comp_mask; + __u32 wcdpi; + __u64 dbr_bar_addr; +} __attribute__((packed)); + +enum { + BNXT_RE_COMP_MASK_CQ_HAS_DB_INFO = 0x01, + BNXT_RE_COMP_MASK_CQ_HAS_WC_DPI = 0x02, + BNXT_RE_COMP_MASK_CQ_HAS_CQ_PAGE = 0x04, +}; + +enum { + BNXT_RE_COMP_MASK_CQ_REQ_HAS_CAP_MASK = 0x1 +}; + +enum { + BNXT_RE_COMP_MASK_CQ_REQ_CAP_DBR_RECOVERY = 0x1, + BNXT_RE_COMP_MASK_CQ_REQ_CAP_DBR_PACING_NOTIFY = 0x2 +}; + +#define BNXT_RE_IS_DBR_PACING_NOTIFY_CQ(_req) \ + (_req.comp_mask & BNXT_RE_COMP_MASK_CQ_REQ_HAS_CAP_MASK && \ + _req.cq_capability & BNXT_RE_COMP_MASK_CQ_REQ_CAP_DBR_PACING_NOTIFY) + +#define BNXT_RE_IS_DBR_RECOV_CQ(_req) \ + (_req.comp_mask & BNXT_RE_COMP_MASK_CQ_REQ_HAS_CAP_MASK && \ + _req.cq_capability & BNXT_RE_COMP_MASK_CQ_REQ_CAP_DBR_RECOVERY) + +struct bnxt_re_cq_req { + __u64 cq_va; + __u64 cq_handle; + __aligned_u64 comp_mask; + __u16 cq_capability; +} __attribute__((packed)); + +struct bnxt_re_cq_resp { + __u32 cqid; + __u32 tail; + __u32 phase; + __u32 rsvd; + __aligned_u64 comp_mask; + __u32 dpi; + __u64 dbr; + __u32 wcdpi; + __u64 uctx_cq_page; +} __attribute__((packed)); + +struct bnxt_re_resize_cq_req { + __u64 cq_va; +} __attribute__((packed)); + +struct bnxt_re_qp_req { + __u64 qpsva; + __u64 qprva; + __u64 qp_handle; +} __attribute__((packed)); + +struct bnxt_re_qp_resp { + __u32 qpid; +} __attribute__((packed)); + +struct bnxt_re_srq_req { + __u64 srqva; + __u64 srq_handle; +} __attribute__((packed)); + +struct bnxt_re_srq_resp { + __u32 srqid; +} __attribute__((packed)); + +/* Modify QP */ +enum { + BNXT_RE_COMP_MASK_MQP_EX_PPP_REQ_EN_MASK = 0x1, + BNXT_RE_COMP_MASK_MQP_EX_PPP_REQ_EN = 0x1, + BNXT_RE_COMP_MASK_MQP_EX_PATH_MTU_MASK = 0x2 +}; + +struct bnxt_re_modify_qp_ex_req { + __aligned_u64 comp_mask; + __u32 dpi; + __u32 rsvd; +} __packed; + +struct bnxt_re_modify_qp_ex_resp { + __aligned_u64 comp_mask; + __u32 ppp_st_idx; + __u32 path_mtu; +} __packed; + +enum bnxt_re_shpg_offt { + BNXT_RE_BEG_RESV_OFFT = 0x00, + BNXT_RE_AVID_OFFT = 0x10, + BNXT_RE_AVID_SIZE = 0x04, + BNXT_RE_END_RESV_OFFT = 0xFF0 +}; +#endif diff --git a/sys/dev/bnxt/bnxt_re/bnxt_re.h b/sys/dev/bnxt/bnxt_re/bnxt_re.h new file mode 100644 index 000000000000..3bf0bbeb1061 --- /dev/null +++ b/sys/dev/bnxt/bnxt_re/bnxt_re.h @@ -0,0 +1,1075 @@ +/* + * Copyright (c) 2015-2024, Broadcom. All rights reserved. The term + * Broadcom refers to Broadcom Limited and/or its subsidiaries. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Description: main (header) + */ + +#ifndef __BNXT_RE_H__ +#define __BNXT_RE_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bnxt.h" +#include "bnxt_ulp.h" +#include "hsi_struct_def.h" +#include "qplib_res.h" +#include "qplib_sp.h" +#include "qplib_fp.h" +#include "qplib_rcfw.h" +#include "ib_verbs.h" +#include "stats.h" + +#define ROCE_DRV_MODULE_NAME "bnxt_re" +#define ROCE_DRV_MODULE_VERSION "230.0.133.0" +#define ROCE_DRV_MODULE_RELDATE "April 22, 2024" + +#define BNXT_RE_REF_WAIT_COUNT 20 +#define BNXT_RE_ROCE_V1_ETH_TYPE 0x8915 +#define BNXT_RE_ROCE_V2_PORT_NO 4791 +#define BNXT_RE_RES_FREE_WAIT_COUNT 1000 + +#define BNXT_RE_PAGE_SHIFT_4K (12) +#define BNXT_RE_PAGE_SHIFT_8K (13) +#define BNXT_RE_PAGE_SHIFT_64K (16) +#define BNXT_RE_PAGE_SHIFT_2M (21) +#define BNXT_RE_PAGE_SHIFT_8M (23) +#define BNXT_RE_PAGE_SHIFT_1G (30) + +#define BNXT_RE_PAGE_SIZE_4K BIT(BNXT_RE_PAGE_SHIFT_4K) +#define BNXT_RE_PAGE_SIZE_8K BIT(BNXT_RE_PAGE_SHIFT_8K) +#define BNXT_RE_PAGE_SIZE_64K BIT(BNXT_RE_PAGE_SHIFT_64K) +#define BNXT_RE_PAGE_SIZE_2M BIT(BNXT_RE_PAGE_SHIFT_2M) +#define BNXT_RE_PAGE_SIZE_8M BIT(BNXT_RE_PAGE_SHIFT_8M) +#define BNXT_RE_PAGE_SIZE_1G BIT(BNXT_RE_PAGE_SHIFT_1G) + +#define BNXT_RE_MAX_MR_SIZE_LOW BIT(BNXT_RE_PAGE_SHIFT_1G) +#define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39) +#define BNXT_RE_MAX_MR_SIZE BNXT_RE_MAX_MR_SIZE_HIGH + +/* Number of MRs to reserve for PF, leaving remainder for VFs */ +#define BNXT_RE_RESVD_MR_FOR_PF (32 * 1024) +#define BNXT_RE_MAX_GID_PER_VF 128 + +#define BNXT_RE_MAX_VF_QPS_PER_PF (6 * 1024) + +/** + * min_not_zero - return the minimum that is _not_ zero, unless both are zero + * @x: value1 + * @y: value2 + */ +#define min_not_zero(x, y) ({ \ + typeof(x) __x = (x); \ + typeof(y) __y = (y); \ + __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) + +struct ib_mr_init_attr { + int max_reg_descriptors; + u32 flags; +}; + +struct bnxt_re_dev; + +int bnxt_re_register_netdevice_notifier(struct notifier_block *nb); +int bnxt_re_unregister_netdevice_notifier(struct notifier_block *nb); +int ib_register_device_compat(struct bnxt_re_dev *rdev); + +#ifndef __struct_group +#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \ + union { \ + struct { MEMBERS } ATTRS; \ + struct TAG { MEMBERS } ATTRS NAME; \ + } +#endif /* __struct_group */ +#ifndef struct_group_attr +#define struct_group_attr(NAME, ATTRS, MEMBERS...) \ + __struct_group(/* no tag */, NAME, ATTRS, MEMBERS) +#endif /* struct_group_attr */ +/* + * Percentage of resources of each type reserved for PF. + * Remaining resources are divided equally among VFs. + * [0, 100] + */ + +#define BNXT_RE_RQ_WQE_THRESHOLD 32 +#define BNXT_RE_UD_QP_HW_STALL 0x400000 + +/* + * Setting the default ack delay value to 16, which means + * the default timeout is approx. 260ms(4 usec * 2 ^(timeout)) + */ + +#define BNXT_RE_DEFAULT_ACK_DELAY 16 +#define BNXT_RE_BOND_PF_MAX 2 + +#define BNXT_RE_STATS_CTX_UPDATE_TIMER 250 +#define BNXT_RE_30SEC_MSEC (30 * 1000) + +#define BNXT_RE_BOND_RESCHED_CNT 10 + +#define BNXT_RE_CHIP_NUM_57454 0xC454 +#define BNXT_RE_CHIP_NUM_57452 0xC452 + +#define BNXT_RE_CHIP_NUM_5745X(chip_num) \ + ((chip_num) == BNXT_RE_CHIP_NUM_57454 || \ + (chip_num) == BNXT_RE_CHIP_NUM_57452) + +#define BNXT_RE_MIN_KERNEL_QP_TX_DEPTH 4096 +#define BNXT_RE_STOP_QPS_BUDGET 200 + +#define BNXT_RE_HWRM_CMD_TIMEOUT(rdev) \ + ((rdev)->chip_ctx->hwrm_cmd_max_timeout * 1000) + +extern unsigned int min_tx_depth; +extern struct mutex bnxt_re_dev_lock; +extern struct mutex bnxt_re_mutex; +extern struct list_head bnxt_re_dev_list; + +struct bnxt_re_ring_attr { + dma_addr_t *dma_arr; + int pages; + int type; + u32 depth; + u32 lrid; /* Logical ring id */ + u16 flags; + u8 mode; + u8 rsvd; +}; + +#define BNXT_RE_MAX_DEVICES 256 +#define BNXT_RE_MSIX_FROM_MOD_PARAM -1 +#define BNXT_RE_MIN_MSIX 2 +#define BNXT_RE_MAX_MSIX_VF 2 +#define BNXT_RE_MAX_MSIX_PF 9 +#define BNXT_RE_MAX_MSIX_NPAR_PF 5 +#define BNXT_RE_MAX_MSIX 64 +#define BNXT_RE_MAX_MSIX_GEN_P5_PF BNXT_RE_MAX_MSIX +#define BNXT_RE_GEN_P5_MAX_VF 64 + +struct bnxt_re_nq_record { + struct bnxt_msix_entry msix_entries[BNXT_RE_MAX_MSIX]; + /* FP Notification Queue (CQ & SRQ) */ + struct bnxt_qplib_nq nq[BNXT_RE_MAX_MSIX]; + int num_msix; + int max_init; + struct mutex load_lock; +}; + +struct bnxt_re_work { + struct work_struct work; + unsigned long event; + struct bnxt_re_dev *rdev; + struct ifnet *vlan_dev; + bool do_lag; + + /* netdev where we received the event */ + struct ifnet *netdev; + struct auxiliary_device *adev; +}; + +/* + * Data structure and defines to handle + * recovery + */ +#define BNXT_RE_RECOVERY_IB_UNINIT_WAIT_RETRY 20 +#define BNXT_RE_RECOVERY_IB_UNINIT_WAIT_TIME_MS 30000 /* 30sec timeout */ +#define BNXT_RE_PRE_RECOVERY_REMOVE 0x1 +#define BNXT_RE_COMPLETE_REMOVE 0x2 +#define BNXT_RE_POST_RECOVERY_INIT 0x4 +#define BNXT_RE_COMPLETE_INIT 0x8 +#define BNXT_RE_COMPLETE_SHUTDOWN 0x10 + +/* QP1 SQ entry data strucutre */ +struct bnxt_re_sqp_entries { + u64 wrid; + struct bnxt_qplib_sge sge; + /* For storing the actual qp1 cqe */ + struct bnxt_qplib_cqe cqe; + struct bnxt_re_qp *qp1_qp; +}; + +/* GSI QP mode enum */ +enum bnxt_re_gsi_mode { + BNXT_RE_GSI_MODE_INVALID = 0, + BNXT_RE_GSI_MODE_ALL = 1, + BNXT_RE_GSI_MODE_ROCE_V1, + BNXT_RE_GSI_MODE_ROCE_V2_IPV4, + BNXT_RE_GSI_MODE_ROCE_V2_IPV6, + BNXT_RE_GSI_MODE_UD +}; + +enum bnxt_re_roce_cap { + BNXT_RE_FLAG_ROCEV1_CAP = 1, + BNXT_RE_FLAG_ROCEV2_CAP, + BNXT_RE_FLAG_ROCEV1_V2_CAP, +}; + +#define BNXT_RE_MAX_GSI_SQP_ENTRIES 1024 +struct bnxt_re_gsi_context { + u8 gsi_qp_mode; + bool first_cq_created; + /* Start: used only in gsi_mode_all */ + struct bnxt_re_qp *gsi_qp; + struct bnxt_re_qp *gsi_sqp; + struct bnxt_re_ah *gsi_sah; + struct bnxt_re_sqp_entries *sqp_tbl; + /* End: used only in gsi_mode_all */ +}; + +struct bnxt_re_tc_rec { + u8 cos_id_roce; + u8 tc_roce; + u8 cos_id_cnp; + u8 tc_cnp; + u8 tc_def; + u8 cos_id_def; + u8 max_tc; + u8 roce_prio; + u8 cnp_prio; + u8 roce_dscp; + u8 cnp_dscp; + u8 prio_valid; + u8 dscp_valid; + bool ecn_enabled; + bool serv_type_enabled; + u64 cnp_dscp_bv; + u64 roce_dscp_bv; +}; + +struct bnxt_re_dscp2pri { + u8 dscp; + u8 mask; + u8 pri; +}; + +struct bnxt_re_cos2bw_cfg { + u8 pad[3]; + struct_group_attr(cfg, __packed, + u8 queue_id; + __le32 min_bw; + __le32 max_bw; + u8 tsa; + u8 pri_lvl; + u8 bw_weight; + ); + u8 unused; +}; + +#define BNXT_RE_AEQ_IDX 0 +#define BNXT_RE_MAX_SGID_ENTRIES 256 + +#define BNXT_RE_DBGFS_FILE_MEM 65536 +enum { + BNXT_RE_STATS_QUERY = 1, + BNXT_RE_QP_QUERY = 2, + BNXT_RE_SERVICE_FN_QUERY = 3, +}; + +struct bnxt_re_dbg_file { + struct bnxt_re_dev *rdev; + u32 type; + union { + struct bnxt_qplib_query_stats_info sinfo; + struct bnxt_qplib_query_fn_info fninfo; + }params; + char dbg_buf[BNXT_RE_DBGFS_FILE_MEM]; +}; + +struct bnxt_re_debug_entries { + /* Dir entries */ + struct dentry *qpinfo_dir; + struct dentry *service_fn_dir; + /* file entries */ + struct dentry *stat_query; + struct bnxt_re_dbg_file stat_file; + struct dentry *qplist_query; + struct bnxt_re_dbg_file qp_file; + struct dentry *service_fn_query; + struct bnxt_re_dbg_file service_fn_file; +}; + +struct bnxt_re_en_dev_info { + struct list_head en_list; + struct bnxt_en_dev *en_dev; + struct bnxt_re_dev *rdev; + unsigned long flags; +#define BNXT_RE_FLAG_EN_DEV_NETDEV_REG 0 +#define BNXT_RE_FLAG_EN_DEV_PRIMARY_DEV 1 +#define BNXT_RE_FLAG_EN_DEV_SECONDARY_DEV 2 + u8 wqe_mode; + u8 gsi_mode; + bool te_bypass; + bool ib_uninit_done; + u32 num_msix_requested; + wait_queue_head_t waitq; +}; + +#define BNXT_RE_DB_FIFO_ROOM_MASK_P5 0x1FFF8000 +#define BNXT_RE_MAX_FIFO_DEPTH_P5 0x2c00 +#define BNXT_RE_DB_FIFO_ROOM_SHIFT 15 + +#define BNXT_RE_DB_FIFO_ROOM_MASK_P7 0x3FFF8000 +#define BNXT_RE_MAX_FIFO_DEPTH_P7 0x8000 + +#define BNXT_RE_DB_FIFO_ROOM_MASK(ctx) \ + (_is_chip_p7((ctx)) ? \ + BNXT_RE_DB_FIFO_ROOM_MASK_P7 :\ + BNXT_RE_DB_FIFO_ROOM_MASK_P5) +#define BNXT_RE_MAX_FIFO_DEPTH(ctx) \ + (_is_chip_p7((ctx)) ? \ + BNXT_RE_MAX_FIFO_DEPTH_P7 :\ + BNXT_RE_MAX_FIFO_DEPTH_P5) + +struct bnxt_dbq_nq_list { + int num_nql_entries; + u16 nq_id[16]; +}; + +#define BNXT_RE_ASYNC_ERR_REP_BASE(_type) \ + (ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_##_type) + +#define BNXT_RE_ASYNC_ERR_DBR_TRESH(_type) \ + (ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_##_type) + +#define BNXT_RE_EVENT_DBR_EPOCH(data) \ + (((data) & \ + BNXT_RE_ASYNC_ERR_DBR_TRESH(EVENT_DATA1_EPOCH_MASK)) >> \ + BNXT_RE_ASYNC_ERR_DBR_TRESH(EVENT_DATA1_EPOCH_SFT)) + +#define BNXT_RE_EVENT_ERROR_REPORT_TYPE(data1) \ + (((data1) & \ + BNXT_RE_ASYNC_ERR_REP_BASE(TYPE_MASK)) >> \ + BNXT_RE_ASYNC_ERR_REP_BASE(TYPE_SFT)) + +#define BNXT_RE_DBR_LIST_ADD(_rdev, _res, _type) \ +{ \ + spin_lock(&(_rdev)->res_list[_type].lock); \ + list_add_tail(&(_res)->dbr_list, \ + &(_rdev)->res_list[_type].head); \ + spin_unlock(&(_rdev)->res_list[_type].lock); \ +} + +#define BNXT_RE_DBR_LIST_DEL(_rdev, _res, _type) \ +{ \ + spin_lock(&(_rdev)->res_list[_type].lock); \ + list_del(&(_res)->dbr_list); \ + spin_unlock(&(_rdev)->res_list[_type].lock); \ +} + +#define BNXT_RE_CQ_PAGE_LIST_ADD(_uctx, _cq) \ +{ \ + mutex_lock(&(_uctx)->cq_lock); \ + list_add_tail(&(_cq)->cq_list, &(_uctx)->cq_list); \ + mutex_unlock(&(_uctx)->cq_lock); \ +} + +#define BNXT_RE_CQ_PAGE_LIST_DEL(_uctx, _cq) \ +{ \ + mutex_lock(&(_uctx)->cq_lock); \ + list_del(&(_cq)->cq_list); \ + mutex_unlock(&(_uctx)->cq_lock); \ +} + +#define BNXT_RE_NETDEV_EVENT(event, x) \ + do { \ + if ((event) == (x)) \ + return #x; \ + } while (0) + +/* Do not change the seq of this enum which is followed by dbr recov */ +enum { + BNXT_RE_RES_TYPE_CQ = 0, + BNXT_RE_RES_TYPE_UCTX, + BNXT_RE_RES_TYPE_QP, + BNXT_RE_RES_TYPE_SRQ, + BNXT_RE_RES_TYPE_MAX +}; + +struct bnxt_re_dbr_res_list { + struct list_head head; + spinlock_t lock; +}; + +struct bnxt_re_dbr_drop_recov_work { + struct work_struct work; + struct bnxt_re_dev *rdev; + u32 curr_epoch; +}; + +struct bnxt_re_aer_work { + struct work_struct work; + struct bnxt_re_dev *rdev; +}; + +struct bnxt_re_dbq_stats { + u64 fifo_occup_slab_1; + u64 fifo_occup_slab_2; + u64 fifo_occup_slab_3; + u64 fifo_occup_slab_4; + u64 fifo_occup_water_mark; + u64 do_pacing_slab_1; + u64 do_pacing_slab_2; + u64 do_pacing_slab_3; + u64 do_pacing_slab_4; + u64 do_pacing_slab_5; + u64 do_pacing_water_mark; +}; + +/* Device debug statistics */ +struct bnxt_re_drv_dbg_stats { + struct bnxt_re_dbq_stats dbq; +}; + +/* DB pacing counters */ +struct bnxt_re_dbr_sw_stats { + u64 dbq_int_recv; + u64 dbq_int_en; + u64 dbq_pacing_resched; + u64 dbq_pacing_complete; + u64 dbq_pacing_alerts; + u64 dbr_drop_recov_events; + u64 dbr_drop_recov_timeouts; + u64 dbr_drop_recov_timeout_users; + u64 dbr_drop_recov_event_skips; +}; + +struct bnxt_re_dev { + struct ib_device ibdev; + struct list_head list; + atomic_t ref_count; + atomic_t sched_count; + unsigned long flags; +#define BNXT_RE_FLAG_NETDEV_REGISTERED 0 +#define BNXT_RE_FLAG_IBDEV_REGISTERED 1 +#define BNXT_RE_FLAG_GOT_MSIX 2 +#define BNXT_RE_FLAG_HAVE_L2_REF 3 +#define BNXT_RE_FLAG_ALLOC_RCFW 4 +#define BNXT_RE_FLAG_NET_RING_ALLOC 5 +#define BNXT_RE_FLAG_RCFW_CHANNEL_EN 6 +#define BNXT_RE_FLAG_ALLOC_CTX 7 +#define BNXT_RE_FLAG_STATS_CTX_ALLOC 8 +#define BNXT_RE_FLAG_STATS_CTX2_ALLOC 9 +#define BNXT_RE_FLAG_RCFW_CHANNEL_INIT 10 +#define BNXT_RE_FLAG_WORKER_REG 11 +#define BNXT_RE_FLAG_TBLS_ALLOCINIT 12 +#define BNXT_RE_FLAG_SETUP_NQ 13 +#define BNXT_RE_FLAG_BOND_DEV_REGISTERED 14 +#define BNXT_RE_FLAG_PER_PORT_DEBUG_INFO 15 +#define BNXT_RE_FLAG_DEV_LIST_INITIALIZED 16 +#define BNXT_RE_FLAG_ERR_DEVICE_DETACHED 17 +#define BNXT_RE_FLAG_INIT_DCBX_CC_PARAM 18 +#define BNXT_RE_FLAG_STOP_IN_PROGRESS 20 +#define BNXT_RE_FLAG_ISSUE_ROCE_STATS 29 +#define BNXT_RE_FLAG_ISSUE_CFA_FLOW_STATS 30 + struct ifnet *netdev; + struct auxiliary_device *adev; + struct bnxt_qplib_chip_ctx *chip_ctx; + struct bnxt_en_dev *en_dev; + struct bnxt_re_nq_record nqr; + int id; + struct delayed_work worker; + u16 worker_30s; + struct bnxt_re_tc_rec tc_rec[2]; + u8 cur_prio_map; + /* RCFW Channel */ + struct bnxt_qplib_rcfw rcfw; + /* Device Resources */ + struct bnxt_qplib_dev_attr *dev_attr; + struct bnxt_qplib_res qplib_res; + struct bnxt_qplib_dpi dpi_privileged; + struct bnxt_qplib_cc_param cc_param; + struct mutex cc_lock; + struct mutex qp_lock; + struct list_head qp_list; + u8 roce_mode; + + /* Max of 2 lossless traffic class supported per port */ + u16 cosq[2]; + /* Start: QP for handling QP1 packets */ + struct bnxt_re_gsi_context gsi_ctx; + /* End: QP for handling QP1 packets */ + bool is_virtfn; + u32 num_vfs; + u32 espeed; + /* + * For storing the speed of slave interfaces. + * Same as espeed when bond is not configured + */ + u32 sl_espeed; + /* To be used for a workaround for ISER stack */ + u32 min_tx_depth; + /* To enable qp debug info. Disabled during driver load */ + u32 en_qp_dbg; + /* Array to handle gid mapping */ + char *gid_map; + + struct bnxt_re_device_stats stats; + struct bnxt_re_drv_dbg_stats *dbg_stats; + /* debugfs to expose per port information*/ + struct dentry *port_debug_dir; + struct dentry *info; + struct dentry *drv_dbg_stats; + struct dentry *sp_perf_stats; + struct dentry *pdev_debug_dir; + struct dentry *pdev_qpinfo_dir; + struct bnxt_re_debug_entries *dbg_ent; + struct workqueue_struct *resolve_wq; + struct list_head mac_wq_list; + struct workqueue_struct *dcb_wq; + struct workqueue_struct *aer_wq; + u32 event_bitmap[3]; + bool unreg_sched; + u64 dbr_throttling_reg_off; + u64 dbr_aeq_arm_reg_off; + u64 dbr_db_fifo_reg_off; + void *dbr_page; + u64 dbr_bar_addr; + u32 pacing_algo_th; + u32 pacing_en_int_th; + u32 do_pacing_save; + struct workqueue_struct *dbq_wq; + struct workqueue_struct *dbr_drop_recov_wq; + struct work_struct dbq_fifo_check_work; + struct delayed_work dbq_pacing_work; + /* protect DB pacing */ + struct mutex dbq_lock; + /* Control DBR pacing feature. Set if enabled */ + bool dbr_pacing; + /* Control DBR recovery feature. Set if enabled */ + bool dbr_drop_recov; + bool user_dbr_drop_recov; + /* DBR recovery feature. Set if running */ + bool dbr_recovery_on; + u32 user_dbr_drop_recov_timeout; + /* + * Value used for pacing algo when pacing is active + */ +#define BNXT_RE_MAX_DBR_DO_PACING 0xFFFF + u32 dbr_do_pacing; + u32 dbq_watermark; /* Current watermark set in HW registers */ + u32 dbq_nq_id; /* Current NQ ID for DBQ events */ + u32 dbq_pacing_time; /* ms */ + u32 dbr_def_do_pacing; /* do_pacing when no congestion */ + u32 dbr_evt_curr_epoch; + bool dbq_int_disable; + + bool mod_exit; + struct bnxt_re_dbr_sw_stats *dbr_sw_stats; + struct bnxt_re_dbr_res_list res_list[BNXT_RE_RES_TYPE_MAX]; + struct bnxt_dbq_nq_list nq_list; + char dev_name[IB_DEVICE_NAME_MAX]; + atomic_t dbq_intr_running; + u32 num_msix_requested; + unsigned char *dev_addr; /* For netdev->dev_addr */ +}; + +#define BNXT_RE_RESOLVE_RETRY_COUNT_US 5000000 /* 5 sec */ +struct bnxt_re_resolve_dmac_work{ + struct work_struct work; + struct list_head list; + struct bnxt_re_dev *rdev; + struct ib_ah_attr *ah_attr; + struct bnxt_re_ah_info *ah_info; + atomic_t status_wait; +}; + +static inline u8 bnxt_re_get_prio(u8 prio_map) +{ + u8 prio = 0xFF; + + for (prio = 0; prio < 8; prio++) + if (prio_map & (1UL << prio)) + break; + return prio; +} + +/* This should be called with bnxt_re_dev_lock mutex held */ +static inline bool __bnxt_re_is_rdev_valid(struct bnxt_re_dev *rdev) +{ + struct bnxt_re_dev *tmp_rdev; + + list_for_each_entry(tmp_rdev, &bnxt_re_dev_list, list) { + if (rdev == tmp_rdev) + return true; + } + return false; +} + +static inline bool bnxt_re_is_rdev_valid(struct bnxt_re_dev *rdev) +{ + struct bnxt_re_dev *tmp_rdev; + + mutex_lock(&bnxt_re_dev_lock); + list_for_each_entry(tmp_rdev, &bnxt_re_dev_list, list) { + if (rdev == tmp_rdev) { + mutex_unlock(&bnxt_re_dev_lock); + return true; + } + } + mutex_unlock(&bnxt_re_dev_lock); + + pr_debug("bnxt_re: %s : Invalid rdev received rdev = %p\n", + __func__, rdev); + return false; +} + +int bnxt_re_send_hwrm_cmd(struct bnxt_re_dev *rdev, void *cmd, + int cmdlen); +void bnxt_re_stopqps_and_ib_uninit(struct bnxt_re_dev *rdev); +int bnxt_re_set_hwrm_dscp2pri(struct bnxt_re_dev *rdev, + struct bnxt_re_dscp2pri *d2p, u16 count, + u16 target_id); +int bnxt_re_query_hwrm_dscp2pri(struct bnxt_re_dev *rdev, + struct bnxt_re_dscp2pri *d2p, u16 *count, + u16 target_id); +int bnxt_re_query_hwrm_qportcfg(struct bnxt_re_dev *rdev, + struct bnxt_re_tc_rec *cnprec, u16 tid); +int bnxt_re_hwrm_cos2bw_qcfg(struct bnxt_re_dev *rdev, u16 target_id, + struct bnxt_re_cos2bw_cfg *cfg); +int bnxt_re_hwrm_cos2bw_cfg(struct bnxt_re_dev *rdev, u16 target_id, + struct bnxt_re_cos2bw_cfg *cfg); +int bnxt_re_hwrm_pri2cos_cfg(struct bnxt_re_dev *rdev, + u16 target_id, u16 port_id, + u8 *cos_id_map, u8 pri_map); +int bnxt_re_prio_vlan_tx_update(struct bnxt_re_dev *rdev); +int bnxt_re_get_slot_pf_count(struct bnxt_re_dev *rdev); +struct bnxt_re_dev *bnxt_re_get_peer_pf(struct bnxt_re_dev *rdev); +struct bnxt_re_dev *bnxt_re_from_netdev(struct ifnet *netdev); +u8 bnxt_re_get_priority_mask(struct bnxt_re_dev *rdev, u8 selector); +struct bnxt_qplib_nq * bnxt_re_get_nq(struct bnxt_re_dev *rdev); +void bnxt_re_put_nq(struct bnxt_re_dev *rdev, struct bnxt_qplib_nq *nq); + +#define to_bnxt_re(ptr, type, member) \ + container_of(ptr, type, member) + +#define to_bnxt_re_dev(ptr, member) \ + container_of((ptr), struct bnxt_re_dev, member) + +/* Even number functions from port 0 and odd number from port 1 */ +#define BNXT_RE_IS_PORT0(rdev) (!(rdev->en_dev->pdev->devfn & 1)) + +#define BNXT_RE_ROCE_V1_PACKET 0 +#define BNXT_RE_ROCEV2_IPV4_PACKET 2 +#define BNXT_RE_ROCEV2_IPV6_PACKET 3 +#define BNXT_RE_ACTIVE_MAP_PORT1 0x1 /*port-1 active */ +#define BNXT_RE_ACTIVE_MAP_PORT2 0x2 /*port-2 active */ + +#define BNXT_RE_MEMBER_PORT_MAP (BNXT_RE_ACTIVE_MAP_PORT1 | \ + BNXT_RE_ACTIVE_MAP_PORT2) + +#define rdev_to_dev(rdev) ((rdev) ? (&(rdev)->ibdev.dev) : NULL) + +void bnxt_re_set_dma_device(struct ib_device *ibdev, struct bnxt_re_dev *rdev); +bool bnxt_re_is_rdev_valid(struct bnxt_re_dev *rdev); + +#define bnxt_re_rdev_ready(rdev) (bnxt_re_is_rdev_valid(rdev) && \ + (test_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags))) +#define BNXT_RE_SRIOV_CFG_TIMEOUT 6 + +int bnxt_re_get_device_stats(struct bnxt_re_dev *rdev); +void bnxt_re_remove_device(struct bnxt_re_dev *rdev, u8 removal_type, + struct auxiliary_device *aux_dev); +void bnxt_re_destroy_lag(struct bnxt_re_dev **rdev); +int bnxt_re_add_device(struct bnxt_re_dev **rdev, + struct ifnet *netdev, + u8 qp_mode, u8 op_type, u8 wqe_mode, u32 num_msix_requested, + struct auxiliary_device *aux_dev); +void bnxt_re_create_base_interface(bool primary); +int bnxt_re_schedule_work(struct bnxt_re_dev *rdev, unsigned long event, + struct ifnet *vlan_dev, + struct ifnet *netdev, + struct auxiliary_device *aux_dev); +void bnxt_re_get_link_speed(struct bnxt_re_dev *rdev); +int _bnxt_re_ib_init(struct bnxt_re_dev *rdev); +int _bnxt_re_ib_init2(struct bnxt_re_dev *rdev); +void bnxt_re_init_resolve_wq(struct bnxt_re_dev *rdev); +void bnxt_re_uninit_resolve_wq(struct bnxt_re_dev *rdev); + +/* The rdev ref_count is to protect immature removal of the device */ +static inline void bnxt_re_hold(struct bnxt_re_dev *rdev) +{ + atomic_inc(&rdev->ref_count); + dev_dbg(rdev_to_dev(rdev), + "Hold ref_count = 0x%x", atomic_read(&rdev->ref_count)); +} + +static inline void bnxt_re_put(struct bnxt_re_dev *rdev) +{ + atomic_dec(&rdev->ref_count); + dev_dbg(rdev_to_dev(rdev), + "Put ref_count = 0x%x", atomic_read(&rdev->ref_count)); +} + +/* +* Responder Error reason codes *** 21957 LINES SKIPPED *** From nobody Mon Jun 3 19:25:10 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 4VtNwQ5VGGz5Js5x; Mon, 03 Jun 2024 19:25:10 +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 4VtNwQ30ftz4Vrc; Mon, 3 Jun 2024 19:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442710; 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=+i8KTVoHBynNpaw4pfiaN3e8AchIO3dYmurLLI3oKgs=; b=gWOPImVVzmbYiqrMtmaMcsuVneOiRO0pjT/w3EDDXhArBC5OiMGggdUIxU3JAiY1dt+Tz+ lm7OQH0/AazSQl1Oap9hJNrLy9Z1hQyOcyQM1tpYNhHxcpJYVx86fvmyXIT5a2o5m5yrc3 evdBxCo/CGceczziJ49ZcaGSB5kSIUrlQos5rD77E4xYdG2IK9MnKhFsc3aWN9wfNYwesr AQrWI6ci0l8AK3VOFKLYsd+/QZnILeWnctA8iZUwRVtjBsjKixl8yKt255i6h4Rtsk2Vug OiWuYL+PbnXXc+lzYyobyPONOJI9py5UA3loZKqD5r7NFmmITa2+c+u6g7bnhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442710; a=rsa-sha256; cv=none; b=H6mibuW2pKYe5+uWSAs3JPhWDbYRXPlVLR0yRsTASkmuALhZxLFQPDw6rN1IpZET4MeAKC zMNPuyBmhdMX/804wU25lUEHDh3f6K4+UMC8E8nO64HuARNaje1pVEcWcyK+8Dy07Kh1vk wnrBWPpLESacvA/nQ9OUzE4NC9/N/6UUfVdiS7uDFYBhEHzhlpuqwwSRJuObDYn7zGWiKM hLuwl6pWa7rlADto/OMl/6HWPvTL2zsFMZpOABYb1+hOyIsS45470y6Q9cHrmrPJdhCbfW FN+wT9tj0dd2bHEyl1hSqCa/WL2RL028O31q3py+uZUjaYxl70RBz4PrN6sqGA== 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=1717442710; 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=+i8KTVoHBynNpaw4pfiaN3e8AchIO3dYmurLLI3oKgs=; b=aNsLnPCqKMEv3lcv+vlGjf42bbbke+Apqaudq6vUIDYqSBytLKbYoXcvd4xIBGtgXtOFse bU3JRajKlw3MHWbiQLcAasyyK54vatszDBKfi3wmXYBusVmqXDt2IGJFnRy3LL65TaX6pr bGxJjR9tfoLlNvkD/lyyNI5pmiSqVB1ZCQlQKXuQHvbsbBBjEGDCSA/5S3zlsn/PcMTlEc /MQfxjNmOMMvKkMoZ7/YulGUp9rC//ufH6m6ZrsVfcAKQx5YxQ0nX2NPKv31p5sZHhfs4I l5TvPQ4ZEC1cJGE2hQdYB40Vbv+dam0ED/6c18vvlphcRCbv1U9ZGkIFro3xnw== 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 4VtNwQ2d1Zznpr; Mon, 3 Jun 2024 19:25:10 +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 453JPA70068238; Mon, 3 Jun 2024 19:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JPAAv068235; Mon, 3 Jun 2024 19:25:10 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:10 GMT Message-Id: <202406031925.453JPAAv068235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 54478f4b7ead - stable/14 - bnxt_re: Explicitly cast pointer-to-integer conversions 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 54478f4b7ead1db3ca885f3befa3eca48675c850 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=54478f4b7ead1db3ca885f3befa3eca48675c850 commit 54478f4b7ead1db3ca885f3befa3eca48675c850 Author: Mark Johnston AuthorDate: 2024-05-28 13:04:21 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 bnxt_re: Explicitly cast pointer-to-integer conversions Reported by: Jenkins Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver") (cherry picked from commit bbe42332e5b2cbe16a885360fad4462d13c7b357) --- sys/dev/bnxt/bnxt_re/qplib_fp.c | 2 +- sys/dev/bnxt/bnxt_re/qplib_sp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/bnxt/bnxt_re/qplib_fp.c b/sys/dev/bnxt/bnxt_re/qplib_fp.c index 438f7ddd468e..3f1b02406f7f 100644 --- a/sys/dev/bnxt/bnxt_re/qplib_fp.c +++ b/sys/dev/bnxt/bnxt_re/qplib_fp.c @@ -660,7 +660,7 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, goto exit; /* Configure the request */ req.dpi = cpu_to_le32(srq->dpi->dpi); - req.srq_handle = cpu_to_le64(srq); + req.srq_handle = cpu_to_le64((uintptr_t)srq); srq_size = min_t(u32, srq->hwq.depth, U16_MAX); req.srq_size = cpu_to_le16(srq_size); pg_sz_lvl |= (_get_base_pg_size(&srq->hwq) << diff --git a/sys/dev/bnxt/bnxt_re/qplib_sp.c b/sys/dev/bnxt/bnxt_re/qplib_sp.c index 8faa3cd9390c..c414718a816f 100644 --- a/sys/dev/bnxt/bnxt_re/qplib_sp.c +++ b/sys/dev/bnxt/bnxt_re/qplib_sp.c @@ -582,7 +582,7 @@ int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A || mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B) req.access = CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY; - req.mrw_handle = cpu_to_le64(mrw); + req.mrw_handle = cpu_to_le64((uintptr_t)mrw); bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), sizeof(resp), 0); From nobody Mon Jun 3 19:25:11 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 4VtNwS0g8yz5JsBr; Mon, 03 Jun 2024 19:25:12 +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 4VtNwR439rz4Vpk; Mon, 3 Jun 2024 19:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442711; 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=oGINzoh1TljyXgAWi7Gud6nvTqPzMstk1vpXCw1Mjxk=; b=RJaV+JJMhgANnmGvgJ6JCQb6s2djSctP13o3BlSeoFG0qYQPDtn97dsxja62IfKCqSI1ra jChOqf/R9AeeV4JPq2lByqh5Djg0zQq05nIdMCKw0F+3Evdho7X2KWwbtzPEI6UyG+MfE8 oqwrv4Y+T2e4rlk6yrt56jnKlt4YfKPmZUMmZ5EyA5w+C5ZHCVDTsMw9Qzz3hD6Jpjsq6j hOdvXFqimAqZxnswAuqtwSB1K827oHSBjc5q+4rOMhJkDuaXlUJw9reHCy6YJkwFS8HlBe sC6Y47Q1XnrkcAD6ekia903tEvQWdGjYqvdG43iZGTVXAoXBRh2+/KW2eAz/xQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442711; a=rsa-sha256; cv=none; b=atw5PpbO2qvS3sP3NgY/GmAUnJcpFUKYknt+q6yxFZZZVT7mc9LfOnRmOg+w5OaJGmgVsY RQ+8j37GfUh89MDZPf7WDDOiFMkPtq9wCgn7LR0uNATzmeVEp/hKvRwikId03GdSHDSiYv XJUqj4DUbE7b8bHGik3E5fOEaVkgdyrlKThS909o/3F9gecrtzYL2vX3php2MBjuznnsdx hMDmNRthIAoeCgMzLnXldczZha02OvG0f6UebZjlQIYV6hIbRug+0IBYdvh0IDrzUEASAS AW15CRUINRnOFl+TOnq6cbL7xqLUHljJWqfzteTPjSuChbAgZAwCHQtlPoYoSw== 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=1717442711; 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=oGINzoh1TljyXgAWi7Gud6nvTqPzMstk1vpXCw1Mjxk=; b=JQwefVmDku1BKK0BCbsZTph1pk7g9d47AmuA49v77mPUzHSdGBTxGDcusyNLDUXYGQJvJX +kvOhRdzOyX/m/3wFmdyWRtsZCmep40aFjhd8ku6kLGfncIDjw+OPEbbqy/4G1k666efbR bFEdJ/z5QYjiYIWO1DEkLKnhQxo3qN50Xj+I2XM30KubSlnAdMHfO+FjHLS3Uh2q8Z9bCf ZwaQ6Bu89TE5es20sGf1AEym9/ZqH+52dZge+eFZ3JBo0cI3QoEa96XBHq1A7APfnmx4SC /tTCUNK6InKaUhF65HhakT5JQOOcFpR5tL1J9aBga7EBSGjTMD0SrUuZ+EHVdQ== 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 4VtNwR3dfZznRH; Mon, 3 Jun 2024 19:25:11 +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 453JPBZC068280; Mon, 3 Jun 2024 19:25:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JPBT4068277; Mon, 3 Jun 2024 19:25:11 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:11 GMT Message-Id: <202406031925.453JPBT4068277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2e7991d03888 - stable/14 - Fix bnxt build in LINT 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e7991d038888bda9d8959d14f5963db29c41654 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2e7991d038888bda9d8959d14f5963db29c41654 commit 2e7991d038888bda9d8959d14f5963db29c41654 Author: Warner Losh AuthorDate: 2024-05-29 15:45:47 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 Fix bnxt build in LINT LINT includes bnxt_re driver. Adjust the path in files, add missing files and add a new BNXT_C to build (which thinly wraps OFED version with bnxt specicif stuff). Sponsored by: Netflix Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver") (cherry picked from commit 175b2c00a6bcb0c8c1f6b76b6da9bf4879a5848e) --- sys/conf/files | 13 ++++++++----- sys/conf/kern.pre.mk | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 7d3c44893e09..bf4d7d9cabfc 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1322,11 +1322,14 @@ dev/bhnd/siba/siba_bhndb.c optional siba bhnd bhndb dev/bhnd/siba/siba_erom.c optional siba bhnd dev/bhnd/siba/siba_subr.c optional siba bhnd # -dev/bnxt/bnxt_hwrm.c optional bnxt iflib pci -dev/bnxt/bnxt_mgmt.c optional bnxt iflib pci -dev/bnxt/bnxt_sysctl.c optional bnxt iflib pci -dev/bnxt/bnxt_txrx.c optional bnxt iflib pci -dev/bnxt/if_bnxt.c optional bnxt iflib pci +dev/bnxt/bnxt_en/bnxt_auxbus_compat.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_dcb.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_hwrm.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_mgmt.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_sysctl.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_txrx.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_ulp.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/if_bnxt.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bwi/bwimac.c optional bwi dev/bwi/bwiphy.c optional bwi dev/bwi/bwirf.c optional bwi diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 567c68e5887e..53b9862f2145 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -335,6 +335,10 @@ MLXFW_C= ${OFED_C_NOIMP} \ -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ ${.IMPSRC} +# BNXT Driver +BNXT_CFLAGS= -I$S/dev/bnxt/bnxt_en ${OFEDCFLAGS} +BNXT_C_NOIMP= ${CC} -c -o ${.TARGET} ${BNXT_CFLAGS} ${WERROR} +BNXT_C= ${BNXT_C_NOIMP} ${.IMPSRC} GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c From nobody Mon Jun 3 19:25:12 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 4VtNwS68LSz5JsBv; Mon, 03 Jun 2024 19:25:12 +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 4VtNwS4ySyz4Vy8; Mon, 3 Jun 2024 19:25:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442712; 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=zoq5WXn5kFjCfZB6PBnlqhhIg55vdZGkzefgBg3zzqM=; b=Dd6UhGuZwDjvoeRdYfi2cWMebiehRL7cBqHqNVgXSm0iQ/J80xRZ+6TPd0JNbiNGO7nDj4 r5hRxU+9xQtsW3Xrbgvdw5wbS/dV91Bft0/14ETsd7vraV/wGZ482j3p0rw2iwMaXW/a9s X0ZvFTwfdffkAubAIGX5HqHafjTcDmWZw3xzmn4mOUFx3O/8I32jFTdqDL549GFp+YPAUa hOlukLdpT5Rfsuu3UCUa4pB9TvFDfI0zV+5NWaM3CC74VWHEFS9IKd5lyVrszitTK2HnS8 UJ1qqvI3cBb45jbjieZ9tw1N1bi5kM885i+za+Vjd+3R84KmzBHqYeDDI2AvtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442712; a=rsa-sha256; cv=none; b=izglEIO4th8niYIDV+dFf2G4m1wV3Ps650AsKuuhUrnxjey1DY8pImtk0nuMLH4DRBaRp6 zvAY+YpFcc8pluluPt4T+NZvM6hmCpQlpmCcWWwzOiEiOyXJtK9/XmYdv74FDqst+r7ddK xh7R89L0dgk4MEBpq1B5vkitqPdUrM4KyKdc8zcbXGdHPEAXjaTJQDqmM41gWQN6lm1AvB yUt63IylddQ/KWpscW506fxyrL4eQEEtgAyKZTmc7YzZnBslJSvO3IWj6CSAeGtPetH5Xz pPhzfz/9bZKC9NORWbWvdGT45qZN1xGzF3QTIsl8kYp72e52hhKite1SeqJzfQ== 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=1717442712; 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=zoq5WXn5kFjCfZB6PBnlqhhIg55vdZGkzefgBg3zzqM=; b=VZvOElITQIXvDn0gp6Azimb0aD4wxO8TY2rqID0cmPYDLU7Th/CoJziTH/9AyN7JZf6sK/ 7fMcRxWQHdDiqYNM41jYgxTm8RBsLzO28qnLqzv0ZM/s4SCqtFrl5cEqftb24Bmav5NfYV sH0gHbBHByKk9crnFB3yddasZQT6NGokos4A+bVJxuQAkxgaA46eexIj4L3jf46aTO9Yrd QB8eAUB5pblNQglxq2eHgDXyIKNS5MahGll4g9egcJXgn+bAQbtQbYTUAqrSyf9AHbmnnQ 6+V6+LaGteCds5cZPSL2qRUYcsgpwFhnUhALPqDWVSanAbdYEb1AJVn0rKXyww== 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 4VtNwS4VL7znPG; Mon, 3 Jun 2024 19:25:12 +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 453JPCbx068325; Mon, 3 Jun 2024 19:25:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JPCHX068322; Mon, 3 Jun 2024 19:25:12 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:12 GMT Message-Id: <202406031925.453JPCHX068322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 76a34e9d942e - stable/14 - bnxt_{en/re}: Update bnxt_en and bnxt_re Makefile 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 76a34e9d942ecc23d017d04c799c938acdac252c Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=76a34e9d942ecc23d017d04c799c938acdac252c commit 76a34e9d942ecc23d017d04c799c938acdac252c Author: Chandrakanth patil AuthorDate: 2024-05-15 07:05:17 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 bnxt_{en/re}: Update bnxt_en and bnxt_re Makefile Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45202 (cherry picked from commit faeff3b851dae6e9eb836c59756476e162ea3c40) --- sys/modules/bnxt/bnxt_en/Makefile | 2 +- sys/modules/bnxt/bnxt_re/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/bnxt/bnxt_en/Makefile b/sys/modules/bnxt/bnxt_en/Makefile index ebe9564fa22f..de08d7c500c4 100644 --- a/sys/modules/bnxt/bnxt_en/Makefile +++ b/sys/modules/bnxt/bnxt_en/Makefile @@ -3,7 +3,7 @@ KMOD = if_bnxt SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h -SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_ratelimit.h +SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += bnxt_txrx.c if_bnxt.c SRCS += bnxt_hwrm.c SRCS += bnxt_sysctl.c diff --git a/sys/modules/bnxt/bnxt_re/Makefile b/sys/modules/bnxt/bnxt_re/Makefile index d6aa701dbae6..2e1dbc048dfb 100644 --- a/sys/modules/bnxt/bnxt_re/Makefile +++ b/sys/modules/bnxt/bnxt_re/Makefile @@ -8,7 +8,7 @@ SRCS += qplib_res.c qplib_res.h SRCS += qplib_rcfw.c qplib_rcfw.h SRCS += stats.c stats.h SRCS += main.c bnxt_re.h -SRCS += opt_inet.h opt_inet6.h opt_ratelimit.h +SRCS += opt_inet.h opt_inet6.h SRCS += ${LINUXKPI_GENSRCS} CFLAGS+= -I${SRCTOP}/sys/dev/bnxt/bnxt_en From nobody Mon Jun 3 19:25:13 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 4VtNwV3x6Qz5JsKH; Mon, 03 Jun 2024 19:25:14 +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 4VtNwT6Zf3z4W2v; Mon, 3 Jun 2024 19:25:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442713; 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=urGKOaGD4y7p5scb181Le5RDHs5IlzEgT9yBnWwRk/w=; b=tCkxoHtEWIzUJ30kEgn+LTcp0Qu9Dsy2uf/nAR5X/82amBAflFa7w3k/GZU0YBb1JFRkmW yvvc3YwOwlEhjiRah77iyJN2BQC+gYga7fCte5ycENDflHFM/b6m2yYDMcck0bVzuTRW4y nySWz3nAXB08n7PiH8TFfccM8u8cji2/fb+AuEC+9pPLwBmI92P2Bb4IKMpRgAswU/hZYx 0zxIgRbHj/h7z/ggE4ZiN8C0IIojJqF1e8q4eSYFNumMHFuavksrnVQBDWiYRJCRSeyJhA 0eylgp0vqrLGd7h4JYlv9ZpBSgRSKP3TNThuC8+FC7kes3sUgC6fDb3MbOTmrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442713; a=rsa-sha256; cv=none; b=ys+7nHBNLDn0uEg4F32beHWR4RBXI5JGqFYmCb/IyatFQDcJ1TywNmZzmJpGiPbhFN2ii+ Bfk/lv3cRrWCP1Sj3IkNYrcOjpD4dzQUpLQlsUNQDFxBq0YT/NZKFA/8f2JLXPFji+5WJk P9FSebeI6epvclN31LG8gbUbo0cBok9VdfGO6T3l26/PDprNQb7+MAojefbJtt3lPmYfyQ FcOBAjJ0OZUjPtMxxXXZTMevEpReqCNDxdHMpjT7nq1apGH1igvMsbUn/YwbB2NJcNvSYi woI9a7YsIxklQd9nXYDMu7QRUYy90Lku/paTV2w8lHHJQTuouN9etgsQr8nKPw== 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=1717442713; 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=urGKOaGD4y7p5scb181Le5RDHs5IlzEgT9yBnWwRk/w=; b=WB4clmDmrPWYcgM8KqDKh5ZjbsDNAKcjXIwBy8Ko1Kw4m0JZ/k3oLDHfmZ16F9FYPTbBgp K0jxUBKJRlCOJLE4MpYe5dbDCw5B5Ly96xIx2iO2ZpfP7UwyGGlcF6aoYbhhIYn2F1dtgl lZqWUS/qCx3C5ho3Rr4/JtFCz/eLwIJhyHO5ZiMNx99m2ozpLGWRRGczL9gVB7uNyETC+E izClddR0G3WtVLRYRsmkMxIQ1kNa+2ijP7KwrWd1eGi8QJOs579mi5wkUYNJbnkYpJvzfF k7c4044SRsinQyWD/wKv74aSpPPjRCvM/RodgpzORLzufUTGlznxvllnVznevg== 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 4VtNwT5WyQznML; Mon, 3 Jun 2024 19:25:13 +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 453JPDEx068379; Mon, 3 Jun 2024 19:25:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JPDc8068376; Mon, 3 Jun 2024 19:25:13 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:13 GMT Message-Id: <202406031925.453JPDc8068376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 20213402c678 - stable/14 - bnxt: Add a module makefile to fix the build 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 20213402c67895fe0c66e58a2138d77f7e40c496 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=20213402c67895fe0c66e58a2138d77f7e40c496 commit 20213402c67895fe0c66e58a2138d77f7e40c496 Author: Mark Johnston AuthorDate: 2024-05-28 12:02:19 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 bnxt: Add a module makefile to fix the build Fixes: 35b53f8c989f ("bnxt_en: Add PFC, ETS & App TLVs protocols support") (cherry picked from commit bf56e8b9c8639ac4447d223b83cdc128107cc3cd) --- sys/modules/bnxt/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/modules/bnxt/Makefile b/sys/modules/bnxt/Makefile new file mode 100644 index 000000000000..32aec4806a2c --- /dev/null +++ b/sys/modules/bnxt/Makefile @@ -0,0 +1,4 @@ +SUBDIR= bnxt_en \ + bnxt_re + +.include From nobody Mon Jun 3 19:25:14 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 4VtNwW32DTz5JsFV; Mon, 03 Jun 2024 19:25:15 +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 4VtNwW0Sxlz4W33; Mon, 3 Jun 2024 19:25:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442715; 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=sEY64ihpqCUSa+XQP4KGHh2Vb2QgSnjSvXku6x3pbIc=; b=bxvFGqwXcEJVtQNML5fwA1w9wgUGJXs4wWGgb7eYmYezL9UpePrqTP1LMeYkwr94XCosDm BypLym+DOTNRlTNJz6jErK18Awp1Lben8RRjsCKec+4HE5cd9vVrvslexc8hTqI7tfZsV7 H2Xb3A4HA+TAnaHkiG/KglsezsZOgrOQt0vewTvzDSIL3Sbbmx08gaqZGCB9OFlvHsGdc5 V7Pgw+69u9OuZp47l22uPHCISr0INKWAZeJ884D5s1YV1qi/s+dCtB6nGH3wadfz6rkcIl JAGbLzUXLTLbpAYsA9v3e8aEW5HqVMmLZWwPT3j006ipK7yMwEv0lKSY7O/pRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442715; a=rsa-sha256; cv=none; b=aOq0xpg9YgbSbiz6TI79DAGWb+G7pCt8K8WZy4/WvtQi5I/p3zsmCuJNlWulmLKghCDJ/i GmlVaG0J+Af3hjdlpPfWMfyIZOkNoLhA2Huq/MV6cWSTD3rH1nEBasCzeL9C4O55oNtlNz tMYJwV3GKeIYP4C90kjcTLv/AIvTho4dFPiH0uJ+wzeZnphTTrC0nmjUr5cvTcMPXaqxk+ sf4b/4IgCdGYiwBhYx0SPYsb2BBuWYieH1/oer5W0IiIMdSzc393zZse2gnQ/RzaALwbRp 2B65pIy2MVasn4KkasLAzcXjjfiGMrU0MRftDhCMUOi53WImNSs3SFJde71R4g== 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=1717442715; 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=sEY64ihpqCUSa+XQP4KGHh2Vb2QgSnjSvXku6x3pbIc=; b=sdRqCbBvD9KtbKFKkTwUcLpSwg/AkjK9VisThp9ZDIDtjoNEjROFKOJT058TkBCpyxdCxo hBfiJbnm79CdDhQoGgOnTGBM28lYdHFMNifEgnPcUbc8I9GFB4zjoqCL8U4Oemhjd6e945 0QeVCsRzY39qdad8vK6U0ai9agapk62TBSLI6vtgGQ5Bxt+WFcBJxNAhH6HWTt5c8dgT70 DlfMAv93hCUfkirbKDCkuRPvqqtVR8lVe0gQotZv3JDTp9YTt3e97nyXgVT+GaCXXOeDhs m9OAAKewumj1njK9+vfU5dtjNVXAZJvNsOJAAkduCX7vGuj0JaMh7kswLK8OOA== 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 4VtNwV6X9DznRJ; Mon, 3 Jun 2024 19:25:14 +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 453JPEkD068433; Mon, 3 Jun 2024 19:25:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JPE28068430; Mon, 3 Jun 2024 19:25:14 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:14 GMT Message-Id: <202406031925.453JPE28068430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: bce36dfef81e - stable/14 - bnxt: Do not compile on 32-bit platforms 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bce36dfef81e95f9382de4fecafbb5df54b50204 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bce36dfef81e95f9382de4fecafbb5df54b50204 commit bce36dfef81e95f9382de4fecafbb5df54b50204 Author: Mark Johnston AuthorDate: 2024-05-28 13:05:14 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 bnxt: Do not compile on 32-bit platforms The new bnxt_re driver doesn't compile on any of them (it uses writeq() from the LinuxKPI, which isn't implemented there), and had already been disconnected from the build on i386. Reported by: Jenkins Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver") (cherry picked from commit c867ba72889de51b0bd2c6a7049f539abaafd46e) --- sys/modules/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 4b4534aee076..24e2bbabe481 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -436,8 +436,8 @@ SUBDIR+= dtrace SUBDIR+= opensolaris .endif -# Requires bus_space_read_8 -.if ${MACHINE_ARCH} != "i386" +.if ${MACHINE_ARCH} != "i386" && ${MACHINE_CPUARCH} != "arm" && \ + ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" _bnxt= bnxt .endif From nobody Mon Jun 3 19:25:15 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 4VtNwX5vnpz5JsC7; Mon, 03 Jun 2024 19:25:16 +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 4VtNwX1Q0sz4WBR; Mon, 3 Jun 2024 19:25:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442716; 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=QuOU60b9fjLQdUTWkqIOmJQuVCqgZ9za824LZw8ZSBE=; b=uK9o9AcIJAXN7n36Vu97otRC1kXqbUC2uiA2z4q95sWSG8fsQcEL0tyR+Dwy4dqbM/LHIK Lr9FnhGyh4QOn6fcYaZAKaRE3m3coYfpS3QUkiRX/GAvsa/yf3+191CoB8QhiBvT4nbO9T yFMaOtJen4qZMWNms8r6Yj8hn3tXevmawE25rJ8zZQU70WcodkqkvVethlYDYdRDaPsaKL beEWXsQ33lIsu1cmhpFymE6QIQlGWkQj9PiXYqn1S8OLnzDjea0m4H0Y9y7ljP1P/fB6rd XzGj9O11dZTt8jrLpD2xt3yXsc/YnxaTOjtDtUInJbMBAJLqNn/Kx82YoH2A0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442716; a=rsa-sha256; cv=none; b=bAY0Y+uyoMcgHgZR8BEOkqLM7kIorvB6LQ0R7WA6DkVP10nnwilbvNn2LN6XsjchokvKJg ObNF5xEjI/nS5kRhoX5g6K8GfnHhcepkXzsazxhWW/6fuWjWgATFcYHjsZoUztWpVpqBL/ codGeLCTrZok+XCZO61Pt4gb7mSYDtI5eSGhdEL+pCHk9lULblD8lGAeA6mMweBCXRpI9c 7jLaJRT4fVumtAIDOlaDWjNBMsZHGW9azZz2frGmCukLsen+ZnU4LnmJP4q5jgQ5w0E2k2 oGSpN307WaLuYc4MJiH7/5z9ChucQ/1/FyU3tTdEWba6IfodEeTMA0sarlUbWQ== 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=1717442716; 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=QuOU60b9fjLQdUTWkqIOmJQuVCqgZ9za824LZw8ZSBE=; b=HOV4jpM7DyQD2uAVr5ckjTJXYL2q4EZSqTmawo7+VezqwJzHuD7R+JjTuQubGc5tJJDz4S DmuHaCa+24mcCQNK+JOJjBf/grk/A08WucwJtOvWq7HMVnmMDB7rjm4ADOKLAqYf62EPx3 OrTNlBSBerOvL22KlknH8oESpKpb2+j/XWByzouczQITLgIw/OXFCkec6Mh3r2FmSS65dV HaV5a+DpmrptxnGen+D55gZYV5vrRVHUQ6qsuUfIf0ceVVhvYOtRXwB8RUEW3afAgi3Du+ SDwaW92mQUkz8d+MDYPIwALfGM5+lR8xG75LA87GYbh4KpAqvpdIlOs79R4f1Q== 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 4VtNwX0PhSznPH; Mon, 3 Jun 2024 19:25:16 +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 453JPFi8068475; Mon, 3 Jun 2024 19:25:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JPFce068472; Mon, 3 Jun 2024 19:25:15 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:25:15 GMT Message-Id: <202406031925.453JPFce068472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: eff27c387230 - stable/14 - Fix bnxt build in LINT 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eff27c3872300e594e0b410364a02302fc555121 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eff27c3872300e594e0b410364a02302fc555121 commit eff27c3872300e594e0b410364a02302fc555121 Author: Warner Losh AuthorDate: 2024-05-29 15:45:47 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:15 +0000 Fix bnxt build in LINT LINT includes bnxt_re driver. Adjust the path in files, add missing files and add a new BNXT_C to build (which thinly wraps OFED version with bnxt specicif stuff). Sponsored by: Netflix Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver") (cherry picked from commit 175b2c00a6bcb0c8c1f6b76b6da9bf4879a5848e) --- sys/modules/bnxt/bnxt_re/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/bnxt/bnxt_re/Makefile b/sys/modules/bnxt/bnxt_re/Makefile index 2e1dbc048dfb..d6aa701dbae6 100644 --- a/sys/modules/bnxt/bnxt_re/Makefile +++ b/sys/modules/bnxt/bnxt_re/Makefile @@ -8,7 +8,7 @@ SRCS += qplib_res.c qplib_res.h SRCS += qplib_rcfw.c qplib_rcfw.h SRCS += stats.c stats.h SRCS += main.c bnxt_re.h -SRCS += opt_inet.h opt_inet6.h +SRCS += opt_inet.h opt_inet6.h opt_ratelimit.h SRCS += ${LINUXKPI_GENSRCS} CFLAGS+= -I${SRCTOP}/sys/dev/bnxt/bnxt_en From nobody Mon Jun 3 19:31:02 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 4VtP3B3tTWz5JslW; Mon, 03 Jun 2024 19:31: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 4VtP3B3NV2z4cVR; Mon, 3 Jun 2024 19:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717443062; 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=e7tX937ptuh3lcgaAHQVKJzJHn/d6DeKk53lQc6i7d4=; b=CTnoKydGs+jNG0899sRYGGTuKcCnq7mXc/K+j8B7OhZjck8mYMpAH9yOCmeRJMYB80DQ+U kVI3Q17XbLddpNAPu7MnJNTxIeujwbcZsDq7s1uVQ0GkLflT4JArz7zBowTP+zBJaCTM5N W44VTASJwkOxbQimWmXNLNyhHMTdg17cwiNw/UkFKwuwFaja6YLy3ffsRZbkNXdrkRi46g lDQEeP0QBOeoyP3aaNKwEIi1cC6NmhrAMW2bKausmUp41nmAxz6Sa08F27N0P5ydbz041I SiEbdckIZ+gvFxryOZl1O/fpnknzGqvo4zsEQ5sFAxY33JRa6oGkUZ/YGmqfKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717443062; a=rsa-sha256; cv=none; b=XIHE8pxAqsPN7pfX1d/OZfIRKwrV/N32C3N85tapcBfLnrcqSARv/Us/XodleURZVGalDO 8cj5T8dXznf8nC/IiMaJyM16u925nlvvx00LEyB2jMofmu8/C1NN5dAOtuGfFen1djU2ZL CYGz43+bjN5MN/Q+Z3W7h1aophVztU4TL63sQVUPmuY6m3Ci0x2vEYzoXcwqMfjtpDfZX/ Z4Q1OZ6QvkJgBOle/S/pBOHwD0jY2I1RwcM/4Vt0GnhFTKJ3np5rWg8NyYR+hHYsaUwtb9 YTv9+SY4r4qpFFECO67U1tmPTLeIDw/J+o5UEc/erNgjbvDCNhCzldwnyGpNlw== 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=1717443062; 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=e7tX937ptuh3lcgaAHQVKJzJHn/d6DeKk53lQc6i7d4=; b=e//ZqJx+dQSG3cJ7kywnqnG5YwqK+G54Bp/BH2Oe8m7oxTubX4GwNcTOTSwVlTGkF5yOQg GQdEdIZfL98nmjUvpDBgv+WNE4oOae6bNJN9EeuYD1HCWR4l2gCqviXyMPcUygi0H6RbbN hnMN+UtWD7SLVgh9P5dgpumaubZnuxUWzObCwjOdJxtIMfnYgvx27xou+JxNPxyjfWf6wD kMoZOu5hoSCPwRcyJeKOWpsQdl3jEM8J7PWTqE2Oq4vHrWwScDb8Xu+pPXgke8C9K8sGtP QLr93Lmil/6FlWOoxxC7Dck1m5Pt8uP0polotvFBASlaI/bEVFHjBQBuXKcRdQ== 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 4VtP3B2nMXznnQ; Mon, 3 Jun 2024 19:31:02 +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 453JV2Eh081927; Mon, 3 Jun 2024 19:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JV2IM081924; Mon, 3 Jun 2024 19:31:02 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:31:02 GMT Message-Id: <202406031931.453JV2IM081924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: fbfdf57d65be - main - Fix off-by-one bug in btpand 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: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbfdf57d65bedfab28f9debc8a4a8d6802f9338a Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=fbfdf57d65bedfab28f9debc8a4a8d6802f9338a commit fbfdf57d65bedfab28f9debc8a4a8d6802f9338a Author: Dapeng Gao AuthorDate: 2024-06-03 19:30:36 +0000 Commit: Jessica Clarke CommitDate: 2024-06-03 19:30:36 +0000 Fix off-by-one bug in btpand `ul` reaches `__arraycount(services)` before the bound-check happens, causing undefined behaviour. Reviewed by: imp, jrtc27 Fixes: 7718ced0ea98 ("Add btpand(8) daemon from NetBSD.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45463 --- usr.sbin/bluetooth/btpand/btpand.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bluetooth/btpand/btpand.c b/usr.sbin/bluetooth/btpand/btpand.c index d4bc15823290..f0b29837188f 100644 --- a/usr.sbin/bluetooth/btpand/btpand.c +++ b/usr.sbin/bluetooth/btpand/btpand.c @@ -143,11 +143,14 @@ main(int argc, char *argv[]) case 's': /* service */ case 'S': /* service (no SDP) */ - for (ul = 0; strcasecmp(optarg, services[ul].name); ul++) { - if (ul == __arraycount(services)) - errx(EXIT_FAILURE, "%s: unknown service", optarg); + for (ul = 0; ul < __arraycount(services); ul++) { + if (strcasecmp(optarg, services[ul].name) == 0) + break; } + if (ul == __arraycount(services)) + errx(EXIT_FAILURE, "%s: unknown service", optarg); + if (ch == 's') service_name = services[ul].name; From nobody Mon Jun 3 20:12:59 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 4VtPzb5kxXz5JxQs for ; Mon, 03 Jun 2024 20:12:59 +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 4VtPzb55hpz4gvQ; Mon, 3 Jun 2024 20:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717445579; 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=SlKSe633k6QuR/AdKXandCqWFE/82JaXZ/PF1kGXkRQ=; b=w4/AGQRgYYH+GhWxAqfYI/g6HGI4OLlsYAPUXvswY3hu9FNt4JDcX3HiIc8LHfBV7uRd2R 3W3Jt4S7OkK9Kc7fsA5gCpk3MXtnC6yFbW9CmvXY6FnASVH8iuopv6UOzGQFsG8Wx+hwzn tM/dk6xi3DtI3u3PkHSbFr/rLyyROgpHxQc3FP7nCAax5ew5VbHncyKafK5CPzI83DE9XX RbTx4tMzyUW9xUYIzHtqxujopf+xGko7JhRXpgb3Bm2nAPVjqQe4VRpF2BHHb9USxLyj/8 GcZM5gY7LJUOsMc23f0hPSfCtaOuk334a6gbaFWEvKY52D8ObMyubUumrDIdeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717445579; a=rsa-sha256; cv=none; b=B3V73tEm+QmgB29S29OYv/FSHF6qAzir0PLsVPHjjfLjU1Cp/8OU1osyGcHZ833HjyVDk+ 7mXWKyf26DtnVU8AwpvIEyfhHLYqSRY6VNH74v+vNlHxXkZKrzjOvxOqhypPrXfnyePe8q d2qAStDIdyjiX67DgtidnxlFMAMr+cU1ELSIgFsso5PQYid0Tij7qyeS/e6AkyQDLHHS/8 H8YbBVSm4WwVJN/h9KaJZr3DmXh+/XH4gkcyCqDgWmCVdvzWGPDN8tMb9aLo0vw3/pKlg+ 3yr+yOlAWjNXTOtnBefEtLyxPqHetwGD7gFifB2Sl5Nw00iuGrVRZK+PFIwpMg== 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=1717445579; 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=SlKSe633k6QuR/AdKXandCqWFE/82JaXZ/PF1kGXkRQ=; b=IUCrrb5A+5UZsS03fE75myZbVPe+9OzcazoyisNyLhvaYpLiVUptWpNO6gYL/ms3Ockzen rIV3SorYvQvEDmoD4ZIRgLDdfzbZEuTCcdQeS0s5VHlC4MeGqxz4w9VddIINQD9kwogtAw KK3WYSemlsR93bRwI+YfXRCXRHh+WQ1vcFg1+o3+kh5iVqmyDZ8f1UhN9Y4JrwahwW0zJP +17Ukf0HyKl5YjjyzMJ5AYCziTSUQQkZL8FgkaQFMJZzlpe1weEQ5IEFV3V0+oize9bQF9 dGkIQQEqYtgDZCVGb6HFpJsXWSz77zOAw58nPDIAdlEVVvIvSg/LFIY3dD+CoQ== 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 4VtPzb4jBGzpfl; Mon, 3 Jun 2024 20:12:59 +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 453KCxfg053128; Mon, 3 Jun 2024 20:12:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453KCxu8053125; Mon, 3 Jun 2024 20:12:59 GMT (envelope-from git) Date: Mon, 3 Jun 2024 20:12:59 GMT Message-Id: <202406032012.453KCxu8053125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 49f1aa4755ca - internal/admin - Release gordon from mentorship 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: emaste X-Git-Repository: src X-Git-Refname: refs/internal/admin X-Git-Reftype: branch X-Git-Commit: 49f1aa4755cab28e259437113b6b89689e817d59 Auto-Submitted: auto-generated The branch internal/admin has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=49f1aa4755cab28e259437113b6b89689e817d59 commit 49f1aa4755cab28e259437113b6b89689e817d59 Author: Ed Maste AuthorDate: 2024-06-03 14:58:12 +0000 Commit: Ed Maste CommitDate: 2024-06-03 14:58:12 +0000 Release gordon from mentorship Approved by: delphij (co-mentor) Approved by: core (implicit) Event: Kitchener-Waterloo Hackathon 202406 --- mentors | 1 - 1 file changed, 1 deletion(-) diff --git a/mentors b/mentors index 8bf3992b5cc1..2a3cc4452f2a 100644 --- a/mentors +++ b/mentors @@ -14,7 +14,6 @@ bnovkov markj Co-mentor: jhb brd allanjude Co-mentor: bapt bryanv grehan def oshogbo -gordon delphij Co-mentor: emaste jfree imp Co-mentor: markj oh manu olce emaste Co-mentor: markj From nobody Mon Jun 3 20:33:04 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 4VtQQn21K3z5LDDY; Mon, 03 Jun 2024 20:33:05 +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 4VtQQm6rZjz4jtm; Mon, 3 Jun 2024 20:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717446785; 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=UPEtLXi4stQNcVrZb04Y63c6dc4vH8k6/vu69bkaYa0=; b=xlKXxYz3Re/34K/44yzrrmdhKQNZVApccDMLRAGo3mc/CndsVT859OArr+7DY9MFbVZn10 UC0qtVMQ2XFYcBq13x9VSWwc823D//QX8fTSs3TItTUoe02bi+NGhHRlinHwaRXriTvJGn KVtidmUv+P8L/RXG6H2OX2i6v97vEMyCefmqHFkiiLSeuWQUAT9lLbX/NTTLNlEPgd92Ou gdLjyIVjdh7ytnAvPQ1sVb0sjXmxZmBf7rrUJcaqn8eGxvwJGA1mchNWJkyIWZ4m2aqLHi YODH/xllrDWTKgQLLItVD+YBq7JsGXhqMPfFPXjQsjwnSf3nGLokCSMYtRM39A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717446785; a=rsa-sha256; cv=none; b=BAnoP7/tjdN0vToaAFLF8bWP+EsuPuvLuplxJeDdtxjYmaq91kmFJlTytndk377NaSYWVP O59AZ10ehy+QbPfDBI7SIAt9LtGfRVBKRIq/puilNUo3msNWOrJ0bbqJS3VEOUE97pmm+Q Jnap/LYPNdg3iqlsWYsbyGDh2DcuYYs4VG7H0sLBiYweIstiw2NFaApuw8av4Y0o8VKWoI 7NokGnC/tz+9TODjQogKBpt3UOB/RmCDEaaw4ocNG4I9YFATWXEvYEd5siyousKdEO6FND S73cB6UuqT+CudUrhcffHA3gv34bxWvNgZ8eGsXDI5koPQ7Pkxw12ZahsdGDXw== 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=1717446785; 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=UPEtLXi4stQNcVrZb04Y63c6dc4vH8k6/vu69bkaYa0=; b=Uj8T4b/zoRZ1GcdPZ+hoxpv6fpz//ORlX3COdT9VxjkMwR4Ch124jIlw0zpLU2vvaIQNd+ TG6000s+v4E4gSfkX5OaOp20HTDZaiL7MxoX/htfshXIn6FX+UvVeRgdqhayj3c4LT4bZp rgpshMLakfYMt+d/q+D5Oo8xrETBIiCP1j+reZlu2novgYwNnuiaro/BYySjfqQw0mcHBB DRnKRFgAsy8NRpcjYJ7WrGPqlr20kp9Y8nIW2z0r4BiZq6I0/6Nb7MC1HA/stt3fMdVK6Q Tuuva/vBDfxXE8xzRZTORghVotmpsGyjBnZa7QhX7IXYpD1KG1GFSg+be9KxBA== 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 4VtQQm6DGNzq9y; Mon, 3 Jun 2024 20:33:04 +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 453KX4oj086688; Mon, 3 Jun 2024 20:33:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453KX4ZP086685; Mon, 3 Jun 2024 20:33:04 GMT (envelope-from git) Date: Mon, 3 Jun 2024 20:33:04 GMT Message-Id: <202406032033.453KX4ZP086685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e0dcb9b611d3 - main - mfi: correct typo in sysctl/tunable description 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0dcb9b611d3b3e471d7bc30bcff7cd4e26c6f19 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e0dcb9b611d3b3e471d7bc30bcff7cd4e26c6f19 commit e0dcb9b611d3b3e471d7bc30bcff7cd4e26c6f19 Author: Ed Maste AuthorDate: 2024-06-03 20:31:16 +0000 Commit: Ed Maste CommitDate: 2024-06-03 20:32:36 +0000 mfi: correct typo in sysctl/tunable description Reported by: jrtc27 Reviewed by: lwhsu Sponsored by: The FreeBSD Foundation Event: Kitchener-Waterloo Hackathon 202406 --- sys/dev/mfi/mfi_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mfi/mfi_pci.c b/sys/dev/mfi/mfi_pci.c index de7d88556c8c..82082e6b72cf 100644 --- a/sys/dev/mfi/mfi_pci.c +++ b/sys/dev/mfi/mfi_pci.c @@ -112,7 +112,7 @@ SYSCTL_INT(_hw_mfi, OID_AUTO, msi, CTLFLAG_RDTUN, &mfi_msi, 0, static int mfi_mrsas_enable; SYSCTL_INT(_hw_mfi, OID_AUTO, mrsas_enable, CTLFLAG_RDTUN, &mfi_mrsas_enable, - 0, "Allow mrasas to take newer cards"); + 0, "Allow mrsas to take newer cards"); struct mfi_ident { uint16_t vendor; From nobody Mon Jun 3 20:49:21 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 4VtQnY573vz5LFBF; Mon, 03 Jun 2024 20:49:21 +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 4VtQnY2y9mz4mjM; Mon, 3 Jun 2024 20:49:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717447761; 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=maNMZ/UXxJBnasoK7YkOzeDKNq2Y93XIOyFenp67UL4=; b=aQbXUy1BJgEbmFEQM6VQtqIp8pnZnRN/GsHwAuZbohtFzxu3TRtwfobKb0wrmAkaFT6waU e4f1sY5z+43XN2s6qwayHP3hobmJVpVA6Il/WXqpr8Mc75jTlGXvCdWKrtYztLV+O5oczs eWjPzI+XVPzS5DbObDEYIwexI+QkhZTE3tZ8Pc2k9uKSpjBQ6HUgkD9elmHn616epz6qEj IrzX5J1xC/0SlZlsUSIbK7Xfht6BZ1mzWmzcFdIKguKnCCnwDb/YgCgdGqWWUGuPfkTN4Z I2adKxgxhnOfwFdPbX6G9s/gHW65dAcycLON9WlyZAijdO8glTHEOkJBQZxk5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717447761; a=rsa-sha256; cv=none; b=ArZQ7mIptERtg0G0J9MXXjRpQdOl9T/IG4P9dI/Wopi/NF9lCJkQuJYse+WlVztPnBbLzO vvYdlZkIIyigVrUKwNUvROp/qnOgBflXbAagZxtkMsT85BDvaiHlMrJJKLY65R34Z2cpC5 +WhkblxvHAhelBj/yljl/7qBkX6I74bdBUHFQED7eZExQTHFpY4ZqIONtnRy41MP+oIagk W/4l52a9e3iZc2+R/5m2uHv0cFvPkljtooLOekF70pF05DHLupp77KwWpkwmbj/9qwf6rW f3VgOoJgtApYcl54n0Fzr2VEAaf4R2oPzDGfxAY52QZRZINCzFjPmMZhbKVKag== 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=1717447761; 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=maNMZ/UXxJBnasoK7YkOzeDKNq2Y93XIOyFenp67UL4=; b=v7yFqBhHKWkZNQKGk86UNMCTjan8athQ+uIHf928TS/4ed2DJXJIMmBsCznhRzcEjD+96n Uvw/lgBCv/sOIsRWjPdKbr+DQfISYGudlWppExbsVIJgQIAmIzXxmFjJD4a+PVB1JavnDh PQiMVlhCTPU9DdonAiks9WkMmzkPLu0otRGjnYMlB46aNlN4nwcm0xkigCWamq8EkmJixN oJJLApG/VNAqWdV72qbFQQ5t3jsivy50IL1Dse5YkhFrMw3Q/g5Cdxxr8s2JE4OYDxusIh ibIysNHuca47LIeIJFrNCn+4DrrT3CS5lpsQP9BgMtd8/uwansLqX+sEfAfrJQ== 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 4VtQnY2YhJzqrK; Mon, 3 Jun 2024 20:49:21 +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 453KnL2N005086; Mon, 3 Jun 2024 20:49:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453KnL19005083; Mon, 3 Jun 2024 20:49:21 GMT (envelope-from git) Date: Mon, 3 Jun 2024 20:49:21 GMT Message-Id: <202406032049.453KnL19005083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: f3ab0d86e807 - main - bitset: Fix __BIT_FFS_AT()'s herald comment 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: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3ab0d86e8070c73bf2e2852341f8e5c709f5682 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f3ab0d86e8070c73bf2e2852341f8e5c709f5682 commit f3ab0d86e8070c73bf2e2852341f8e5c709f5682 Author: Olivier Certner AuthorDate: 2024-06-03 19:22:12 +0000 Commit: Olivier Certner CommitDate: 2024-06-03 20:48:49 +0000 bitset: Fix __BIT_FFS_AT()'s herald comment The manual page is correct though. No functional change. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Event: Kitchener-Waterloo Hackathon 202406 Sponsored by: The FreeBSD Foundation --- sys/sys/bitset.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h index 4afac9b172e8..2b26e8bcdbf9 100644 --- a/sys/sys/bitset.h +++ b/sys/sys/bitset.h @@ -232,8 +232,9 @@ } while (0) /* - * Note that `start` and the returned value from __BIT_FFS_AT are - * 1-based bit indices. + * 'start' and 'end' are 0-based bit (runtime) indices. Note that, as for ffs(), + * the returned index is 1-based, 0 being reserved to indicate that no bits are + * set. */ #define __BIT_FFS_AT(_s, p, start) __extension__ ({ \ __size_t __i; \ From nobody Tue Jun 4 00:01:18 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 4VtW321rgPz5LY4C; Tue, 04 Jun 2024 00:01:18 +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 4VtW321NJLz5705; Tue, 4 Jun 2024 00:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717459278; 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=HEgaodaXbFjcRH+q2tsLPjP4tw6Uenzk0x8LLzf5E58=; b=w04PwiH1S3xAAHO4MhvMFAO2jQKnE4nTPC9Kt0nuDbs8ojR0t3hv21999ZdmGUMQqTKUi+ ZAoPANW0isskuJvyYJ5X94Dd7pyMqQ7gUD5AC4iSKvMWs4ki72pza9hQXnMaJbHi/eSibd KQrBux/iPHl2EapltiHrU+Aq/Fhp1OuAXXtpVigCicry+ZjTzvgt23JAF2e5gxP08+Jf52 k9N/mtN0A5aeBeDRlosw5TsHRVVZcaFlbLbn2PGUh1dgOT9lLcSyct00IE8PbUeN0Vkgpk oAD9g3abijG/MLCUT39ZX6l0O8WKGgaH7tNIQLhcD0Fl7DM4LLF1k86tYNpj4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717459278; a=rsa-sha256; cv=none; b=Q9Vp02G/bMa/8DOJMTTeROKLBRdAcBrXoJ+vzccZHNu4ClRgEkbD2QS5295CdhV0gt2KyV /AqHyULx2uERnMSmE9SuRyZVnuedevtLkEWpwm+wyTQwV2mh61r03FItdzC1DanYKDOyQq K1lujjHaGhWMYhrssgs9f5pKXnAhX+i0gEiMydYfwVuwaSSFpj3P54RfAec5Q96WKxLzWO B33R2SXEmyR4Qmm9Z1smjU8kdd4/axqGhDudQZQH0kvhxMyp8/XMhiNjzNpnmTfhNEt+tk QJrqPRc3lyot8ZlD9nAHeLUIZ0Dn3Bie5aGCZts1LhvcoFJ6NddEhvJ9IFJWrw== 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=1717459278; 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=HEgaodaXbFjcRH+q2tsLPjP4tw6Uenzk0x8LLzf5E58=; b=SLbA2avMsYQFyGN/2xkudi5CymgTMYZaNxDNNOxJZSTiy9Xsdx0WNgLCkJhiY6qnrT90W7 FHi8wKmTamsXeyCutgTdWRV6uaToAmpa3rj5bH3ti3xDWlWLSMitkPYvh+uhxli4S05c8i 2TeKF0hhEuwRZpckZUq9XDJ46v+gX3SbNEeegUW9PzPi3JyTv8kGGncvaFOIPflKFPJKDX 6O9jRQ92Cov7iJhQgLQqtPENsEs9QkSaxWkhEkZDV7/SJP+mJBdB8kMc1iUKKPe1gPybgM q0yUEDvaAPBqAhxrdf3t7qWWe2feAy0oNOhIY4qI5fcoxAj6uzK7HBVOCgFvsg== 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 4VtW320zf6zwVx; Tue, 4 Jun 2024 00:01:18 +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 45401ITP036671; Tue, 4 Jun 2024 00:01:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45401IVu036668; Tue, 4 Jun 2024 00:01:18 GMT (envelope-from git) Date: Tue, 4 Jun 2024 00:01:18 GMT Message-Id: <202406040001.45401IVu036668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ef659a2d041c - main - snd_hda: Add Lenovo X1 Carbon Gen11 support 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef659a2d041c01b747ae4605160c24156cae081b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ef659a2d041c01b747ae4605160c24156cae081b commit ef659a2d041c01b747ae4605160c24156cae081b Author: Oleksandr Kryvulia AuthorDate: 2024-06-04 00:00:12 +0000 Commit: Christos Margiolis CommitDate: 2024-06-04 00:00:12 +0000 snd_hda: Add Lenovo X1 Carbon Gen11 support MFC after: 2 days Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D45361 --- sys/dev/sound/pci/hda/hdac.h | 2 ++ sys/dev/sound/pci/hda/pin_patch_realtek.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 6b6bc58a4818..191c835595ef 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -379,6 +379,7 @@ #define LENOVO_X230_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fa) #define LENOVO_X230T_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2203) #define LENOVO_T431S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2208) +#define LENOVO_X1CRBNG11_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2315) #define LENOVO_G580_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3977) #define LENOVO_L5AMD_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x381b) #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) @@ -573,6 +574,7 @@ #define HDA_CODEC_ALC284 HDA_CODEC_CONSTRUCT(REALTEK, 0x0284) #define HDA_CODEC_ALC285 HDA_CODEC_CONSTRUCT(REALTEK, 0x0285) #define HDA_CODEC_ALC286 HDA_CODEC_CONSTRUCT(REALTEK, 0x0286) +#define HDA_CODEC_ALC287 HDA_CODEC_CONSTRUCT(REALTEK, 0x0287) #define HDA_CODEC_ALC288 HDA_CODEC_CONSTRUCT(REALTEK, 0x0288) #define HDA_CODEC_ALC289 HDA_CODEC_CONSTRUCT(REALTEK, 0x0289) #define HDA_CODEC_ALC290 HDA_CODEC_CONSTRUCT(REALTEK, 0x0290) diff --git a/sys/dev/sound/pci/hda/pin_patch_realtek.h b/sys/dev/sound/pci/hda/pin_patch_realtek.h index 49afdedea8a1..abb03c92571b 100644 --- a/sys/dev/sound/pci/hda/pin_patch_realtek.h +++ b/sys/dev/sound/pci/hda/pin_patch_realtek.h @@ -582,6 +582,21 @@ static struct hdaa_model_pin_patch_t realtek_model_pin_patches[] = { } }, { } } + }, { /**** CODEC: HDA_CODEC_ALC287 ****/ + .id = HDA_CODEC_ALC287, + .patches = (struct model_pin_patch_t[]){ + { + .models = (struct pin_machine_model_t[]){ + PIN_SUBVENDOR(LENOVO_X1CRBNG11_SUBVENDOR), + { } + }, + .pin_patches = (struct pin_patch_t[]){ + PIN_PATCH_NOT_APPLICABLE(20), + PIN_PATCH_STRING(33, "as=1 seq=15 device=Headphones loc=Right"), + { } + } + }, { } + } }, { /**** CODEC: HDA_CODEC_ALC288 ****/ .id = HDA_CODEC_ALC288, .patches = (struct model_pin_patch_t[]){ From nobody Tue Jun 4 00:23:17 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 4VtWXQ0D0Lz5Lb5c; Tue, 04 Jun 2024 00:23:18 +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 4VtWXP6X92z591Q; Tue, 4 Jun 2024 00:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717460597; 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=oX6xAJHt4+OA6djs4+yeIzZVtaY3qAwKJN0P+rpPzgI=; b=tH/fczErJoYyNjGJ+f+kVGCG7xzyZbItxd2M0XEI9keuJhF2cjgPIaJba3u/orDTxY56d3 k7XQUIjDd/Xlx7d3WKj2t8GsHdN9rg6eSMnlcARzF2YZ/NPoyEU9FhnSkUK8SjG4A5/IWk ffBvLB0VP+teK/MJckIiHd6cPidRWKS0HNty9HOMklTRPBH8jY205UKMBvphxOnvopDQTB q5e06vlMWl+4hiCWNUBRQ+TLWBQEfDGAdAbbrHGPiHZZ3GqgKTyvE/SI3KTy1I3ob4BjrJ QXKo77N8vIJY7cWqeomxUVq0Btwqf8b+nrLaUWaaduTDB5Bqlj26hprr1Sf62A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717460597; a=rsa-sha256; cv=none; b=yPjU7+sWxa+m/UW4+lHWxadbde4objAJ1zRKrnW0FiK6u+JicioS00RswB+6TSWmYg+Am3 B3CZZ6JsBM8cXUIU9lFHqKqfCJJBwpwPyBbpqz2kFCbrrEyHNnMzyY+7FENf3lFU6r6ofF Ygzmjz7IKK5XHaoXEKYQHxXFxk9qrLEH3kXIytTAi4MZrAgxbcSQKM4GkWevlfIqySL2xi XWQJIlegJAYFwhJAAw/wE/JYGkyOh2LrEmDO3bquvtUWJfYZq9CtocVEy+mY9jqmrvw8Ic p8LqNIY+i/8m/LU0s15ex/26DMQXbxYAd4r+pT2ytvLiMrBBF91xZv5HHDbenw== 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=1717460597; 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=oX6xAJHt4+OA6djs4+yeIzZVtaY3qAwKJN0P+rpPzgI=; b=yumRaDIysUhiylCoj2iebHyGE7sSIiqWgZmgMRGOhyz13ElU4/y3gOzbMOrWRNIn8kUi2u rDIYM4MAMKXKwLFexh4Vi/oucRg/XkFWNAzm2t/thH/NNupPpe4VJcqaMAtlRIQCb4gGGL U/4KXyk3IufaNB103WPC1cNZ19aSpXab4muq0uy0yvHdsgsQcZ/RgIU9AGrA+V34AEEw83 7QcRusFrPbKnweqy4FE1ut+AlLVx8tQgNaZwJzNuw5yL+4UxrNiX4kGNbrBzAsCaDVoe4Q a7OnPfU+cbu6n4te5zgZH/4iej+ONLkLjAv3BHbe2r+rhFmqmf3N3EjW1Xh8uw== 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 4VtWXP5mk3zwnC; Tue, 4 Jun 2024 00:23:17 +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 4540NH2q077344; Tue, 4 Jun 2024 00:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4540NH99077341; Tue, 4 Jun 2024 00:23:17 GMT (envelope-from git) Date: Tue, 4 Jun 2024 00:23:17 GMT Message-Id: <202406040023.4540NH99077341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: badf44cc2124 - main - mbuf: provide m_freemp() 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: badf44cc21249a56e7d822a77acfdd21f8352d50 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=badf44cc21249a56e7d822a77acfdd21f8352d50 commit badf44cc21249a56e7d822a77acfdd21f8352d50 Author: Gleb Smirnoff AuthorDate: 2024-06-04 00:22:07 +0000 Commit: Gleb Smirnoff CommitDate: 2024-06-04 00:23:06 +0000 mbuf: provide m_freemp() This function follows both m_nextpkt and m_next linkage freeing all mbufs. Note that existing m_freem() follows only m_next. Reviewed by: khng Differential Revision: https://reviews.freebsd.org/D45477 --- sys/kern/kern_mbuf.c | 19 +++++++++++++++++++ sys/kern/uipc_mbuf.c | 3 +++ sys/sys/mbuf.h | 2 ++ 3 files changed, 24 insertions(+) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 44b6584f7331..5c1c5b095449 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -1591,6 +1591,25 @@ m_freem(struct mbuf *mb) mb = m_free(mb); } +/* + * Free an entire chain of mbufs and associated external buffers, following + * both m_next and m_nextpkt linkage. + * Note: doesn't support NULL argument. + */ +void +m_freemp(struct mbuf *m) +{ + struct mbuf *n; + + MBUF_PROBE1(m__freemp, m); + do { + n = m->m_nextpkt; + while (m != NULL) + m = m_free(m); + m = n; + } while (m != NULL); +} + /* * Temporary primitive to allow freeing without going through m_free. */ diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index d3389aeeccaf..d6b38cf8fbc8 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -111,6 +111,9 @@ SDT_PROBE_DEFINE1_XLATE(sdt, , , m__free, SDT_PROBE_DEFINE1_XLATE(sdt, , , m__freem, "struct mbuf *", "mbufinfo_t *"); +SDT_PROBE_DEFINE1_XLATE(sdt, , , m__freemp, + "struct mbuf *", "mbufinfo_t *"); + #include /* diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 741ae1b7c387..6e8454ea62d6 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -65,6 +65,7 @@ SDT_PROBE_DECLARE(sdt, , , m__cljget); SDT_PROBE_DECLARE(sdt, , , m__cljset); SDT_PROBE_DECLARE(sdt, , , m__free); SDT_PROBE_DECLARE(sdt, , , m__freem); +SDT_PROBE_DECLARE(sdt, , , m__freemp); #endif /* _KERNEL */ @@ -843,6 +844,7 @@ void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); +void m_freemp(struct mbuf *); void m_free_raw(struct mbuf *); struct mbuf *m_get2(int, int, short, int); struct mbuf *m_get3(int, int, short, int); From nobody Tue Jun 4 00:23:18 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 4VtWXR0NYbz5Lb5f; Tue, 04 Jun 2024 00:23:19 +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 4VtWXQ6gvKz58w9; Tue, 4 Jun 2024 00:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717460598; 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=r021potMeUwanzAC6+MwWK4TtSDoV6ENrDTXgKExdtg=; b=yBm/o1CbC7jK4m9QjMttJr0WLfdtsoQP4h8uu+Rhi8TNwpvcYMogSAnmq4wXtRnqdwsgNL Jbdg2bmYJt9/XXDnTwIpN+NPxmAi8xCrsCkNyHRLdxpLviDCf8yqQ7UiR/6fIaAjV2NB2I 2dPdyDHMRlc4XuMUQbONwHdOr87FmWDDeM5m4jeG0aI0y2g056Wk7YNzFiNduwtoz/AwBc Il3fTNxCqd/QghofQwJaLBrsYOFLcmuZEdUTRyq6n05R59c9rwuaMl5F9gpW62wQOUAXye fiq65t0Q+sGgWZKXEkTMZc0h1dibZMyLvs+GGy29pOZs1R3YGOR145cKi/8uHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717460598; a=rsa-sha256; cv=none; b=hbYFfra5WHRII35d+H70pRv8zmvap0+5TAHDM9zBizjvvKQg3fWYBgjus9efN7f+00OEVJ xxe4JAVkPGGdcGAtTPMzdyrPM2s8S1hEHAiA8lxV9YvrON7FD2FS8etKJUgRSzy3NYXxCo T7/y7j9+MN9n1rZghN1k1S1OvbaX2XoHLx75mJNKPLxSyNLALzsJzAyI6fdq9+A6qy1+85 hqDkV1xdygEckCNbYB+/kTYNYCxIvpvh4ybi+CENOnZGCDAZ2Hx2K8GlcZc6mQBEmqwaH8 h+3TlK9COoqnQiUtxS1jWy7R+geyUjZJp03J07QnXONHkdHJQ3+0NTabbBvKLg== 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=1717460598; 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=r021potMeUwanzAC6+MwWK4TtSDoV6ENrDTXgKExdtg=; b=P7YHn2/Mnz0wqDHbYkfg7q3A/BdXL2yeS0uuFDhdpylkd7GJpQbrg8PStiHaZWSnvkFlZo oFN1ozUpRlb0GxRsFFx5SI2k7svmkcP5d/alQQvDzxpmmRWMI5RKSrCKRd8xmr+Z+HZuY+ uEBg9uiYU6N2c/LBjnl0kNyigEwpgpD5Ljcykh/ypF7AY1bEwBmGkKD5lDtxnJjyA742gU UqC03/lCY6efFLB8TWyotDwA90Qqk1TlcWu+ZDZnAmqEWUtrSo0SmCXLt/Z8anMR666kC0 /FIvbLSA7tikNYabwSgSMloqnlfVT9kINYqo2IAp0BTekQHxjs9U5mKgybOT1g== 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 4VtWXQ6HKTzx1L; Tue, 4 Jun 2024 00:23:18 +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 4540NIPL077403; Tue, 4 Jun 2024 00:23:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4540NI1m077400; Tue, 4 Jun 2024 00:23:18 GMT (envelope-from git) Date: Tue, 4 Jun 2024 00:23:18 GMT Message-Id: <202406040023.4540NI1m077400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: a9b55a66440c - main - unix: use m_freemp() when disposing unix socket buffers 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9b55a66440ce67e545b60f2861badbfc5ec6327 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a9b55a66440ce67e545b60f2861badbfc5ec6327 commit a9b55a66440ce67e545b60f2861badbfc5ec6327 Author: Gleb Smirnoff AuthorDate: 2024-06-04 00:22:33 +0000 Commit: Gleb Smirnoff CommitDate: 2024-06-04 00:23:06 +0000 unix: use m_freemp() when disposing unix socket buffers The new unix/dgram uses m_nextpkt linkage, while the old unix/stream uses m_next linkage. This fixes memory leak. Diagnosed by: khng Reviewed by: khng, markj PR: 279467 Fixes: 458f475df8e5912609c14208c189414a8255c738 Differential Revision: https://reviews.freebsd.org/D45478 MFC After: 1 week --- sys/kern/uipc_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 6e83e2be6f05..0f01afa97878 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -2190,7 +2190,7 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2) if (m != NULL) { unp_scan(m, unp_freerights); - m_freem(m); + m_freemp(m); } } @@ -3280,7 +3280,7 @@ unp_dispose(struct socket *so) if (m != NULL) { unp_scan(m, unp_freerights); - m_freem(m); + m_freemp(m); } } From nobody Tue Jun 4 01:01:59 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 4VtXP40b4zz5Lww4 for ; Tue, 04 Jun 2024 01:02:00 +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 4VtXP406r6z49mW; Tue, 4 Jun 2024 01:02:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717462920; 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=TDLXejn6YDS85Oq98xQ7m3lEPSU/OiiXHuN3OzRl624=; b=OFHc9BpmQqcRCDTLNlMgRgXXeFKPLEAntW1TCQSNceenVGtSVU21HkspPN2m8nmv+Fn295 CHqvuQZueR3kI2W7vvffxOBX0JrDZLxAt6vGwqjSxbt8FVM8r0E2ZuThRqiCa+uSKuxx4p LNy2eA7Nth9IF4E6A9kdyjiotdBn8tT4/wJVXFe12XWn35GtnBYaXsERQRL6047UJqYfrR otykBtKNgFRChy0y+UjzpgKbc5oCtvACDZlVMtZDU4/gFfgt3lm4dXeOiNKGeES7T0zvw3 Y+3r3RbMRBxI/8qUvIvxv17CEtmgB220yHup4PNyWcT6DnNeU6ntlOgtjOLHQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717462920; a=rsa-sha256; cv=none; b=eouBQknWKTMm+ivOb0LXh0y2YYnGl3fPL47NfBNa38vLYM1j9w0rrjM4j4ZiYw47TEarRM qDJdDpGh7s1Ks+ES+KPa5MpB+TwJs6zypuFdSPiYX1MSwF6cGAEPT6QBtKNhrT86Jbqftw O69haXgvxdVG79ovhOfwdnMxtsfn18UCxOz5MdGDeU/raO+WTyO7srcRdfPY6kkcWUi3Qn M4IwavmD7St+xV3ObrhJrXKKpgJYEWTKz7RFfepStXIev2gvPMke3j+tk/Did+wZ2OwSKn OZ+D3NuAGFtXI9ewCWBi4x9kYTvUK0RRjtWSj2S+jvd7Pa4DO9NpKVQzgD2V+A== 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=1717462920; 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=TDLXejn6YDS85Oq98xQ7m3lEPSU/OiiXHuN3OzRl624=; b=fcQKu6qEo8DSEB98B6GDcRo79UAKznLxLE/JmNXzCxHSpA/011BB8ve9h1qhH4dH+sCzZ2 F/7CfaFxSGNb1XGg8k+eVFWPomVenGxQ+66RBwaJ1juOhWLub0tIUCII0dzr8M1r6NKgO4 eHBrOlTFkUyw096ZnRh94POp8F1Fu22fTQxjOIsd3XvcTMg610QlsAzoHzzzG97+U0s+od OcKTkFVtmKr5JsBFKAwlFLoTDfwIgq2XdVAMoaqHNrlPnYvmk4UI9nC1ZY+7QS6bVgcJfN QWqrwlf7Zg+x0eFVWCnRvz0CYEgmNFbo3jMgkcsNyy/H84XyTNDU2mzcAt+ucA== 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 4VtXP36TwDzxvV; Tue, 4 Jun 2024 01:01:59 +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 45411xQL043353; Tue, 4 Jun 2024 01:01:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45411xlS043352; Tue, 4 Jun 2024 01:01:59 GMT (envelope-from git) Date: Tue, 4 Jun 2024 01:01:59 GMT Message-Id: <202406040101.45411xlS043352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Xin LI Subject: git: a7819ed7ade8..b599c3410cda - vendor/xz - vendor branch updated 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/vendor/xz X-Git-Reftype: branch X-Git-Commit: b599c3410cda4294a1f24783c500a7ee63f2f3af X-Git-Oldrev: a7819ed7ade8bf37ad82b0b26da9237692430eef X-Git-Newrev: b599c3410cda4294a1f24783c500a7ee63f2f3af Auto-Submitted: auto-generated The branch vendor/xz has been updated by delphij: URL: https://cgit.FreeBSD.org/src/log/?id=a7819ed7ade8..b599c3410cda b599c3410cda Vendor import of xz 5.6.2 (trimmed) From nobody Tue Jun 4 01:01:59 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 4VtXP43B29z5Lx0g for ; Tue, 04 Jun 2024 01:02:00 +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 4VtXP40X6Sz49mX; Tue, 4 Jun 2024 01:02:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717462920; 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=pmbOt5pMDzS2isz5Kkoh277Y7PjKRCw2nvGan3r1vW4=; b=QmWuKRWXziOUdrC5wIjr2XWKKJ+VGDACihL7HltZnb1Xkm//mqhVru25cJGv1E4CSWU6Qo GEODF2x7z+2i2AC1dUexkJeZiEqWEl81XtYL4KI7Gc/fiTbMYNw5ouwwI5QrzmiaxjL8Y0 MGZ7bs0QSNjrd5V7NPIWKRbe5soICjP75ucmuQ8ceRUDkl8Jjd+Fo/r3Bu1czeWQkgVesr arwK5YBX33r0V9A3na55RmLgA0vY68F988Vuzu/3nGzXa+YSv0rkt6hTWsLSfFqeYpQ138 J5P8gM7UWYXVQydcWaTv8UQJ2JnldkebGDGtXLGu/99M8M1loxbEo/HERa21Vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717462920; a=rsa-sha256; cv=none; b=IAEoB/IuaHL6GTXz43Qev7NWk3hKxNhLcwU3zaJ1LnUyD19M5dXWwcNO6rZT1rYfPAQxbJ G8rOIhhmX2gex6QLD4oifS8f9lSL3qnem3lXrq3qAqOeSyUjqjjpR8Zpc9qKkEjwmRBwMX a1BiGkCqDWB3GOsSvVdmKqBVBB4jZ3pVTadUzro4u4UqcEiIccoYq/AziEIbRazmsXpQBV RTCvrHKvJoc16kKjfARaOo5JSlcOEXEn9C/SwhYkvT/63miN3cHYCu6s+e9tcM3PuKZJAR AlVN9sxIKXvl+lgYbMfXxfDNh1iu8Xaw956fD5IHndixLlrZsVpOhGTkeyRLtQ== 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=1717462920; 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=pmbOt5pMDzS2isz5Kkoh277Y7PjKRCw2nvGan3r1vW4=; b=o1utz8CWzB/N8fjU873eikC2ApSIMr7YObKdP2ZCIaqdyHrQYNiY8ASBXI6uM9NgqpSx1F EYBApwfc8xPZAwNBlYWMYP+83f/vCBQqLMh+UZVRUoPLe261qYS2tN+30zLu/TkZWrf0uh gl3NDZEyd7t8O75QLZw9p916ULiClPokBXYuqHsuuI6rJJjPDxKwXLHv6CaT75cAse4lAS JcpyFoU/ykwUEWevoSs0BSTUWgekbwXk0kT7HVAJz/aSN6eqZxij4INuIQfraKAJujmhLA QOKx1uDySYEG0fPeg/iDCIDn2CAOiNPdynXytE8ZdXUHNuCWc+NYuQpXPfYSCQ== 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 4VtXP36xQCzxjZ; Tue, 4 Jun 2024 01:01:59 +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 45411xr6043372; Tue, 4 Jun 2024 01:01:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45411xhA043371; Tue, 4 Jun 2024 01:01:59 GMT (envelope-from git) Date: Tue, 4 Jun 2024 01:01:59 GMT Message-Id: <202406040101.45411xhA043371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Xin LI Subject: git: a2307688092c - Create tag vendor/xz/5.6.2 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: delphij X-Git-Repository: src X-Git-Refname: refs/tags/vendor/xz/5.6.2 X-Git-Reftype: annotated tag X-Git-Commit: a2307688092c7d0f8d06ca2982517381d25a24a4 Auto-Submitted: auto-generated The annotated tag vendor/xz/5.6.2 has been created by delphij: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/xz/5.6.2 tag vendor/xz/5.6.2 Tagger: Xin LI TaggerDate: 2024-06-03 05:49:35 +0000 Tag xz 5.6.2. commit b599c3410cda4294a1f24783c500a7ee63f2f3af Author: Xin LI AuthorDate: 2024-06-03 05:49:22 +0000 Commit: Xin LI CommitDate: 2024-06-03 05:49:22 +0000 Vendor import of xz 5.6.2 (trimmed) From nobody Tue Jun 4 01:17:37 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 4VtXl84PM0z5M09b; Tue, 04 Jun 2024 01:17:40 +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 4VtXl849Cgz4Dk8; Tue, 4 Jun 2024 01:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717463860; 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=GBE0a1nMp5q07icGJ36SSTtGRCCuTL7BlqBY2pVHbg8=; b=noL2okV6A258Uu+LH9orspWz2bqiijuX6YkJub9CU0lMfOnCfdUcsOS/4DlKcGVxYjNhTY T7NcqHZXrE/O17ds/j18OR2rdVqNeCi+aa7wq/KYWR3aQwQZ2z+TqJbgPiI0lOFIKxecou 56u4lE0CCqOimzLsgMDHyQfeKGVdpQ8/dTa/zDMtr6LDijFiOhEvzSFqDksyZIraQTtp3o Xdf3vCsIbb3ag6rxaBIQIMBxYTs52NWpDAA+VMYJkqK/mUPuLnEteXQOua+x+CN6mZ9z+M vgTTIJr0iMvX/OjeIDE1WQd12YoqoayXtZYbCrNt6TB5n5wyeBJF3NLJsJvigA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717463860; a=rsa-sha256; cv=none; b=ieREiYufIeJsRCoW2tDsIHjYn7lgCi90QBWuGi7d1WJtcXgH7U9e45SSzw9Ia+iCwZszBe C1awWG63WwV/DR/m8IdRq8Bh2fgGLxyMLqbuZiE2m3fJ8ABy3ES1rHJnoMJ8ENrOxrBTDk hI47uwSm4Rt9Yz7dxTskFxTwwSEigTnOMA41GaDvpkKEe0g6z14k1BIhf7e4I+2lZdnbY0 MXhDerzARDwbCHQr0dHLPSfgN41+1SjmMH3Sbm1b78QafTbXjzwVuUktNo1nElCL4Epncv KsWzwWo0j0sjoQM4vdPj/msoPDwJIvu7exH8+ZMK3q4ZHnlwLik/ymtpl4galA== 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=1717463860; 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=GBE0a1nMp5q07icGJ36SSTtGRCCuTL7BlqBY2pVHbg8=; b=vkCPpQ0q2bxF+PqkxWRhsKIFvXk2nOo/O+oN1gYnIrNGPbqTKIq3tdiXORHeqqvmhpAXQH z+bzn+Fi0sEeh7mQRuUt4eGeNsQbTiARRYEPQhqPvjCvErD3tFCmPWs7/Ku0Fah3H0ruNc NankGKY5ACPkojF+0EFOV9N0w7/zndQgq/5hXnFvnq0e8rrR9vFkZOdFuVXz9VX1C0xwyo c078UPQ5EYStVHp4v4ilHrG5VCV93YL5DZWAuMAfykBB3dJPOLlTt9wLvq7IZLPegVE4Q8 KapPBZKXW6cqDgy6t+enW4zrXIGCF22WcMEDSE1/rnWfjBuoQ/AQNCiXV04REQ== 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 4VtXl83gZRzy5Y; Tue, 4 Jun 2024 01:17:40 +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 4541HeaE064401; Tue, 4 Jun 2024 01:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4541HbEi064389; Tue, 4 Jun 2024 01:17:37 GMT (envelope-from git) Date: Tue, 4 Jun 2024 01:17:37 GMT Message-Id: <202406040117.4541HbEi064389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 3b35e7ee8de9 - main - MFV: xz 5.6.2. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b35e7ee8de9b0260149a2b77e87a2b9c7a36244 Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=3b35e7ee8de9b0260149a2b77e87a2b9c7a36244 commit 3b35e7ee8de9b0260149a2b77e87a2b9c7a36244 Merge: a9b55a66440c b599c3410cda Author: Xin LI AuthorDate: 2024-06-04 01:14:43 +0000 Commit: Xin LI CommitDate: 2024-06-04 01:14:43 +0000 MFV: xz 5.6.2. MFC after: 4 weeks contrib/xz/AUTHORS | 49 +- contrib/xz/COPYING | 103 +- contrib/xz/COPYING.0BSD | 11 + contrib/xz/ChangeLog | 17790 ++++++++++--------- contrib/xz/README | 57 +- contrib/xz/THANKS | 13 +- contrib/xz/TODO | 4 - contrib/xz/doxygen/Doxyfile | 2698 +-- contrib/xz/doxygen/update-doxygen | 137 +- contrib/xz/src/common/mythread.h | 30 +- contrib/xz/src/common/sysdefs.h | 18 +- contrib/xz/src/common/tuklib_common.h | 27 +- contrib/xz/src/common/tuklib_config.h | 2 + contrib/xz/src/common/tuklib_cpucores.c | 5 +- contrib/xz/src/common/tuklib_cpucores.h | 5 +- contrib/xz/src/common/tuklib_exit.c | 5 +- contrib/xz/src/common/tuklib_exit.h | 9 +- contrib/xz/src/common/tuklib_gettext.h | 5 +- contrib/xz/src/common/tuklib_integer.h | 56 +- contrib/xz/src/common/tuklib_mbstr.h | 5 +- contrib/xz/src/common/tuklib_mbstr_fw.c | 5 +- contrib/xz/src/common/tuklib_mbstr_width.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.h | 5 +- contrib/xz/src/common/tuklib_physmem.c | 25 +- contrib/xz/src/common/tuklib_physmem.h | 5 +- contrib/xz/src/common/tuklib_progname.c | 5 +- contrib/xz/src/common/tuklib_progname.h | 5 +- contrib/xz/src/liblzma/api/lzma.h | 31 +- contrib/xz/src/liblzma/api/lzma/base.h | 25 +- contrib/xz/src/liblzma/api/lzma/bcj.h | 10 +- contrib/xz/src/liblzma/api/lzma/block.h | 5 +- contrib/xz/src/liblzma/api/lzma/check.h | 5 +- contrib/xz/src/liblzma/api/lzma/container.h | 17 +- contrib/xz/src/liblzma/api/lzma/delta.h | 5 +- contrib/xz/src/liblzma/api/lzma/filter.h | 11 +- contrib/xz/src/liblzma/api/lzma/hardware.h | 5 +- contrib/xz/src/liblzma/api/lzma/index.h | 42 +- contrib/xz/src/liblzma/api/lzma/index_hash.h | 5 +- contrib/xz/src/liblzma/api/lzma/lzma12.h | 7 +- contrib/xz/src/liblzma/api/lzma/stream_flags.h | 5 +- contrib/xz/src/liblzma/api/lzma/version.h | 9 +- contrib/xz/src/liblzma/api/lzma/vli.h | 10 +- contrib/xz/src/liblzma/check/check.c | 5 +- contrib/xz/src/liblzma/check/check.h | 5 +- contrib/xz/src/liblzma/check/crc32_arm64.h | 122 + contrib/xz/src/liblzma/check/crc32_fast.c | 158 +- contrib/xz/src/liblzma/check/crc32_small.c | 5 +- contrib/xz/src/liblzma/check/crc32_table.c | 34 +- contrib/xz/src/liblzma/check/crc32_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc32_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc32_tablegen.c | 23 +- contrib/xz/src/liblzma/check/crc32_x86.S | 5 +- contrib/xz/src/liblzma/check/crc64_fast.c | 446 +- contrib/xz/src/liblzma/check/crc64_small.c | 5 +- contrib/xz/src/liblzma/check/crc64_table.c | 16 +- contrib/xz/src/liblzma/check/crc64_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc64_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc64_tablegen.c | 15 +- contrib/xz/src/liblzma/check/crc64_x86.S | 5 +- contrib/xz/src/liblzma/check/crc_common.h | 137 + contrib/xz/src/liblzma/check/crc_macros.h | 30 - contrib/xz/src/liblzma/check/crc_x86_clmul.h | 428 + contrib/xz/src/liblzma/common/alone_decoder.c | 5 +- contrib/xz/src/liblzma/common/alone_decoder.h | 5 +- contrib/xz/src/liblzma/common/alone_encoder.c | 5 +- contrib/xz/src/liblzma/common/auto_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.h | 5 +- contrib/xz/src/liblzma/common/block_decoder.c | 5 +- contrib/xz/src/liblzma/common/block_decoder.h | 5 +- contrib/xz/src/liblzma/common/block_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_encoder.h | 5 +- .../xz/src/liblzma/common/block_header_decoder.c | 5 +- .../xz/src/liblzma/common/block_header_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_util.c | 5 +- contrib/xz/src/liblzma/common/common.c | 5 +- contrib/xz/src/liblzma/common/common.h | 5 +- .../xz/src/liblzma/common/easy_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/easy_decoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_encoder.c | 5 +- .../xz/src/liblzma/common/easy_encoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.h | 10 +- contrib/xz/src/liblzma/common/file_info.c | 5 +- .../xz/src/liblzma/common/filter_buffer_decoder.c | 7 +- .../xz/src/liblzma/common/filter_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/filter_common.c | 16 +- contrib/xz/src/liblzma/common/filter_common.h | 5 +- contrib/xz/src/liblzma/common/filter_decoder.c | 28 +- contrib/xz/src/liblzma/common/filter_decoder.h | 5 +- contrib/xz/src/liblzma/common/filter_encoder.c | 38 +- contrib/xz/src/liblzma/common/filter_encoder.h | 5 +- .../xz/src/liblzma/common/filter_flags_decoder.c | 5 +- .../xz/src/liblzma/common/filter_flags_encoder.c | 5 +- .../xz/src/liblzma/common/hardware_cputhreads.c | 5 +- contrib/xz/src/liblzma/common/hardware_physmem.c | 5 +- contrib/xz/src/liblzma/common/index.c | 5 +- contrib/xz/src/liblzma/common/index.h | 5 +- contrib/xz/src/liblzma/common/index_decoder.c | 16 +- contrib/xz/src/liblzma/common/index_decoder.h | 5 +- contrib/xz/src/liblzma/common/index_encoder.c | 5 +- contrib/xz/src/liblzma/common/index_encoder.h | 5 +- contrib/xz/src/liblzma/common/index_hash.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.h | 5 +- contrib/xz/src/liblzma/common/memcmplen.h | 37 +- contrib/xz/src/liblzma/common/microlzma_decoder.c | 5 +- contrib/xz/src/liblzma/common/microlzma_encoder.c | 5 +- contrib/xz/src/liblzma/common/outqueue.c | 5 +- contrib/xz/src/liblzma/common/outqueue.h | 10 +- .../xz/src/liblzma/common/stream_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/stream_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.h | 5 +- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 5 +- .../xz/src/liblzma/common/stream_flags_common.c | 5 +- .../xz/src/liblzma/common/stream_flags_common.h | 5 +- .../xz/src/liblzma/common/stream_flags_decoder.c | 5 +- .../xz/src/liblzma/common/stream_flags_encoder.c | 5 +- contrib/xz/src/liblzma/common/string_conversion.c | 26 +- contrib/xz/src/liblzma/common/vli_decoder.c | 5 +- contrib/xz/src/liblzma/common/vli_encoder.c | 5 +- contrib/xz/src/liblzma/common/vli_size.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.h | 5 +- contrib/xz/src/liblzma/delta/delta_decoder.c | 10 +- contrib/xz/src/liblzma/delta/delta_decoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.c | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_private.h | 5 +- contrib/xz/src/liblzma/liblzma.pc.in | 6 +- contrib/xz/src/liblzma/liblzma_generic.map | 4 +- contrib/xz/src/liblzma/liblzma_linux.map | 4 +- contrib/xz/src/liblzma/lz/lz_decoder.c | 48 +- contrib/xz/src/liblzma/lz/lz_decoder.h | 116 +- contrib/xz/src/liblzma/lz/lz_encoder.c | 9 +- contrib/xz/src/liblzma/lz/lz_encoder.h | 15 +- contrib/xz/src/liblzma/lz/lz_encoder_hash.h | 5 +- contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h | 4 +- contrib/xz/src/liblzma/lz/lz_encoder_mf.c | 5 +- contrib/xz/src/liblzma/lzma/fastpos.h | 5 +- contrib/xz/src/liblzma/lzma/fastpos_table.c | 4 +- contrib/xz/src/liblzma/lzma/fastpos_tablegen.c | 17 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.c | 5 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.c | 5 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_common.h | 41 +- contrib/xz/src/liblzma/lzma/lzma_decoder.c | 760 +- contrib/xz/src/liblzma/lzma/lzma_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder.c | 18 +- contrib/xz/src/liblzma/lzma/lzma_encoder.h | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_fast.c | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_normal.c | 7 +- contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder_private.h | 9 +- contrib/xz/src/liblzma/rangecoder/price.h | 5 +- contrib/xz/src/liblzma/rangecoder/price_table.c | 4 +- contrib/xz/src/liblzma/rangecoder/price_tablegen.c | 22 +- contrib/xz/src/liblzma/rangecoder/range_common.h | 14 +- contrib/xz/src/liblzma/rangecoder/range_decoder.h | 839 +- contrib/xz/src/liblzma/rangecoder/range_encoder.h | 5 +- contrib/xz/src/liblzma/simple/arm.c | 5 +- contrib/xz/src/liblzma/simple/arm64.c | 5 +- contrib/xz/src/liblzma/simple/armthumb.c | 5 +- contrib/xz/src/liblzma/simple/ia64.c | 5 +- contrib/xz/src/liblzma/simple/powerpc.c | 5 +- contrib/xz/src/liblzma/simple/riscv.c | 755 + contrib/xz/src/liblzma/simple/simple_coder.c | 5 +- contrib/xz/src/liblzma/simple/simple_coder.h | 22 +- contrib/xz/src/liblzma/simple/simple_decoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_decoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_private.h | 5 +- contrib/xz/src/liblzma/simple/sparc.c | 5 +- contrib/xz/src/liblzma/simple/x86.c | 16 +- contrib/xz/src/liblzma/validate_map.sh | 6 +- contrib/xz/src/lzmainfo/lzmainfo.1 | 4 +- contrib/xz/src/lzmainfo/lzmainfo.c | 5 +- contrib/xz/src/xz/args.c | 186 +- contrib/xz/src/xz/args.h | 8 +- contrib/xz/src/xz/coder.c | 607 +- contrib/xz/src/xz/coder.h | 42 +- contrib/xz/src/xz/file_io.c | 144 +- contrib/xz/src/xz/file_io.h | 21 +- contrib/xz/src/xz/hardware.c | 11 +- contrib/xz/src/xz/hardware.h | 5 +- contrib/xz/src/xz/list.c | 31 +- contrib/xz/src/xz/list.h | 5 +- contrib/xz/src/xz/main.c | 91 +- contrib/xz/src/xz/main.h | 5 +- contrib/xz/src/xz/message.c | 94 +- contrib/xz/src/xz/message.h | 16 +- contrib/xz/src/xz/mytime.c | 105 +- contrib/xz/src/xz/mytime.h | 11 +- contrib/xz/src/xz/options.c | 7 +- contrib/xz/src/xz/options.h | 5 +- contrib/xz/src/xz/private.h | 26 +- contrib/xz/src/xz/sandbox.c | 355 + contrib/xz/src/xz/sandbox.h | 43 + contrib/xz/src/xz/signals.c | 29 +- contrib/xz/src/xz/signals.h | 5 +- contrib/xz/src/xz/suffix.c | 17 +- contrib/xz/src/xz/suffix.h | 5 +- contrib/xz/src/xz/util.c | 36 +- contrib/xz/src/xz/util.h | 19 +- contrib/xz/src/xz/xz.1 | 469 +- contrib/xz/src/xzdec/xzdec.1 | 6 +- contrib/xz/src/xzdec/xzdec.c | 180 +- lib/liblzma/Makefile | 1 + lib/liblzma/config.h | 123 +- usr.bin/xz/Makefile | 1 + 217 files changed, 15386 insertions(+), 13436 deletions(-) diff --cc contrib/xz/COPYING.0BSD index 000000000000,4322122aecf1..4322122aecf1 mode 000000,100644..100644 --- a/contrib/xz/COPYING.0BSD +++ b/contrib/xz/COPYING.0BSD diff --cc contrib/xz/src/liblzma/check/crc32_arm64.h index 000000000000,39c1c63ec0ec..39c1c63ec0ec mode 000000,100644..100644 --- a/contrib/xz/src/liblzma/check/crc32_arm64.h +++ b/contrib/xz/src/liblzma/check/crc32_arm64.h diff --cc contrib/xz/src/liblzma/check/crc_common.h index 000000000000,63a7b5cefebf..63a7b5cefebf mode 000000,100644..100644 --- a/contrib/xz/src/liblzma/check/crc_common.h +++ b/contrib/xz/src/liblzma/check/crc_common.h diff --cc contrib/xz/src/liblzma/check/crc_x86_clmul.h index 000000000000,f1254ece18ed..f1254ece18ed mode 000000,100644..100644 --- a/contrib/xz/src/liblzma/check/crc_x86_clmul.h +++ b/contrib/xz/src/liblzma/check/crc_x86_clmul.h diff --cc contrib/xz/src/liblzma/simple/riscv.c index 000000000000,b18df8b637d0..b18df8b637d0 mode 000000,100644..100644 --- a/contrib/xz/src/liblzma/simple/riscv.c +++ b/contrib/xz/src/liblzma/simple/riscv.c diff --cc contrib/xz/src/xz/sandbox.c index 000000000000,5bd227370751..5bd227370751 mode 000000,100644..100644 --- a/contrib/xz/src/xz/sandbox.c +++ b/contrib/xz/src/xz/sandbox.c diff --cc contrib/xz/src/xz/sandbox.h index 000000000000,98b9862a1c0a..98b9862a1c0a mode 000000,100644..100644 --- a/contrib/xz/src/xz/sandbox.h +++ b/contrib/xz/src/xz/sandbox.h diff --cc lib/liblzma/Makefile index 85e7b87bbbf0,000000000000..e656ddd9bb45 mode 100644,000000..100644 --- a/lib/liblzma/Makefile +++ b/lib/liblzma/Makefile @@@ -1,176 -1,0 +1,177 @@@ + +PACKAGE=lib${LIB} +LIB= lzma +LZMADIR= ${SRCTOP}/contrib/xz/src/liblzma + +.PATH: ${LZMADIR:H}/common +SRCS+= tuklib_physmem.c tuklib_cpucores.c + +.PATH: ${LZMADIR}/api/lzma + +MAININCS= ../lzma.h +MAININCSDIR= ${INCLUDEDIR} + +LZMAINCS+= base.h \ + bcj.h \ + block.h \ + check.h \ + container.h \ + delta.h \ + filter.h \ + hardware.h \ + index.h \ + index_hash.h \ + lzma12.h \ + stream_flags.h \ + version.h \ + vli.h + +LZMAINCSDIR= ${INCLUDEDIR}/lzma + +INCSGROUPS= MAININCS LZMAINCS + +.PATH: ${LZMADIR}/common +SRCS+= common.c \ + block_util.c \ + easy_preset.c \ + filter_common.c \ + hardware_physmem.c \ + hardware_cputhreads.c \ + index.c \ + stream_flags_common.c \ + string_conversion.c \ + vli_size.c \ + alone_encoder.c \ + block_buffer_encoder.c \ + block_encoder.c \ + block_header_encoder.c \ + easy_buffer_encoder.c \ + easy_encoder.c \ + easy_encoder_memusage.c \ + filter_buffer_encoder.c \ + filter_encoder.c \ + filter_flags_encoder.c \ + index_encoder.c \ + lzip_decoder.c \ + microlzma_encoder.c \ + microlzma_decoder.c \ + stream_buffer_encoder.c \ + stream_encoder.c \ + stream_flags_encoder.c \ + vli_encoder.c \ + alone_decoder.c \ + auto_decoder.c \ + block_buffer_decoder.c \ + block_decoder.c \ + block_header_decoder.c \ + easy_decoder_memusage.c \ + file_info.c \ + filter_buffer_decoder.c \ + filter_decoder.c \ + filter_flags_decoder.c \ + index_decoder.c \ + index_hash.c \ + stream_buffer_decoder.c \ + stream_decoder.c \ + stream_decoder_mt.c \ + stream_flags_decoder.c \ + stream_encoder_mt.c \ + vli_decoder.c \ + outqueue.c + + +.PATH: ${LZMADIR}/check +SRCS+= check.c \ + crc32_table.c \ + crc64_table.c +.if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386" +SRCS+= crc32_x86.S \ + crc64_x86.S +ACFLAGS+= -Wa,--noexecstack +.else +SRCS+= crc32_fast.c \ + crc64_fast.c +.endif + +.PATH: ${LZMADIR}/lz +SRCS+= lz_encoder.c \ + lz_encoder_mf.c \ + lz_decoder.c + +.PATH: ${LZMADIR}/lzma +SRCS+= lzma_encoder.c \ + lzma_encoder_presets.c \ + lzma_encoder_optimum_fast.c \ + lzma_encoder_optimum_normal.c \ + fastpos_table.c \ + lzma_decoder.c \ + lzma2_encoder.c \ + lzma2_decoder.c + +.PATH: ${LZMADIR}/rangecoder +SRCS+= price_table.c + +.PATH: ${LZMADIR}/delta +SRCS+= delta_common.c \ + delta_encoder.c \ + delta_decoder.c + +.PATH: ${LZMADIR}/simple +SRCS+= simple_coder.c \ + simple_encoder.c \ + simple_decoder.c \ + x86.c \ + powerpc.c \ + ia64.c \ + arm.c \ + arm64.c \ + armthumb.c \ ++ riscv.c \ + sparc.c + +.PATH: ${LZMADIR} + +VERSION_MAJOR!= sed -n '/define.*LZMA_VERSION_MAJOR/{s,[^0-9.],,gp;q;}' \ + ${LZMADIR}/api/lzma/version.h +VERSION_MINOR!= sed -n '/define.*LZMA_VERSION_MINOR/{s,[^0-9.],,gp;q;}' \ + ${LZMADIR}/api/lzma/version.h +VERSION_PATCH!= sed -n '/define.*LZMA_VERSION_PATCH/{s,[^0-9.],,gp;q;}' \ + ${LZMADIR}/api/lzma/version.h + +WARNS?= 3 + +CFLAGS+= -DHAVE_CONFIG_H \ + -DTUKLIB_SYMBOL_PREFIX=lzma_ \ + -I${.CURDIR} \ + -I${LZMADIR}/api \ + -I${LZMADIR}/common \ + -I${LZMADIR}/check \ + -I${LZMADIR}/lz \ + -I${LZMADIR}/rangecoder \ + -I${LZMADIR}/lzma \ + -I${LZMADIR}/delta \ + -I${LZMADIR}/simple \ + -I${LZMADIR:H}/common + +LIBADD+= md pthread + +VERSION_DEF= ${.CURDIR}/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map + +CLEANFILES+= liblzma.pc + +PCFILES= liblzma.pc + +liblzma.pc: liblzma.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,/usr,g ; \ + s,@libdir@,${LIBDIR},g ; \ + s,@sharedlibdir@,${SHLIBDIR},g ; \ + s,@includedir@,${INCLUDEDIR},g ; \ + s,@LIBS@,-pthread -lmd,g ; \ + s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \ + s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \ + s,@PTHREAD_CFLAGS@,,g ; \ + s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET} + +.include diff --cc lib/liblzma/config.h index cfa53becb2ad,000000000000..ca7375dd8725 mode 100644,000000..100644 --- a/lib/liblzma/config.h +++ b/lib/liblzma/config.h @@@ -1,618 -1,0 +1,643 @@@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* How many MiB of RAM to assume if the real amount cannot be determined. */ +#define ASSUME_RAM 128 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* FreeBSD - disabled intentionally */ +/* #undef ENABLE_NLS */ + ++/* Define to 1 if ARM64 CRC32 instruction is supported. See configure.ac for ++ details. */ ++/* #undef HAVE_ARM64_CRC32 */ ++ +/* Define to 1 if bswap_16 is available. */ +/* #undef HAVE_BSWAP_16 */ + +/* Define to 1 if bswap_32 is available. */ +/* #undef HAVE_BSWAP_32 */ + +/* Define to 1 if bswap_64 is available. */ +/* #undef HAVE_BSWAP_64 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +#ifndef WITHOUT_CAPSICUM - /* Define to 1 if Capsicum is available. */ - #define HAVE_CAPSICUM 1 ++/* Define to 1 if you have the 'cap_rights_limit' function. */ ++#define HAVE_CAP_RIGHTS_LIMIT 1 +#endif + - /* Define to 1 if the system has the type `CC_SHA256_CTX'. */ ++/* Define to 1 if the system has the type 'CC_SHA256_CTX'. */ +/* #undef HAVE_CC_SHA256_CTX */ + - /* Define to 1 if you have the `CC_SHA256_Init' function. */ ++/* Define to 1 if you have the 'CC_SHA256_Init' function. */ +/* #undef HAVE_CC_SHA256_INIT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* Define to 1 if crc32 integrity check is enabled. */ +#define HAVE_CHECK_CRC32 1 + +/* Define to 1 if crc64 integrity check is enabled. */ +#define HAVE_CHECK_CRC64 1 + +/* Define to 1 if sha256 integrity check is enabled. */ +#define HAVE_CHECK_SHA256 1 + - /* Define to 1 if you have the `clock_gettime' function. */ ++/* Define to 1 if you have the 'clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + - /* Define to 1 if `CLOCK_MONOTONIC' is declared in . */ ++/* Define to 1 if 'CLOCK_MONOTONIC' is declared in . */ +#define HAVE_CLOCK_MONOTONIC 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_COMMONCRYPTO_COMMONDIGEST_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CPUID_H 1 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* FreeBSD - disabled intentionally */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if any of HAVE_DECODER_foo have been defined. */ +#define HAVE_DECODERS 1 + +/* Define to 1 if arm decoder is enabled. */ +#define HAVE_DECODER_ARM 1 + +/* Define to 1 if arm64 decoder is enabled. */ +#define HAVE_DECODER_ARM64 1 + +/* Define to 1 if armthumb decoder is enabled. */ +#define HAVE_DECODER_ARMTHUMB 1 + +/* Define to 1 if delta decoder is enabled. */ +#define HAVE_DECODER_DELTA 1 + +/* Define to 1 if ia64 decoder is enabled. */ +#define HAVE_DECODER_IA64 1 + +/* Define to 1 if lzma1 decoder is enabled. */ +#define HAVE_DECODER_LZMA1 1 + +/* Define to 1 if lzma2 decoder is enabled. */ +#define HAVE_DECODER_LZMA2 1 + +/* Define to 1 if powerpc decoder is enabled. */ +#define HAVE_DECODER_POWERPC 1 + ++/* Define to 1 if riscv decoder is enabled. */ ++#define HAVE_DECODER_RISCV 1 ++ +/* Define to 1 if sparc decoder is enabled. */ +#define HAVE_DECODER_SPARC 1 + +/* Define to 1 if x86 decoder is enabled. */ +#define HAVE_DECODER_X86 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + ++/* Define to 1 if you have the 'elf_aux_info' function. */ ++/* #undef HAVE_ELF_AUX_INFO */ ++ +/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */ +#define HAVE_ENCODERS 1 + +/* Define to 1 if arm encoder is enabled. */ +#define HAVE_ENCODER_ARM 1 + +/* Define to 1 if arm64 encoder is enabled. */ +#define HAVE_ENCODER_ARM64 1 + +/* Define to 1 if armthumb encoder is enabled. */ +#define HAVE_ENCODER_ARMTHUMB 1 + +/* Define to 1 if delta encoder is enabled. */ +#define HAVE_ENCODER_DELTA 1 + +/* Define to 1 if ia64 encoder is enabled. */ +#define HAVE_ENCODER_IA64 1 + +/* Define to 1 if lzma1 encoder is enabled. */ +#define HAVE_ENCODER_LZMA1 1 + +/* Define to 1 if lzma2 encoder is enabled. */ +#define HAVE_ENCODER_LZMA2 1 + +/* Define to 1 if powerpc encoder is enabled. */ +#define HAVE_ENCODER_POWERPC 1 + ++/* Define to 1 if riscv encoder is enabled. */ ++#define HAVE_ENCODER_RISCV 1 ++ +/* Define to 1 if sparc encoder is enabled. */ +#define HAVE_ENCODER_SPARC 1 + +/* Define to 1 if x86 encoder is enabled. */ +#define HAVE_ENCODER_X86 1 + - /* Define to 1 if you have the header file. */ - #define HAVE_FCNTL_H 1 - +/* Define to 1 if __attribute__((__constructor__)) is supported for functions. + */ +#define HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR 1 + - /* Define to 1 if you have the `futimens' function. */ ++/* Define to 1 if you have the 'futimens' function. */ +#define HAVE_FUTIMENS 1 + - /* Define to 1 if you have the `futimes' function. */ ++/* Define to 1 if you have the 'futimes' function. */ +/* #undef HAVE_FUTIMES */ + - /* Define to 1 if you have the `futimesat' function. */ ++/* Define to 1 if you have the 'futimesat' function. */ +/* #undef HAVE_FUTIMESAT */ + ++/* Define to 1 if you have the 'getauxval' function. */ ++/* #undef HAVE_GETAUXVAL */ ++ +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + - /* Define to 1 if you have the `getopt_long' function. */ ++/* Define to 1 if you have the 'getopt_long' function. */ +#define HAVE_GETOPT_LONG 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* FreeBSD - disabled intentionally */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +/* FreeBSD - only with clang because the base gcc does not support it */ +#if defined(__clang__) && defined(__FreeBSD__) && defined(__amd64__) +#define HAVE_IMMINTRIN_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + - /* Define to 1 if you have the header file. */ - #define HAVE_LIMITS_H 1 ++/* Define to 1 if Linux Landlock is supported. See configure.ac for details. ++ */ ++/* #undef HAVE_LINUX_LANDLOCK */ + +/* Define to 1 if .lz (lzip) decompression support is enabled. */ +#define HAVE_LZIP_DECODER 1 + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 to enable bt2 match finder. */ +#define HAVE_MF_BT2 1 + +/* Define to 1 to enable bt3 match finder. */ +#define HAVE_MF_BT3 1 + +/* Define to 1 to enable bt4 match finder. */ +#define HAVE_MF_BT4 1 + +/* Define to 1 to enable hc3 match finder. */ +#define HAVE_MF_HC3 1 + +/* Define to 1 to enable hc4 match finder. */ +#define HAVE_MF_HC4 1 + ++/* Define to 1 if MicroLZMA support is enabled. */ ++#define HAVE_MICROLZMA 1 ++ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MINIX_CONFIG_H */ + +/* Define to 1 if getopt.h declares extern int optreset. */ +#define HAVE_OPTRESET 1 + - /* Define to 1 if you have the `pledge' function. */ ++/* Define to 1 if you have the 'pledge' function. */ +/* #undef HAVE_PLEDGE */ + - /* Define to 1 if you have the `posix_fadvise' function. */ ++/* Define to 1 if you have the 'posix_fadvise' function. */ +#define HAVE_POSIX_FADVISE 1 + - /* Define to 1 if `program_invocation_name' is declared in . */ ++/* Define to 1 if 'program_invocation_name' is declared in . */ +/* #undef HAVE_PROGRAM_INVOCATION_NAME */ + - /* Define to 1 if you have the `pthread_condattr_setclock' function. */ ++/* Define to 1 if you have the 'pthread_condattr_setclock' function. */ +#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1 + +/* Have PTHREAD_PRIO_INHERIT. */ +#define HAVE_PTHREAD_PRIO_INHERIT 1 + - /* Define to 1 if you have the `SHA256Init' function. */ ++/* Define to 1 if you have the 'SHA256Init' function. */ +/* #undef HAVE_SHA256INIT */ + - /* Define to 1 if the system has the type `SHA256_CTX'. */ ++/* Define to 1 if the system has the type 'SHA256_CTX'. */ +#define HAVE_SHA256_CTX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SHA256_H 1 + - /* Define to 1 if you have the `SHA256_Init' function. */ ++/* Define to 1 if you have the 'SHA256_Init' function. */ +#define HAVE_SHA256_INIT 1 + - /* Define to 1 if the system has the type `SHA2_CTX'. */ ++/* Define to 1 if the system has the type 'SHA2_CTX'. */ +/* #undef HAVE_SHA2_CTX */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SHA2_H */ + +/* Define to 1 if optimizing for size. */ +/* #undef HAVE_SMALL */ + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + - /* Define to 1 if `st_atimensec' is a member of `struct stat'. */ ++/* Define to 1 if 'st_atimensec' is a member of 'struct stat'. */ +#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 + - /* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ ++/* Define to 1 if 'st_atimespec.tv_nsec' is a member of 'struct stat'. */ +#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 + - /* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */ ++/* Define to 1 if 'st_atim.st__tim.tv_nsec' is a member of 'struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC */ + - /* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ ++/* Define to 1 if 'st_atim.tv_nsec' is a member of 'struct stat'. */ +#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 + - /* Define to 1 if `st_uatime' is a member of `struct stat'. */ ++/* Define to 1 if 'st_uatime' is a member of 'struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_UATIME */ + +/* Define to 1 to if GNU/Linux-specific details are unconditionally wanted for + symbol versioning. Define to 2 to if these are wanted only if also PIC is + defined (allows building both shared and static liblzma at the same time + with Libtool if neither --with-pic nor --without-pic is used). This define + must be used together with liblzma_linux.map. */ +/* #undef HAVE_SYMBOL_VERSIONS_LINUX */ + ++/* Define to 1 if you have the 'sysctlbyname' function. */ ++/* #undef HAVE_SYSCTLBYNAME */ ++ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BYTEORDER_H */ + - #ifndef WITHOUT_CAPSICUM - /* Define to 1 if you have the header file. */ - #define HAVE_SYS_CAPSICUM_H 1 - #endif ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_CDEFS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_ENDIAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + - /* Define to 1 if you have the header file. */ - #define HAVE_SYS_TIME_H 1 - +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + - /* Define to 1 if the system has the type `uintptr_t'. */ ++/* Define to 1 if the system has the type 'uintptr_t'. */ +#define HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if _mm_set_epi64x and _mm_clmulepi64_si128 are usable. See + configure.ac for details. */ +#if defined(__FreeBSD__) && defined(__amd64__) +#define HAVE_USABLE_CLMUL 1 +#endif + - /* Define to 1 if you have the `utime' function. */ ++/* Define to 1 if you have the 'utime' function. */ +/* #undef HAVE_UTIME */ + - /* Define to 1 if you have the `utimes' function. */ ++/* Define to 1 if you have the 'utimes' function. */ +/* #undef HAVE_UTIMES */ + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#define HAVE_VISIBILITY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + - /* Define to 1 if you have the `wcwidth' function. */ ++/* Define to 1 if you have the 'wcwidth' function. */ +#define HAVE_WCWIDTH 1 + - /* Define to 1 if the system has the type `_Bool'. */ ++/* Define to 1 if the system has the type '_Bool'. */ +#define HAVE__BOOL 1 + - /* Define to 1 if you have the `_futime' function. */ ++/* Define to 1 if you have the '_futime' function. */ +/* #undef HAVE__FUTIME */ + +/* Define to 1 if _mm_movemask_epi8 is available. */ +#if defined(__FreeBSD__) && defined(__amd64__) +#define HAVE__MM_MOVEMASK_EPI8 1 +#endif + +/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported. + */ +#define HAVE___BUILTIN_ASSUME_ALIGNED 1 + +/* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported. + */ +#define HAVE___BUILTIN_BSWAPXX 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 when using POSIX threads (pthreads). */ +#define MYTHREAD_POSIX 1 + +/* Define to 1 when using Windows Vista compatible threads. This uses features + that are not available on Windows XP. */ +/* #undef MYTHREAD_VISTA */ + +/* Define to 1 when using Windows 95 (and thus XP) compatible threads. This + avoids use of features that were added in Windows Vista. */ +/* #undef MYTHREAD_WIN95 */ + +/* Define to 1 to disable debugging code. */ +#define NDEBUG 1 + +/* Name of package */ +#define PACKAGE "xz" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "xz@tukaani.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "XZ Utils" + +/* Define to the full name and version of this package. */ - #define PACKAGE_STRING "XZ Utils 5.4.5" ++#define PACKAGE_STRING "XZ Utils 5.6.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "xz" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://tukaani.org/xz/" + +/* Define to the version of this package. */ - #define PACKAGE_VERSION "5.4.5" ++#define PACKAGE_VERSION "5.6.2" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + - /* The size of `size_t', as computed by sizeof. */ ++/* The size of 'size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + - /* Define to 1 if all of the C90 standard headers exist (not just the ones ++/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define STDC_HEADERS 1 + +/* Define to 1 if the number of available CPU cores can be detected with + cpuset(2). */ +#define TUKLIB_CPUCORES_CPUSET 1 + +/* Define to 1 if the number of available CPU cores can be detected with + pstat_getdynamic(). */ +/* #undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC */ + +/* Define to 1 if the number of available CPU cores can be detected with + sched_getaffinity() */ +/* #undef TUKLIB_CPUCORES_SCHED_GETAFFINITY */ + +/* Define to 1 if the number of available CPU cores can be detected with + sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROC_ONLN). */ +/* #undef TUKLIB_CPUCORES_SYSCONF */ + +/* Define to 1 if the number of available CPU cores can be detected with + sysctl(). */ +/* #undef TUKLIB_CPUCORES_SYSCTL */ + +/* Define to 1 if the system supports fast unaligned access to 16-bit, 32-bit, + and 64-bit integers. */ +/* FreeBSD - derive from __NO_STRICT_ALIGNMENT */ +/* #undef TUKLIB_FAST_UNALIGNED_ACCESS */ + +/* Define to 1 if the amount of physical memory can be detected with + _system_configuration.physmem. */ +/* #undef TUKLIB_PHYSMEM_AIX */ + +/* Define to 1 if the amount of physical memory can be detected with + getinvent_r(). */ +/* #undef TUKLIB_PHYSMEM_GETINVENT_R */ + +/* Define to 1 if the amount of physical memory can be detected with + getsysinfo(). */ +/* #undef TUKLIB_PHYSMEM_GETSYSINFO */ + +/* Define to 1 if the amount of physical memory can be detected with + pstat_getstatic(). */ +/* #undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC */ + +/* Define to 1 if the amount of physical memory can be detected with + sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */ +#define TUKLIB_PHYSMEM_SYSCONF 1 + +/* Define to 1 if the amount of physical memory can be detected with sysctl(). + */ +/* #undef TUKLIB_PHYSMEM_SYSCTL */ + +/* Define to 1 if the amount of physical memory can be detected with Linux + sysinfo(). */ +/* #undef TUKLIB_PHYSMEM_SYSINFO */ + +/* Define to 1 to use unsafe type punning, e.g. char *x = ...; *(int *)x = + 123; which violates strict aliasing rules and thus is undefined behavior + and might result in broken code. */ +/* #undef TUKLIB_USE_UNSAFE_TYPE_PUNNING */ + - /* Enable extensions on AIX 3, Interix. */ ++/* Enable extensions on AIX, Interix, z/OS. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE *** 218 LINES SKIPPED *** From nobody Tue Jun 4 05:00:57 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 4Vtdhn2N9bz5MLF6; Tue, 04 Jun 2024 05:00:57 +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 4Vtdhn1Zv5z4bcM; Tue, 4 Jun 2024 05:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717477257; 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=hLWZDzIESOXdSjAMRDHhcIUwNgmjfJ9puSxyyXFLkqE=; b=obIqiiZWtIyILuPc2BUMu3UPbVfJrkzW+j5ccBxvnQ+2u9ziYvpvqLb453h0pmOl9NX19W P8+OV8//QMfatN87VzUchNs8suAPgyS3pQdZf272dOfYJ2WCT2pysGQq4v6h4VyNg0wrbh lAoCRj5cM3fSMHHsBM4uAb9merI++LptJW3N1zj76bU/uaXwXcJUbP+duYSMsIgjhFCdEP iTRcPNRnDGkwURo8zj5A+T8ipAgJ25iJsdUBJ+0K9NQpkvgd939jBv2at01eJdr9gYIM3J 7qW/YHyfJrhja0pJ6wcv5ZMadffZskTOGq1//HK31bdfED7qeRW6y6OFOIaCkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717477257; a=rsa-sha256; cv=none; b=A90Z3iZQsk/oiutbmeruzv57wzlstrwb0k4SPj6/5lw5pOX6kzsCTTaX7iPBGzsUXp0ZLr Y/vUbdhSoaDHTu/2LXwrrBJC79VgUDtfIs4Wt+6T2X8G3YwXCg5eZNcQ8WqhmFhAQ5QeIx 3LIpjThokzNX72vKrFxt1rtKCv+tGycYcPt4hJpw5qEpw7he5vvAPWz8YOAYPjfK/wR/On 29BUURyLG6ztjlxGC6eluFzT1T3ACSyJq3uQV0O6uC5UIFP8AL/taBClLib8Dd0bi+AIVT zvkvr7MHqczKCigxEfe0Pdhwlr9CUNvUG8R9yFI0zNV+Umnc6wvPAa0XXZYRSA== 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=1717477257; 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=hLWZDzIESOXdSjAMRDHhcIUwNgmjfJ9puSxyyXFLkqE=; b=Ea3sPKxX5KtDgUt8htga4fA+aJpV+H0H+zzT6aNaILwNQQWtRQ1mylsN1Uey/HYH4hIRJY fxTFEP/C68XCRGryvMCT0Do/hCmSzumaPGxsiP48d/K7Qs/UgpPguOTnq44Rq3emzkgdpb +DOH4DlcPXKxjLjcR2snL/yTCDQhzp2OFXlnlddaLn6zie7tTs6mzjkuglv5rxiERDGAqm b3cgfAJUis78x/4VVN5pgRgzMpa4jBZC60WVz0XZ/HWj2SSU+EEqgoFptnr4pDKRYoOVP8 G0kaThYOObmieG13FlGEn3gvoacOC5UKRbap2wccqpXyttmpMJ+ATio8kN0k+g== 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 4Vtdhn13zsz153n; Tue, 4 Jun 2024 05:00:57 +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 45450v46045846; Tue, 4 Jun 2024 05:00:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45450vJo045843; Tue, 4 Jun 2024 05:00:57 GMT (envelope-from git) Date: Tue, 4 Jun 2024 05:00:57 GMT Message-Id: <202406040500.45450vJo045843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Matthew Seaman Subject: git: a7abf88b4783 - stable/14 - Don't package /var/db/locate.database 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: matthew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7abf88b478302fe1e30a1e70cf0f5c01bc58288 Auto-Submitted: auto-generated The branch stable/14 has been updated by matthew: URL: https://cgit.FreeBSD.org/src/commit/?id=a7abf88b478302fe1e30a1e70cf0f5c01bc58288 commit a7abf88b478302fe1e30a1e70cf0f5c01bc58288 Author: Matthew Seaman AuthorDate: 2024-05-27 08:14:15 +0000 Commit: Matthew Seaman CommitDate: 2024-06-04 05:00:44 +0000 Don't package /var/db/locate.database ... or install an empty file. The locate database is a mutable working file, and unsuitable to be managed by pkg(8). locate(1) copes gracefully with the absence of this file. Running /etc/periodic/weekly/310.locate will create the locate database with the correct ownership and permissions. Having the locate.database file as part of the FreeBSD-runtime package means it gets zeroed if ever that package gets updated, which is excessive, given that updating packages will typically only change a relatively small number of the _filenames_ on the system -- unlike the file contents. Plus it always causes it to flag as modified when verifying checksums, but /var/db/locate.database is expected to be modified by the user. MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45384 (cherry picked from commit 4354163e5fe8e180f62b892cdc3e51e3d7e4706f) --- etc/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index ddef82f64510..bd6d692e5316 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -88,10 +88,6 @@ distribution: .if ${MK_SENDMAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ -T "package=sendmail" ${ETCMAIL_SENDMAIL} ${DESTDIR}/etc/mail -.endif -.if ${MK_LOCATE} != "no" - ${INSTALL} -o nobody -g ${BINGRP} -m 644 -T "package=runtime"\ - /dev/null ${DESTDIR}/var/db/locate.database .endif cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ -T "package=runtime" ${FREEBSD} ${DESTDIR}/ From nobody Tue Jun 4 05:11:38 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 4Vtdx64dgzz5MMlp; Tue, 04 Jun 2024 05:11:38 +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 4Vtdx646nPz4cqp; Tue, 4 Jun 2024 05:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717477898; 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=cLt76yiSctsiG59WRzlWmn2UjFXIWvKZetHgH3vBi3U=; b=AMgilRE9wJ5Sbgo+JK+jOdJmkFSSm+d2ToKF22IWspk5tcW+6pXjEXi0eXWLQBXJBC87Wa iTiD1rjqtushog0vkaW48mfpcuQgm7CnoRSJzAB/oecQ2wsEfpoD2o4GgZAmdJpjl8k6wq Yo08BWdn/ruZV+BnAYK6PDhlgyBrDaKez1ZFyOhXOBWThgBXgpA8gZ881y89NMcqy+EHGa Q2Ut7i4Ls9GpxeRL7L0ohdRbfV967LpiN4KYy2k110qOqn2W9xU0JWEDS9hLu6BzGdLI6h 2scsQFXR0kCoY55FeDdP5YcwIlGCVlrfSY15MWuRCsD2K+ElMH+NcB12FgcZEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717477898; a=rsa-sha256; cv=none; b=aTXOZZEwlFzWUMe1cMNmvOPaSH7pYON57zcaeaEKVeYzoMuu1rOtlzX0ZDAL2Jhxjk0wHs WD0XwUf4TglmQupCOPHseDdl8ex00gqtyqW4e7vDNlAKWDFTem+Xe6D2NlA90+OFrXhX2V j6hAjbczqI1nVwztH53nUeK1XCr75AhVdTqEeIZwpQb1YpMh/iy0OkZtpRKw8BUkbtXa83 LxwygJWMDj2HcNQ35ih4hdpG6GWU7MPiw5hhwfc/eQr4DtsR0hpRrSH7nL3V3gUAAyHcDG sfffq7WriJVcZ4NWqrXcGv8CQb5l/hkZDTIZJ9F+M/L/AP8uJknj8Q+GP3+p8w== 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=1717477898; 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=cLt76yiSctsiG59WRzlWmn2UjFXIWvKZetHgH3vBi3U=; b=OHs6V+P1wE51frdSdv6Zzytcru/v1ty7N4IwOVP33nAYWIgqUAFXuTk3f2+w/OcdiYYXOL t5yYp9YmKwJdPoRbz0ouYbDgZYI75kKC41Wa79J4mEa7VQ2ofSiVpNBUoGxEE1txvuV8ho 20u+WfYqcxXvPsv9Z1Uy8xzTXVRVctHv7hSHaYuafrux58UUYi6JcWIr7js5aTFpsSfhvd EATTDqSkqNihn987RHJb151wU3+j4m4VtpSpfzmE/WZUOVVZTRHAuAl9Pj1Ot1WOR8jpLX BpJdIhuBL0EnNM8E4/bGzZMHORg6a9AKnQ/kTiggUOBniHjynoXOIIrIRuRW+g== 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 4Vtdx63hFdz15HP; Tue, 4 Jun 2024 05:11:38 +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 4545BccS065101; Tue, 4 Jun 2024 05:11:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4545BcVW065098; Tue, 4 Jun 2024 05:11:38 GMT (envelope-from git) Date: Tue, 4 Jun 2024 05:11:38 GMT Message-Id: <202406040511.4545BcVW065098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Matthew Seaman Subject: git: a30b941ea739 - stable/13 - Don't package /var/db/locate.database 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: matthew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a30b941ea73995e7a92bdc925b6267652a6b3ee2 Auto-Submitted: auto-generated The branch stable/13 has been updated by matthew: URL: https://cgit.FreeBSD.org/src/commit/?id=a30b941ea73995e7a92bdc925b6267652a6b3ee2 commit a30b941ea73995e7a92bdc925b6267652a6b3ee2 Author: Matthew Seaman AuthorDate: 2024-05-27 08:14:15 +0000 Commit: Matthew Seaman CommitDate: 2024-06-04 05:11:10 +0000 Don't package /var/db/locate.database ... or install an empty file. The locate database is a mutable working file, and unsuitable to be managed by pkg(8). locate(1) copes gracefully with the absence of this file. Running /etc/periodic/weekly/310.locate will create the locate database with the correct ownership and permissions. Having the locate.database file as part of the FreeBSD-runtime package means it gets zeroed if ever that package gets updated, which is excessive, given that updating packages will typically only change a relatively small number of the _filenames_ on the system -- unlike the file contents. Plus it always causes it to flag as modified when verifying checksums, but /var/db/locate.database is expected to be modified by the user. MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45384 (cherry picked from commit 4354163e5fe8e180f62b892cdc3e51e3d7e4706f) --- etc/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index 05632e8ce710..6d53b64a79eb 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -81,10 +81,6 @@ distribution: ${INSTALL_SYMLINK} -T "package=sendmail" \ mail/aliases ${DESTDIR}/etc/aliases; \ fi -.endif -.if ${MK_LOCATE} != "no" - ${INSTALL} -o nobody -g ${BINGRP} -m 644 -T "package=runtime"\ - /dev/null ${DESTDIR}/var/db/locate.database .endif cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ -T "package=runtime" ${FREEBSD} ${DESTDIR}/ From nobody Tue Jun 4 05:39:15 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 4VtfY02B8vz5MQx4; Tue, 04 Jun 2024 05:39:16 +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 4VtfY01QDTz4fjJ; Tue, 4 Jun 2024 05:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717479556; 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=0hCK772cNyzFS5PQ3SpelnwAjhc8bbbrsDMUJU2heU0=; b=BHWLMf8FBaz406KndRVDjO9YOdtAMeLPZL+rCSsmtCYrlWpZVsC784oQPvkbVmI69XHKfZ VvLZ0xsRrMhjVd5B+nysRHpphnao7GUfjCToytzQZJbQyG4lyZpKMDMsDld5pQqKVCx1l7 LcXPF5fv/+DE9B0ukeaszF5C5xQSBJQRuspjlM6l8r3/1OUGPTc40HIorT3PHYd9kRrnRH M3IojzaWhoCfn/wwzBnPYDaic6d8ToErtzVgiuRYDAZIJbaPQdsjoHYoIx80Q3sT0UR35C WBb4CCPbSfT2TWOOWNFkiydwXhyO3cR/2MWqrQbZag+9ynpNINcJ9vtRKy+TjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717479556; a=rsa-sha256; cv=none; b=ZiZzWu5tyBybawHS6oN/nLLZg28T3BY8/ATdckMmyybsivvbE6oiwkxAq4EvslmKmVvzRE Vy3jGG81KsJiNu50hhJB7lc1/YJv0ChqIBhbHFyuQwZtHSkhd/TwL5jhNw382fK9L6kNaE RcJI3rKaSlL+2k1L6Uv9ifacTJVmeEP+ZbRAYLgQuwACd757UOdOZC3yHZ+Vie14T/B0QK MsZJthWfl4CrryfmRH0Z/htyKyHfF9I+IHJ+MN1YfN2QA6w5WpdPGX4LGGunAkPhHXLocA wSLVCZPACQYw08iM7fU/fm6+txE8Dlp9p6RrWp4wMYwbybZzlA0nw3c5wWeagA== 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=1717479556; 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=0hCK772cNyzFS5PQ3SpelnwAjhc8bbbrsDMUJU2heU0=; b=arGI59PkwFB/ixuhjme0AwKEnHrr6VvWwwsiK3CCdfgH+IHcqgYJskEH7VuPmErwwnLFvy 66LrbD+SPgFrXfZhogN3K/PGPLPdnNK499SZcdTAVDV9BQWsnopVz6dYL91Cjoj+UCsUYr no0hETkRbuLhe+Dia6GjZfxZ1+h9ewKfpE6LYAtURWDA6RTjHfyG0xJ3hs2aNs54TRwCOH Ek2EtqHP9AheR2xHJ7zc9IF8mPHHPRbxOYhnFxxWPy6UqFILXRPHlCJWH7xP5dx2eN3omQ Tkf3ryDvF2rWV7GRMmhGNkFlsK28P3/260NPw6t1q5+nE26VxaTNCYYwDy5aPA== 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 4VtfY00thJz15wH; Tue, 4 Jun 2024 05:39:16 +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 4545dF6c004078; Tue, 4 Jun 2024 05:39:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4545dFF7004075; Tue, 4 Jun 2024 05:39:15 GMT (envelope-from git) Date: Tue, 4 Jun 2024 05:39:15 GMT Message-Id: <202406040539.4545dFF7004075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: f1d73aacdc47 - main - pmap: Skip some superpage promotion attempts that will fail 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: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1d73aacdc47529310e2302094685295c032e28f Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=f1d73aacdc47529310e2302094685295c032e28f commit f1d73aacdc47529310e2302094685295c032e28f Author: Alan Cox AuthorDate: 2024-06-02 08:56:47 +0000 Commit: Alan Cox CommitDate: 2024-06-04 05:38:05 +0000 pmap: Skip some superpage promotion attempts that will fail Implement a simple heuristic to skip pointless promotion attempts by pmap_enter_quick_locked() and moea64_enter(). Specifically, when vm_fault() calls pmap_enter_quick() to map neighboring pages at the end of a copy-on-write fault, there is no point in attempting promotion in pmap_enter_quick_locked() and moea64_enter(). Promotion will fail because the base pages have differing protection. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45431 MFC after: 1 week --- sys/amd64/amd64/pmap.c | 3 ++- sys/arm64/arm64/pmap.c | 3 ++- sys/i386/i386/pmap.c | 3 ++- sys/powerpc/aim/mmu_oea64.c | 9 +++++++-- sys/riscv/riscv/pmap.c | 3 ++- sys/vm/vm.h | 1 + sys/vm/vm_fault.c | 11 ++++++++++- 7 files changed, 26 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8105c9d92478..2f3119aede67 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -7818,7 +7818,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, * If both the PTP and the reservation are fully populated, then * attempt promotion. */ - if ((mpte == NULL || mpte->ref_count == NPTEPG) && + if ((prot & VM_PROT_NO_PROMOTE) == 0 && + (mpte == NULL || mpte->ref_count == NPTEPG) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { if (pde == NULL) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index aaba6ca189a1..b6bc113ba8a4 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -6052,7 +6052,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, * If both the PTP and the reservation are fully populated, then * attempt promotion. */ - if ((mpte == NULL || mpte->ref_count == NL3PG) && + if ((prot & VM_PROT_NO_PROMOTE) == 0 && + (mpte == NULL || mpte->ref_count == NL3PG) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { if (l2 == NULL) diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 40d8ceaf42b9..5808c31a99af 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -4250,7 +4250,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, * If both the PTP and the reservation are fully populated, then * attempt promotion. */ - if ((mpte == NULL || mpte->ref_count == NPTEPG) && + if ((prot & VM_PROT_NO_PROMOTE) == 0 && + (mpte == NULL || mpte->ref_count == NPTEPG) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { if (pde == NULL) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 391f90bb04eb..273dc38214e2 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1755,10 +1755,14 @@ out: * If the VA of the entered page is not aligned with its PA, * don't try page promotion as it is not possible. * This reduces the number of promotion failures dramatically. + * + * Ignore VM_PROT_NO_PROMOTE unless PMAP_ENTER_QUICK_LOCKED. */ if (moea64_ps_enabled(pmap) && pmap != kernel_pmap && pvo != NULL && (pvo->pvo_vaddr & PVO_MANAGED) != 0 && (va & HPT_SP_MASK) == (pa & HPT_SP_MASK) && + ((prot & VM_PROT_NO_PROMOTE) == 0 || + (flags & PMAP_ENTER_QUICK_LOCKED) == 0) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) moea64_sp_promote(pmap, va, m); @@ -1850,8 +1854,9 @@ moea64_enter_quick(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - moea64_enter(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), - PMAP_ENTER_NOSLEEP | PMAP_ENTER_QUICK_LOCKED, 0); + moea64_enter(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE | + VM_PROT_NO_PROMOTE), PMAP_ENTER_NOSLEEP | PMAP_ENTER_QUICK_LOCKED, + 0); } vm_paddr_t diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 1e507f62696e..e8504bcb0f59 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -3519,7 +3519,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, * If both the PTP and the reservation are fully populated, then attempt * promotion. */ - if ((mpte == NULL || mpte->ref_count == Ln_ENTRIES) && + if ((prot & VM_PROT_NO_PROMOTE) == 0 && + (mpte == NULL || mpte->ref_count == Ln_ENTRIES) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { if (l2 == NULL) diff --git a/sys/vm/vm.h b/sys/vm/vm.h index 5fac6b3f2e78..b7d149a2fca2 100644 --- a/sys/vm/vm.h +++ b/sys/vm/vm.h @@ -76,6 +76,7 @@ typedef u_char vm_prot_t; /* protection codes */ #define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */ #define VM_PROT_PRIV_FLAG ((vm_prot_t) 0x10) #define VM_PROT_FAULT_LOOKUP VM_PROT_PRIV_FLAG +#define VM_PROT_NO_PROMOTE VM_PROT_PRIV_FLAG #define VM_PROT_QUICK_NOFAULT VM_PROT_PRIV_FLAG /* same to save bits */ #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index fbe0a117a388..3da411643f26 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1891,6 +1891,7 @@ vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, vm_offset_t addr, starta; vm_pindex_t pindex; vm_page_t m; + vm_prot_t prot; int i; pmap = fs->map->pmap; @@ -1906,6 +1907,14 @@ vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, if (starta < entry->start) starta = entry->start; } + prot = entry->protection; + + /* + * If pmap_enter() has enabled write access on a nearby mapping, then + * don't attempt promotion, because it will fail. + */ + if ((fs->prot & VM_PROT_WRITE) != 0) + prot |= VM_PROT_NO_PROMOTE; /* * Generate the sequence of virtual addresses that are candidates for @@ -1949,7 +1958,7 @@ vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, } if (vm_page_all_valid(m) && (m->flags & PG_FICTITIOUS) == 0) - pmap_enter_quick(pmap, addr, m, entry->protection); + pmap_enter_quick(pmap, addr, m, prot); if (!obj_locked || lobject != entry->object.vm_object) VM_OBJECT_RUNLOCK(lobject); } From nobody Tue Jun 4 06:28:19 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 4Vtgdc1K7xz5MYWV; Tue, 04 Jun 2024 06:28:20 +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 4Vtgdc0Xcrz4kvV; Tue, 4 Jun 2024 06:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717482500; 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=qg5SEhzDq5UjZ5aN/ODYZrtuC6LTrmqt0N/TZtrPXTQ=; b=NlkT0YPc3S7zeuzCVX8B8UB+a7A3o1ZO6qlkx6fhMlrBFP/DpF3OqSEnzNe8UVOcCpzOuA cARCgrhNUGhzcYdTPvcdjykNkrFWhSv6oaQPMIkUDdXxZ7C/+UKNZ5SDjn3ScTUbosF084 Zcys/YF8nru/d7uUK8wAEifL6siirCZWfJzoMu2iiB4jsopo9cUQ7MF5N0nGmcCSfuXao9 vqs2ImqZGYsdY6PQab90ZojVF6kr8V8kS4X55m0or/89BUWLdDkRty/mlEz1+npSgB2ItA 8tfTneRHNqbHwnRjg2LrzK7iz5Duf1rAASUg5lvhuMjBAxqPPvOoDqatLnWMCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717482500; a=rsa-sha256; cv=none; b=ggmrtXExSwH11TA3HKwGnDuDBTTsRDZpCJKH9ZD+x5BIFxTdHJYF5d1ZOCl84nNGWBrkRr lEGO/0jLxVKC/Frf1oKmgYn0cKHD/so++o/jkarVrj6A7ZTe5McYw9m7rr3JojHxOiSzYk sRrlMaZl8P3Z/a0BfMQsbf/T6vOToWquWk5JC8Tj22plEiy0qZb4Q3a+uAXHetQGQO760i lnYmz8WaoStZxVYHcbSG72sWYRSihwkCTGq03DuYZeCMg3ooACpbW2TeMRhQKyl4+bJ/iX G3/F5JG25vc/YtljsHk80gzXP+CJzRhN1lQeyYKL2qed8WWUU3SLq+wagjbmyw== 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=1717482500; 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=qg5SEhzDq5UjZ5aN/ODYZrtuC6LTrmqt0N/TZtrPXTQ=; b=pYVn2yoBB2G3Y6IiGNgdfCKQYdk+FJ8261HnEYl07QnqCWwsw76ytiFA1NXORkT0bmPVHA DFzUvDwvHZ946y17mZcwHq/T21J7CiQpENsClQpeDzXGMPTI2q3Bg4KpDd9HxV3/PPsVzD aHTVsYEfHirIMgG+L/mldfOx1vpIZmiTSVbdevCFFGBfKh6q3oPwhMsgUk6vUbFRhyo/3y eEMtlOlBSbNyQwckH0n5Wc5iWzpNiBIosmTK5S/cpkAmCn8mE8ddh9uSFQ8mJi4pKbwoL3 UYiJHCMvsPLY5cC2SXyTcSp5a/ebu7Aly5w++WXabZUYFbfSZy6PE7W3oZCfgg== 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 4Vtgdc085rz16w5; Tue, 4 Jun 2024 06:28:20 +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 4546SJLW088671; Tue, 4 Jun 2024 06:28:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4546SJ98088668; Tue, 4 Jun 2024 06:28:19 GMT (envelope-from git) Date: Tue, 4 Jun 2024 06:28:19 GMT Message-Id: <202406040628.4546SJ98088668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 41ee91c64f47 - main - newfs_msdos: fix build on non-FreeBSD systems 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: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41ee91c64f47faaa8131df3cd8a63bdb60fa486a Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=41ee91c64f47faaa8131df3cd8a63bdb60fa486a commit 41ee91c64f47faaa8131df3cd8a63bdb60fa486a Author: Stefan Eßer AuthorDate: 2024-06-04 06:26:09 +0000 Commit: Stefan Eßer CommitDate: 2024-06-04 06:26:09 +0000 newfs_msdos: fix build on non-FreeBSD systems Disable data area alignment if the build environment does not define PAGE_SIZE (e.g., when building on Linux or macOS). Reported by: jrtc27 MFC after: 1 week --- sbin/newfs_msdos/mkfs_msdos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msdos.c index 423fbbcadcc5..1bca560a59e1 100644 --- a/sbin/newfs_msdos/mkfs_msdos.c +++ b/sbin/newfs_msdos/mkfs_msdos.c @@ -571,7 +571,11 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op) if (o.align) alignto = bpb.bpbSecPerClust; else +#ifdef PAGE_SIZE alignto = PAGE_SIZE / bpb.bpbBytesPerSec; +#else + alignto = 1; +#endif if (alignto > 1) { /* align data clusters */ alignment = (bpb.bpbResSectors + bpb.bpbBigFATsecs * bpb.bpbFATs + rds) % From nobody Tue Jun 4 06:39:16 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 4VtgtH1G6vz5MZhn; Tue, 04 Jun 2024 06:39:19 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtgtH0kWrz4mDj; Tue, 4 Jun 2024 06:39:19 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717483159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sJ5VHpqhi+8E1vHcgmePZc7hbraaiUcNiiFAIg5hHUE=; b=ttcEo4cGXgazDKhRiW7OjvQQxvvFv1sQJmw+0NcaY1nG4j83q9f/xqFWXRb+3v9CdCZlrY f1LVjg/O8vuJPtCq27yXXAcXDCk7k40xIqa8rZKZsjaLyNtDkDx7zuHEiJI3mXVq72BE0B BOKlPdbJ4/QiTzk16LC4TqyUKAWqiOZFFgEmLvJyrX4JAAQ+M503sWocNl8Av4isKHXnab lm1KVNm3OZxdZaL0tkcsJJddrbKPxfpIa6EotUU/3iQLX3bKX77vdQGsJh6KPusBw9Kcme oozMunMs3RRI5vxoZgLdwMLJJoGvDjMpydR9W9WTsKX3szAAeF2QRjT7yLLzcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717483159; a=rsa-sha256; cv=none; b=u8zpA83Syf1knxCyQn1olpx7BIRN82qJt+8LfL1vxvuJ/jt1Ct0wUaUGGfTljzDOOwn62O aGnbz1Vbq2KqDKq7jnSZEe6ZUZrlSlbUvjFf67dT3fS28f97dI/srLni9ClpV1P+gzgVJU MNzYKsCPnOSQVpj/FUx0HDTvyjRWOP52qbPVFn0XxSKDR7PKu03qEvZQS/p9O+ExhXTcXo TD5DPM2TFWxlUnW7Eth8DfLACvEiP/4LdwHG9OExN37BmqkARIlR6G+A7MJ/oQOuTWbdK3 h6amDV415wRSGprxIBa1gJuvTviqL1n11sMfRrGKME81jQS5bKKFZbSI9YGyqg== 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=1717483159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sJ5VHpqhi+8E1vHcgmePZc7hbraaiUcNiiFAIg5hHUE=; b=d5+1Z1e+hK97RaLfOBi43LtCunwT7iwYpx4s7lJREoGM9cEfmR10xurn5CwtxTh/My/+UR 64F+3cs7Am+1ikfvByVa4kVTXmH5EI9AKrYhaOTyQ3/ECvnP3FV113UH9dD8/NrVj7D0Qo NsV3PV5IMG9W2fHmycBYEwrtN1GmloHKsMPH85Ti0aTaz5iVu2nsVzHkXGFhSHE6UvI6HP w+YHGnCozB48urFwsFQdtdXOOwmteNJxyU6pxyJj57LBbzuJZTE2iNL6Zax2RkXwQw4/uJ EEfvMEvyEsO/9ygvz9z4XR5jdnRKsGCBuDhf+kq2/NdkOKBfCa2eLPpJ4HJRCQ== Received: from [192.168.119.168] (p5dc83c4c.dip0.t-ipconnect.de [93.200.60.76]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VtgtG2PtQz1HFZ; Tue, 4 Jun 2024 06:39:18 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: Date: Tue, 4 Jun 2024 08:39:16 +0200 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 User-Agent: Mozilla Thunderbird From: =?UTF-8?Q?Stefan_E=C3=9Fer?= Subject: Re: git: 077f757d72e5 - main - newfs_msdos: align data area to VM page boundary by default To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202406021227.452CRx8I007470@gitrepo.freebsd.org> <6D077B35-48BA-4516-BAB7-0B23CD3AB042@freebsd.org> Content-Language: de-DE, en-US In-Reply-To: <6D077B35-48BA-4516-BAB7-0B23CD3AB042@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 03.06.24 um 19:25 schrieb Jessica Clarke: > On 2 Jun 2024, at 13:27, Stefan Eßer wrote: >> >> The branch main has been updated by se: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=077f757d72e561eb84193d8e58f63e96e69b8096 >> >> commit 077f757d72e561eb84193d8e58f63e96e69b8096 >> Author: Stefan Eßer >> AuthorDate: 2024-06-02 12:07:52 +0000 >> Commit: Stefan Eßer >> CommitDate: 2024-06-02 12:07:52 +0000 >> >> newfs_msdos: align data area to VM page boundary by default [...] > > Hi, > This has completely broken[1] all of the Linux and macOS cross-build CI > jobs (which pass -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP). Please either fix > this promptly or back it out until you can do so. > > Jess > > [1] See https://github.com/freebsd/freebsd-src/actions/runs/9338256762 Thank you for the report and sorry for the breakage. This should be fixed in commit 41ee91c64f47faaa by skipping the alignment of the data area, if PAGE_SIZE is not defined. An alternative approach would have been to define PAGE_SIZE to a sane default value of 4096 (as used on most current architectures by default), if not set in the build environment. If there is consensus that this would be more appropriate (since it matches what the man page says), I'd revert the latest commit and instead of it commit the following change: index 1bca560a59e1..c4f18a28ec39 100644 --- a/sbin/newfs_msdos/mkfs_msdos.c +++ b/sbin/newfs_msdos/mkfs_msdos.c @@ -55,6 +55,10 @@ #include "mkfs_msdos.h" +#ifndef PAGE_SIZE +#define PAGE_SIZE 4096 +#endif + #define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ #define BPN 4 /* bits per nibble */ #define NPB 2 /* nibbles per byte */ Regards, STefan From nobody Tue Jun 4 07:11:13 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 4Vthb56czJz5MfXy; Tue, 04 Jun 2024 07:11:13 +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 4Vthb569yHz4q9d; Tue, 4 Jun 2024 07:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717485073; 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=u7FpMMW32FVhcb1rsNatgf7KLJY8hbLhjC9ywwUyDOk=; b=U4PFfuDFEdT7oFz81zVcbsviwY06jebfSStM1qbzHk/5VFox2E7G+QWp0UuGoNmzBmMqqc tawkhybfc1wEaNT7tVOIDODahPrHzSL/aVd3gQpFEeXEDyI42R4Yx7mnGyeY8/0UKXYIyw /6kAgnc6i07CPuUp8mr1hVRLBos1Bd+2bUCRCKY6ARzJLvwdCcX1JgotFsC7WfmEHjaJs9 d/uUijksegucmiI3SH8hXeDJJNZfu57c/3/Ui1mm3MyOelw18zU30U0VTFXmPrfdd4ESs2 3Pgi7b+KvLkQNjMheC+U7yi5baQyGFlAlPpxaIcnk+fHtOfWsJYQ37O/fC7+ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717485073; a=rsa-sha256; cv=none; b=ZRNK7i6UQnddeXLUvCxsSroIDMNJgx2bBcZL8mnNl8/oJOKCXHtf4MX+VoBCN58uuXKECm dXxsz3jTW6hla6xhjooep1vRNumIcBH8X7Zl8TkmKwQu+XuPh8Ey6PIq8Sje3uKX+8QiPI gBMyUq0XdRKU9NX2RVX3EerBKQWCY0ZidLGqJEMZBWnEbWw3ZpMka9y91O5ayFEm9mCyTY 9eFC1cVax4SMom+Fo1/plbduyJypNAOT67XdXQiNFrFiwZuOM0Q0efKK53eZGKopwNOs+N S7uhyO1dCJ72ysH5abDayCppPlXJYmHWFnKS0VI+bjO4g/8Fu3GXjFCIS5k0Vg== 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=1717485073; 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=u7FpMMW32FVhcb1rsNatgf7KLJY8hbLhjC9ywwUyDOk=; b=d+NI9YRZbLT52VBrNrgYIVKVSZnud5LzTPG+1grp+JWgk4ciOvjNNonTv03UZhhDqzwZVx S6Bkjyl700c2ygv4fUrabFYdd7dWwcM/u84rOAhmYC0YI+ipV/5djtO12kNtH8jfveNTsl UjzSjP5bqFjce6YlKl5hpREgLCi2ekNe0XFCqh8pbyblkv5lZad6weC5QY4ozQ+hfSDTw9 H5eImTMnAMOy0UziVKUSxmus6wAilAPHaN1BJABPTPbRV2KWdLn8fRqXjtewSoaV2lwDp+ urS+dUUgd1klFKSLulzbwDe3a+dIOtQKRnVKdxBmTlTEVkVZMAoyfgHrZxfksw== 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 4Vthb55nHNz17jw; Tue, 4 Jun 2024 07:11:13 +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 4547BDQR071059; Tue, 4 Jun 2024 07:11:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4547BDS2071056; Tue, 4 Jun 2024 07:11:13 GMT (envelope-from git) Date: Tue, 4 Jun 2024 07:11:13 GMT Message-Id: <202406040711.4547BDS2071056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Corvin =?utf-8?Q?K=C3=B6hne?= Subject: git: 5e09c5a1ed66 - main - bhyve: use correct size to map the OpRegion 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e09c5a1ed66f58c499884ebf44e1633be195578 Auto-Submitted: auto-generated The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=5e09c5a1ed66f58c499884ebf44e1633be195578 commit 5e09c5a1ed66f58c499884ebf44e1633be195578 Author: Corvin Köhne AuthorDate: 2023-12-18 12:44:04 +0000 Commit: Corvin Köhne CommitDate: 2024-06-04 07:08:34 +0000 bhyve: use correct size to map the OpRegion We're already converting the size reported by the OpRegion header from kilobytes to bytes. We don't have to do that twice when mapping the OpRegion. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45334 --- usr.sbin/bhyve/amd64/pci_gvt-d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/amd64/pci_gvt-d.c b/usr.sbin/bhyve/amd64/pci_gvt-d.c index dfcd6a8f68c8..95f9066498d6 100644 --- a/usr.sbin/bhyve/amd64/pci_gvt-d.c +++ b/usr.sbin/bhyve/amd64/pci_gvt-d.c @@ -222,8 +222,8 @@ gvt_d_setup_opregion(struct pci_devinst *const pi) opregion->len = header->size * KB; munmap(header, sizeof(*header)); - opregion->hva = mmap(NULL, opregion->len * KB, PROT_READ, MAP_SHARED, - memfd, opregion->hpa); + opregion->hva = mmap(NULL, opregion->len, PROT_READ, MAP_SHARED, memfd, + opregion->hpa); if (opregion->hva == MAP_FAILED) { warn("%s: Unable to map host OpRegion", __func__); close(memfd); From nobody Tue Jun 4 07:11:14 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 4Vthb73CYqz5MfQJ; Tue, 04 Jun 2024 07:11:15 +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 4Vthb71tq4z4qGG; Tue, 4 Jun 2024 07:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717485075; 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=iUSDn3ruVB6P+rtVcH0BYIu8MUgHabU+bOs4p9Z9xZM=; b=lArkWPrNmcCQdTZLAgiS4Xe+sE6hophzyNzoT2R+OqCvMuN07yl/p1verEh11UnURK6X0X URpY3lzynnjAsybhSE0Obv0qxYEcxs1pRKlw+kvVc+NoBmbRcduSLGgf2OGAKPZjkAGXGe z8KmjEnFaXxLEcWUuzEdvRiWK4XWnoRFy0UoXc1nf+w2YwCIvlgRCN5z4LC8QnMnfBOyvU zFm7XeYRZ3l3OiF5B9tOoje3FuRZISsG1jF3NWL4i8xKa25PbA7UtfA2Q6MbhI/IUZP4Y9 spVhr0/ne0XriORz83eJG9Xu2pJp706nMVErclteeLNbS169brv1H7LX6OPohg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717485075; a=rsa-sha256; cv=none; b=RAplpUyWIqts7dfoWkB8PQwfzorinyNfIDALQA8TJDaWfon04+lTuIMQ/ZbTS3SLFwRORa iVwrL0mgfxmkwhOft3Aebvbv3soeHyVgvPghA1rFfb/NGPQM6WwG+TwyvJxEHj2izfD5GM RAa+2itYpG9VSWsKt46i6Ph145Sm9oEDdhFSZhZZO77H6DZZZ0af46KRxKVIGKHgXL32mR XiuQM7lUTaisl49iMudI6X4NGpBP74AGZHUpzhvFhhJq5WngTjFQP03W9bgf9LqSlLlPar T+N3raUkJrBppr3x+MPiZzAbUm+PA5S85B2jVuQWnYJ3kh/FqVzSnmeyvgU8mw== 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=1717485075; 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=iUSDn3ruVB6P+rtVcH0BYIu8MUgHabU+bOs4p9Z9xZM=; b=xOY1Cr3iAMdZEPK6YXKr/uplhfjt+ohOsQpX/NY49dVMhlZBma222QbHhJo6dj+SJji/pg 3qlxwrUatCyOMdgknMV9QyIxsb/fSYRjXCqJ5uMFsagM/olnPZEC25WVAoUtLTL+pDuSJt Fyauk9i/UQW2F+cvrxX5pm2XvA5JUkMBuDKboFSjRxMM2AsOCzP9uCnzVxQURULbujuB/p LuPAal9aNJ+b837NVbwe/Jzn8x6h65T8NPoocg9DHfxP9YohzIB+fHsJNyqHeUWJVWvu5G 4uJiFdTr+tXUFG5nNtpEoXE7yWVSN6pWiaeYJ4EYv1yLlV2aPCPJTklaQ6w01g== 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 4Vthb66p8Gz185v; Tue, 4 Jun 2024 07:11:14 +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 4547BEVF071101; Tue, 4 Jun 2024 07:11:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4547BEfm071098; Tue, 4 Jun 2024 07:11:14 GMT (envelope-from git) Date: Tue, 4 Jun 2024 07:11:14 GMT Message-Id: <202406040711.4547BEfm071098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Corvin =?utf-8?Q?K=C3=B6hne?= Subject: git: e425e601b978 - main - bhyve: verify OpRegion size 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e425e601b9781c3585fcee4adf29a295a6b2aa45 Auto-Submitted: auto-generated The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=e425e601b9781c3585fcee4adf29a295a6b2aa45 commit e425e601b9781c3585fcee4adf29a295a6b2aa45 Author: Corvin Köhne AuthorDate: 2023-12-15 11:46:09 +0000 Commit: Corvin Köhne CommitDate: 2024-06-04 07:08:49 +0000 bhyve: verify OpRegion size If the OpRegion size doesn't match the size of our igd_opregion struct, it's using a different layout than we're expecting. To avoid strange issues, we should exit hard. If we see any devices in the field with a different OpRegion size, we can analyse it and fix it accordingly. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D45335 --- usr.sbin/bhyve/amd64/pci_gvt-d.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/bhyve/amd64/pci_gvt-d.c b/usr.sbin/bhyve/amd64/pci_gvt-d.c index 95f9066498d6..8cd5d21c8e6d 100644 --- a/usr.sbin/bhyve/amd64/pci_gvt-d.c +++ b/usr.sbin/bhyve/amd64/pci_gvt-d.c @@ -222,6 +222,13 @@ gvt_d_setup_opregion(struct pci_devinst *const pi) opregion->len = header->size * KB; munmap(header, sizeof(*header)); + if (opregion->len != sizeof(struct igd_opregion)) { + warnx("%s: Invalid OpRegion size of 0x%lx", __func__, + opregion->len); + close(memfd); + return (-1); + } + opregion->hva = mmap(NULL, opregion->len, PROT_READ, MAP_SHARED, memfd, opregion->hpa); if (opregion->hva == MAP_FAILED) { From nobody Tue Jun 4 07:40:09 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 4VtjDT2RX7z5Mklr; Tue, 04 Jun 2024 07:40:09 +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 4VtjDT1f62z4vh9; Tue, 4 Jun 2024 07:40:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717486809; 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=ejINXpiHP0q2AF/E/7BfniJFbWBIrfNxYm3cOsmKNVU=; b=s00WDxA38zbtAtcnYLuL5i/8Qui2JGCLcH7XgmNJwPssdI5oikLlC/PBQkEMpBqEp6+B7G 9cZYNVrY0fGfoWmRy/sj/0LcobKCbeDlAj4b0K+EdEzFSZ4eP1JjS8AYgqWDzXTWUyWn+s cp99HTVJ7Al34PdiUJaOGFjnB6VrZC7fClLVswjGRTD52UMrOI5XfFS9j8Nex1tFC2wZZU 9IOkqo2MIhho0HljC0oiwy29CVoipV5TKIs9+/m0EJaf2JwHqumVBwQKU8o2RYUqd3q4fl PWtEyNW3ST4W9RLSnzWRCdLLHI7wPaUhRQjtVSiOSkfTNMU65cFn5zw0pkSPYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717486809; a=rsa-sha256; cv=none; b=ZutoqubhZsWJNAN4l/GN2ESAK0v94AIG+kZU6iPbNZjXtQBUdoki62vRfMtx/PllKagP5B Ub7YbdmnuMEml3XToQwpjNQVjbDX4L5FlbLZbqo9oNOjkJ/HfderqoQaTOxm+4VpuohpK2 9OEY3PzLaElMplO2kFw00RMP7OUR81LvmH11I5TimLb4cnqDr+zI8zXsNQ8cBSqGP4TMcg An+t/z8B9RtoM3PsLzi30+7bYgcpb3YRqcrEWfoslbkIrMn7eU+WhpFXiBA8RbTp62AMyk lnSnYqqx99nY7pUMjnKisbm4Sjfa6rdzDTeAThlUPq8a8RPb/+VOZ7GZ9F6AdQ== 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=1717486809; 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=ejINXpiHP0q2AF/E/7BfniJFbWBIrfNxYm3cOsmKNVU=; b=pawYV35x+U5kHhIK8OqpRP2WUY/hcm7tGXDNO/jiDWuY3hR4shcpBVb2SaVJcAfDcWKjHU X1tLV6v2wjGlrSkklj92heNdzxz5fq404a4Rb19XdV4lvIU893h1etU+Kv4oskFyPzht70 jgTqeUNuY03zTDXi7ntHoS8L196xLX2u5Rcxfpuh5PV+X9fCAZDgLjYwU1UroKPd4KhxDt DGywHEN1dsDRaKVSx46x836rfM4CFQS0I+ZVj4z7vEyzX6UQ9rCnf+m1w+MDc6Q6t7A8Gx dpGH+DFJPMCU5P9P5EARVQ5sl2yj0F4bTxiiDGB8l4/MWFb0QKosOAf9tf1jdw== 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 4VtjDT0ycvz18xC; Tue, 4 Jun 2024 07:40:09 +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 4547e9OY011463; Tue, 4 Jun 2024 07:40:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4547e91D011458; Tue, 4 Jun 2024 07:40:09 GMT (envelope-from git) Date: Tue, 4 Jun 2024 07:40:09 GMT Message-Id: <202406040740.4547e91D011458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 005dd61dd6d6 - main - stress2: Change fixed number of test loops to timed loops. This to improve testing with qemu. 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: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 005dd61dd6d64a60bb01c27319cd457302e20aee Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=005dd61dd6d64a60bb01c27319cd457302e20aee commit 005dd61dd6d64a60bb01c27319cd457302e20aee Author: Peter Holm AuthorDate: 2024-06-04 07:39:40 +0000 Commit: Peter Holm CommitDate: 2024-06-04 07:39:40 +0000 stress2: Change fixed number of test loops to timed loops. This to improve testing with qemu. --- tools/test/stress2/misc/crossmp.sh | 3 ++- tools/test/stress2/misc/crossmp2.sh | 3 ++- tools/test/stress2/misc/crossmp5.sh | 5 ++++- tools/test/stress2/misc/crossmp6.sh | 3 ++- tools/test/stress2/misc/crossmp7.sh | 3 ++- tools/test/stress2/misc/flock_open_close.sh | 7 +++++-- tools/test/stress2/misc/gnop2.sh | 2 ++ tools/test/stress2/misc/mmap5.sh | 14 ++++++++------ tools/test/stress2/misc/procfs.sh | 3 ++- tools/test/stress2/misc/rename3.sh | 3 ++- tools/test/stress2/misc/rename7.sh | 6 ++++-- tools/test/stress2/misc/tmpfs2.sh | 6 ++++-- tools/test/stress2/misc/umountf4.sh | 6 ++++-- tools/test/stress2/misc/umountf6.sh | 6 ++++-- tools/test/stress2/misc/vunref.sh | 3 ++- 15 files changed, 49 insertions(+), 24 deletions(-) diff --git a/tools/test/stress2/misc/crossmp.sh b/tools/test/stress2/misc/crossmp.sh index 0bd07cea2aaf..b61506dcc477 100755 --- a/tools/test/stress2/misc/crossmp.sh +++ b/tools/test/stress2/misc/crossmp.sh @@ -74,7 +74,8 @@ else else # The test: Parallel mount and unmounts - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 mount /dev/md${m} ${mntpoint}$m while mount | grep -q "on ${mntpoint}$m "; do diff --git a/tools/test/stress2/misc/crossmp2.sh b/tools/test/stress2/misc/crossmp2.sh index 03cd04e077c1..1f2f1a921e10 100755 --- a/tools/test/stress2/misc/crossmp2.sh +++ b/tools/test/stress2/misc/crossmp2.sh @@ -67,7 +67,8 @@ else else # The test: Parallel mount and unmounts - for i in `jot 128`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 mount -t nfs -o tcp -o nfsv3 -o retrycnt=3 \ -o intr,soft -o rw $nfs_export ${mntpoint}$m diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh index b5a8304f2dcb..038dea7ebe4f 100755 --- a/tools/test/stress2/misc/crossmp5.sh +++ b/tools/test/stress2/misc/crossmp5.sh @@ -74,8 +74,10 @@ else done else # The test: Parallel mount and unmount + i=0 m=$1 - for i in `jot 200`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do mount /dev/md${m} ${mntpoint}$m chmod 777 ${mntpoint}$m l=`jot -r 1 65535` @@ -88,6 +90,7 @@ else echo "-f") umount $opt ${mntpoint}$m > /dev/null 2>&1 done + i=$((i + 1)) done rm -f /tmp/crossmp.continue fi diff --git a/tools/test/stress2/misc/crossmp6.sh b/tools/test/stress2/misc/crossmp6.sh index 92ca0abcba27..d5abd27f99f1 100755 --- a/tools/test/stress2/misc/crossmp6.sh +++ b/tools/test/stress2/misc/crossmp6.sh @@ -72,7 +72,8 @@ if [ $# -eq 0 ]; then exit 0 else if [ $1 = find ]; then - for i in `jot 128`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -maxdepth 1 -type f > \ /dev/null 2>&1 (lockf -t 10 ${mntpoint}$2/$0.$$.$i sleep 1 &) > \ diff --git a/tools/test/stress2/misc/crossmp7.sh b/tools/test/stress2/misc/crossmp7.sh index c2c2752f38e7..f4f12e64c35f 100755 --- a/tools/test/stress2/misc/crossmp7.sh +++ b/tools/test/stress2/misc/crossmp7.sh @@ -91,7 +91,8 @@ else else # The test: Parallel mount and unmounts m=$1 - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do zfs mount stress2_tank/test$m zfs umount -f stress2_tank/test$m done 2>/dev/null diff --git a/tools/test/stress2/misc/flock_open_close.sh b/tools/test/stress2/misc/flock_open_close.sh index 01e376319abe..39b894da8a63 100755 --- a/tools/test/stress2/misc/flock_open_close.sh +++ b/tools/test/stress2/misc/flock_open_close.sh @@ -87,6 +87,7 @@ EOF #include #include #include +#include #include static void @@ -135,7 +136,8 @@ main(int ac, char **av) { struct stat sb; pid_t pid; - int e, i, status; + time_t start; + int e, status; if (ac < 2) usage(); @@ -150,7 +152,8 @@ main(int ac, char **av) if (pid == 0) child(av[1]); e = 0; - for (i = 0; i < 200000; i++) { + start = time(NULL); + while (time(NULL) - start < 150) { pid = fork(); if (pid < 0) err(1, "vfork"); diff --git a/tools/test/stress2/misc/gnop2.sh b/tools/test/stress2/misc/gnop2.sh index d38754d58456..0a6b830ce749 100755 --- a/tools/test/stress2/misc/gnop2.sh +++ b/tools/test/stress2/misc/gnop2.sh @@ -71,8 +71,10 @@ test() { gnop status || exit 1 +start=`date +%s` for i in 1k 2k 4k 8k; do test $i + [ $((`date +%s` - start)) -gt 1200 ] && break done [ $notloaded ] && gnop unload diff --git a/tools/test/stress2/misc/mmap5.sh b/tools/test/stress2/misc/mmap5.sh index e6dee6d551de..c7369118e0e2 100755 --- a/tools/test/stress2/misc/mmap5.sh +++ b/tools/test/stress2/misc/mmap5.sh @@ -52,15 +52,16 @@ rm -f /tmp/mmap5 /tmp/mmap5.inputfile exit EOF -#include -#include -#include +#include #include #include -#include #include #include #include +#include +#include +#include +#include #include const char *file; @@ -113,13 +114,14 @@ test(void) int main(int argc, char *argv[]) { - int i; + time_t start; if (argc != 2) errx(1, "Usage: %s ", argv[0]); file = argv[1]; - for (i = 0; i < 30000; i++) { + start = time(NULL); + while (time(NULL) - start < 120) { if (fork() == 0) test(); wait(NULL); diff --git a/tools/test/stress2/misc/procfs.sh b/tools/test/stress2/misc/procfs.sh index 6b445b0d7e48..a59235c6d521 100755 --- a/tools/test/stress2/misc/procfs.sh +++ b/tools/test/stress2/misc/procfs.sh @@ -56,7 +56,8 @@ else else # The test: Parallel mount and unmounts - for i in `jot 128`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 mount -t procfs proc ${mntpoint}$m while mount | grep -qw $mntpoint$m; do diff --git a/tools/test/stress2/misc/rename3.sh b/tools/test/stress2/misc/rename3.sh index c7ce91f0d359..aa4a3754bfab 100755 --- a/tools/test/stress2/misc/rename3.sh +++ b/tools/test/stress2/misc/rename3.sh @@ -36,7 +36,8 @@ # Test scenario by Tor Egge root=/tmp -for i in `jot 10000`; do +start=`date +%s` +while [ $((`date +%s` - start)) -lt 60 ]; do rm -rf $root/a mkdir -p $root/a/b/c/d/e/f/g mkdir -p $root/a/b/c/d/e/f/z diff --git a/tools/test/stress2/misc/rename7.sh b/tools/test/stress2/misc/rename7.sh index 9f6954916411..fdaa8f575117 100755 --- a/tools/test/stress2/misc/rename7.sh +++ b/tools/test/stress2/misc/rename7.sh @@ -122,7 +122,8 @@ int main(void) { pid_t wpid, spid; - int e, fd, i, status; + time_t start; + int e, fd, status; if ((wpid = fork()) == 0) r1(); @@ -132,7 +133,8 @@ main(void) setproctitle("main"); e = 0; - for (i = 0; i < 800000; i++) { + start = time(NULL); + while (time(NULL) - start < 60) { if ((fd = open(logfile, O_RDWR | O_CREAT | O_TRUNC, 0644)) == -1) warn("creat(%s)", logfile); close(fd); diff --git a/tools/test/stress2/misc/tmpfs2.sh b/tools/test/stress2/misc/tmpfs2.sh index 80885c331e14..09a2cfd68266 100755 --- a/tools/test/stress2/misc/tmpfs2.sh +++ b/tools/test/stress2/misc/tmpfs2.sh @@ -45,13 +45,15 @@ if [ $# -eq 0 ]; then else if [ $1 = find ]; then - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmounts - for i in `jot 1024`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` mount -t tmpfs tmpfs ${mntpoint}$m diff --git a/tools/test/stress2/misc/umountf4.sh b/tools/test/stress2/misc/umountf4.sh index 4f5ea0fff660..e26555e7c6f3 100755 --- a/tools/test/stress2/misc/umountf4.sh +++ b/tools/test/stress2/misc/umountf4.sh @@ -65,13 +65,15 @@ if [ $# -eq 0 ]; then else if [ $1 = find ]; then - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmounts - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` mount $opt /dev/md${m} ${mntpoint}$m diff --git a/tools/test/stress2/misc/umountf6.sh b/tools/test/stress2/misc/umountf6.sh index aeb4454ea69c..628342689b38 100755 --- a/tools/test/stress2/misc/umountf6.sh +++ b/tools/test/stress2/misc/umountf6.sh @@ -65,13 +65,15 @@ if [ $# -eq 0 ]; then else if [ $1 = find ]; then - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do find ${mntpoint}* -type f > /dev/null 2>&1 done else # The test: Parallel mount and unmounts - for i in `jot 100`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do m=$1 opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` mount $opt /dev/md${m} ${mntpoint}$m diff --git a/tools/test/stress2/misc/vunref.sh b/tools/test/stress2/misc/vunref.sh index f844a0dd3625..f08035a95694 100755 --- a/tools/test/stress2/misc/vunref.sh +++ b/tools/test/stress2/misc/vunref.sh @@ -82,7 +82,8 @@ if [ $# -eq 0 ]; then else if [ $1 = mmap ]; then touch $RUNDIR/active.$2 - for i in `jot 500`; do + start=`date +%s` + while [ $((`date +%s`- start)) -lt 300 ]; do cd ${mntpoint}$2 /tmp/vunref > /dev/null 2>&1 cd / From nobody Tue Jun 4 11:19:41 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 4Vtp5n55jWz5NFxS; Tue, 04 Jun 2024 11:19:41 +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 4Vtp5n4VDdz4Lvl; Tue, 4 Jun 2024 11:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717499981; 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=JNSiRuwr/xvJVmeaDCw+W8I3VGw1rdlOflO8pP3nmxQ=; b=RPyHdq++6ZPb+zqQSP62pmjQo6GEesqCO+C+wsWfLhO8C5hE7erwp2a6vGy1LS4biXeKfH Nl9kF46oo9SL/Iu4mODL2qDt8I+YozmaOnjG9XQuAbcLIpTNt6kvZCPFo2GBjKFYjXFc32 5nzcPtlsRk8rTM5G2FI47gT+DLKm1UZMAHBco+ti0raqu/7qQKgdp3tze0NcQFJ1q98kXj rStq9wuiQ2zBAyCfY7arPrnlhYuZirGCAiYdvqjiT9GMshnjZl2UGOUyB9DDNgqv1zs2g1 /UaV11gcAiBq5AARdPWzfTs83sCfglp/Gcsd6C1HgZysCjV7TALPN7oMDCV1sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717499981; a=rsa-sha256; cv=none; b=vimkira3/wXJfQjetbHHHRnkxGW7aHT0lOM7LC5RzQmgCKKFLWZ/dnPWUS5Bfcnj5G10Ah NWTsmcfIESjYlBQbdgcbKT568ingSr4n9VeNQfLk5ckQK3QtI7OK1tVvYDOphJGCmY5+Cj QFOIHnFSD5L/lXN7Q1sqeOJToTB40vLJmVFCrEpT5h8x2dt95H11UP2nfTptLMhw3x/oHX 5wAK498in/Ysh2NEm+kyRKDV4jM2jcfzhfgaYmyhIMrIncafhSMfErNY1FDXsPr+hp7X5n RR0TdMYmPUFPKMn4DuuxFZZnh6vwUDIsGgZFTMnMTMMscGdbO0yw+fPgh9ydDg== 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=1717499981; 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=JNSiRuwr/xvJVmeaDCw+W8I3VGw1rdlOflO8pP3nmxQ=; b=uh8nc82D608l2xA4eWntdP/R/O2SR6z2i18WPZJAp7QLwvEpKabfgHhSS+bMDBse6BciLB SmRbPYmAQDLZKqVU8XPIEFczn0wKBiquvAWvqeC50+klb1VGzRyhjMYt+PhotUwxeVpy7h fg1ZXN2h0LH1ZSYCQZQu/gKJY1l6hxYgU7gXhUijYV3CgJjqJJViFIY4dedpDSMI7AjrTK 3+Qtd6GZGrBzWUgTFvkW6VXq7z91jnvACn+hk7iUXDbuR1AOH3v051sXI0sKNCPNru2FG3 aa8c9VY8lj6mksITzlE+NSPrxmfHWKYs/BHqKdZD2n5zFEZnOo28NKKC+4nWhQ== 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 4Vtp5n45VyzGxN; Tue, 4 Jun 2024 11:19:41 +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 454BJfoR077757; Tue, 4 Jun 2024 11:19:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 454BJfSr077754; Tue, 4 Jun 2024 11:19:41 GMT (envelope-from git) Date: Tue, 4 Jun 2024 11:19:41 GMT Message-Id: <202406041119.454BJfSr077754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 13671022ebfb - stable/14 - linuxkpi: hdmi: Split the module declaration to a new file 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 13671022ebfb31ad49480973801fb4742a773a20 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=13671022ebfb31ad49480973801fb4742a773a20 commit 13671022ebfb31ad49480973801fb4742a773a20 Author: Emmanuel Vadot AuthorDate: 2024-04-24 07:59:20 +0000 Commit: Emmanuel Vadot CommitDate: 2024-06-04 11:06:40 +0000 linuxkpi: hdmi: Split the module declaration to a new file In order to have a proper linuxkpi_video kmod, move the module declaration to a new file as linuxkpi_video will also include linux_hdmi.c Differential Revision: https://reviews.freebsd.org/D44926 Reviewed by: bz, emaste, wulf Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 7f84bb34a1d191949ec519a01c0c574f5e827c88) --- sys/compat/linuxkpi/common/src/linux_hdmi.c | 10 ---------- sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c | 7 +++++++ sys/modules/linuxkpi_hdmi/Makefile | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_hdmi.c b/sys/compat/linuxkpi/common/src/linux_hdmi.c index 172616306506..947be761dfa4 100644 --- a/sys/compat/linuxkpi/common/src/linux_hdmi.c +++ b/sys/compat/linuxkpi/common/src/linux_hdmi.c @@ -21,12 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef __FreeBSD__ -#include -#include -#include -#endif - #include #include #include @@ -1915,7 +1909,3 @@ int hdmi_infoframe_unpack(union hdmi_infoframe *frame, return ret; } EXPORT_SYMBOL(hdmi_infoframe_unpack); - - -MODULE_VERSION(linuxkpi_hdmi, 1); -MODULE_DEPEND(linuxkpi_hdmi, linuxkpi, 1, 1, 1); diff --git a/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c b/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c new file mode 100644 index 000000000000..b0d4c013a6f3 --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c @@ -0,0 +1,7 @@ +/* Public domain. */ + +#include +#include + +MODULE_VERSION(linuxkpi_hdmi, 1); +MODULE_DEPEND(linuxkpi_hdmi, linuxkpi, 1, 1, 1); diff --git a/sys/modules/linuxkpi_hdmi/Makefile b/sys/modules/linuxkpi_hdmi/Makefile index ef843c726dac..dc19c0afeebc 100644 --- a/sys/modules/linuxkpi_hdmi/Makefile +++ b/sys/modules/linuxkpi_hdmi/Makefile @@ -2,6 +2,7 @@ KMOD= linuxkpi_hdmi SRCS= linux_hdmi.c \ + linuxkpi_hdmikmod.c SRCS+= ${LINUXKPI_GENSRCS} From nobody Tue Jun 4 11:19:42 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 4Vtp5p6K8vz5NFvh; Tue, 04 Jun 2024 11:19:42 +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 4Vtp5p4vPxz4Ll8; Tue, 4 Jun 2024 11:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717499982; 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=AvrtYddFa/ccrk6i5qwc+KO6Cm9SbbOMCECdxKh8ncQ=; b=PXqd/0aRceYoqbQRP/cxA30KpVSv1Ymb3wXfV7pb33lRYqJD2JsKcIeHSYp7Oo7YsEhyYW yJ4QdI+k7GqXWDEwvgpJPCpsJtcSgjCku0QqjsK9gR+lb0L+Kcn8C/RvS5q8WlB2j55T8M q2SBtbAU/y4bKIVkLzqjapcTtIViaD9e7CBQD7BpQVWTUtHyz5sBJPiypykafQb4adtZQW hENM8osYTIGbPnmPaP52tERD4Zgnq0t3kz230oEpBo/NzsZWg1XnKlDa+aS/TaQ5qzkJRF 43/VyyHT5wZla+oOugAwFkx/1ug3ZLR9e3BOaFmTWiBCN9O9L5bcdo658xzidw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717499982; a=rsa-sha256; cv=none; b=EhNi5zFOXs49S7D6/2bTuLEkOhbmQ7iUU5t6NQ5q7R3ZPeLqrdDZqNPREhsn97jMwAaEuf /eqsFTTtigIL2GIRuVrhtjW1wLm8ncDesRQehzkbjw5x9dJYydxQ28rde/Fbb5dozNSiOO dr4uJrt0+ftp9J+QZCQttQ0qm1CpkGL9FM5v9gDASj5shoOfivyMprsm5PyJMqca5c90QU g3Oswl1D8az/2vTotlHF/IbJUtar5GzCi/2kLSi6OwJ6dw+aDIIZrBHfHG9DoJEE1/Lgop jA7+GKnzqzWzTXeRJZmexQ4BuveAXTkp1/W3UJvjY50tkPyVkyGsli0FB5pa2A== 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=1717499982; 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=AvrtYddFa/ccrk6i5qwc+KO6Cm9SbbOMCECdxKh8ncQ=; b=eaL+2f4sXi/oUtJ0TBp0KqeLYO4OsfKqCnXuA+lEHX/x2MbIfrKFHA5sNERSN418gXfjqg oR5feTZVitGJjNhCnEfRAqaQdDRZ3FVJv2FkJn3W2a/bQJAMy2L/Itlls3yISwJUeBUXKO vq7hePFEqun49fl/+CExE8y6hhyMqc650vpH0RjSX/UVzSeY8xaIxu08SOaV/grg//d2NU C5KQ4/ebCgdnDuo1MgbfTj0Bh8qpGNgeVahLQYXubkRpRkbDTXMdNHKY/BsoajZN5owL/2 4DRbEULmaN/vYvEmlCuMreLNZ1N+V4reYps0r7TcysKW+3wVmqqE0UDFhQAZ2w== 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 4Vtp5p4VyjzGNj; Tue, 4 Jun 2024 11:19:42 +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 454BJgtE077797; Tue, 4 Jun 2024 11:19:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 454BJgLN077794; Tue, 4 Jun 2024 11:19:42 GMT (envelope-from git) Date: Tue, 4 Jun 2024 11:19:42 GMT Message-Id: <202406041119.454BJgLN077794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 5080cf0846df - stable/14 - linuxkpi: Add linuxkpi_video module 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5080cf0846dff22c25358bc2db15a147866578af Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=5080cf0846dff22c25358bc2db15a147866578af commit 5080cf0846dff22c25358bc2db15a147866578af Author: Emmanuel Vadot AuthorDate: 2024-04-24 08:14:36 +0000 Commit: Emmanuel Vadot CommitDate: 2024-06-04 11:06:45 +0000 linuxkpi: Add linuxkpi_video module This contain the hdmi code and the aperture code like in linux. Differential Revision: https://reviews.freebsd.org/D44925 Reviewed by: bz Obtained from: drm-kmod Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 11d79c4756b7c85faf7c4a268c301a41ce0887b9) --- .../linuxkpi/common/include/linux/aperture.h | 58 ++++ sys/compat/linuxkpi/common/src/linux_aperture.c | 365 +++++++++++++++++++++ .../linuxkpi/common/src/linuxkpi_videokmod.c | 7 + sys/modules/Makefile | 1 + sys/modules/linuxkpi_video/Makefile | 15 + 5 files changed, 446 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/aperture.h b/sys/compat/linuxkpi/common/include/linux/aperture.h new file mode 100644 index 000000000000..e0387ed0225d --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/aperture.h @@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef _LINUX_APERTURE_H_ +#define _LINUX_APERTURE_H_ + +#include + +#define CONFIG_APERTURE_HELPERS + +struct pci_dev; +struct platform_device; + +#if defined(CONFIG_APERTURE_HELPERS) +int devm_aperture_acquire_for_platform_device(struct platform_device *pdev, + resource_size_t base, + resource_size_t size); + +int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, + bool primary, const char *name); + +int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name); +#else +static inline int devm_aperture_acquire_for_platform_device(struct platform_device *pdev, + resource_size_t base, + resource_size_t size) +{ + return 0; +} + +static inline int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, + bool primary, const char *name) +{ + return 0; +} + +static inline int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name) +{ + return 0; +} +#endif + +/** + * aperture_remove_all_conflicting_devices - remove all existing framebuffers + * @primary: also kick vga16fb if present; only relevant for VGA devices + * @name: a descriptive name of the requesting driver + * + * This function removes all graphics device drivers. Use this function on systems + * that can have their framebuffer located anywhere in memory. + * + * Returns: + * 0 on success, or a negative errno code otherwise + */ +static inline int aperture_remove_all_conflicting_devices(bool primary, const char *name) +{ + return aperture_remove_conflicting_devices(0, (resource_size_t)-1, primary, name); +} + +#endif diff --git a/sys/compat/linuxkpi/common/src/linux_aperture.c b/sys/compat/linuxkpi/common/src/linux_aperture.c new file mode 100644 index 000000000000..15a56839fa9c --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_aperture.c @@ -0,0 +1,365 @@ +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include