Author: np
Date: Wed May 24 03:56:48 2017
New Revision: 318772
URL: https://svnweb.freebsd.org/changeset/base/318772

Log:
  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

Modified:
  stable/11/sys/netinet/tcp_lro.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_lro.c
==============================================================================
--- stable/11/sys/netinet/tcp_lro.c     Wed May 24 03:26:15 2017        
(r318771)
+++ stable/11/sys/netinet/tcp_lro.c     Wed May 24 03:56:48 2017        
(r318772)
@@ -110,7 +110,6 @@ tcp_lro_init_args(struct lro_ctrl *lc, s
        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, 
        /* 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, 
            ((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 */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to