All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Peng Fan <van.freenix@gmail.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien.grall@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [RFC V2] xen: interface: introduce pvclk interface
Date: Wed, 20 Jan 2016 13:11:39 +0100	[thread overview]
Message-ID: <569F797B.3090004@suse.com> (raw)
In-Reply-To: <20160120114759.GB9856@linux-7smt.suse>

On 20/01/16 12:48, Peng Fan wrote:
> Hi Juergen,
> 
> On Wed, Jan 20, 2016 at 11:40:55AM +0100, Juergen Gross wrote:
>> On 20/01/16 10:25, Peng Fan wrote:
>>> Hi Juergen,
>>>
>>> On Wed, Jan 20, 2016 at 10:05:15AM +0100, Juergen Gross wrote:
>>>> On 20/01/16 09:31, Peng Fan wrote:
>>>>> Introduce pvclk interface which is useful when doing device passthrough
>>>>> on ARM platform.
>>>>
>>>> ...
>>>>
>>>>> +/*
>>>>> + * Frontend request
>>>>> + *
>>>>> + * cmd: command for operation on clk, should be XEN_CLK_[xx],
>>>>> + *	excluding XEN_CLK_END. id is the
>>>>> + * id: clk id
>>>>> + * rate: clock rate. Used for set rate.
>>>>
>>>> Which unit? Hz?
>>>
>>> Yeah. Hz. I'll add comments in V3.
>>>
>>>>
>>>>> + */
>>>>> +struct xen_clkif_request {
>>>>> +	uint32_t cmd;
>>>>> +	uint32_t id;
>>>>> +	uint64_t rate;
>>>>> +};
>>>>> +typedef struct xen_clkif_request xen_clkif_request_t;
>>>>> +
>>>>> +/*
>>>>> + * Backend response
>>>>> + *
>>>>> + * cmd: command for operation on clk, same with the cmd in request.
>>>>> + * id: clk id, same with the id in request.
>>>>> + * success: indicate failure or success for the cmd.
>>>>
>>>> Values?
>>>
>>> I'd like to let the frontend/backend driver to determine the value.
>>> In my implementation for linux, if the backend API supports return value,
>>> I'll fill the return value to success entry. If the backend API returns
>>> void, I'll just fill 0 to success entry.
>>
>> So please specify "0" to mean success and add some sensible error
>> values. There might be multiple frontend- and/or backend-variants which
>> all must agree using the same interface.
> 
> Will change this to `int status`, as also observed by Jan.
> I'll also define macros such as "#define XEN_CLK_ENABLE_OK 0", "#define XEN_CLK_ENABLE_FAILURE -1"
> 
>>
>>>>> + * rate: clock rate. Used for get rate.
>>>>> + *
>>>>> + * cmd and id are filled by backend and passed to frontend to
>>>>> + * let frontend check whether the response is for the current
>>>>> + * request or not.
>>>>
>>>> I'd rather let the frontend add a request Id to the request which
>>>> will be echoed here instead cmd and clock Id.
>>>
>>> If using request id, I think we can encode cmd and id into request id?
>>
>> This should just be an opaque value for the backend. The frontend is
>> free how to create this value, it should be unique for every outstanding
>> request of a domU, however. It could be built from cmd and id in case
>> there can't be multiple requests with the same cmd/id combination
>> active in a domU.
> 
> Thanks for teaching me on this. So the request id should be globally unique
> for backend. So "random value(generated in frontend) + frontend domid" is ok for this?

Being unique per frontend is enough, as each frontend will only ever see
responses for it's own requests. Make it as simple as possible. I guess
there will be a maximum of active requests possible, e.g. the number of
request slots in the request ring. You could use the index into the ring
as Id (pvSCSI frontend is doing it this way).

Juergen

  reply	other threads:[~2016-01-20 12:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20  8:31 [RFC V2] xen: interface: introduce pvclk interface Peng Fan
2016-01-20  9:05 ` Juergen Gross
2016-01-20  9:25   ` Peng Fan
2016-01-20 10:16     ` Jan Beulich
2016-01-20 10:40     ` Juergen Gross
2016-01-20 11:48       ` Peng Fan
2016-01-20 12:11         ` Juergen Gross [this message]
2016-01-20 14:13           ` Peng Fan
2016-01-20 10:14 ` Jan Beulich
2016-01-20 11:40   ` Peng Fan
2016-01-20 12:01     ` Jan Beulich
2016-01-20 14:05       ` Peng Fan
2016-01-20 14:16         ` Jan Beulich
2016-01-20 14:37           ` Peng Fan
2016-01-20 14:49             ` Ian Campbell
2016-01-20 14:52             ` Jan Beulich
2016-01-21  1:29               ` Peng Fan
2016-01-21  7:53                 ` Jan Beulich
2016-01-21  8:59                   ` Peng Fan
2016-01-21 10:19                     ` Ian Campbell
2016-01-21 11:55                       ` Peng Fan
2016-01-21 12:26                         ` Ian Campbell
2016-01-21 12:35                           ` Peng Fan
2016-01-21 12:49                             ` Ian Campbell
2016-01-22  2:19                               ` Peng Fan
2016-01-23 15:26                               ` Peng Fan
2016-01-21 12:55                             ` Stefano Stabellini
2016-01-21 13:11                               ` Ian Campbell
2016-01-21 16:11                                 ` Stefano Stabellini
2016-01-22  2:51                                   ` Peng Fan
2016-01-21 10:21                     ` Jan Beulich
2016-01-21 12:06                       ` Peng Fan
2016-01-21 12:52                         ` Jan Beulich
2016-01-22  1:56                           ` Peng Fan
2016-01-22  7:36                             ` Jan Beulich
2016-01-22  9:27                               ` Peng Fan
2016-01-22 10:25                                 ` Jan Beulich
2016-01-22 12:12                                   ` Peng Fan
2016-01-22 12:33                                     ` Jan Beulich
2016-01-22 13:55                                       ` Stefano Stabellini
2016-01-20 12:06 ` Stefano Stabellini
2016-01-20 12:27   ` Ian Campbell
2016-01-20 13:52     ` Peng Fan

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=569F797B.3090004@suse.com \
    --to=jgross@suse.com \
    --cc=david.vrabel@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=van.freenix@gmail.com \
    --cc=xen-devel@lists.xenproject.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.