On 09/29/2010 04:59 PM, Phil Sutter wrote: > Hi, > > On Wed, Sep 29, 2010 at 03:56:46PM +0200, Nikos Mavrogiannopoulos wrote: >> I like the implementation and the idea. A question would be why use >> read()/write() >> instead say of new ioctls (e.g. CIOCCRYPT_ASYNC)? > > The motivation behind read() and write() is being able to fetch or push > more than a single struct crypt_op at once. When aiming for async > operation, one probably wants to prevent any blocking. For the write() > case, there is poll() as de-facto standard for ensuring a write is > possible without blocking.
poll can also be seen as a generic way to check for IO, so if having two ioctls, one for submitting and one for retrieving, poll can also be used there. What I don't like with read() and write() is that it comes quite unnatural writing and reading structures. They usually cope with sending and receiving arbitrary data rather than structures (ioctl is for that). > You may say that I can't use poll() to find out how much can be written, > so when trying to write e.g. five objects at once, it could block after > the third. My problem is not with poll(). Poll is pretty straightforward for checking for IO. An ioctl() that returns the length of the queue would solve your issue there. > OTOH the kernel-side would indeed be a lot easier when ioctls were used. and would be more consistent with the rest ioctls. regards, Nikos _______________________________________________ Cryptodev-linux-devel mailing list Cryptodev-linux-devel@gna.org https://mail.gna.org/listinfo/cryptodev-linux-devel