From: Denis Kenzior <denkenz@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
"Stotland, Inga" <inga.stotland@intel.com>,
"linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] shared/io-ell: Add support for ELL based IO handling
Date: Thu, 17 May 2018 11:29:51 -0500 [thread overview]
Message-ID: <22877125-36df-f879-1a0c-aff57ce380c9@gmail.com> (raw)
In-Reply-To: <CABBYNZ+TVBd83x_28BzQM9-qwymtXU19gc5CKYW=o12Ljw1Szg@mail.gmail.com>
Hi Luiz,
>> I would rather not do that actually. It is already weird that you guys have
>> io_send but not io_recv. And since io is not only used with streams /
>> files, but with datagram sockets as well, we would have to add a bunch of
>> methods for symmetry. Not to mention that somehow 'send' uses iovecs and
>> the convention inside ell for this is to suffix the method with a 'v'.
>
> Ive thought of adding io_recv, it just that it was not necessary by
> anyone currently, anyway I guess having _v alternative makes ell play
> nice if the application is using iovec, or you are saying that with
> ell the application would have to use the fd directly and handle
> errors?
Right, that's the intent of the ell api. We only handle the mainloop
integration with io. The actual send/recv/write/read/etc should be
handled outside l_io to keep the l_io API minimal. There are too many
variations between socket types, streams, etc. Most of our projects
bypassed the weird GLib I/O functions (with its buffering semantics,
etc) and just invoked the system calls directly anyway.
>> By the way, correct me if I'm wrong, but I think there is zero need for
>> TEMP_FAILURE_RETRY inside BlueZ since it uses signalfd and non-blocking IO
>> anyway. The only reason ell uses this macro is because we can't assume how
>> signals are used in the enclosing application.
>
> Usually, BlueZ tools would use signalfd, including the daemon, we
> could perhaps remove the handling of EINTR if we could detect if
> signalfd is in fact being used but I don't know if that is possible,
> so better be save than sorry.
So I personally wouldn't introduce quasi-ell API that is not mirrored
inside ell proper. That will just make your job harder in the future.
And if the caller of io_send just handles the writev invocation you can
know exactly if TEMP_FAILURE_RETRY is needed or not.
Ideally this file should not exist. You might get away with just
(struct l_io *) io or vice-versa.
Regards,
-Denis
prev parent reply other threads:[~2018-05-17 16:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 23:56 [PATCH BlueZ] shared/io-ell: Add support for ELL based IO handling Inga Stotland
2018-05-16 12:47 ` Luiz Augusto von Dentz
2018-05-16 13:35 ` Marcel Holtmann
2018-05-16 14:39 ` Denis Kenzior
2018-05-17 8:01 ` Luiz Augusto von Dentz
2018-05-17 15:01 ` Denis Kenzior
2018-05-17 16:03 ` Luiz Augusto von Dentz
2018-05-17 16:29 ` Denis Kenzior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22877125-36df-f879-1a0c-aff57ce380c9@gmail.com \
--to=denkenz@gmail.com \
--cc=inga.stotland@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).