netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements
@ 2016-10-08  3:36 Xin Long
  2016-10-10 17:48 ` Marcelo Ricardo Leitner
  2016-10-13 13:44 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Xin Long @ 2016-10-08  3:36 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Vlad Yasevich, daniel, davem

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 <lucien.xin@gmail.com>
---
 include/net/sctp/structs.h | 2 +-
 net/sctp/output.c          | 3 ++-
 net/sctp/outqueue.c        | 4 +---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 11c3bf2..27a933e 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -641,7 +641,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? */
@@ -656,6 +655,7 @@ struct sctp_chunk {
 		fast_retransmit:2;	/* Is this chunk fast retransmitted? */
 };
 
+#define sctp_chunk_retransmitted(chunk)	(chunk->sent_count > 1)
 void sctp_chunk_hold(struct sctp_chunk *);
 void sctp_chunk_put(struct sctp_chunk *);
 int sctp_user_addto_chunk(struct sctp_chunk *chunk, int len,
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 2a5c189..84f66d5 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -552,7 +552,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 (!sctp_chunk_retransmitted(chunk) &&
+				    !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 5825853..e540826 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -507,8 +507,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.
 			 */
@@ -1439,7 +1437,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
 				 * instance).
 				 */
 				if (!tchunk->tsn_gap_acked &&
-				    !tchunk->resent &&
+				    !sctp_chunk_retransmitted(tchunk) &&
 				    tchunk->rtt_in_progress) {
 					tchunk->rtt_in_progress = 0;
 					rtt = jiffies - tchunk->sent_at;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements
  2016-10-08  3:36 [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements Xin Long
@ 2016-10-10 17:48 ` Marcelo Ricardo Leitner
  2016-10-10 19:56   ` Marcelo Ricardo Leitner
  2016-10-13 13:44 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2016-10-10 17:48 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, Vlad Yasevich, daniel, davem

On Sat, Oct 08, 2016 at 11:36:05AM +0800, Xin Long wrote:
> 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 <lucien.xin@gmail.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  include/net/sctp/structs.h | 2 +-
>  net/sctp/output.c          | 3 ++-
>  net/sctp/outqueue.c        | 4 +---
>  3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index 11c3bf2..27a933e 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -641,7 +641,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? */
> @@ -656,6 +655,7 @@ struct sctp_chunk {
>  		fast_retransmit:2;	/* Is this chunk fast retransmitted? */
>  };
>  
> +#define sctp_chunk_retransmitted(chunk)	(chunk->sent_count > 1)
>  void sctp_chunk_hold(struct sctp_chunk *);
>  void sctp_chunk_put(struct sctp_chunk *);
>  int sctp_user_addto_chunk(struct sctp_chunk *chunk, int len,
> diff --git a/net/sctp/output.c b/net/sctp/output.c
> index 2a5c189..84f66d5 100644
> --- a/net/sctp/output.c
> +++ b/net/sctp/output.c
> @@ -552,7 +552,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 (!sctp_chunk_retransmitted(chunk) &&
> +				    !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 5825853..e540826 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -507,8 +507,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.
>  			 */
> @@ -1439,7 +1437,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
>  				 * instance).
>  				 */
>  				if (!tchunk->tsn_gap_acked &&
> -				    !tchunk->resent &&
> +				    !sctp_chunk_retransmitted(tchunk) &&
>  				    tchunk->rtt_in_progress) {
>  					tchunk->rtt_in_progress = 0;
>  					rtt = jiffies - tchunk->sent_at;
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements
  2016-10-10 17:48 ` Marcelo Ricardo Leitner
@ 2016-10-10 19:56   ` Marcelo Ricardo Leitner
  0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2016-10-10 19:56 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, Vlad Yasevich, daniel, davem

On Mon, Oct 10, 2016 at 02:48:25PM -0300, Marcelo Ricardo Leitner wrote:
> On Sat, Oct 08, 2016 at 11:36:05AM +0800, Xin Long wrote:
> > 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 <lucien.xin@gmail.com>
> 
> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Though you may have to resend later, as we are still in merge window and
we shouldn't be posting net-next patches during it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements
  2016-10-08  3:36 [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements Xin Long
  2016-10-10 17:48 ` Marcelo Ricardo Leitner
@ 2016-10-13 13:44 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-10-13 13:44 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, vyasevich, daniel

From: Xin Long <lucien.xin@gmail.com>
Date: Sat,  8 Oct 2016 11:36:05 +0800

> 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 <lucien.xin@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-13 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-08  3:36 [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements Xin Long
2016-10-10 17:48 ` Marcelo Ricardo Leitner
2016-10-10 19:56   ` Marcelo Ricardo Leitner
2016-10-13 13:44 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).