git: 906521882324 - main - cxgbe: Tidy TOE tunables under hw.cxgbe

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 10 Dec 2024 20:34:52 UTC
The branch main has been updated by jhb:

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

commit 90652188232458891a2922fb5a542971aa58055d
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-12-10 20:30:30 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-12-10 20:32:07 +0000

    cxgbe: Tidy TOE tunables under hw.cxgbe
    
    - Only two of these tunables are used for RATELIMIT without
      TCP_OFFLOAD.
    
    - Mark t4_tmr_idx_ofld and t4_pktc_idx_ofld static.
    
    - Move hw.cxgbe.cop_managed_offloading under hw.cxgbe.toe since it is
      specific to TOE.
    
    Reviewed by:    np
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D47765
---
 sys/dev/cxgbe/t4_main.c        | 19 +++++++++++--------
 usr.sbin/cxgbetool/cxgbetool.8 |  4 ++--
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 8c7d1ad4487a..25d5dee8b781 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -318,15 +318,17 @@ static int t4_nofldtxq = -NOFLDTXQ;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq, CTLFLAG_RDTUN, &t4_nofldtxq, 0,
     "Number of offload TX queues per port");
 
-#define NOFLDRXQ 2
-static int t4_nofldrxq = -NOFLDRXQ;
-SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0,
-    "Number of offload RX queues per port");
-
 #define NOFLDTXQ_VI 1
 static int t4_nofldtxq_vi = -NOFLDTXQ_VI;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq_vi, CTLFLAG_RDTUN, &t4_nofldtxq_vi, 0,
     "Number of offload TX queues per VI");
+#endif
+
+#if defined(TCP_OFFLOAD)
+#define NOFLDRXQ 2
+static int t4_nofldrxq = -NOFLDRXQ;
+SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0,
+    "Number of offload RX queues per port");
 
 #define NOFLDRXQ_VI 1
 static int t4_nofldrxq_vi = -NOFLDRXQ_VI;
@@ -334,12 +336,12 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq_vi, CTLFLAG_RDTUN, &t4_nofldrxq_vi, 0,
     "Number of offload RX queues per VI");
 
 #define TMR_IDX_OFLD 1
-int t4_tmr_idx_ofld = TMR_IDX_OFLD;
+static int t4_tmr_idx_ofld = TMR_IDX_OFLD;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_timer_idx_ofld, CTLFLAG_RDTUN,
     &t4_tmr_idx_ofld, 0, "Holdoff timer index for offload queues");
 
 #define PKTC_IDX_OFLD (-1)
-int t4_pktc_idx_ofld = PKTC_IDX_OFLD;
+static int t4_pktc_idx_ofld = PKTC_IDX_OFLD;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_pktc_idx_ofld, CTLFLAG_RDTUN,
     &t4_pktc_idx_ofld, 0, "holdoff packet counter index for offload queues");
 
@@ -686,9 +688,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l4_errors, CTLFLAG_RDTUN,
  * TOE tunables.
  */
 static int t4_cop_managed_offloading = 0;
-SYSCTL_INT(_hw_cxgbe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN,
+SYSCTL_INT(_hw_cxgbe_toe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN,
     &t4_cop_managed_offloading, 0,
     "COP (Connection Offload Policy) controls all TOE offload");
+TUNABLE_INT("hw.cxgbe.cop_managed_offloading", &t4_cop_managed_offloading);
 #endif
 
 #ifdef KERN_TLS
diff --git a/usr.sbin/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8
index a25a227669ed..995a4146deb3 100644
--- a/usr.sbin/cxgbetool/cxgbetool.8
+++ b/usr.sbin/cxgbetool/cxgbetool.8
@@ -29,7 +29,7 @@
 .\"
 .\" * Other names and brands may be claimed as the property of others.
 .\"
-.Dd April 14, 2022
+.Dd December 10, 2024
 .Dt CXGBETOOL 8
 .Os
 .Sh NAME
@@ -553,7 +553,7 @@ Install the Connection Offload Policy (COP) in
 A COP offers fine-grained control over which connections get offloaded and with
 what parameters.
 Set
-.Cm hw.cxgbe.cop_managed_offloading="1"
+.Cm hw.cxgbe.toe.cop_managed_offloading="1"
 in loader.conf to ensure that t4_tom will not offload any connection before a
 COP is installed.
 Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always