summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2017-05-24 03:56:48 +0000
committernp <np@FreeBSD.org>2017-05-24 03:56:48 +0000
commitfed43ed978f905895080b6863da04d67b31f38e5 (patch)
treec3146f180016b5b0465400ec157c083a405e270d
parent4a711a1dc5df45956b96a38a5ed476802c064a64 (diff)
downloadFreeBSD-src-fed43ed978f905895080b6863da04d67b31f38e5.zip
FreeBSD-src-fed43ed978f905895080b6863da04d67b31f38e5.tar.gz
MFC r317170, r317389, and r317390.
r317170: Remove redundant assignment. r317389: Frames that are not considered for LRO should not be counted in LRO statistics. r317390: Flush the LRO ctrl as soon as lro_mbufs fills up. There is no need to wait for the next enqueue from the driver. Sponsored by: Chelsio Communications
-rw-r--r--sys/netinet/tcp_lro.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c
index cb8cc06..cd235b5 100644
--- a/sys/netinet/tcp_lro.c
+++ b/sys/netinet/tcp_lro.c
@@ -110,7 +110,6 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp,
lc->lro_bad_csum = 0;
lc->lro_queued = 0;
lc->lro_flushed = 0;
- lc->lro_cnt = 0;
lc->lro_mbuf_count = 0;
lc->lro_mbuf_max = lro_mbufs;
lc->lro_cnt = lro_entries;
@@ -889,18 +888,12 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb)
/* check if packet is not LRO capable */
if (__predict_false(mb->m_pkthdr.csum_flags == 0 ||
(lc->ifp->if_capenable & IFCAP_LRO) == 0)) {
- lc->lro_flushed++;
- lc->lro_queued++;
/* input packet to network layer */
(*lc->ifp->if_input) (lc->ifp, mb);
return;
}
- /* check if array is full */
- if (__predict_false(lc->lro_mbuf_count == lc->lro_mbuf_max))
- tcp_lro_flush_all(lc);
-
/* create sequence number */
lc->lro_mbuf_data[lc->lro_mbuf_count].seq =
(((uint64_t)M_HASHTYPE_GET(mb)) << 56) |
@@ -908,7 +901,11 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb)
((uint64_t)lc->lro_mbuf_count);
/* enter mbuf */
- lc->lro_mbuf_data[lc->lro_mbuf_count++].mb = mb;
+ lc->lro_mbuf_data[lc->lro_mbuf_count].mb = mb;
+
+ /* flush if array is full */
+ if (__predict_false(++lc->lro_mbuf_count == lc->lro_mbuf_max))
+ tcp_lro_flush_all(lc);
}
/* end */
OpenPOWER on IntegriCloud