netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery
@ 2007-04-18 18:38 Vlad Yasevich
  2007-04-18 20:24 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Vlad Yasevich @ 2007-04-18 18:38 UTC (permalink / raw)
  To: David Miller; +Cc: lksctp-developers@lists.sourceforge.net, netdev

Hi David

This is a bug fix, but done on top of 2.6.22 tree.  I am trying
to minimize the amount of conflict this would cause during merge
by doing it this way.  However, if you would rather keep all the bugfixes
in net-2.6, I can do that too, but that _will_ give you conflicts.

-vlad
---

[SCTP] Do not interleave non-fragments when in partial delivery

The way partial delivery is currently implemented, it is possible to
interleave a message (either from another stream, or unordered) that
is not part of partial delivery process.  The only way to this is for
a message to not be a fragment and be 'in order' or unordered for a
given stream.  This will result in bypassing the reassembly/ordering
queues where things live during partial delivery, and the
message will be delivered to the socket in the middle of partial delivery.

This is a two-fold problem, in that:
1.  the app now must check the stream-id and flags which it may not
be doing.
2.  this clears partial delivery state from the association and results
in app communication hanging.

This patch is a band-aid over a much bigger problem in that we
don't do stream interleave.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
 net/sctp/ulpqueue.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index ae374a9..fb2ec63 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -224,7 +224,14 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
 		queue = &sk->sk_receive_queue;
 	} else {
 		if (ulpq->pd_mode) {
-			if (event->msg_flags & MSG_NOTIFICATION)
+			/* If the association is in partial delivery, we
+			 * need to finish delivering the partially processed
+			 * packet before passing any other data.  This is
+			 * because we don't truly support stream interleaving.
+			 */
+			if ((event->msg_flags & MSG_NOTIFICATION) ||
+			    (SCTP_DATA_NOT_FRAG ==
+				    (event->msg_flags & SCTP_DATA_FRAG_MASK)))
 				queue = &sctp_sk(sk)->pd_lobby;
 			else {
 				clear_pd = event->msg_flags & MSG_EOR;
-- 
1.5.0.3.438.gc49b2


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

* Re: [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery
  2007-04-18 18:38 [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery Vlad Yasevich
@ 2007-04-18 20:24 ` David Miller
  2007-04-18 20:52   ` Vlad Yasevich
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2007-04-18 20:24 UTC (permalink / raw)
  To: vladislav.yasevich; +Cc: lksctp-developers, netdev

From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Wed, 18 Apr 2007 14:38:15 -0400

> This is a bug fix, but done on top of 2.6.22 tree.  I am trying
> to minimize the amount of conflict this would cause during merge
> by doing it this way.  However, if you would rather keep all the bugfixes
> in net-2.6, I can do that too, but that _will_ give you conflicts.

I've already determined that I'm destined to deal with tons
of conclicts anyways :-)

I'll backport this to net-2.6 unless you beat me to it :-)

Thanks!

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

* Re: [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery
  2007-04-18 20:24 ` David Miller
@ 2007-04-18 20:52   ` Vlad Yasevich
  2007-04-18 21:11     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Vlad Yasevich @ 2007-04-18 20:52 UTC (permalink / raw)
  To: David Miller; +Cc: lksctp-developers, netdev

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

David Miller wrote:
> From: Vlad Yasevich <vladislav.yasevich@hp.com>
> Date: Wed, 18 Apr 2007 14:38:15 -0400
> 
>> This is a bug fix, but done on top of 2.6.22 tree.  I am trying
>> to minimize the amount of conflict this would cause during merge
>> by doing it this way.  However, if you would rather keep all the bugfixes
>> in net-2.6, I can do that too, but that _will_ give you conflicts.
> 
> I've already determined that I'm destined to deal with tons
> of conclicts anyways :-)
> 
> I'll backport this to net-2.6 unless you beat me to it :-)

attached :)

-vlad

[-- Attachment #2: pd.txt --]
[-- Type: text/plain, Size: 2008 bytes --]

>From ebf07dc09049969873b50f594640fe475e1ee294 Mon Sep 17 00:00:00 2001
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Wed, 18 Apr 2007 16:48:24 -0400
Subject: [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery

The way partial delivery is currently implemnted, it is possible to
intereleave a message (either from another steram, or unordered) that
is not part of partial delivery process.  The only way to this is for
a message to not be a fragment and be 'in order' or unorderd for a
given stream.  This will result in bypassing the reassembly/ordering
queues where things live duing partial delivery, and the
message will be delivered to the socket in the middle of partial delivery.

This is a two-fold problem, in that:
1.  the app now must check the stream-id and flags which it may not
be doing.
2.  this clearing partial delivery state from the association and results
in ulp hanging.

This patch is a band-aid over a much bigger problem in that we
don't do stream interleave.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
 net/sctp/ulpqueue.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index bfb197e..b29e3e4 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -190,7 +190,14 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
 	if (!sctp_sk(sk)->pd_mode) {
 		queue = &sk->sk_receive_queue;
 	} else if (ulpq->pd_mode) {
-		if (event->msg_flags & MSG_NOTIFICATION)
+		/* If the association is in partial delivery, we
+		 * need to finish delivering the partially processed
+		 * packet before passing any other data.  This is
+		 * because we don't truly support stream interleaving.
+		 */
+		if ((event->msg_flags & MSG_NOTIFICATION) ||
+		    (SCTP_DATA_NOT_FRAG ==
+			    (event->msg_flags & SCTP_DATA_FRAG_MASK)))
 			queue = &sctp_sk(sk)->pd_lobby;
 		else {
 			clear_pd = event->msg_flags & MSG_EOR;
-- 
1.5.0.3.438.gc49b2


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

* Re: [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery
  2007-04-18 20:52   ` Vlad Yasevich
@ 2007-04-18 21:11     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2007-04-18 21:11 UTC (permalink / raw)
  To: vladislav.yasevich; +Cc: lksctp-developers, netdev

From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Wed, 18 Apr 2007 16:52:26 -0400

> David Miller wrote:
> > From: Vlad Yasevich <vladislav.yasevich@hp.com>
> > Date: Wed, 18 Apr 2007 14:38:15 -0400
> > 
> >> This is a bug fix, but done on top of 2.6.22 tree.  I am trying
> >> to minimize the amount of conflict this would cause during merge
> >> by doing it this way.  However, if you would rather keep all the bugfixes
> >> in net-2.6, I can do that too, but that _will_ give you conflicts.
> > 
> > I've already determined that I'm destined to deal with tons
> > of conclicts anyways :-)
> > 
> > I'll backport this to net-2.6 unless you beat me to it :-)
> 
> attached :)

Thanks a lot, applied.

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

end of thread, other threads:[~2007-04-18 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-18 18:38 [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery Vlad Yasevich
2007-04-18 20:24 ` David Miller
2007-04-18 20:52   ` Vlad Yasevich
2007-04-18 21:11     ` 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).