Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-11 Thread Tadeusz Struk
On 03/10/2015 09:02 PM, David Miller wrote:
 
 Because of the way you quoted the patch, it looked like a list posting
 looping back to the list again, because of the List-ID:  email header.
 
 Therefore your posting was blocked and you'll have to resend your posting
 in a way such that this doesn't happen.
 
Oops, sorry, here it is.

Hi,
After couple of attempts to implement an user space interface to crypto HW that 
would meet our performance requirements, and after discussion with Herbert, we 
have come to conclusion that using AF_ALG sockets and AIO interface is the way 
to go.
Unfortunately it looks like AIO operations will no longer be supported on 
sockets because of the commit 1b784140474e4fc94281a49e96c67d29df0efbde.
My question is why do we want to abandon AIO support in the socket layer? Is it 
not worth keeping it for scenarios like this?
Do we have any alternative?
Here is the mentioned patch.

https://patchwork.kernel.org/patch/5971491/

Regards,
Tadeusz
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-11 Thread Tadeusz Struk
On 03/10/2015 09:06 PM, David Miller wrote:
 From: Ying Xue ying@windriver.com
 Date: Wed, 11 Mar 2015 11:18:01 +0800
 
 Sorry, I did not realize the case when I created the commit. However, 
 although I
 don't understand its scenario, in my opinion, adding one redundant argument 
 for
 all sockets to satisfy the special case seems unreasonable for us.
 
 And the AIO socket mechanism was buggy and references freed up stack
 objects.
 
 That whole set of problems would need to be addressed fully before
 we could even think of adding AIO support back to the socket layer.
 

Maybe we can add new sock_aio_read_iter() and sock_aio_write_iter() functions 
in socket.c, and set the 
aio_read() and aio_write() ptrs to these in the socket_file_ops struct.
Then we can add new async_sendmsg() and async_recvmsg() to struct proto_ops 
that will still take the struct kiocb.
These new async_sendmsg() and async_recvmsg() functions will be called from the 
sock_aio_read_iter() and sock_aio_write_iter()?
Do you want me to put a patch together?


--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-10 Thread Tadeusz Struk
On 03/10/2015 08:18 PM, Ying Xue wrote:
 Sorry, I did not realize the case when I created the commit. However, 
 although I
 don't understand its scenario, in my opinion, adding one redundant argument 
 for
 all sockets to satisfy the special case seems unreasonable for us.

In my opinion this is not about a single, special case, but rather about being 
able to support asynchronous operations on socket interface.
It is important for AF_ALG since we have crypto HW accelerators, that people 
want to access from user space, but in the future there might be other use 
cases.
Regards,
Tadeusz

--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-10 Thread David Miller
From: Tadeusz Struk tadeusz.st...@intel.com
Date: Tue, 10 Mar 2015 20:25:29 -0700

 In my opinion this is not about a single, special case, but rather
 about being able to support asynchronous operations on socket
 interface.

Nobody used the socket AIO facility for two decades, it just
rotted and turned out to be buggy and reference freed stack
memory on top of that.

I am absolutely not convinced this is the only way to solve your
problem.
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-10 Thread Ying Xue
Sorry, I did not realize the case when I created the commit. However, although I
don't understand its scenario, in my opinion, adding one redundant argument for
all sockets to satisfy the special case seems unreasonable for us.

Regards,
Ying

On 03/11/2015 10:37 AM, Tadeusz Struk wrote:
 Hi,
 After couple of attempts to implement an user space interface to crypto HW 
 that would meet our performance requirements, and after discussion with 
 Herbert, we have come to conclusion that using AF_ALG sockets and AIO 
 interface is the way to go.
 Unfortunately it looks like AIO operations will no longer be supported on 
 sockets because of the commit 1b784140474e4fc94281a49e96c67d29df0efbde.
 My question is why do we want to abandon AIO support in the socket layer? Is 
 it not worth keeping it for scenarios like this?
 Do we have any alternative?
 The mentioned patch attached for your reference.
 Regards,
 Tadeusz
 

--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-10 Thread David Miller
From: Ying Xue ying@windriver.com
Date: Wed, 11 Mar 2015 11:18:01 +0800

 Sorry, I did not realize the case when I created the commit. However, 
 although I
 don't understand its scenario, in my opinion, adding one redundant argument 
 for
 all sockets to satisfy the special case seems unreasonable for us.

And the AIO socket mechanism was buggy and references freed up stack
objects.

That whole set of problems would need to be addressed fully before
we could even think of adding AIO support back to the socket layer.
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-10 Thread Tadeusz Struk
On 03/10/2015 09:06 PM, David Miller wrote:
 In my opinion this is not about a single, special case, but rather
  about being able to support asynchronous operations on socket
  interface.
 Nobody used the socket AIO facility for two decades, it just
 rotted and turned out to be buggy and reference freed stack
 memory on top of that.
 
 I am absolutely not convinced this is the only way to solve your
 problem.

Do you have any suggestion?
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: net: Remove iocb argument from sendmsg and recvmsg

2015-03-10 Thread David Miller

Because of the way you quoted the patch, it looked like a list posting
looping back to the list again, because of the List-ID:  email header.

Therefore your posting was blocked and you'll have to resend your posting
in a way such that this doesn't happen.
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v2 0/2] net: Remove iocb argument from sendmsg and recvmsg

2015-03-09 Thread Herbert Xu
David Miller da...@davemloft.net wrote:
 From: Ying Xue ying@windriver.com
 Date: Mon, 2 Mar 2015 15:37:46 +0800
 
 Currently there is only one user - TIPC whose sendmsg() instances
 using iocb argument. Meanwhile, there is no user using iocb argument
 in its recvmsg() instance. Therefore, if we eliminate the werid usage
 of iobc argument from TIPC, the iocb argument can be removed from
 all sendmsg() and recvmsg() instances of the whole networking stack.
 
 Reference:
 https://patchwork.ozlabs.org/patch/433960/
 
 Changes:
 
 v2:
  * Fix compile errors of DCCP module pointed by David
 
 Series applied, thanks.

This totally breaks Tadeusz Struk's attempt at making an AIO
interface for algif_skcipher:

https://patchwork.kernel.org/patch/5971491/

Now granted nothing in the network stack ever supported AIO so
maybe this is a bad idea anyway.  But I guess it's a good time
and place to discuss what alternatives are available for Tadeus
to export his crypto hardware using an asynchronous interface
to user-space?

Cheers,
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html