Author: arybchik
Date: Mon Feb 16 06:04:26 2015
New Revision: 278835
URL: https://svnweb.freebsd.org/changeset/base/278835

Log:
  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:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c       Mon Feb 16 06:02:46 2015        
(r278834)
+++ head/sys/dev/sfxge/sfxge_tx.c       Mon Feb 16 06:04:26 2015        
(r278835)
@@ -792,8 +792,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)
@@ -895,7 +893,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);
 
@@ -1015,7 +1012,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