aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2022-09-09 22:21:18 +0000
committerNavdeep Parhar <np@FreeBSD.org>2022-09-12 18:40:35 +0000
commit998eb37aca6670b1ecbb7b5cad2b5b2d85d744b8 (patch)
treea4864e1623c55dee0abd6e740a6583ea53c97eeb
parentdf275ae5090048fb7a8c082d509fae57e891957a (diff)
downloadsrc-998eb37aca6670b1ecbb7b5cad2b5b2d85d744b8.tar.gz
src-998eb37aca6670b1ecbb7b5cad2b5b2d85d744b8.zip
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
-rw-r--r--sys/dev/cxgbe/t4_sge.c18
1 files changed, 17 insertions, 1 deletions
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);