From nobody Mon Apr 29 21:02:27 2024 X-Original-To: dev-commits-src-main@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 4VSy1N6Kbjz5Jvyd; Mon, 29 Apr 2024 22:00: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 4VSy1N5FCtz4nLh; Mon, 29 Apr 2024 22:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428008; 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=3IsPWF+eR+tWYg/+Fh6Nqch42M3zDa+XKmfSABbpH8A=; b=RFBWL2MShkhwZ46rn/n6AiJE3upcc25vbEVUkm1OnQwnY+TJ591eZ6fgQmz933I9VXDON/ bRorfUqP3fs2xxTMvZbm/xUlzaCtPYdFUwPAZa79kNhY+I5jkg7DnZAysluIJ+gGFUFuUG mHTO0IcwKEK2tw99MkECDWUN5JRktqXPe73VRF1137AXEcG9C5JBCVVxkIKLwAY4MAF/vY 60M1M36lVM+7FpI2+5KcGsbTdOH8gsKz5IDqFv9tUHNDA40djP+ETTO3G153BRNTuyhwSQ 5FH6tP2IgqBhulKP/fj5npmH/NlMXzO3EPeIn0/4P1gPuulk6PbwKVQcjRtv7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428008; a=rsa-sha256; cv=none; b=L6uNd6igsHWPgYkQhkInE0JhWFOrJQ8TQGhejPBnvNLNO+qaWbZZxGiByDgdAtritjpNjQ QjfSJpe39n9Xay7bBrqz18gOENBgO/NnIr9W/mcvehXsSEZ5za4siGNzl162fcfir8H+4P J9kknCbrG3DX0XKuFxFszZ4Gpv3hEkAbyDrCQ1J6d5zKPFXG4HSj+VE9CQ5UtVpeC76UAu SeRiT+wzeY4p+86v+w5UGmzUyuEh94kSkeR1DuaUvCsot7oSil7ePwfBLvicDqcFD6Tl+5 eOjj3GmmWoini4D3a1map6Xeov7Hr8Vsei/IpAOByb+AnZUIZZo0eYeHRYy+Yw== 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=1714428008; 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=3IsPWF+eR+tWYg/+Fh6Nqch42M3zDa+XKmfSABbpH8A=; b=wRb5wmS21+d8MGsPcAtQvzhvm7SuD5z+a7WIZDMjLokGIZQkeKSpMqPMV0Fz0G9U79zsnt 1l99kWiW7Sfm+4bKKqFG1mwjtzWI8wOUx0KQEI5isDtCbpcTKYLv+DY/OElxJFGRHoI+G8 5wUIcmavlv9mRWCMRAGqSxVetGzpacXnTI4WJZXohmZIs8fNhwFOwlbsywOsrxYfuCKz+r rSgnqnwKUJ2m9xhzPf+mfhqJ+sZANDSIJ+2fcVxBjDAUBOZex1Oc9RSKRsv7IQJoon+cS3 Azi2jQv49A+y6dJJMf40aVffq9eni5FlbKD7M+TLcv/khGELHCigWfXWyzq/MA== Received: from gitrepo.freebsd.org (unknown [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 4VSxgf19s6z1KGD; Mon, 29 Apr 2024 21:44:46 +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 43TL2RjA040879; Mon, 29 Apr 2024 21:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TL2Raw040876; Mon, 29 Apr 2024 21:02:27 GMT (envelope-from git) Date: Mon, 29 Apr 2024 21:02:27 GMT Message-Id: <202404292102.43TL2Raw040876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 2965ae591441 - main - cxgbe(4): Shared code update to deal with partial failure in query_params. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2965ae59144177eb3570721295da9cbc447f1105 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=2965ae59144177eb3570721295da9cbc447f1105 commit 2965ae59144177eb3570721295da9cbc447f1105 Author: Navdeep Parhar AuthorDate: 2024-02-14 01:28:53 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 20:51:41 +0000 cxgbe(4): Shared code update to deal with partial failure in query_params. Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications --- 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 bb2ed5e4d820..360d44847004 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; }