All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
@ 2017-03-18 12:03 ` Xin Long
  0 siblings, 0 replies; 6+ messages in thread
From: Xin Long @ 2017-03-18 12:03 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: davem, Marcelo Ricardo Leitner, Neil Horman, Vlad Yasevich

This patch is to fix the issue that sctp_prsctp_prune_sent forgot
to update q->out_qlen when removing a chunk from unsent queue.

Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/outqueue.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index db352e5..025ccff 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -382,17 +382,18 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
 }
 
 static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
-				    struct sctp_sndrcvinfo *sinfo,
-				    struct list_head *queue, int msg_len)
+				    struct sctp_sndrcvinfo *sinfo, int msg_len)
 {
+	struct sctp_outq *q = &asoc->outqueue;
 	struct sctp_chunk *chk, *temp;
 
-	list_for_each_entry_safe(chk, temp, queue, list) {
+	list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
 		if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
 		    chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
 			continue;
 
 		list_del_init(&chk->list);
+		q->out_qlen -= chk->skb->len;
 		asoc->sent_cnt_removable--;
 		asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
 
@@ -431,9 +432,7 @@ void sctp_prsctp_prune(struct sctp_association *asoc,
 			return;
 	}
 
-	sctp_prsctp_prune_unsent(asoc, sinfo,
-				 &asoc->outqueue.out_chunk_list,
-				 msg_len);
+	sctp_prsctp_prune_unsent(asoc, sinfo, msg_len);
 }
 
 /* Mark all the eligible packets on a transport for retransmission.  */
-- 
2.1.0

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

* [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
@ 2017-03-18 12:03 ` Xin Long
  0 siblings, 0 replies; 6+ messages in thread
From: Xin Long @ 2017-03-18 12:03 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: davem, Marcelo Ricardo Leitner, Neil Horman, Vlad Yasevich

This patch is to fix the issue that sctp_prsctp_prune_sent forgot
to update q->out_qlen when removing a chunk from unsent queue.

Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/outqueue.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index db352e5..025ccff 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -382,17 +382,18 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
 }
 
 static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
-				    struct sctp_sndrcvinfo *sinfo,
-				    struct list_head *queue, int msg_len)
+				    struct sctp_sndrcvinfo *sinfo, int msg_len)
 {
+	struct sctp_outq *q = &asoc->outqueue;
 	struct sctp_chunk *chk, *temp;
 
-	list_for_each_entry_safe(chk, temp, queue, list) {
+	list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
 		if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
 		    chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
 			continue;
 
 		list_del_init(&chk->list);
+		q->out_qlen -= chk->skb->len;
 		asoc->sent_cnt_removable--;
 		asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
 
@@ -431,9 +432,7 @@ void sctp_prsctp_prune(struct sctp_association *asoc,
 			return;
 	}
 
-	sctp_prsctp_prune_unsent(asoc, sinfo,
-				 &asoc->outqueue.out_chunk_list,
-				 msg_len);
+	sctp_prsctp_prune_unsent(asoc, sinfo, msg_len);
 }
 
 /* Mark all the eligible packets on a transport for retransmission.  */
-- 
2.1.0


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

* Re: [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
  2017-03-18 12:03 ` Xin Long
@ 2017-03-20 18:43   ` Marcelo Ricardo Leitner
  -1 siblings, 0 replies; 6+ messages in thread
From: Marcelo Ricardo Leitner @ 2017-03-20 18:43 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman, Vlad Yasevich

On Sat, Mar 18, 2017 at 08:03:59PM +0800, Xin Long wrote:
> This patch is to fix the issue that sctp_prsctp_prune_sent forgot
> to update q->out_qlen when removing a chunk from unsent queue.
> 
> Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

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

> ---
>  net/sctp/outqueue.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index db352e5..025ccff 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -382,17 +382,18 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
>  }
>  
>  static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
> -				    struct sctp_sndrcvinfo *sinfo,
> -				    struct list_head *queue, int msg_len)
> +				    struct sctp_sndrcvinfo *sinfo, int msg_len)
>  {
> +	struct sctp_outq *q = &asoc->outqueue;
>  	struct sctp_chunk *chk, *temp;
>  
> -	list_for_each_entry_safe(chk, temp, queue, list) {
> +	list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
>  		if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
>  		    chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
>  			continue;
>  
>  		list_del_init(&chk->list);
> +		q->out_qlen -= chk->skb->len;
>  		asoc->sent_cnt_removable--;
>  		asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
>  
> @@ -431,9 +432,7 @@ void sctp_prsctp_prune(struct sctp_association *asoc,
>  			return;
>  	}
>  
> -	sctp_prsctp_prune_unsent(asoc, sinfo,
> -				 &asoc->outqueue.out_chunk_list,
> -				 msg_len);
> +	sctp_prsctp_prune_unsent(asoc, sinfo, msg_len);
>  }
>  
>  /* Mark all the eligible packets on a transport for retransmission.  */
> -- 
> 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] 6+ messages in thread

