diff options
author | jhb <jhb@FreeBSD.org> | 2016-11-04 03:49:53 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-11-04 03:49:53 +0000 |
commit | 642b486bea5128a6288c2023c0d57d9a78720184 (patch) | |
tree | 2e9658237ddf7d38974d047e76d5d028d91af41a /sys | |
parent | f610c349e74b68e20c4540d76819a2e516184df5 (diff) | |
download | FreeBSD-src-642b486bea5128a6288c2023c0d57d9a78720184.zip FreeBSD-src-642b486bea5128a6288c2023c0d57d9a78720184.tar.gz |
MFC 290175,290633,299206,300895,301898: Various TOE fixes.
290175:
cxgbe/tom: decide whether to shove segments or not only if there is
payload to transmit.
290633:
cxgbe/t4_tom: add a knob to the default configuration file to tune
the TOE for LAN operation. It is possible to set this to other values
(cluster for networks with little loss and really tight RTTs, and wan
for relatively large RTTs and/or lossy networks) depending on the
environment in which the TOE is being used.
None of this affects plain NIC operation in any way.
299206:
Set the correct vnet in TOE event handlers.
300895:
cxgbe/t4_tom: Exempt RDMA connections from a TCP sanity test for now, to
avoid panicking debug kernels.
t4_tom does not keep track of a connection once it switches to ULP mode
iWARP. If the connection falls out of ULP mode the driver/hardware seq#
etc. are out of sync. A better fix would be to figure out what the
current seq# are, update the driver's state, and perform all sanity
checks as usual.
301898:
cxgbe/t4_tom: Fix inverted assertion in r300895. It is RDMA
connections and not others that are allowed to fail the receive window
check.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/cxgbe/firmware/t4fw_cfg.txt | 5 | ||||
-rw-r--r-- | sys/dev/cxgbe/firmware/t5fw_cfg.txt | 5 | ||||
-rw-r--r-- | sys/dev/cxgbe/tom/t4_cpl_io.c | 12 | ||||
-rw-r--r-- | sys/dev/cxgbe/tom/t4_listen.c | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/sys/dev/cxgbe/firmware/t4fw_cfg.txt b/sys/dev/cxgbe/firmware/t4fw_cfg.txt index f417abb..78caa28 100644 --- a/sys/dev/cxgbe/firmware/t4fw_cfg.txt +++ b/sys/dev/cxgbe/firmware/t4fw_cfg.txt @@ -33,6 +33,9 @@ tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K + # cluster, lan, or wan. + tp_tcptuning = lan + # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 @@ -160,7 +163,7 @@ [fini] version = 0x1 - checksum = 0xb4168add + checksum = 0xc5e9ef34 # # $FreeBSD$ # diff --git a/sys/dev/cxgbe/firmware/t5fw_cfg.txt b/sys/dev/cxgbe/firmware/t5fw_cfg.txt index 59ca453..ad50df4 100644 --- a/sys/dev/cxgbe/firmware/t5fw_cfg.txt +++ b/sys/dev/cxgbe/firmware/t5fw_cfg.txt @@ -42,6 +42,9 @@ tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K + # cluster, lan, or wan. + tp_tcptuning = lan + # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 @@ -173,7 +176,7 @@ [fini] version = 0x1 - checksum = 0x4f45e608 + checksum = 0x6b54f66d # # $FreeBSD$ # diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index c553f42..4444ebb 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -295,6 +295,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn, uint32_t rcv_isn, uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; + CURVNET_SET(so->so_vnet); INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || tp->t_state == TCPS_SYN_RECEIVED, @@ -345,6 +346,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn, uint32_t rcv_isn, send_flowc_wr(toep, &ftxp); soisconnected(so); + CURVNET_RESTORE(); } static int @@ -676,7 +678,6 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) } } - shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); space = sbspace(sb); if (space <= sb->sb_hiwat * 3 / 8 && @@ -713,6 +714,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); + shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); if (plen <= max_imm) { /* Immediate data tx */ @@ -1501,7 +1503,11 @@ do_rx_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt; tp->rcv_nxt += len; - KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); + if (tp->rcv_wnd < len) { + KASSERT(toep->ulp_mode == ULP_MODE_RDMA, + ("%s: negative window size", __func__)); + } + tp->rcv_wnd -= len; tp->t_rcvtime = ticks; @@ -1527,6 +1533,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) } /* receive buffer autosize */ + CURVNET_SET(so->so_vnet); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && @@ -1615,6 +1622,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) SOCKBUF_UNLOCK_ASSERT(sb); INP_WUNLOCK(inp); + CURVNET_RESTORE(); return (0); } diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index fa2385d..317bf8a 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -1357,6 +1357,7 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; + CURVNET_SET(so->so_vnet); mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; @@ -1403,6 +1404,7 @@ found: */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ + CURVNET_RESTORE(); /* * If we replied during syncache_add (synqe->wr has been consumed), |