From patchwork Wed Oct 16 07:22:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chang Xiangzhong X-Patchwork-Id: 283869 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 295952C00CC for ; Wed, 16 Oct 2013 18:23:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759887Ab3JPHWl (ORCPT ); Wed, 16 Oct 2013 03:22:41 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:38617 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317Ab3JPHWj (ORCPT ); Wed, 16 Oct 2013 03:22:39 -0400 Received: by mail-la0-f41.google.com with SMTP id ec20so246559lab.14 for ; Wed, 16 Oct 2013 00:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ugABGHgQJgxP0ngx54inGz+c4ljjSZMaCOITqTadR48=; b=TxIvykuO/eiE0VnsZ4NCNjpdQgQZwzTPlwgdegj2uZXj0a2V/jDYlTMH1jchzQUoV5 8UXibjO8+4ngyetjW5blWFlAXjDzsFYpjEFy/FjRvhtbno0OhnGZ8oaqcBnJ1krKKSgM vKQIDsUi+9CSqXELsdeiphDZuwE3lZhRe1fNWqKG1qp1QkLYyC42HIIjLITm3me4ol85 raStv0y70pN7coKgk+6W1XqDWn4kCBkwjeAv6IE8a8c0GSA9xNSiKknzlccCG6WTJ8yn aBarZ/8ZrnCzCaIOU4M/63GZYha9DIqYv1AAAwH5yO+eJbPivcLmHl6ZvQuUSJf/aPui a87w== X-Received: by 10.112.149.197 with SMTP id uc5mr1500669lbb.19.1381908157735; Wed, 16 Oct 2013 00:22:37 -0700 (PDT) Received: from localhost.localdomain (host-37-191-210-127.lynet.no. [37.191.210.127]) by mx.google.com with ESMTPSA id oc1sm50188976lbb.3.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 00:22:36 -0700 (PDT) From: Chang Xiangzhong To: vyasevich@gmail.com Cc: nhorman@tuxdriver.com, davem@davemloft.net, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chang Xiangzhong Subject: [PATCH v3] net: sctp: fix a cacc_saw_newack missetting issue Date: Wed, 16 Oct 2013 09:22:11 +0200 Message-Id: <1381908131-24809-1-git-send-email-changxiangzhong@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For for each TSN t being newly acked (Not only cumulatively, but also SELECTIVELY) cacc_saw_newack should be set to 1. Signed-off-by: Xiangzhong Chang --- net/sctp/outqueue.c | 53 ++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 94df758..da9a778 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -1383,19 +1383,38 @@ static void sctp_check_transmitted(struct sctp_outq *q, } } - /* If the chunk hasn't been marked as ACKED, - * mark it and account bytes_acked if the - * chunk had a valid transport (it will not - * have a transport if ASCONF had deleted it - * while DATA was outstanding). - */ if (!tchunk->tsn_gap_acked) { + /* If the chunk hasn't been marked as ACKED, + * mark it and account bytes_acked if the + * chunk had a valid transport (it will not + * have a transport if ASCONF had deleted it + * while DATA was outstanding). + */ tchunk->tsn_gap_acked = 1; *highest_new_tsn_in_sack = tsn; bytes_acked += sctp_data_size(tchunk); if (!tchunk->transport) migrate_bytes += sctp_data_size(tchunk); forward_progress = true; + + /* + * SFR-CACC algorithm: + * 2) If the SACK contains gap acks + * and the flag CHANGEOVER_ACTIVE is + * set the receiver of the SACK MUST + * take the following action: + * + * B) For each TSN t being acked that + * has not been acked in any SACK so + * far, set cacc_saw_newack to 1 for + * the destination that the TSN was + * sent to. + */ + if (transport && + sack->num_gap_ack_blocks && + q->asoc->peer.primary_path->cacc. + changeover_active) + transport->cacc.cacc_saw_newack = 1; } if (TSN_lte(tsn, sack_ctsn)) { @@ -1411,28 +1430,6 @@ static void sctp_check_transmitted(struct sctp_outq *q, restart_timer = 1; forward_progress = true; - if (!tchunk->tsn_gap_acked) { - /* - * SFR-CACC algorithm: - * 2) If the SACK contains gap acks - * and the flag CHANGEOVER_ACTIVE is - * set the receiver of the SACK MUST - * take the following action: - * - * B) For each TSN t being acked that - * has not been acked in any SACK so - * far, set cacc_saw_newack to 1 for - * the destination that the TSN was - * sent to. - */ - if (transport && - sack->num_gap_ack_blocks && - q->asoc->peer.primary_path->cacc. - changeover_active) - transport->cacc.cacc_saw_newack - = 1; - } - list_add_tail(&tchunk->transmitted_list, &q->sacked); } else {