1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

cxgbe/tom: Slight simplification of code that calculates options2.

MFC after:	3 days
This commit is contained in:
Navdeep Parhar 2013-04-11 21:36:01 +00:00
parent 5e79631638
commit b7a7c6d0c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249385
2 changed files with 16 additions and 10 deletions

View File

@ -226,7 +226,10 @@ calc_opt2a(struct socket *so, struct toepcb *toep)
struct tcpcb *tp = so_sototcpcb(so);
struct port_info *pi = toep->port;
struct adapter *sc = pi->adapter;
uint32_t opt2 = 0;
uint32_t opt2;
opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) |
F_RSS_QUEUE_VALID | V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id);
if (tp->t_flags & TF_SACK_PERMIT)
opt2 |= F_SACK_EN;
@ -240,12 +243,12 @@ calc_opt2a(struct socket *so, struct toepcb *toep)
if (V_tcp_do_ecn)
opt2 |= F_CCTRL_ECN;
opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]);
opt2 |= F_RSS_QUEUE_VALID | V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id);
/* RX_COALESCE is always a valid value (M_RX_COALESCE). */
if (is_t4(sc))
opt2 |= F_RX_COALESCE_VALID | V_RX_COALESCE(M_RX_COALESCE);
opt2 |= F_RX_COALESCE_VALID;
else
opt2 |= F_T5_OPT_2_VALID | V_RX_COALESCE(M_RX_COALESCE);
opt2 |= F_T5_OPT_2_VALID;
opt2 |= V_RX_COALESCE(M_RX_COALESCE);
#ifdef USE_DDP_RX_FLOW_CONTROL
if (toep->ulp_mode == ULP_MODE_TCPDDP)

View File

@ -990,8 +990,11 @@ static uint32_t
calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid,
const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode)
{
uint32_t opt2 = 0;
struct sge_ofld_rxq *ofld_rxq = &sc->sge.ofld_rxq[rxqid];
uint32_t opt2;
opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) |
F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id);
if (V_tcp_do_rfc1323) {
if (tcpopt->tstamp)
@ -1005,12 +1008,12 @@ calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid,
if (V_tcp_do_ecn && th->th_flags & (TH_ECE | TH_CWR))
opt2 |= F_CCTRL_ECN;
opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]);
opt2 |= F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id);
/* RX_COALESCE is always a valid value (0 or M_RX_COALESCE). */
if (is_t4(sc))
opt2 |= F_RX_COALESCE_VALID | V_RX_COALESCE(M_RX_COALESCE);
opt2 |= F_RX_COALESCE_VALID;
else
opt2 |= F_T5_OPT_2_VALID | V_RX_COALESCE(M_RX_COALESCE);
opt2 |= F_T5_OPT_2_VALID;
opt2 |= V_RX_COALESCE(M_RX_COALESCE);
#ifdef USE_DDP_RX_FLOW_CONTROL
if (ulp_mode == ULP_MODE_TCPDDP)