From nobody Mon Jun 3 07:36:22 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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 16:34:37 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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 19:24:47 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:58 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:57 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:59 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:03 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:10 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:08 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:11 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:14 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:13 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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:15 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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 Tue Jun 4 05:00:57 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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 11:19:41 2024 X-Original-To: dev-commits-src-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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-branches@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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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