* [PATCH 2/3] sctp: fix association hangs due to reassembly/ordering logic
[not found] <1361374925.3450.2.camel@laptop.lroberts>
2013-02-20 15:55 ` Roberts, Lee A.
@ 2013-02-20 15:55 ` Roberts, Lee A.
0 siblings, 0 replies; 5+ messages in thread
From: Roberts, Lee A. @ 2013-02-20 15:55 UTC (permalink / raw)
To: linux-sctp@vger.kernel.org, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
RnJvbTogTGVlIEEuIFJvYmVydHMgPGxlZS5yb2JlcnRzQGhwLmNvbT4NCg0KUmVzb2x2ZSBTQ1RQ
IGFzc29jaWF0aW9uIGhhbmdzIG9ic2VydmVkIGR1cmluZyBTQ1RQIHN0cmVzcw0KdGVzdGluZy4g
IE9ic2VydmFibGUgc3ltcHRvbXMgaW5jbHVkZSBjb21tdW5pY2F0aW9ucyBoYW5ncw0Kd2l0aCBk
YXRhIGJlaW5nIGhlbGQgaW4gdGhlIGFzc29jaWF0aW9uIHJlYXNzZW1ibHkgYW5kL29yIGxvYmJ5
DQoob3JkZXJpbmcpIHF1ZXVlcy4gIENsb3NlIGV4YW1pbmF0aW9uIG9mIHJlYXNzZW1ibHkgcXVl
dWUgc2hvd3MNCm1pc3NpbmcgcGFja2V0cy4NCg0KSW4gc2N0cF91bHBxX3JlbmVnZV9saXN0KCks
IGRvIG5vdCByZW5lZ2UgcGFja2V0cyBiZWxvdyB0aGUNCmN1bXVsYXRpdmUgVFNOIEFDSyBwb2lu
dC4gIEV2ZW50cyBiZWluZyByZW5lZ2VkIGZyb20gdGhlDQpvcmRlcmluZyBxdWV1ZSBtYXkgY29y
cmVzcG9uZCB0byBtdWx0aXBsZSBUU05zOyBpZGVudGlmeQ0KYW5kIHJlbmVnZSBhbGwgYWZmZWN0
ZWQgcGFja2V0cyBmcm9tIHRoZSB0c25tYXAuDQoNClBhdGNoIGFwcGxpZXMgdG8gbGludXgtMy44
IGtlcm5lbC4NCg0KU2lnbmVkLW9mZi1ieTogTGVlIEEuIFJvYmVyd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zbm1hcF9yZW5lZ2UodHNubWFwLCB0c24pOw0KKwkJ
d2hpbGUgKFRTTl9sdGUodHNuLCBsYXN0X3RzbikpIHsNCisJCQlzY3RwX3Rzbm1hcF9yZW5lZ2Uo
dHNubWFwLCB0c24pOw0KKwkJCXRzbisrOw0KKwkJfQ0KIAkJaWYgKGZyZWVkID49IG5lZWRlZCkN
CiAJCQlyZXR1cm4gZnJlZWQ7DQogCX0NCg0K
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] sctp: fix association hangs due to reassembly/ordering logic
@ 2013-02-20 15:55 ` Roberts, Lee A.
0 siblings, 0 replies; 5+ messages in thread
From: Roberts, Lee A. @ 2013-02-20 15:55 UTC (permalink / raw)
To: linux-sctp@vger.kernel.org, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2451 bytes --]
From: Lee A. Roberts <lee.roberts@hp.com>
Resolve SCTP association hangs observed during SCTP stress
testing. Observable symptoms include communications hangs
with data being held in the association reassembly and/or lobby
(ordering) queues. Close examination of reassembly queue shows
missing packets.
In sctp_ulpq_renege_list(), do not renege packets below the
cumulative TSN ACK point. Events being reneged from the
ordering queue may correspond to multiple TSNs; identify
and renege all affected packets from the tsnmap.
Patch applies to linux-3.8 kernel.
Signed-off-by: Lee A. Roberts <lee.roberts@hp.com>
---
net/sctp/ulpqueue.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff -uprN -X linux-3.8-vanilla/Documentation/dontdiff linux-3.8-SCTP
+1/net/sctp/ulpqueue.c linux-3.8-SCTP+2/net/sctp/ulpqueue.c
--- linux-3.8-SCTP+1/net/sctp/ulpqueue.c 2013-02-18 16:58:34.000000000
-0700
+++ linux-3.8-SCTP+2/net/sctp/ulpqueue.c 2013-02-20 08:17:53.679233365
-0700
@@ -962,20 +962,40 @@ static __u16 sctp_ulpq_renege_list(struc
struct sk_buff_head *list, __u16 needed)
{
__u16 freed = 0;
- __u32 tsn;
- struct sk_buff *skb;
+ __u32 tsn, last_tsn;
+ struct sk_buff *skb, *flist, *last;
struct sctp_ulpevent *event;
struct sctp_tsnmap *tsnmap;
tsnmap = &ulpq->asoc->peer.tsn_map;
- while ((skb = __skb_dequeue_tail(list)) != NULL) {
- freed += skb_headlen(skb);
+ while ((skb = skb_peek_tail(list)) != NULL) {
event = sctp_skb2event(skb);
tsn = event->tsn;
+ /* Don't renege below the Cumulative TSN ACK Point. */
+ if (TSN_lte(tsn, sctp_tsnmap_get_ctsn(tsnmap)))
+ break;
+
+ /* Events in ordering queue may have multiple fragments
+ * corresponding to additional TSNs. Find the last one.
+ */
+ flist = skb_shinfo(skb)->frag_list;
+ for (last = flist; flist; flist = flist->next)
+ last = flist;
+ if (last)
+ last_tsn = sctp_skb2event(last)->tsn;
+ else
+ last_tsn = tsn;
+
+ /* Unlink the event, then renege all applicable TSNs. */
+ __skb_unlink(skb, list);
+ freed += skb_headlen(skb);
sctp_ulpevent_free(event);
- sctp_tsnmap_renege(tsnmap, tsn);
+ while (TSN_lte(tsn, last_tsn)) {
+ sctp_tsnmap_renege(tsnmap, tsn);
+ tsn++;
+ }
if (freed >= needed)
return freed;
}
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] sctp: fix association hangs due to reassembly/ordering logic
@ 2013-02-20 15:55 ` Roberts, Lee A.
0 siblings, 0 replies; 5+ messages in thread
From: Roberts, Lee A. @ 2013-02-20 15:55 UTC (permalink / raw)
To: linux-sctp@vger.kernel.org, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
From: Lee A. Roberts <lee.roberts@hp.com>
Resolve SCTP association hangs observed during SCTP stress
testing. Observable symptoms include communications hangs
with data being held in the association reassembly and/or lobby
(ordering) queues. Close examination of reassembly queue shows
missing packets.
In sctp_ulpq_renege_list(), do not renege packets below the
cumulative TSN ACK point. Events being reneged from the
ordering queue may correspond to multiple TSNs; identify
and renege all affected packets from the tsnmap.
Patch applies to linux-3.8 kernel.
Signed-off-by: Lee A. Roberts <lee.roberts@hp.com>
---
net/sctp/ulpqueue.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff -uprN -X linux-3.8-vanilla/Documentation/dontdiff linux-3.8-SCTP
+1/net/sctp/ulpqueue.c linux-3.8-SCTP+2/net/sctp/ulpqueue.c
--- linux-3.8-SCTP+1/net/sctp/ulpqueue.c 2013-02-18 16:58:34.000000000
-0700
+++ linux-3.8-SCTP+2/net/sctp/ulpqueue.c 2013-02-20 08:17:53.679233365
-0700
@@ -962,20 +962,40 @@ static __u16 sctp_ulpq_renege_list(struc
struct sk_buff_head *list, __u16 needed)
{
__u16 freed = 0;
- __u32 tsn;
- struct sk_buff *skb;
+ __u32 tsn, last_tsn;
+ struct sk_buff *skb, *flist, *last;
struct sctp_ulpevent *event;
struct sctp_tsnmap *tsnmap;
tsnmap = &ulpq->asoc->peer.tsn_map;
- while ((skb = __skb_dequeue_tail(list)) != NULL) {
- freed += skb_headlen(skb);
+ while ((skb = skb_peek_tail(list)) != NULL) {
event = sctp_skb2event(skb);
tsn = event->tsn;
+ /* Don't renege below the Cumulative TSN ACK Point. */
+ if (TSN_lte(tsn, sctp_tsnmap_get_ctsn(tsnmap)))
+ break;
+
+ /* Events in ordering queue may have multiple fragments
+ * corresponding to additional TSNs. Find the last one.
+ */
+ flist = skb_shinfo(skb)->frag_list;
+ for (last = flist; flist; flist = flist->next)
+ last = flist;
+ if (last)
+ last_tsn = sctp_skb2event(last)->tsn;
+ else
+ last_tsn = tsn;
+
+ /* Unlink the event, then renege all applicable TSNs. */
+ __skb_unlink(skb, list);
+ freed += skb_headlen(skb);
sctp_ulpevent_free(event);
- sctp_tsnmap_renege(tsnmap, tsn);
+ while (TSN_lte(tsn, last_tsn)) {
+ sctp_tsnmap_renege(tsnmap, tsn);
+ tsn++;
+ }
if (freed >= needed)
return freed;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] sctp: fix association hangs due to reassembly/ordering logic
2013-02-20 15:55 ` Roberts, Lee A.
@ 2013-02-20 16:38 ` Vlad Yasevich
-1 siblings, 0 replies; 5+ messages in thread
From: Vlad Yasevich @ 2013-02-20 16:38 UTC (permalink / raw)
To: Roberts, Lee A.
Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
On 02/20/2013 10:55 AM, Roberts, Lee A. wrote:
> From: Lee A. Roberts <lee.roberts@hp.com>
>
> Resolve SCTP association hangs observed during SCTP stress
> testing. Observable symptoms include communications hangs
> with data being held in the association reassembly and/or lobby
> (ordering) queues. Close examination of reassembly queue shows
> missing packets.
>
> In sctp_ulpq_renege_list(), do not renege packets below the
> cumulative TSN ACK point. Events being reneged from the
> ordering queue may correspond to multiple TSNs; identify
> and renege all affected packets from the tsnmap.
>
> Patch applies to linux-3.8 kernel.
>
> Signed-off-by: Lee A. Roberts <lee.roberts@hp.com>
> ---
> net/sctp/ulpqueue.c | 30 +++++++++++++++++++++++++-----
> 1 file changed, 25 insertions(+), 5 deletions(-)
>
> diff -uprN -X linux-3.8-vanilla/Documentation/dontdiff linux-3.8-SCTP
> +1/net/sctp/ulpqueue.c linux-3.8-SCTP+2/net/sctp/ulpqueue.c
> --- linux-3.8-SCTP+1/net/sctp/ulpqueue.c 2013-02-18 16:58:34.000000000
> -0700
> +++ linux-3.8-SCTP+2/net/sctp/ulpqueue.c 2013-02-20 08:17:53.679233365
> -0700
> @@ -962,20 +962,40 @@ static __u16 sctp_ulpq_renege_list(struc
> struct sk_buff_head *list, __u16 needed)
> {
> __u16 freed = 0;
> - __u32 tsn;
> - struct sk_buff *skb;
> + __u32 tsn, last_tsn;
> + struct sk_buff *skb, *flist, *last;
> struct sctp_ulpevent *event;
> struct sctp_tsnmap *tsnmap;
>
> tsnmap = &ulpq->asoc->peer.tsn_map;
>
> - while ((skb = __skb_dequeue_tail(list)) != NULL) {
> - freed += skb_headlen(skb);
> + while ((skb = skb_peek_tail(list)) != NULL) {
> event = sctp_skb2event(skb);
> tsn = event->tsn;
>
> + /* Don't renege below the Cumulative TSN ACK Point. */
> + if (TSN_lte(tsn, sctp_tsnmap_get_ctsn(tsnmap)))
> + break;
> +
> + /* Events in ordering queue may have multiple fragments
> + * corresponding to additional TSNs. Find the last one.
> + */
> + flist = skb_shinfo(skb)->frag_list;
> + for (last = flist; flist; flist = flist->next)
> + last = flist;
> + if (last)
> + last_tsn = sctp_skb2event(last)->tsn;
> + else
> + last_tsn = tsn;
> +
> + /* Unlink the event, then renege all applicable TSNs. */
> + __skb_unlink(skb, list);
> + freed += skb_headlen(skb);
This is no longer correct. You are actually freeing more space if you
are reneging a reassembled event from the the ordered queue.
Please separate the 2 patches since they fix 2 distinct bugs.
Thanks
-vlad
> sctp_ulpevent_free(event);
> - sctp_tsnmap_renege(tsnmap, tsn);
> + while (TSN_lte(tsn, last_tsn)) {
> + sctp_tsnmap_renege(tsnmap, tsn);
> + tsn++;
> + }
> if (freed >= needed)
> return freed;
> }
>
> N�����r��y���b�X��ǧv�^�){.n�+����{���i�{ay�\x1dʇڙ�,j\a��f���h���z�\x1e�w���\f���j:+v���w�j�m����\a����zZ+��ݢj"��!tml>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] sctp: fix association hangs due to reassembly/ordering logic
@ 2013-02-20 16:38 ` Vlad Yasevich
0 siblings, 0 replies; 5+ messages in thread
From: Vlad Yasevich @ 2013-02-20 16:38 UTC (permalink / raw)
To: Roberts, Lee A.
Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
On 02/20/2013 10:55 AM, Roberts, Lee A. wrote:
> From: Lee A. Roberts <lee.roberts@hp.com>
>
> Resolve SCTP association hangs observed during SCTP stress
> testing. Observable symptoms include communications hangs
> with data being held in the association reassembly and/or lobby
> (ordering) queues. Close examination of reassembly queue shows
> missing packets.
>
> In sctp_ulpq_renege_list(), do not renege packets below the
> cumulative TSN ACK point. Events being reneged from the
> ordering queue may correspond to multiple TSNs; identify
> and renege all affected packets from the tsnmap.
>
> Patch applies to linux-3.8 kernel.
>
> Signed-off-by: Lee A. Roberts <lee.roberts@hp.com>
> ---
> net/sctp/ulpqueue.c | 30 +++++++++++++++++++++++++-----
> 1 file changed, 25 insertions(+), 5 deletions(-)
>
> diff -uprN -X linux-3.8-vanilla/Documentation/dontdiff linux-3.8-SCTP
> +1/net/sctp/ulpqueue.c linux-3.8-SCTP+2/net/sctp/ulpqueue.c
> --- linux-3.8-SCTP+1/net/sctp/ulpqueue.c 2013-02-18 16:58:34.000000000
> -0700
> +++ linux-3.8-SCTP+2/net/sctp/ulpqueue.c 2013-02-20 08:17:53.679233365
> -0700
> @@ -962,20 +962,40 @@ static __u16 sctp_ulpq_renege_list(struc
> struct sk_buff_head *list, __u16 needed)
> {
> __u16 freed = 0;
> - __u32 tsn;
> - struct sk_buff *skb;
> + __u32 tsn, last_tsn;
> + struct sk_buff *skb, *flist, *last;
> struct sctp_ulpevent *event;
> struct sctp_tsnmap *tsnmap;
>
> tsnmap = &ulpq->asoc->peer.tsn_map;
>
> - while ((skb = __skb_dequeue_tail(list)) != NULL) {
> - freed += skb_headlen(skb);
> + while ((skb = skb_peek_tail(list)) != NULL) {
> event = sctp_skb2event(skb);
> tsn = event->tsn;
>
> + /* Don't renege below the Cumulative TSN ACK Point. */
> + if (TSN_lte(tsn, sctp_tsnmap_get_ctsn(tsnmap)))
> + break;
> +
> + /* Events in ordering queue may have multiple fragments
> + * corresponding to additional TSNs. Find the last one.
> + */
> + flist = skb_shinfo(skb)->frag_list;
> + for (last = flist; flist; flist = flist->next)
> + last = flist;
> + if (last)
> + last_tsn = sctp_skb2event(last)->tsn;
> + else
> + last_tsn = tsn;
> +
> + /* Unlink the event, then renege all applicable TSNs. */
> + __skb_unlink(skb, list);
> + freed += skb_headlen(skb);
This is no longer correct. You are actually freeing more space if you
are reneging a reassembled event from the the ordered queue.
Please separate the 2 patches since they fix 2 distinct bugs.
Thanks
-vlad
> sctp_ulpevent_free(event);
> - sctp_tsnmap_renege(tsnmap, tsn);
> + while (TSN_lte(tsn, last_tsn)) {
> + sctp_tsnmap_renege(tsnmap, tsn);
> + tsn++;
> + }
> if (freed >= needed)
> return freed;
> }
>
> N�����r��y���b�X��ǧv�^�){.n�+����{���i�{ay�\x1dʇڙ�,j\a��f���h���z�\x1e�w���\f���j:+v���w�j�m����\a����zZ+��ݢj"��!tml=
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-20 16:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1361374925.3450.2.camel@laptop.lroberts>
2013-02-20 15:55 ` [PATCH 2/3] sctp: fix association hangs due to reassembly/ordering logic Roberts, Lee A.
2013-02-20 15:55 ` Roberts, Lee A.
2013-02-20 15:55 ` Roberts, Lee A.
2013-02-20 16:38 ` Vlad Yasevich
2013-02-20 16:38 ` Vlad Yasevich
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.