Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_tom.c
Show First 20 Lines • Show All 1,371 Lines • ▼ Show 20 Lines | init_conn_params(struct vi_info *vi , struct offload_settings *s, | ||||
/* | /* | ||||
* Index in the PMTU table. This controls the MSS that we announce in | * Index in the PMTU table. This controls the MSS that we announce in | ||||
* our SYN initially, but after ESTABLISHED it controls the MSS that we | * our SYN initially, but after ESTABLISHED it controls the MSS that we | ||||
* use to send data. | * use to send data. | ||||
*/ | */ | ||||
cp->mtu_idx = find_best_mtu_idx(sc, inc, s); | cp->mtu_idx = find_best_mtu_idx(sc, inc, s); | ||||
/* Tx queue for this connection. */ | /* Tx queue for this connection. */ | ||||
if (s->txq >= 0 && s->txq < vi->nofldtxq) | if (s->txq == QUEUE_RANDOM) | ||||
cp->txq_idx = s->txq; | cp->txq_idx = arc4random(); | ||||
else if (s->txq == QUEUE_ROUNDROBIN) | |||||
cp->txq_idx = atomic_fetchadd_int(&vi->txq_rr, 1); | |||||
else | else | ||||
cp->txq_idx = arc4random() % vi->nofldtxq; | cp->txq_idx = s->txq; | ||||
cp->txq_idx %= vi->nofldtxq; | |||||
cp->txq_idx += vi->first_ofld_txq; | cp->txq_idx += vi->first_ofld_txq; | ||||
/* Rx queue for this connection. */ | /* Rx queue for this connection. */ | ||||
if (s->rxq >= 0 && s->rxq < vi->nofldrxq) | if (s->rxq == QUEUE_RANDOM) | ||||
cp->rxq_idx = s->rxq; | cp->rxq_idx = arc4random(); | ||||
else if (s->rxq == QUEUE_ROUNDROBIN) | |||||
cp->rxq_idx = atomic_fetchadd_int(&vi->rxq_rr, 1); | |||||
else | else | ||||
cp->rxq_idx = arc4random() % vi->nofldrxq; | cp->rxq_idx = s->rxq; | ||||
cp->rxq_idx %= vi->nofldrxq; | |||||
cp->rxq_idx += vi->first_ofld_rxq; | cp->rxq_idx += vi->first_ofld_rxq; | ||||
if (SOLISTENING(so)) { | if (SOLISTENING(so)) { | ||||
/* Passive open */ | /* Passive open */ | ||||
MPASS(tcpopt != NULL); | MPASS(tcpopt != NULL); | ||||
/* TCP timestamp option */ | /* TCP timestamp option */ | ||||
if (tcpopt->tstamp && | if (tcpopt->tstamp && | ||||
▲ Show 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | static const struct offload_settings allow_offloading_settings = { | ||||
.cong_algo = -1, | .cong_algo = -1, | ||||
.sched_class = -1, | .sched_class = -1, | ||||
.tstamp = -1, | .tstamp = -1, | ||||
.sack = -1, | .sack = -1, | ||||
.nagle = -1, | .nagle = -1, | ||||
.ecn = -1, | .ecn = -1, | ||||
.ddp = -1, | .ddp = -1, | ||||
.tls = -1, | .tls = -1, | ||||
.txq = -1, | .txq = QUEUE_RANDOM, | ||||
.rxq = -1, | .rxq = QUEUE_RANDOM, | ||||
.mss = -1, | .mss = -1, | ||||
}; | }; | ||||
static const struct offload_settings disallow_offloading_settings = { | static const struct offload_settings disallow_offloading_settings = { | ||||
.offload = 0, | .offload = 0, | ||||
/* rest is irrelevant when offload is off. */ | /* rest is irrelevant when offload is off. */ | ||||
}; | }; | ||||
rw_assert(&sc->policy_lock, RA_LOCKED); | rw_assert(&sc->policy_lock, RA_LOCKED); | ||||
▲ Show 20 Lines • Show All 350 Lines • Show Last 20 Lines |