Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2021 19:00:23 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5fe0cd6503d3 - main - ccr: Disable requests on port 1 when needed to workaround a firmware bug.
Message-ID:  <202103121900.12CJ0Nj5068578@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec

commit 5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-03-12 18:35:56 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-03-12 18:59:35 +0000

    ccr: Disable requests on port 1 when needed to workaround a firmware bug.
    
    Completions for crypto requests on port 1 can sometimes return a stale
    cookie value due to a firmware bug.  Disable requests on port 1 by
    default on affected firmware.
    
    Reviewed by:    np
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D26581
---
 sys/dev/cxgbe/crypto/t4_crypto.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c
index 8cb5924c6b4c..cdd14fcee2f9 100644
--- a/sys/dev/cxgbe/crypto/t4_crypto.c
+++ b/sys/dev/cxgbe/crypto/t4_crypto.c
@@ -2153,7 +2153,15 @@ ccr_init_port(struct ccr_softc *sc, int port)
 	sc->ports[port].stats_completed = counter_u64_alloc(M_WAITOK);
 	_Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1,
 	    "Too many ports to fit in port_mask");
-	sc->port_mask |= 1u << port;
+
+	/*
+	 * Completions for crypto requests on port 1 can sometimes
+	 * return a stale cookie value due to a firmware bug.  Disable
+	 * requests on port 1 by default on affected firmware.
+	 */
+	if (sc->adapter->params.fw_vers >= FW_VERSION32(1, 25, 4, 0) ||
+	    port == 0)
+		sc->port_mask |= 1u << port;
 }
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103121900.12CJ0Nj5068578>