netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, davem@davemloft.net,
	Neil Horman <nhorman@tuxdriver.com>,
	Vlad Yasevich <vyasevich@gmail.com>
Subject: Re: [PATCH net] sctp: out_qlen should be updated when pruning unsent queue
Date: Mon, 20 Mar 2017 15:43:11 -0300	[thread overview]
Message-ID: <20170320184311.GE23553@localhost.localdomain> (raw)
In-Reply-To: <16cb6e6d2ef47481123bc3ff1b99e8abf5334d14.1489838639.git.lucien.xin@gmail.com>

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
> 

  reply	other threads:[~2017-03-20 18:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-18 12:03 [PATCH net] sctp: out_qlen should be updated when pruning unsent queue Xin Long
2017-03-20 18:43 ` Marcelo Ricardo Leitner [this message]
2017-03-22  1:32 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170320184311.GE23553@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).