From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Ricardo Leitner Subject: Re: send/sendmsg ENOMEM errors WAS(Re: [PATCH net 6/6] sctp: not return ENOMEM err back in sctp_packet_transmit Date: Tue, 25 Oct 2016 08:34:16 -0200 Message-ID: <20161025103416.GG2958@localhost.localdomain> References: <2fa21505-59c2-fb8b-6e89-11fccc953d25@mojatatu.com> <369b7b2c-d1fb-5dd2-30b9-4f54400aa770@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Xin Long , "netdev@vger.kernel.org" , Vlad Yasevich , Daniel Borkmann , David Miller , "linux-sctp@vger.kernel.org" , Michael Tuexen , Eric Dumazet , Brenda Butler , gabor@mojatatu.com To: Jamal Hadi Salim Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54278 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941505AbcJYKeb (ORCPT ); Tue, 25 Oct 2016 06:34:31 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Oct 25, 2016 at 05:05:41PM +0800, Xin Long wrote: > >> in case [1], user can't see the ENOMEM, ENOMEM is more like > >> a internal err. > >> > > > > Still not clear. Are you saying, say an old kernel like 3.11 would > > not return the user ENOMEN for the use case[1] you fixed? I am not > > talking post your fix. > Sorry for confusing you. > > 3.11 would return the user ENOMEN for the use case[1]. > but this behavior is incorrect, it's not consistent with tcp. > > > > >> in case [2], user will got the ENOMEM, they should resend this msg, > >> It's the the general case mentioned-above > >> > > > > I am trying to see if we can avoid backporting this fix to 3.11. > > In [1], is ENOMEM propagated to user space (dont talk about your > > fix, I mean pre-your-fix). > yes, in [1], pre-my-fix, ENOMEM is propagated to user space. > > > > > > >> here sctp's behavior is actually same with tcp's, in tcp, tcp_transmit_skb > >> also may fail to alloc skb, but it doesn't return any err to user, just > >> like > >> sctp_packet_transmit. That's why I don't think we should change something > >> in manpage, as here sctp is consistent with tcp now. > >> > >> make sense ? > > > > > > No ;-> The manpage is bad. Go look at it. In the case of ENOBUFS or > > EMSGSIZE it is clear what needs to be done. > > If the answer is _on ENOMEM_ user must resend then thats what we need > > to say. > yes, on ENOMEM user must resend if he want send out this msg successfully. Thing is, it may lead to duplicate messages in Application layer, as the msg that was errored out may have been actually queued and later retransmitted. That's why I said the recovery steps from this depends on the application on top of SCTP, if it can handle such duplicate messages or not. Marcelo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Ricardo Leitner Date: Tue, 25 Oct 2016 10:34:16 +0000 Subject: Re: send/sendmsg ENOMEM errors WAS(Re: [PATCH net 6/6] sctp: not return ENOMEM err back in sctp_pack Message-Id: <20161025103416.GG2958@localhost.localdomain> List-Id: References: <2fa21505-59c2-fb8b-6e89-11fccc953d25@mojatatu.com> <369b7b2c-d1fb-5dd2-30b9-4f54400aa770@mojatatu.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jamal Hadi Salim Cc: Xin Long , "netdev@vger.kernel.org" , Vlad Yasevich , Daniel Borkmann , David Miller , "linux-sctp@vger.kernel.org" , Michael Tuexen , Eric Dumazet , Brenda Butler , gabor@mojatatu.com On Tue, Oct 25, 2016 at 05:05:41PM +0800, Xin Long wrote: > >> in case [1], user can't see the ENOMEM, ENOMEM is more like > >> a internal err. > >> > > > > Still not clear. Are you saying, say an old kernel like 3.11 would > > not return the user ENOMEN for the use case[1] you fixed? I am not > > talking post your fix. > Sorry for confusing you. > > 3.11 would return the user ENOMEN for the use case[1]. > but this behavior is incorrect, it's not consistent with tcp. > > > > >> in case [2], user will got the ENOMEM, they should resend this msg, > >> It's the the general case mentioned-above > >> > > > > I am trying to see if we can avoid backporting this fix to 3.11. > > In [1], is ENOMEM propagated to user space (dont talk about your > > fix, I mean pre-your-fix). > yes, in [1], pre-my-fix, ENOMEM is propagated to user space. > > > > > > >> here sctp's behavior is actually same with tcp's, in tcp, tcp_transmit_skb > >> also may fail to alloc skb, but it doesn't return any err to user, just > >> like > >> sctp_packet_transmit. That's why I don't think we should change something > >> in manpage, as here sctp is consistent with tcp now. > >> > >> make sense ? > > > > > > No ;-> The manpage is bad. Go look at it. In the case of ENOBUFS or > > EMSGSIZE it is clear what needs to be done. > > If the answer is _on ENOMEM_ user must resend then thats what we need > > to say. > yes, on ENOMEM user must resend if he want send out this msg successfully. Thing is, it may lead to duplicate messages in Application layer, as the msg that was errored out may have been actually queued and later retransmitted. That's why I said the recovery steps from this depends on the application on top of SCTP, if it can handle such duplicate messages or not. Marcelo