From owner-svn-src-head@freebsd.org Fri Aug 26 19:23:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DABF3B76056; Fri, 26 Aug 2016 19:23:18 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AF3647BE; Fri, 26 Aug 2016 19:23:18 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QJNHST058387; Fri, 26 Aug 2016 19:23:17 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QJNHIY058386; Fri, 26 Aug 2016 19:23:17 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201608261923.u7QJNHIY058386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 26 Aug 2016 19:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304857 - head/sys/netinet/tcp_stacks 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.22 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: Fri, 26 Aug 2016 19:23:19 -0000 Author: hiren Date: Fri Aug 26 19:23:17 2016 New Revision: 304857 URL: https://svnweb.freebsd.org/changeset/base/304857 Log: Adjust TCP module fastpath after r304803's cc_ack_received() changes. Reported by: hiren, bz, np Reviewed by: rrs Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D7664 Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:08:58 2016 (r304856) +++ head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:23:17 2016 (r304857) @@ -172,7 +172,10 @@ tcp_do_fastack(struct mbuf *m, struct tc int ti_locked, u_long tiwin) { int acked; + uint16_t nsegs; int winup_only=0; + + nsegs = max(1, m->m_pkthdr.lro_nsegs); #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -278,7 +281,7 @@ tcp_do_fastack(struct mbuf *m, struct tc * typically means increasing the congestion * window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); tp->snd_una = th->th_ack; /* @@ -502,9 +505,12 @@ tcp_do_slowpath(struct mbuf *m, struct t { int acked, ourfinisacked, needoutput = 0; int rstreason, todrop, win; + uint16_t nsegs; char *s; struct in_conninfo *inc; struct mbuf *mfree = NULL; + + nsegs = max(1, m->m_pkthdr.lro_nsegs); #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -1085,7 +1091,8 @@ tcp_do_slowpath(struct mbuf *m, struct t tp->t_dupacks = 0; else if (++tp->t_dupacks > tcprexmtthresh || IN_FASTRECOVERY(tp->t_flags)) { - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -1135,7 +1142,8 @@ tcp_do_slowpath(struct mbuf *m, struct t } /* Congestion signal before ack. */ cc_cong_signal(tp, th, CC_NDUPACK); - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; if (tp->t_flags & TF_SACK_PERMIT) { @@ -1169,7 +1177,8 @@ tcp_do_slowpath(struct mbuf *m, struct t * segment. Restore the original * snd_cwnd after packet transmission. */ - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; @@ -1323,7 +1332,7 @@ process_ACK: * control related information. This typically means increasing * the congestion window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); SOCKBUF_LOCK(&so->so_snd); if (acked > sbavail(&so->so_snd)) { @@ -1758,6 +1767,7 @@ tcp_do_segment_fastslow(struct mbuf *m, int thflags; u_long tiwin; char *s; + uint16_t nsegs; int can_enter; struct in_conninfo *inc; struct tcpopt to; @@ -1765,6 +1775,7 @@ tcp_do_segment_fastslow(struct mbuf *m, thflags = th->th_flags; tp->sackhint.last_sack_ack = 0; inc = &tp->t_inpcb->inp_inc; + nsegs = max(1, m->m_pkthdr.lro_nsegs); /* * If this is either a state-changing packet or current state isn't * established, we require a write lock on tcbinfo. Otherwise, we @@ -1983,7 +1994,10 @@ tcp_fastack(struct mbuf *m, struct tcphd int ti_locked, u_long tiwin) { int acked; + uint16_t nsegs; int winup_only=0; + + nsegs = max(1, m->m_pkthdr.lro_nsegs); #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -2128,7 +2142,7 @@ tcp_fastack(struct mbuf *m, struct tcphd * typically means increasing the congestion * window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); tp->snd_una = th->th_ack; tp->t_dupacks = 0;