From nobody Wed Jul 17 14:24:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WPJ9K4G1Sz5RQ1j; Wed, 17 Jul 2024 14:24:37 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WPJ9K1TXdz40yP; Wed, 17 Jul 2024 14:24:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721226277; 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=kWfMHeqbm9Ois5RqxlPJfdpM29zTiPLROKuBq9RBCFE=; b=gkx1S7OCAwqHL7doHxHFE0EAiO5k+O8eJdtahx8OHIP7YDOTH+m82dxWaPKA4H0BnS4U9Q 5PeYCKklrJF5IiVgla3fn7o3x9nYwOs67UftxS0Uf7N0PJThxgy0z6oPitxEq3rUvzq36L dnqEtMKWyNJP/JVQuFBAxezDdSNJRBzqwSiweIpE9jThs+wXhnyg21TeKVz35fVF/tHZxl hjPhvtPHaJbV+svM39TEF7lFbG7yYnNNUsjQ4XpVsDXkrYGER+vKkEHKL4Ygu4/avuI3LZ fMmXOWVyfn8vraIYnLUzqfBqseBJjUdsTBA9sww68E1ev6XRrmvBGVDhW5Z8vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721226277; a=rsa-sha256; cv=none; b=vKDo5zSNoimeUdYlPirhkzs/d2BDN9nlvlUG/ta9/T1VZS56R31Q4OJJRgQ8YiXNFgcYoB vafGEIHoiEZlCQFGW4vl9Nso4RKbZihhUaOzBPKMA1+J/w50/gpNU6Ks2MDKdqo6IUu6r0 7eScfSTL9z+YHiCQIyg45ScbjUwTn9gYyDu03xcYSUx5afnyjXyPQqyOCl9nX80uuwtNiS hVN5Ly5xw4BRejPt/RWfRlv+GXtxyEyUukPfNFZ0nP5OR2bFz87C/mEdLXWIzA6jpHUkic DV1Jtc9FVX2k6dEIGQxQGhxvkWWZm1YZJTmIb72gk7sc5aT1Hc62uLiAWopp1A== 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=1721226277; 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=kWfMHeqbm9Ois5RqxlPJfdpM29zTiPLROKuBq9RBCFE=; b=saaCK+dLGFat3n3vTmhF75hiIVcyAg2aVi4en0Pf+X78l5OjPiXQ92pOQyWxj5ZY/pKsZU e/Or37rK7jchDK0YJUMI0mnbZ8kPk4P/Its8DiGoVLb7TLBM/gtdcfe/Ar3VFqIoM4HjlE gb474pZK7sXAtLZVzDEDnFXn+vlLnWi5HhvTDQbHs3fYCP9g/CPTnGJ0V7AE0Qlzp9Qna3 CYOgZ7ke0TBgxK8m+5Btwxjxc9YFY5a1hwtO098Ode1DXUGJ0jxhFq4JRxmUBomi1Y8FPY KSfZgEuKvzJRz0eEM1eahVqJqw9UIvI0xQw2XAH1w8btdZ2ucv98RlIuKiH1AQ== 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 4WPJ9K106jz1Mpd; Wed, 17 Jul 2024 14:24:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46HEObnT033061; Wed, 17 Jul 2024 14:24:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46HEObM3033058; Wed, 17 Jul 2024 14:24:37 GMT (envelope-from git) Date: Wed, 17 Jul 2024 14:24:37 GMT Message-Id: <202407171424.46HEObM3033058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 0109a527607c - stable/13 - cxgbe(4): Shared code update to deal with partial failure in query_params. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0109a527607ce0390ed5dfe59e9e3bf868ce08fa Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=0109a527607ce0390ed5dfe59e9e3bf868ce08fa commit 0109a527607ce0390ed5dfe59e9e3bf868ce08fa Author: Navdeep Parhar AuthorDate: 2024-02-14 01:28:53 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-17 07:14:14 +0000 cxgbe(4): Shared code update to deal with partial failure in query_params. Obtained from: Chelsio Communications Sponsored by: Chelsio Communications (cherry picked from commit 2965ae59144177eb3570721295da9cbc447f1105) --- sys/dev/cxgbe/common/t4_hw.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 9048884eeb7e..8a225849930d 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -7740,9 +7740,18 @@ int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf, } ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); - if (ret == 0) - for (i = 0, p = &c.param[0].val; i < nparams; i++, p += 2) - *val++ = be32_to_cpu(*p); + + /* + * We always copy back the results, even if there's an error. We'll + * get an error if any of the parameters was unknown to the Firmware, + * but there will be results for the others ... (Older Firmware + * stopped at the first unknown parameter; newer Firmware processes + * them all and flags the unknown parameters with a return value of + * ~0UL.) + */ + for (i = 0, p = &c.param[0].val; i < nparams; i++, p += 2) + *val++ = be32_to_cpu(*p); + return ret; }