All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: lars.kurth@citrix.com, vlad.babchuk@gmail.com,
	julien.grall@arm.com, andrii.anisov@gmail.com,
	olekstysh@gmail.com, al1img@gmail.com, JBeulich@suse.com,
	xen-devel@lists.xenproject.org, joculator@gmail.com
Subject: Re: [PATCH 1/2] xen/kbdif: update protocol documentation
Date: Wed, 11 Jan 2017 20:40:13 +0200	[thread overview]
Message-ID: <259345c1-04a9-0a3d-3b67-b71b4941804e@gmail.com> (raw)
In-Reply-To: <1484156127.32021.143.camel@citrix.com>

On 01/11/2017 07:35 PM, Dario Faggioli wrote:
> On Tue, 2017-01-10 at 09:21 +0200, Oleksandr Andrushchenko wrote:
>> On 01/07/2017 12:20 AM, Stefano Stabellini wrote:
>>> On Fri, 6 Jan 2017, Oleksandr Andrushchenko wrote:
>>>> |                               reserved
>>>>         |
>>>> + * +-----------------+-----------------+-----------------+----
>>>> -------------+
>>>> + *
>>>> |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
>>>> /\/\/\/|
>>>> + * +-----------------+-----------------+-----------------+----
>>>> -------------+
>>> I guess this means that we are skipping some bytes because they are
>>> all
>>> reserved, right?  If so, it would be useful to write the byte count
>>> at this
>>> point. What's the total size of the event struct?
>>>
>> IMO, we shouldn't put any sizes here because:
>> 1. Above we say "All event packets have the same
>>      length (40 octets)"
>> 2. All the event structures are part of the
>> union xenkbd_in_event, which has
>> char pad[XENKBD_IN_EVENT_SIZE];
>> which effectively regulates the size of the event.
>>
> In which case, you can use either 40 or XENKBD_IN_EVENT_SIZE (probably
> the latter).
>
> It's indeed a repetition, but a good one, IMO: it helps the reader, as
> she won't have to go back to figure out how big the struct was, how the
> macro was call and to what value it was defined).
I am still not convinced that we should put it.
Probably we can go the way other RFCs do, like TCP [1], 802.11 [2] etc:
those do not define any reserved fields at the bottom of structures,
(which are effectively padding?) but are limited to only those fields
which are defined. This means that, for example, instead of

  *          0                 1                  2 3        octet
  * 
+-----------------+-----------------+-----------------+-----------------+
  * |   _TYPE_MOTION  | reserved                      |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | rel_x                                 |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | rel_y                                 |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | rel_z                                 |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | reserved                                |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * 
|/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | reserved                                |
  * 
+-----------------+-----------------+-----------------+-----------------+

simply put

  *          0                 1                  2 3        octet
  * 
+-----------------+-----------------+-----------------+-----------------+
  * |   _TYPE_MOTION  | reserved                      |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | rel_x                                 |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | rel_y                                 |
  * 
+-----------------+-----------------+-----------------+-----------------+
  * | rel_z                                 |
  * 
+-----------------+-----------------+-----------------+-----------------+

What do you think?


[1] https://www.ietf.org/rfc/rfc793.txt
[2] https://tools.ietf.org/html/rfc5416
> Regards,
> Dario
Thank you,
Oleksandr

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

  reply	other threads:[~2017-01-11 18:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06  9:32 [PATCH 0/2] xen/kbdif: add multi-touch support Oleksandr Andrushchenko
2017-01-06  9:32 ` [PATCH 1/2] xen/kbdif: update protocol documentation Oleksandr Andrushchenko
2017-01-06 22:20   ` Stefano Stabellini
2017-01-10  7:21     ` Oleksandr Andrushchenko
2017-01-11 17:35       ` Dario Faggioli
2017-01-11 18:40         ` Oleksandr Andrushchenko [this message]
2017-01-11 22:50           ` Dario Faggioli
2017-01-12  6:36             ` Oleksandr Andrushchenko
2017-01-18 19:41               ` Oleksandr Andrushchenko
2017-01-18 20:28                 ` Stefano Stabellini
2017-01-06  9:32 ` [PATCH 2/2] xen/kbdif: add multi-touch support Oleksandr Andrushchenko
2017-01-06 22:37   ` Stefano Stabellini
2017-01-10  7:53     ` Oleksandr Andrushchenko
2017-01-11  0:29       ` Stefano Stabellini
2017-01-11  9:32         ` Oleksandr Andrushchenko
2017-01-19 22:10           ` Stefano Stabellini
2017-01-11  8:01 ` [PATCH 0/2] " 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=259345c1-04a9-0a3d-3b67-b71b4941804e@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=joculator@gmail.com \
    --cc=julien.grall@arm.com \
    --cc=lars.kurth@citrix.com \
    --cc=olekstysh@gmail.com \
    --cc=sstabellini@kernel.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 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.