git: f76effed14b2 - main - cxgbe(4): Remove tx_modq lookup table.

From: Navdeep Parhar <np_at_FreeBSD.org>
Date: Mon, 29 Apr 2024 18:35:49 UTC
The branch main has been updated by np:

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

commit f76effed14b25bfa0c47b10f6d8a076104c48d94
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2024-03-29 05:49:32 +0000
Commit:     Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2024-04-29 18:26:49 +0000

    cxgbe(4): Remove tx_modq lookup table.
    
    The driver always uses the same modulation queue as the channel and the
    table is unnecessary.
    
    MFC after:      1 week
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/common/common.h      | 4 +++-
 sys/dev/cxgbe/common/t4_hw.c       | 5 -----
 sys/dev/cxgbe/crypto/t6_kern_tls.c | 4 ++--
 sys/dev/cxgbe/tom/t4_tom.c         | 2 +-
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h
index 0861e3df4bee..a9a609d5c995 100644
--- a/sys/dev/cxgbe/common/common.h
+++ b/sys/dev/cxgbe/common/common.h
@@ -252,7 +252,6 @@ struct tp_params {
 	unsigned int tre;            /* log2 of core clocks per TP tick */
 	unsigned int dack_re;        /* DACK timer resolution */
 	unsigned int la_mask;        /* what events are recorded by TP LA */
-	unsigned short tx_modq[MAX_NCHAN];  /* channel to modulation queue map */
 
 	uint16_t filter_mode;
 	uint16_t filter_mask;	/* Used by TOE and hashfilters */
@@ -273,6 +272,9 @@ struct tp_params {
 	int8_t frag_shift;
 };
 
+/* Use same modulation queue as the tx channel. */
+#define TX_MODQ(tx_chan) (tx_chan)
+
 struct vpd_params {
 	unsigned int cclk;
 	u8 ec[EC_LEN + 1];
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index c18243e4b681..25eefa57b29f 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -9800,7 +9800,6 @@ read_filter_mode_and_ingress_config(struct adapter *adap)
  */
 int t4_init_tp_params(struct adapter *adap)
 {
-	int chan;
 	u32 tx_len, rx_len, r, v;
 	struct tp_params *tpp = &adap->params.tp;
 
@@ -9808,10 +9807,6 @@ int t4_init_tp_params(struct adapter *adap)
 	tpp->tre = G_TIMERRESOLUTION(v);
 	tpp->dack_re = G_DELAYEDACKRESOLUTION(v);
 
-	/* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */
-	for (chan = 0; chan < MAX_NCHAN; chan++)
-		tpp->tx_modq[chan] = chan;
-
 	read_filter_mode_and_ingress_config(adap);
 
 	if (chip_id(adap) > CHELSIO_T5) {
diff --git a/sys/dev/cxgbe/crypto/t6_kern_tls.c b/sys/dev/cxgbe/crypto/t6_kern_tls.c
index a9fc70c8f7d7..f374de5241f6 100644
--- a/sys/dev/cxgbe/crypto/t6_kern_tls.c
+++ b/sys/dev/cxgbe/crypto/t6_kern_tls.c
@@ -170,7 +170,7 @@ mk_ktls_act_open_req(struct adapter *sc, struct vi_info *vi, struct inpcb *inp,
 	options |= F_NON_OFFLOAD;
 	cpl->opt0 = htobe64(options);
 
-	options = V_TX_QUEUE(sc->params.tp.tx_modq[vi->pi->tx_chan]);
+	options = V_TX_QUEUE(TX_MODQ(vi->pi->tx_chan));
 	if (tp->t_flags & TF_REQ_TSTMP)
 		options |= F_TSTAMPS_EN;
 	cpl->opt2 = htobe32(options);
@@ -205,7 +205,7 @@ mk_ktls_act_open_req6(struct adapter *sc, struct vi_info *vi,
 	options |= F_NON_OFFLOAD;
 	cpl->opt0 = htobe64(options);
 
-	options = V_TX_QUEUE(sc->params.tp.tx_modq[vi->pi->tx_chan]);
+	options = V_TX_QUEUE(TX_MODQ(vi->pi->tx_chan));
 	if (tp->t_flags & TF_REQ_TSTMP)
 		options |= F_TSTAMPS_EN;
 	cpl->opt2 = htobe32(options);
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
index 4d4400512ef5..b2d0b85e4832 100644
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -1202,7 +1202,7 @@ calc_options2(struct vi_info *vi, struct conn_params *cp)
 
 	/* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */
 
-	opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]);
+	opt2 |= V_TX_QUEUE(TX_MODQ(pi->tx_chan));
 	opt2 |= V_PACE(0);
 	opt2 |= F_RSS_QUEUE_VALID;
 	opt2 |= V_RSS_QUEUE(sc->sge.ofld_rxq[cp->rxq_idx].iq.abs_id);