git: ee3da604dd01 - main - cxgbe(4): Clobber all tracer state on stop and redo only traceq on restart.

From: Navdeep Parhar <np_at_FreeBSD.org>
Date: Tue, 24 Sep 2024 23:53:08 UTC
The branch main has been updated by np:

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

commit ee3da604dd016439850dae77366796313e60f0e0
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2024-09-24 23:28:29 +0000
Commit:     Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2024-09-24 23:52:22 +0000

    cxgbe(4): Clobber all tracer state on stop and redo only traceq on restart.
    
    Tracers have to be recreated after a restart but that's okay given that
    they are used for debugging only.
    
    MFC after:      1 week
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/t4_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 4412e1ab95fb..307b9c27111a 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -2095,6 +2095,8 @@ stop_lld(struct adapter *sc)
 		if (pi->flags & HAS_TRACEQ) {
 			pi->flags &= ~HAS_TRACEQ;
 			sc->traceq = -1;
+			sc->tracer_valid = 0;
+			sc->tracer_enabled = 0;
 		}
 	}
 	if (sc->flags & FULL_INIT_DONE) {
@@ -2411,6 +2413,15 @@ restart_lld(struct adapter *sc)
 					    "interface: %d\n", rc);
 					goto done;
 				}
+				if (sc->traceq < 0 && IS_MAIN_VI(vi)) {
+					sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id;
+					t4_write_reg(sc, is_t4(sc) ?
+					    A_MPS_TRC_RSS_CONTROL :
+					    A_MPS_T5_TRC_RSS_CONTROL,
+					    V_RSSCONTROL(pi->tx_chan) |
+					    V_QUEUENUMBER(sc->traceq));
+					pi->flags |= HAS_TRACEQ;
+				}
 
 				ifp = vi->ifp;
 				if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))