lkml.org 
[lkml]   [2019]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v13] platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc
On Sun, Apr 7, 2019 at 5:05 AM Liming Sun <lsun@mellanox.com> wrote:

> > > + * mlxbf_tmfifo_msg_hdr - Structure of the TmFifo message header
> > > + * @type: message type
> > > + * @len: payload length
> > > + * @u: 64-bit union data
> > > + */
> > > +union mlxbf_tmfifo_msg_hdr {
> > > + struct {
> > > + u8 type;
> > > + __be16 len;
> > > + u8 unused[5];
> > > + } __packed;
> > > + u64 data;
> >
> > I'm not sure I understand how you can distinguish which field of union to use?
> > Isn't here some type missed?
>
> Updated the comment in v14.
>
> This message header is a union of struct and u64 data.
> The 'struct' has
> type and length field which are used to encode & decode the message.
> The 'data' field is used to read/write the message header from/to the FIFO.

Something fishy here.

You are using a structure of data which you would like to write with
one call? Perhaps you need to construct this on-the-fly.
Moreover, the __be memeber is used in a data which is written as LE.
This needs more explanation.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2019-04-11 16:14    [W:0.088 / U:4.136 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site