cxgbe/t4_tom: Add a knob to select the congestion control algorigthm

used by the TOE hardware for fully offloaded connections.  The knob
affects new connections only.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2017-08-31 20:33:22 +00:00
parent 3b65550eec
commit 3ef7429927
4 changed files with 13 additions and 0 deletions

View file

@ -144,6 +144,7 @@ struct uld_info {
};
struct tom_tunables {
int cong_algorithm;
int sndbuf;
int ddp;
int rx_coalesce;

View file

@ -5416,6 +5416,12 @@ t4_sysctls(struct adapter *sc)
NULL, "TOE parameters");
children = SYSCTL_CHILDREN(oid);
sc->tt.cong_algorithm = -1;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "cong_algorithm",
CTLFLAG_RW, &sc->tt.cong_algorithm, 0, "congestion control "
"(-1 = default, 0 = reno, 1 = tahoe, 2 = newreno, "
"3 = highspeed)");
sc->tt.sndbuf = 256 * 1024;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sndbuf", CTLFLAG_RW,
&sc->tt.sndbuf, 0, "max hardware send buffer size");

View file

@ -259,6 +259,9 @@ calc_opt2a(struct socket *so, struct toepcb *toep)
if (sc->tt.rx_coalesce)
opt2 |= V_RX_COALESCE(M_RX_COALESCE);
if (sc->tt.cong_algorithm != -1)
opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL);
#ifdef USE_DDP_RX_FLOW_CONTROL
if (toep->ulp_mode == ULP_MODE_TCPDDP)
opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;

View file

@ -1047,6 +1047,9 @@ calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid,
if (sc->tt.rx_coalesce)
opt2 |= V_RX_COALESCE(M_RX_COALESCE);
if (sc->tt.cong_algorithm != -1)
opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL);
#ifdef USE_DDP_RX_FLOW_CONTROL
if (ulp_mode == ULP_MODE_TCPDDP)
opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;