xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: lars.kurth@citrix.com, iurii.konovalenko@globallogic.com,
	vlad.babchuk@gmail.com, tim@xen.org, dario.faggioli@citrix.com,
	ian.jackson@eu.citrix.com, al1img@gmail.com,
	andrii.anisov@gmail.com, olekstysh@gmail.com,
	embedded-pv-devel@lists.xenproject.org, julien.grall@arm.com,
	david.vrabel@citrix.com, xen-devel@lists.xenproject.org,
	oleksandr.dmytryshyn@globallogic.com, joculator@gmail.com
Subject: Re: [PATCH v13] This is the ABI for the two halves of a para-virtualized sound driver to communicate with each to other.
Date: Mon, 28 Nov 2016 16:12:22 +0200	[thread overview]
Message-ID: <7636abe0-53d9-4be7-b090-d47ed9baa923@gmail.com> (raw)
In-Reply-To: <583C3EB50200007800122CF7@prv-mh.provo.novell.com>


On 11/28/2016 03:27 PM, Jan Beulich wrote:
>>>> On 28.11.16 at 13:30, <andr2000@gmail.com> wrote:
>> + * Request open - open a PCM stream for playback or capture:
>> + *          0                 1                  2                3        octet
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                 id                | XENSND_OP_OPEN  |     stream_idx  |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                                padding                                |
> This still say "padding" instead of "reserved". Also isn't this still part
> of the common header?
done
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                                pcm_rate                               |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |  pcm_format     |  pcm_channels   |             reserved              |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                               buffer_sz                               |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                         gref_directory_start                          |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
> Don't you elsewhere use this as an "and so one" marker? That's not
> what you want here afaict, because of ...
>
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                               reserved                                |
>> + * +-----------------+-----------------+-----------------+-----------------+
> ... this.
done
>> +/*
>> + * Shared page for XENSND_OP_OPEN buffer descriptor (gref_directory in the
>> + *   request) employs a list of pages, describing all pages of the shared data
>> + *   buffer:
>> + *          0                 1                  2                3        octet
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                          gref_dir_next_page                           |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                                gref[0]                                |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                                gref[i]                                |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |                                gref[N -1]                             |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + *
>> + * gref_dir_next_page - grant_ref_t, reference to the next page describing
>> + *   page directory. Must be 0 if no more pages in the list.
>> + * gref[i] - grant_ref_t, reference to a shared page of the buffer
>> + *   allocated at XENSND_OP_OPEN
>> + *
>> + * Number of grant_ref_t entries in the whole page directory is not
>> + * passed, but instead can be calculated as:
>> + *   num_grefs_total = DIV_ROUND_UP(XENSND_OP_OPEN.buffer_sz, PAGE_SIZE);
> The header should be self contained, and there's no DIV_ROUND_UP()
> anywhere under public/io/ for a reader to refer to. Please express this
> using mathematical terms plus, if needed, standard C library ones.
done, will put:
num_grefs_total = (XENSND_OP_OPEN.buffer_sz + PAGE_SIZE - 1) / PAGE_SIZE
>> + * operation - XENSND_OP_MUTE for mute or XENSND_OP_UNMUTE for unmute
>> + * Buffer passed with XENSND_OP_OPEN is used to exchange mute/unmute
>> + * values:
>> + *
>> + *          0                 1                  2                3        octet
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |   channel[0]    |   channel[1]    |   channel[2]    |   channel[3]    |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * |   channel[i]    |   channel[i+1]  |   channel[i+2]  |   channel[i+3]  |
>> + * +-----------------+-----------------+-----------------+-----------------+
>> + * +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
>> + * +-----------------+-----------------+-----------------+-----------------+
> Iirc you had confirmed to change this, but you didn't: I can only repeat
> that other than e.g. for the volume operations, it is unclear what the
> upper bound here is, as you don't use N.
done
>> +struct xensnd_req {
>> +    uint16_t id;
>> +    uint8_t operation;
>> +    uint8_t stream_idx;
>> +    uint32_t reserved;
>> +    union {
>> +        struct xensnd_open_req open;
>> +        struct xensnd_close_req close;
>> +        struct xensnd_rw_req write;
>> +        struct xensnd_rw_req read;
> I guess this has been this way before, but - why two of them? Just like
> thy type can be shared, the field needs to be here just once (perhaps
> named "rw").
done
>> +        struct xensnd_get_vol_req get_vol;
>> +        struct xensnd_set_vol_req set_vol;
> Same here - if these dummy structures really need to survive, then
> I don't think you need multiple for the volume operations or ...
>
>> +        struct xensnd_mute_req mute;
>> +        struct xensnd_unmute_req unmute;
> ... or the muting ones. In fact, if these dummy structures are needed
> in the first place, perhaps just one total would suffice?
I will remove all empty structures
>> +struct xensnd_resp {
>> +    uint16_t id;
>> +    uint8_t operation;
>> +    uint8_t stream_idx;
>> +    int8_t status;
>> +    uint8_t padding[26];
>> +};
> 2 + 1 + 1 + 1 + 26 = 31, which I don't think is what you want.
changed 26 to 27
>
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-11-28 14:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 12:30 [PATCH v13] sndif: add ABI for para-virtual sound Oleksandr Andrushchenko
2016-11-28 12:30 ` [PATCH v13] This is the ABI for the two halves of a para-virtualized sound driver to communicate with each to other Oleksandr Andrushchenko
2016-11-28 13:27   ` Jan Beulich
2016-11-28 14:12     ` Oleksandr Andrushchenko [this message]
2016-11-28 14:24       ` Julien Grall
2016-11-28 14:56         ` Oleksandr Andrushchenko
2016-11-28 15:00           ` Julien Grall
2016-11-28 15:43             ` Oleksandr Andrushchenko
2016-11-28 16:26               ` Julien Grall
2016-11-28 16:59               ` Julien Grall
2016-11-28 17:11                 ` Andrew Cooper
2016-11-28 17:12                   ` Julien Grall
2016-11-29  7:03                     ` Oleksandr Andrushchenko

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=7636abe0-53d9-4be7-b090-d47ed9baa923@gmail.com \
    --to=andr2000@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=al1img@gmail.com \
    --cc=andrii.anisov@gmail.com \
    --cc=dario.faggioli@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=embedded-pv-devel@lists.xenproject.org \
    --cc=ian.jackson@eu.citrix.com \
    --cc=iurii.konovalenko@globallogic.com \
    --cc=joculator@gmail.com \
    --cc=julien.grall@arm.com \
    --cc=lars.kurth@citrix.com \
    --cc=oleksandr.dmytryshyn@globallogic.com \
    --cc=olekstysh@gmail.com \
    --cc=tim@xen.org \
    --cc=vlad.babchuk@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 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).