Skip to contentSkip to conversation

net: Remove iocb argument from sendmsg and recvmsg

DISCUSSION Ying Xue 3 participants 8 messages Mar 11, 2015 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ying Xue

author
#1 lore raw

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

Quoted 9 lines · Tadeusz Struk

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

#2 lore raw
Quoted 3 lines · 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.

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

maintainer
#3 lore raw

From: Tadeusz Struk <[email protected]>
Date: Tue, 10 Mar 2015 20:25:29 -0700

Quoted 3 lines

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.

#4 lore raw
Quoted 9 lines · David Miller
Quoted 3 lines

In my opinion this is not about a single, special case, but rather

Quoted 2 lines

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?

maintainer
#5 lore raw
In reply to Ying Xue

From: Ying Xue <[email protected]>
Date: Wed, 11 Mar 2015 11:18:01 +0800

Quoted 3 lines

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.

#6 lore raw
Quoted 7 lines · David Miller

From: Ying Xue <[email protected]>
Date: Wed, 11 Mar 2015 11:18:01 +0800

Quoted 3 lines

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.

Quoted 6 lines

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?

maintainer
#7 lore raw
In reply to a message not in the archive

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.

#8 lore raw
Quoted 7 lines · 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.

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