All of lore.kernel.org
 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>
Subject: Re: [PATCH net 3/3] sctp: do not abandon the other frags in unsent outq if one msg has outstanding frags
Date: Mon, 27 Nov 2017 10:26:50 -0200	[thread overview]
Message-ID: <20171127122650.GC3473@localhost.localdomain> (raw)
In-Reply-To: <12f2aba36279bcf52a1e9836a68c0e592c8d35bc.1511615658.git.lucien.xin@gmail.com>

On Sat, Nov 25, 2017 at 09:18:36PM +0800, Xin Long wrote:
> Now for the abandoned chunks in unsent outq, it would just free the chunks.
> Because no tsn is assigned to them yet, there's no need to send fwd tsn to
> peer, unlike for the abandoned chunks in sent outq.
> 
> The problem is when parts of the msg have been sent and the other frags
> are still in unsent outq, if they are abandoned/dropped, the peer would
> never get this msg reassembled.
> 
> So these frags in unsent outq can't be dropped if this msg already has
> outstanding frags.
> 
> This patch does the check in sctp_chunk_abandoned and
> sctp_prsctp_prune_unsent.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

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

> ---
>  net/sctp/chunk.c    | 4 ++++
>  net/sctp/outqueue.c | 3 ++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
> index 9213805..7f8baa4 100644
> --- a/net/sctp/chunk.c
> +++ b/net/sctp/chunk.c
> @@ -308,6 +308,10 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
>  	if (chunk->msg->abandoned)
>  		return 1;
>  
> +	if (!chunk->has_tsn &&
> +	    !(chunk->chunk_hdr->flags & SCTP_DATA_FIRST_FRAG))
> +		return 0;
> +
>  	if (SCTP_PR_TTL_ENABLED(chunk->sinfo.sinfo_flags) &&
>  	    time_after(jiffies, chunk->msg->expires_at)) {
>  		struct sctp_stream_out *streamout =
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 4ab164b..7d67fee 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -407,7 +407,8 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
>  
>  	list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
>  		if (!chk->msg->abandoned &&
> -		    (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
> +		    (!(chk->chunk_hdr->flags & SCTP_DATA_FIRST_FRAG) ||
> +		     !SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
>  		     chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive))
>  			continue;
>  
> -- 
> 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
> 

WARNING: multiple messages have this Message-ID (diff)
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>
Subject: Re: [PATCH net 3/3] sctp: do not abandon the other frags in unsent outq if one msg has outstanding f
Date: Mon, 27 Nov 2017 12:26:50 +0000	[thread overview]
Message-ID: <20171127122650.GC3473@localhost.localdomain> (raw)
In-Reply-To: <12f2aba36279bcf52a1e9836a68c0e592c8d35bc.1511615658.git.lucien.xin@gmail.com>

On Sat, Nov 25, 2017 at 09:18:36PM +0800, Xin Long wrote:
> Now for the abandoned chunks in unsent outq, it would just free the chunks.
> Because no tsn is assigned to them yet, there's no need to send fwd tsn to
> peer, unlike for the abandoned chunks in sent outq.
> 
> The problem is when parts of the msg have been sent and the other frags
> are still in unsent outq, if they are abandoned/dropped, the peer would
> never get this msg reassembled.
> 
> So these frags in unsent outq can't be dropped if this msg already has
> outstanding frags.
> 
> This patch does the check in sctp_chunk_abandoned and
> sctp_prsctp_prune_unsent.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

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

> ---
>  net/sctp/chunk.c    | 4 ++++
>  net/sctp/outqueue.c | 3 ++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
> index 9213805..7f8baa4 100644
> --- a/net/sctp/chunk.c
> +++ b/net/sctp/chunk.c
> @@ -308,6 +308,10 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
>  	if (chunk->msg->abandoned)
>  		return 1;
>  
> +	if (!chunk->has_tsn &&
> +	    !(chunk->chunk_hdr->flags & SCTP_DATA_FIRST_FRAG))
> +		return 0;
> +
>  	if (SCTP_PR_TTL_ENABLED(chunk->sinfo.sinfo_flags) &&
>  	    time_after(jiffies, chunk->msg->expires_at)) {
>  		struct sctp_stream_out *streamout > diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 4ab164b..7d67fee 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -407,7 +407,8 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
>  
>  	list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
>  		if (!chk->msg->abandoned &&
> -		    (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
> +		    (!(chk->chunk_hdr->flags & SCTP_DATA_FIRST_FRAG) ||
> +		     !SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
>  		     chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive))
>  			continue;
>  
> -- 
> 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-11-27 12:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-25 13:18 [PATCH net 0/3] a couple of fixes for chunks abandoned in prsctp Xin Long
2017-11-25 13:18 ` Xin Long
2017-11-25 13:18 ` [PATCH net 1/3] sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune Xin Long
2017-11-25 13:18   ` Xin Long
2017-11-25 13:18   ` [PATCH net 2/3] sctp: abandon the whole msg if one part of a fragmented message is abandoned Xin Long
2017-11-25 13:18     ` Xin Long
2017-11-25 13:18     ` [PATCH net 3/3] sctp: do not abandon the other frags in unsent outq if one msg has outstanding frags Xin Long
2017-11-25 13:18       ` Xin Long
2017-11-27 12:26       ` Marcelo Ricardo Leitner [this message]
2017-11-27 12:26         ` [PATCH net 3/3] sctp: do not abandon the other frags in unsent outq if one msg has outstanding f Marcelo Ricardo Leitner
2017-11-27 12:26     ` [PATCH net 2/3] sctp: abandon the whole msg if one part of a fragmented message is abandoned Marcelo Ricardo Leitner
2017-11-27 12:26       ` Marcelo Ricardo Leitner
2017-11-27 12:26   ` [PATCH net 1/3] sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune Marcelo Ricardo Leitner
2017-11-27 12:26     ` [PATCH net 1/3] sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prun Marcelo Ricardo Leitner
2017-11-27 13:58 ` [PATCH net 0/3] a couple of fixes for chunks abandoned in prsctp Neil Horman
2017-11-27 13:58   ` Neil Horman
2017-11-27 19:52 ` David Miller
2017-11-27 19:52   ` 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=20171127122650.GC3473@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 \
    /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 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.