OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [PATCH V5 1/2] virtio-gpio: Add the device specification


On Fri, 16 Jul 2021 at 20:52, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Fri, Jul 16, 2021 at 01:09:18PM +0530, Viresh Kumar wrote:
> > +\begin{lstlisting}
> > +struct virtio_gpio_config {
> > +    u8 name[32];
> > +    le16 ngpio;
> > +    le16 names_offset;
> > +    le32 names_size;
> > +
> > +    /* at offset defined by names_offset field */
> > +    u8 gpio_names[];
> > +};
> > +\end{lstlisting}
> > +
> > +\item[\field{gpio_names}] field is optional for a device to implement. If this
> > +    field isn't implemented by the device, then the device must set the
> > +    \field{names_size} field to zero. If this field is implemented by the
> > +    device, then it must contain a stream of \field{ngpio} zero-terminated
> > +    strings, where each string represents the name of a GPIO line, present in
> > +    increasing order of the GPIO line numbers. The GPIO line names must
> > +    be unique within a GPIO Device and must not be empty string.
> > +
> > +\end{description}
>
> There's a problem with this approach: config space size is
> actually pretty limited since it might be in the IO space
> when using PCI. That is turn is recommended not to exceed 256 bytes.

Hmm, interesting. This block of data, for gpio names, can be really
large as well,
lets say if we have 256 GPIOs with each requiring 10 bytes for name,
its over 2KB.

Yeah, that can't go with the config structure then.

> Is it important to have the names accessible before driver
> is fully initialized?

Not really.

> If not I would just create a VQ and use that to retrieve this data.

For example in Linux we need this information before the
GPIO device is registered with the framework and we can fetch data
over virtio there.

> Note: the competing virtio-gpio proposal on list shares the issue.

Right.

Thanks Michael for your feedback.

--
viresh


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]