From owner-svn-src-stable@FreeBSD.ORG Sun May 16 16:45:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 536681065670; Sun, 16 May 2010 16:45:51 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41A568FC17; Sun, 16 May 2010 16:45:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4GGjnL7057506; Sun, 16 May 2010 16:45:49 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4GGjnID057504; Sun, 16 May 2010 16:45:49 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201005161645.o4GGjnID057504@svn.freebsd.org> From: Randall Stewart Date: Sun, 16 May 2010 16:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208155 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2010 16:45:51 -0000 Author: rrs Date: Sun May 16 16:45:49 2010 New Revision: 208155 URL: http://svn.freebsd.org/changeset/base/208155 Log: MFC of 207963 This fixes PR-SCTP issues: - Slide the map at the proper place. - Mark the bits in the nr_array ONLY if there is no marking. - When generating a FWD-TSN we allow us to skip past ACKED chunks too. Modified: stable/8/sys/netinet/sctp_indata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sun May 16 16:42:52 2010 (r208154) +++ stable/8/sys/netinet/sctp_indata.c Sun May 16 16:45:49 2010 (r208155) @@ -3694,6 +3694,7 @@ sctp_try_advance_peer_ack_point(struct s tp1 = TAILQ_FIRST(&asoc->sent_queue); while (tp1) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && + tp1->sent != SCTP_DATAGRAM_ACKED && tp1->sent != SCTP_DATAGRAM_RESEND) { /* no chance to advance, out of here */ break; @@ -5540,8 +5541,8 @@ sctp_handle_forward_tsn(struct sctp_tcb * report where we are. */ struct sctp_association *asoc; - uint32_t new_cum_tsn, tsn, gap; - unsigned int i, fwd_sz, cumack_set_flag, m_size, fnd = 0; + uint32_t new_cum_tsn, gap; + unsigned int i, fwd_sz, cumack_set_flag, m_size; uint32_t str_seq; struct sctp_stream_in *strm; struct sctp_tmit_chunk *chk, *at; @@ -5565,15 +5566,6 @@ sctp_handle_forward_tsn(struct sctp_tcb /* Already got there ... */ return; } - if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_map, - MAX_TSN)) { - asoc->highest_tsn_inside_map = new_cum_tsn; - - } - if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_nr_map, - MAX_TSN)) { - asoc->highest_tsn_inside_nr_map = new_cum_tsn; - } /* * now we know the new TSN is more advanced, let's find the actual * gap @@ -5628,34 +5620,14 @@ sctp_handle_forward_tsn(struct sctp_tcb } else { SCTP_TCB_LOCK_ASSERT(stcb); for (i = 0; i <= gap; i++) { - SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, i); - SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); - /* FIX ME add something to set up highest TSN in map */ - } - if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { - asoc->highest_tsn_inside_nr_map = new_cum_tsn; - } - if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_map, MAX_TSN) || - new_cum_tsn == asoc->highest_tsn_inside_map) { - /* We must back down to see what the new highest is */ - for (tsn = new_cum_tsn; (compare_with_wrap(tsn, asoc->mapping_array_base_tsn, MAX_TSN) || - (tsn == asoc->mapping_array_base_tsn)); tsn--) { - SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); - if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { - asoc->highest_tsn_inside_map = tsn; - fnd = 1; - break; + if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, i) && + !SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, i)) { + SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); + if (compare_with_wrap(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + asoc->highest_tsn_inside_nr_map = asoc->mapping_array_base_tsn + i; } } - if (!fnd) { - asoc->highest_tsn_inside_map = asoc->mapping_array_base_tsn - 1; - } } - /* - * Now after marking all, slide thing forward but no sack - * please. - */ - sctp_slide_mapping_arrays(stcb); } /*************************************************************/ /* 2. Clear up re-assembly queue */ @@ -5826,6 +5798,11 @@ sctp_handle_forward_tsn(struct sctp_tcb } SCTP_INP_READ_UNLOCK(stcb->sctp_ep); } + /* + * Now slide thing forward. + */ + sctp_slide_mapping_arrays(stcb); + if (TAILQ_FIRST(&asoc->reasmqueue)) { /* now lets kick out and check for more fragmented delivery */ /* sa_ignore NO_NULL_CHK */