Re: [PATCHv5 7/7] pciutils: Allow 32-bit domains

From: Keith Busch
Date: Mon Jan 04 2016 - 17:29:55 EST


Hi, thanks for the feedback. I've a few follow up questions.

On Sun, Jan 03, 2016 at 03:11:24PM +0100, Martin Mares wrote:
> This is definitely not enough. Try grepping the source for "domain" :-)
>
> At least the following places need updating, too:
>
> o struct pci_filter and operations on it

Not sure I follow. struct pci_filter's domain was already a 32-bit int.

> o Format strings for printing domains at various places

Are you wanting a %04x for 16 bit domains and %08x for 32 bit ones? The
%04x specifier still works with 32-bit values.

We just need a bit so this new h/w can't collide with ACPI _SEG defined
domains. I don't know of any real need for the full 32-bits; we'd do
fine using only 17 bits, so thought the leading 0's wasn't useful.

> o ABI compability ... changing a field in the middle of struct pci_dev
> (or pci_filter) is going to break ABI, so you either need to change the
> structures in a backward-compatible way, or to use ABI versioning.

It looks like there's a 16-bit gap after device_class. Would it be
acceptable place the domain's upper 16 bits in there to keep ABI
compatibility?

> Also, we should decide on what type the domain should have -- currently, some
> places use "int", others use u16, and your patch introduces int32_t. I would
> prefer u32 myself, but especially in the filters we should be careful about
> how to encode "any domain".

I left it as a signed int to allow a negative number for "any", and that's
also what the linux kernel uses.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/