From patchwork Mon Sep 26 09:47:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 675056 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 3sjK0B6gMdz9s9x for ; Mon, 26 Sep 2016 19:48:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Kocr5c31; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032809AbcIZJsJ (ORCPT ); Mon, 26 Sep 2016 05:48:09 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:33213 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030209AbcIZJsF (ORCPT ); Mon, 26 Sep 2016 05:48:05 -0400 Received: by mail-pa0-f68.google.com with SMTP id oz2so8566064pac.0; Mon, 26 Sep 2016 02:48:05 -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:in-reply-to:references :in-reply-to:references; bh=bE3CRfS7XsQEBEFe2SA7p+loW4InbY54vOnyfTHFWw0=; b=Kocr5c31wYd14w1OrylrzXYFta3OEVHQNury1Si2eYhziQ7zbEEjFzymL8n04goUAl HmEUPtqGsg2G8vHu+Tt3+pffXIawtyMiHk9MgzCl9jsRr4BxEljpXNcpjFxHMFJmgemu 7la16efdMAM60uq7ZLkA9rRuF/F15x65rbwpuHtgYhj1j/9qEpR+cnUxp8agAYFF+VNu 62/CzPbf9NehBlMA7MDlCeODfEgQwvnCYRkSoW7TQeAjyysthOte0+FsLwHqr5vh01UJ Q26kBgVWfC2XpoZ+Viw4bM7dwXrob1hbtBBfbGZRQCkO5mEtglHBlb4tfmn08j6gEyG1 wbTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=bE3CRfS7XsQEBEFe2SA7p+loW4InbY54vOnyfTHFWw0=; b=JXrwdfJF90fVpg/ehqy1fp3QESj+Q8nbe97DhOJVoqp3dssbFdRvNcJLrjy6t185yz jrcRj1+XyVw6LmiChNcQ5sb2K/ROefw+c5po2Q1aoOGvGUGrCU3twGA8nl+iblep1Fh5 G1N6mLVMsdUl7DKfhi5FnhSI7ARnAfsmGtaYb/JFe7174JqvJmOmapJQZyDfckPQlukd klFRiJZ96yJgGt6unYbZ/yoy5Sn2wfeB6tcZGFE2cQm1d3VeyFwPoDr8/xN8wDgmJ5Up rPA5Fi9sqH8RYkOKZDDOrLeK6cXvcs2Sm+sVyhTcV16RIEIenIc145x0T6kwLIWIKm8/ e6eA== X-Gm-Message-State: AE9vXwNNJk9c2abhBPtHzgviTVYJx5Bk9Y3nHjPJraqCt5TQhAPflztrbvhpzJ8vP+uigQ== X-Received: by 10.66.159.1 with SMTP id wy1mr37126342pab.20.1474883285168; Mon, 26 Sep 2016 02:48:05 -0700 (PDT) Received: from localhost (138.128.208.20.16clouds.com. [138.128.208.20]) by smtp.gmail.com with ESMTPSA id xn11sm29530180pac.38.2016.09.26.02.48.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Sep 2016 02:48:04 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, Marcelo Ricardo Leitner , Vlad Yasevich , daniel@iogearbox.net Subject: [PATCH net 2/5] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements Date: Mon, 26 Sep 2016 17:47:51 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: <03a642a76d02e8536404aa27561c44e348f3e3a0.1474883200.git.lucien.xin@gmail.com> References: <03a642a76d02e8536404aa27561c44e348f3e3a0.1474883200.git.lucien.xin@gmail.com> In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now sctp uses chunk->resent to record if a chunk is retransmitted, for RTT measurements with retransmitted DATA chunks. chunk->sent_count was introduced to record how many times one chunk has been sent for prsctp RTX policy before. We actually can know if one chunk is retransmitted by checking chunk->sent_count is greater than 1. This patch is to remove resent from sctp_chunk and reuse sent_count to avoid retransmitted chunks for RTT measurements. Signed-off-by: Xin Long --- include/net/sctp/structs.h | 1 - net/sctp/output.c | 3 ++- net/sctp/outqueue.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 4f097f5..81a5faa 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -647,7 +647,6 @@ struct sctp_chunk { #define SCTP_NEED_FRTX 0x1 #define SCTP_DONT_FRTX 0x2 __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ - resent:1, /* Has this chunk ever been resent. */ has_tsn:1, /* Does this chunk have a TSN yet? */ has_ssn:1, /* Does this chunk have a SSN yet? */ singleton:1, /* Only chunk in the packet? */ diff --git a/net/sctp/output.c b/net/sctp/output.c index 31b7bc3..483d2ed 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -547,7 +547,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) * for a given destination transport address. */ - if (!chunk->resent && !tp->rto_pending) { + if (chunk->sent_count == 1 && + !tp->rto_pending) { chunk->rtt_in_progress = 1; tp->rto_pending = 1; } diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 72e54a4..2a629fa 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -536,8 +536,6 @@ void sctp_retransmit_mark(struct sctp_outq *q, transport->rto_pending = 0; } - chunk->resent = 1; - /* Move the chunk to the retransmit queue. The chunks * on the retransmit queue are always kept in order. */ @@ -1467,7 +1465,7 @@ static void sctp_check_transmitted(struct sctp_outq *q, * instance). */ if (!tchunk->tsn_gap_acked && - !tchunk->resent && + tchunk->sent_count == 1 && tchunk->rtt_in_progress) { tchunk->rtt_in_progress = 0; rtt = jiffies - tchunk->sent_at;