Author: arybchik
Date: Wed Mar 25 10:35:19 2015
New Revision: 280528
URL: https://svnweb.freebsd.org/changeset/base/280528

Log:
  MFC: 278835
  
  sfxge: remove full_packet_size from sfxge_tso_state
  
  It makes sfxge_tso_state smaller and even makes tso_start_new_packet()
  few bytes smaller. Data used to calculate packet size are used nearby,
  so it should be no problems with cache etc.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:    gnn (mentor), glebius

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Mar 25 10:34:20 2015        
(r280527)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Mar 25 10:35:19 2015        
(r280528)
@@ -791,8 +791,6 @@ struct sfxge_tso_state {
        ssize_t nh_off;         /* Offset of network header */
        ssize_t tcph_off;       /* Offset of TCP header */
        unsigned header_len;    /* Number of bytes of header */
-       int full_packet_size;   /* Number of bytes to put in each outgoing
-                                * segment */
 };
 
 static inline const struct ip *tso_iph(const struct sfxge_tso_state *tso)
@@ -894,7 +892,6 @@ static void tso_start(struct sfxge_tso_s
        }
 
        tso->header_len = tso->tcph_off + 4 * tso_tcph(tso)->th_off;
-       tso->full_packet_size = tso->header_len + mbuf->m_pkthdr.tso_segsz;
 
        tso->seqnum = ntohl(tso_tcph(tso)->th_seq);
 
@@ -1014,7 +1011,8 @@ static int tso_start_new_packet(struct s
        tso->seqnum += tso->mbuf->m_pkthdr.tso_segsz;
        if (tso->out_len > tso->mbuf->m_pkthdr.tso_segsz) {
                /* This packet will not finish the TSO burst. */
-               ip_length = tso->full_packet_size - tso->nh_off;
+               ip_length = tso->header_len - tso->nh_off +
+                   tso->mbuf->m_pkthdr.tso_segsz;
                tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH);
        } else {
                /* This packet will be the last in the TSO burst. */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to