Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-22 Thread Tom Herbert
On Fri, Feb 22, 2019 at 12:28 PM Dominique Martinet wrote: > > Tom Herbert wrote on Fri, Feb 22, 2019: > > > > So basically it sounds like you're interested in supporting TCP > > > > connections that are half closed. I believe that the error in half > > > > closed is EPIPE, so if the TCP socket re

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-22 Thread Dominique Martinet
Tom Herbert wrote on Fri, Feb 22, 2019: > > > So basically it sounds like you're interested in supporting TCP > > > connections that are half closed. I believe that the error in half > > > closed is EPIPE, so if the TCP socket returns that it can be ignored > > > and the socket can continue being a

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-22 Thread Tom Herbert
On Thu, Feb 21, 2019 at 12:22 AM Dominique Martinet wrote: > > Tom Herbert wrote on Wed, Feb 20, 2019: > > > When the client closes the socket, some messages are obviously still "in > > > flight", and the server will recv a POLLERR notification on the csock at > > > some point with many messages l

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-21 Thread Dominique Martinet
Tom Herbert wrote on Wed, Feb 20, 2019: > > When the client closes the socket, some messages are obviously still "in > > flight", and the server will recv a POLLERR notification on the csock at > > some point with many messages left. > > The documentation says to unattach the csock when you get POL

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-20 Thread Tom Herbert
On Tue, Feb 19, 2019 at 8:12 PM Dominique Martinet wrote: > > Dominique Martinet wrote on Fri, Feb 15, 2019: > > With all that said I guess my patch should work correctly then, I'll try > > to find some time to check the error does come back up the tcp socket in > > my reproducer but I have no rea

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-19 Thread Dominique Martinet
Dominique Martinet wrote on Fri, Feb 15, 2019: > With all that said I guess my patch should work correctly then, I'll try > to find some time to check the error does come back up the tcp socket in > my reproducer but I have no reason to believe it doesn't. Ok, so I can confirm this part - the 'cso

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Dominique Martinet
Tom Herbert wrote on Thu, Feb 14, 2019: > On Thu, Feb 14, 2019 at 7:31 PM Dominique Martinet > wrote: > > Yes, the parser fails with -ENOMEM ; that is not handled gracefully at > > all: from a user point of view, the connection just hangs (recvmsg never > > returns), without so much as a message i

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Tom Herbert
On Thu, Feb 14, 2019 at 7:31 PM Dominique Martinet wrote: > > Tom Herbert wrote on Thu, Feb 14, 2019: > > > This second patch[2] (the current thread) now does an extra clone if > > > there is an offset, but the problem really isn't in the clone but the > > > pull itself that can fail and return NU

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Dominique Martinet
Tom Herbert wrote on Thu, Feb 14, 2019: > > This second patch[2] (the current thread) now does an extra clone if > > there is an offset, but the problem really isn't in the clone but the > > pull itself that can fail and return NULL when there is memory pressure. > > For some reason I hadn't been a

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Tom Herbert
On Thu, Feb 14, 2019 at 5:57 PM Dominique Martinet wrote: > > Tom Herbert wrote on Thu, Feb 14, 2019: > > > The best alternative I see is adding a proper helper to get > > > "kcm_rx_msg(skb)->offset" from bpf and document it so users aren't as > > > lost as I have been; I'm not quite sure how/wher

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Dominique Martinet
Tom Herbert wrote on Thu, Feb 14, 2019: > > The best alternative I see is adding a proper helper to get > > "kcm_rx_msg(skb)->offset" from bpf and document it so users aren't as > > lost as I have been; I'm not quite sure how/where to add such a helper > > though as I've barely looked at the bpf co

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Tom Herbert
On Thu, Feb 14, 2019 at 5:00 PM Dominique Martinet wrote: > > Dominique Martinet wrote on Wed, Oct 31, 2018: > > Anyway, that probably explains I have no problem with bigger VM > > (uselessly more memory available) or without KASAN (I guess there's > > overhead?), but I'm sending at most 300k of d

Re: [PATCH v2] kcm: remove any offset before parsing messages

2019-02-14 Thread Dominique Martinet
Dominique Martinet wrote on Wed, Oct 31, 2018: > Anyway, that probably explains I have no problem with bigger VM > (uselessly more memory available) or without KASAN (I guess there's > overhead?), but I'm sending at most 300k of data and the VM has a 1.5GB > of ram, so if there's an allocation fail