All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: ofono@ofono.org
Subject: Re: [RFC PATCH 00/30] QMI rework
Date: Thu, 29 Mar 2018 12:31:44 +0200	[thread overview]
Message-ID: <f695ef6f-f5b3-8b96-aa11-af0a652a4e02@southpole.se> (raw)
In-Reply-To: <3ff1fc64-7169-bc32-b4ba-de7ca1af796d@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4157 bytes --]

On 28/03/18 23:51, Denis Kenzior wrote:
> Hi Jonas,
>
>>
>> So, that said, this is my attempt at cleaning up service sharing in the
>> QMI core.  The jist of this is that we switch to a model that looks a
>> bit like file descriptions/descriptors in Linux.  The QMI services
>> obtain a service description which manages their info and the underlying
>> connection (client id) state that the 'shared services' actually share.
>
> So can you save me the trouble of looking through 30 patches and 
> describe what the end resulting API is going to look like?

Right. So this what I'm aiming for:

QMI Device -> Service1
                  -> ServiceHandle1
                  -> ServiceHandle2
            -> Service2
                  -> ServiceHandle1
                  -> ServiceHandle2
            -> Service3
                  -> ServiceHandle1
                  -> ServiceHandle2
                  -> ServiceHandle3
                  -> ServiceHandle4

ServiceN contains all the shared service data.  This is an underlying 
structure; it is not made available directly to any user.

ServiceHandleN is an service instance that requests can be sent to.  
Notifications and requests are tied to the ServiceHandle they originate 
on so that they can be properly cancelled when the ServiceHandle i

This differs from what ofono has today in that today qmi_service_create 
returns (effecitvely) a reference counted ServiceN instance.  
qmi_service is a ServiceN object.  In order to not have to change the 
API, I want to push the shared details of the service down a level and 
make the user visible qmi_service type be a ServiceHandle.

This is effectively the same as what you proposed with a little twist 
(improvement :) ):
i)  you wanted to add a list of groups to qmi_service so that groups of 
notifations/requests could be cancelled independently of other groups:  
that what ServiceHandle is above, effectively
ii)  the improvement is making ServiceHandle the user-visible type 
instead of ServiceN so that user doesn't need to be aware of this 
grouping or even the fact that the underlying service is shared... 
things just work

The reason the patch series becomes long is that reworking the layering 
in this way is a bit intrusive.  It's worth it though, as the end 
results is _no API change_.  qmi_service_ref becomes a no-op because the 
ServiceHandles are not shareable; qmi_service_unref becomes effectively 
free(ServiceHandle).

The above is sound.  Now we take things further, just for fun, and put 
new windows on the house.  Since the above looks like "file 
descriptions" and "file descriptors" from UNIX, we _could_ use similar 
terminology.  Just for fun, I proposed a rename:

qmi_service_create -> qmi_service_open
qmi_service_unref -> qmi_service_close
...and we drop qmi_service_ref altogether.

Even better would probably be qmi_device_open(device, SERVICE_NAME) 
because the services (files) live on the device and that's the 'object' 
we are requesting a service be opend on... but whatever.  The naming 
isn't important.


>
>> On top of this service description we provide service descriptors which
>> provide private state.  Requests and notifications are registered on the
>> service descriptor and their lifetimes are tied to it; when the service
>> descriptor is closed (released), the requests and notifications can be
>> cleaned up without affecting other users of the shared unlying
>> description.
>>
>
> This sounds an awful lot like what GAtChat does.  Except less flexible 
> since you can't unregister or cancel an individual notification/request.

It doesn't say that anywhere above  Just because I  removed those 
_unused_ functions in a patch doesn't mean they are impossible to 
provide.  If there was _one_ user of such a function then having them 
makes sense, but since they are totally unused they are just untested code.

/Jonas

>
> Regards,
> -Denis


  reply	other threads:[~2018-03-29 10:31 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 18:59 [RFC PATCH 00/30] QMI rework Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 01/30] qmi: remove unused fields of service_send_data Jonas Bonn
2018-03-28 19:53   ` Denis Kenzior
2018-03-28 21:09     ` Jonas Bonn
2018-03-28 21:18       ` Denis Kenzior
2018-03-29 10:46     ` Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 02/30] qmi: remove headroom parameter from req_alloc Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 03/30] qmi: unify common request header setup Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 04/30] qmi: request_alloc has no meaningful failure path Jonas Bonn
2018-03-28 19:59   ` Denis Kenzior
2018-03-28 20:51     ` Jonas Bonn
2018-03-28 21:12       ` Denis Kenzior
2018-03-28 18:59 ` [RFC PATCH 05/30] qmi: push request_submit into request_alloc Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 06/30] qmi: rename request_alloc to request_submit Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 07/30] qmi: figure out request id without accessing header Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 08/30] qmi: make qmi_service_send return result Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 09/30] qmi: drop 'head' pointer from request_submit Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 10/30] qmi: remove unused qmi_service_cancel Jonas Bonn
2018-03-28 21:07   ` Denis Kenzior
2018-03-28 18:59 ` [RFC PATCH 11/30] qmi: remove unused qmi_service_unregister Jonas Bonn
2018-03-28 18:59 ` [RFC PATCH 12/30] qmi: replace GQueues for requests Jonas Bonn
2018-03-28 20:16   ` Denis Kenzior
2018-03-28 21:06     ` Jonas Bonn
2018-03-28 21:24       ` Denis Kenzior
2018-03-28 18:59 ` [RFC PATCH 13/30] qmi: assume version_list is up to date Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 14/30] qmi: absorb service_create_discover into service_create Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 15/30] qmi: drop discovery_queue Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 16/30] qmi: make services always shared Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 17/30] qmi: switch service_list to list_head type Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 18/30] qmi: switch notify_list " Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 19/30] qmi: drop unused struct field Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 20/30] qmi: reference version_info from device in services Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 21/30] qmi: make version_list private Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 22/30] qmi: move client_id to qmi_version Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 23/30] qmi: use standard endian macros Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 24/30] qmi: convert version_list to struct list head Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 25/30] qmi: move service device to service_info Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 26/30] qmi: make all services unique instances backed by common description Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 27/30] qmi: drop qmi_service_ref function Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 28/30] qmi: rename qmi_service_create/unref to open/close Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 29/30] qmi: pass service directly to request_submit Jonas Bonn
2018-03-28 19:00 ` [RFC PATCH 30/30] qmi: add requests to service queue Jonas Bonn
2018-03-28 21:51 ` [RFC PATCH 00/30] QMI rework Denis Kenzior
2018-03-29 10:31   ` Jonas Bonn [this message]
2018-03-29 15:55     ` Denis Kenzior
2018-03-29 16:43       ` Jonas Bonn
2018-03-29 18:08         ` Denis Kenzior

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=f695ef6f-f5b3-8b96-aa11-af0a652a4e02@southpole.se \
    --to=jonas@southpole.se \
    --cc=ofono@ofono.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.