The branch main has been updated by np:

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

commit 998eb37aca6670b1ecbb7b5cad2b5b2d85d744b8
Author:     Navdeep Parhar <n...@freebsd.org>
AuthorDate: 2022-09-09 22:21:18 +0000
Commit:     Navdeep Parhar <n...@freebsd.org>
CommitDate: 2022-09-12 18:40:35 +0000

    cxgbe(4): Add knob to control congestion behavior for TOE queues.
    
    hw.cxgbe.ofld_cong_drop works just like hw.cxgbe.cong_drop but for TOE
    rx queues.
    
    MFC after:      2 weeks
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/t4_sge.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 9e75d1d96bad..0ee8d709eca4 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -129,6 +129,11 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, spg_len, CTLFLAG_RDTUN, 
&spg_len, 0,
 static int cong_drop = 0;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, cong_drop, CTLFLAG_RDTUN, &cong_drop, 0,
     "Congestion control for NIC RX queues (0 = backpressure, 1 = drop, 2 = 
both");
+#ifdef TCP_OFFLOAD
+static int ofld_cong_drop = 0;
+SYSCTL_INT(_hw_cxgbe, OID_AUTO, ofld_cong_drop, CTLFLAG_RDTUN, 
&ofld_cong_drop, 0,
+    "Congestion control for TOE RX queues (0 = backpressure, 1 = drop, 2 = 
both");
+#endif
 
 /*
  * Deliver multiple frames in the same free list buffer if they fit.
@@ -560,6 +565,13 @@ t4_sge_modload(void)
                    " using 0 instead.\n", cong_drop);
                cong_drop = 0;
        }
+#ifdef TCP_OFFLOAD
+       if (ofld_cong_drop < -1 || ofld_cong_drop > 2) {
+               printf("Invalid hw.cxgbe.ofld_cong_drop value (%d),"
+                   " using 0 instead.\n", ofld_cong_drop);
+               ofld_cong_drop = 0;
+       }
+#endif
 
        if (tscale != 1 && (tscale < 3 || tscale > 17)) {
                printf("Invalid hw.cxgbe.tscale value (%d),"
@@ -1004,6 +1016,10 @@ t4_sge_sysctls(struct adapter *sc, struct 
sysctl_ctx_list *ctx,
 
        SYSCTL_ADD_INT(ctx, children, OID_AUTO, "cong_drop", CTLFLAG_RD,
            NULL, cong_drop, "congestion drop setting");
+#ifdef TCP_OFFLOAD
+       SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ofld_cong_drop", CTLFLAG_RD,
+           NULL, ofld_cong_drop, "congestion drop setting");
+#endif
 
        SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pack", CTLFLAG_RD,
            NULL, sp->pack_boundary, "payload pack boundary (bytes)");
@@ -4113,7 +4129,7 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq 
*ofld_rxq, int idx,
                    CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload rx queue");
 
                init_iq(&ofld_rxq->iq, sc, vi->ofld_tmr_idx, vi->ofld_pktc_idx,
-                   vi->qsize_rxq, intr_idx, 0, IQ_OFLD);
+                   vi->qsize_rxq, intr_idx, ofld_cong_drop, IQ_OFLD);
                snprintf(name, sizeof(name), "%s ofld_rxq%d-fl",
                    device_get_nameunit(vi->dev), idx);
                init_fl(sc, &ofld_rxq->fl, vi->qsize_rxq / 8, maxp, name);

Reply via email to