From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 06:04:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA54E9EC; Mon, 16 Feb 2015 06:04:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0AF6B; Mon, 16 Feb 2015 06:04:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1G64RAA016543; Mon, 16 Feb 2015 06:04:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1G64R9f016542; Mon, 16 Feb 2015 06:04:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502160604.t1G64R9f016542@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 16 Feb 2015 06:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278835 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2015 06:04:27 -0000 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. */