* Re: [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
@ 2017-03-20 18:43   ` Marcelo Ricardo Leitner
  0 siblings, 0 replies; 6+ messages in thread
From: Marcelo Ricardo Leitner @ 2017-03-20 18:43 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman, Vlad Yasevich

On Sat, Mar 18, 2017 at 08:03:59PM +0800, Xin Long wrote:
> This patch is to fix the issue that sctp_prsctp_prune_sent forgot
> to update q->out_qlen when removing a chunk from unsent queue.
> 
> Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

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

> ---
>  net/sctp/outqueue.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index db352e5..025ccff 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -382,17 +382,18 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
>  }
>  
>  static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
> -				    struct sctp_sndrcvinfo *sinfo,
> -				    struct list_head *queue, int msg_len)
> +				    struct sctp_sndrcvinfo *sinfo, int msg_len)
>  {
> +	struct sctp_outq *q = &asoc->outqueue;
>  	struct sctp_chunk *chk, *temp;
>  
> -	list_for_each_entry_safe(chk, temp, queue, list) {
> +	list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
>  		if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
>  		    chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
>  			continue;
>  
>  		list_del_init(&chk->list);
> +		q->out_qlen -= chk->skb->len;
>  		asoc->sent_cnt_removable--;
>  		asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
>  
> @@ -431,9 +432,7 @@ void sctp_prsctp_prune(struct sctp_association *asoc,
>  			return;
>  	}
>  
> -	sctp_prsctp_prune_unsent(asoc, sinfo,
> -				 &asoc->outqueue.out_chunk_list,
> -				 msg_len);
> +	sctp_prsctp_prune_unsent(asoc, sinfo, msg_len);
>  }
>  
>  /* Mark all the eligible packets on a transport for retransmission.  */
> -- 
> 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] 6+ messages in thread

* Re: [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
  2017-03-18 12:03 ` Xin Long
@ 2017-03-22  1:32   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-03-22  1:32 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman, vyasevich

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 18 Mar 2017 20:03:59 +0800

> This patch is to fix the issue that sctp_prsctp_prune_sent forgot
> to update q->out_qlen when removing a chunk from unsent queue.
> 
> Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied, thanks.

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

* Re: [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
@ 2017-03-22  1:32   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-03-22  1:32 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman, vyasevich

From: Xin Long <lucien.xin@gmail.com>
Date: Sat, 18 Mar 2017 20:03:59 +0800

> This patch is to fix the issue that sctp_prsctp_prune_sent forgot
> to update q->out_qlen when removing a chunk from unsent queue.
> 
> Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied, thanks.

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

end of thread, other threads:[~2017-03-22  1:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-18 12:03 [PATCH net] sctp: out_qlen should be updated when pruning unsent queue Xin Long
2017-03-18 12:03 ` Xin Long
2017-03-20 18:43 ` Marcelo Ricardo Leitner
2017-03-20 18:43   ` Marcelo Ricardo Leitner
2017-03-22  1:32 ` David Miller
2017-03-22  1:32   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.