Date: Wed, 17 Jul 2024 14:24:37 GMT From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 0109a527607c - stable/13 - cxgbe(4): Shared code update to deal with partial failure in query_params. Message-ID: <202407171424.46HEObM3033058@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=0109a527607ce0390ed5dfe59e9e3bf868ce08fa commit 0109a527607ce0390ed5dfe59e9e3bf868ce08fa Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2024-02-14 01:28:53 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> 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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407171424.46HEObM3033058>