[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 09/11] vpci/msi: add MSI handlers



>>> On 10.10.17 at 13:35, <roger.pau@xxxxxxxxxx> wrote:
> On Wed, Oct 04, 2017 at 08:34:13AM +0000, Jan Beulich wrote:
>> >>> On 19.09.17 at 17:29, <roger.pau@xxxxxxxxxx> wrote:
>> > --- a/xen/include/xen/vpci.h
>> > +++ b/xen/include/xen/vpci.h
>> > @@ -72,6 +72,30 @@ struct vpci {
>> >          } bars[7]; /* At most 6 BARS + 1 expansion ROM BAR. */
>> >          /* FIXME: currently there's no support for SR-IOV. */
>> >      } header;
>> > +
>> > +    /* MSI data. */
>> > +    struct vpci_msi {
>> > +        /* Arch-specific data. */
>> > +        struct vpci_arch_msi arch;
>> > +        /* Address. */
>> > +        uint64_t address;
>> > +        /* Offset of the capability in the config space. */
>> > +        unsigned int pos;
>> > +        /* Maximum number of vectors supported by the device. */
>> > +        unsigned int max_vectors;
>> > +        /* Number of vectors configured. */
>> > +        unsigned int vectors;
>> > +        /* Mask bitfield. */
>> > +        uint32_t mask;
>> > +        /* Data. */
>> > +        uint16_t data;
>> > +        /* Enabled? */
>> > +        bool enabled;
>> > +        /* Supports per-vector masking? */
>> > +        bool masking;
>> > +        /* 64-bit address capable? */
>> > +        bool address64;
>> > +    } *msi;
>> >  #endif
>> >  };
>> 
>> As there may be quite a few instance of this structure, please strive to
>> keep its size down. Many of the fields above have a pretty limited valid
>> value range and hence would benefit from using more narrow types and/or
>> bitfields.
> 
> max_vectors/vectors can be uint8_t, the rest I'm not sure how to
> reduce.

"pos" can be uint8_t too afaict.

> I could turn the bools into a bitfield, but isn't a bool
> already limited to 1 bit?

Plus 7 bits of unused data. The minimum addressable unit is a
byte after all, and non-bitfield members need to allow their
address being taken.

Jan


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.