[{"id":1765525,"web_url":"http://patchwork.ozlabs.org/comment/1765525/","msgid":"<20170908.100707.1766699944700264489.davem@davemloft.net>","list_archive_url":null,"date":"2017-09-08T17:07:07","subject":"Re: [PATCH net] sctp: fix missing wake ups in some situations","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>\nDate: Fri,  8 Sep 2017 11:35:21 -0300\n\n> Commit fb586f25300f (\"sctp: delay calls to sk_data_ready() as much as\n> possible\") minimized the number of wake ups that are triggered in case\n> the association receives a packet with multiple data chunks on it and/or\n> when io_events are enabled and then commit 0970f5b36659 (\"sctp: signal\n> sk_data_ready earlier on data chunks reception\") moved the wake up to as\n> soon as possible. It thus relies on the state machine running later to\n> clean the flag that the event was already generated.\n> \n> The issue is that there are 2 call paths that calls\n> sctp_ulpq_tail_event() outside of the state machine, causing the flag to\n> linger and possibly omitting a needed wake up in the sequence.\n> \n> One of the call paths is when enabling SCTP_SENDER_DRY_EVENTS via\n> setsockopt(SCTP_EVENTS), as noticed by Harald Welte. The other is when\n> partial reliability triggers removal of chunks from the send queue when\n> the application calls sendmsg().\n> \n> This commit fixes it by not setting the flag in case the socket is not\n> owned by the user, as it won't be cleaned later. This works for\n> user-initiated calls and also for rx path processing.\n> \n> Fixes: fb586f25300f (\"sctp: delay calls to sk_data_ready() as much as possible\")\n> Reported-by: Harald Welte <laforge@gnumonks.org>\n> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>\n\nApplied and queued up for -stable, th anks.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpkJb64gcz9ryv\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 03:07:11 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756210AbdIHRHK (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 8 Sep 2017 13:07:10 -0400","from shards.monkeyblade.net ([184.105.139.130]:58416 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752132AbdIHRHJ (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 8 Sep 2017 13:07:09 -0400","from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net\n\t[74.93.104.98]) (using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id 51B26125F68D2;\n\tFri,  8 Sep 2017 10:07:08 -0700 (PDT)"],"Date":"Fri, 08 Sep 2017 10:07:07 -0700 (PDT)","Message-Id":"<20170908.100707.1766699944700264489.davem@davemloft.net>","To":"marcelo.leitner@gmail.com","Cc":"netdev@vger.kernel.org, linux-sctp@vger.kernel.org,\n\tnhorman@tuxdriver.com, vyasevich@gmail.com, laforge@gnumonks.org","Subject":"Re: [PATCH net] sctp: fix missing wake ups in some situations","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<202d7b2e172746c0bed742255bc1583beca45fce.1504880548.git.marcelo.leitner@gmail.com>","References":"<202d7b2e172746c0bed742255bc1583beca45fce.1504880548.git.marcelo.leitner@gmail.com>","X-Mailer":"Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Fri, 08 Sep 2017 10:07:08 -0700 (PDT)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]