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

Re: [PATCH 2/2] vpci: use named rangeset for BARs


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Mon, 22 Nov 2021 10:59:33 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BBq+nZhvrgME/r1E16pAlev2cFaLl10SPqFI3WkmRfQ=; b=c1iPUvJCdFI7+OC4voxRMNyXryDmawNHxDVePJe0SDx1pCTR8oSA7YGKhLb254Zd5imIj9W1Z2qLovSUAIdgZXvfWJEhep/+N5dRrSEG6lDGZu1zNZ4UJw40FqtEITQ9/qVc5wu/RQmK2BNcpVjrdTTtCH58RJ62hotQw1xMSgw42C4NBT6QO5EL2YcqP9wT6q1Z8bdvb8nP6R6YRjTLfnadsPAPb2mPyeh+qlMxdCj/OO0xd/Iu4y5dWyR6dezQiETh8XYGcM9mGzHkg/L6S6MZeUeS1fE6SkIQfZ575KGG7stORti/NRncqtNsy8ACl/+OHPz5cmKwpq6mKiUaMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTaMGxODocEGpjjJfmqC45UaFgCHso1Po7XT8Y4pewu+SvSE8GJuHxjOwPBimbLQbQEjg1ssoHoScY5+aXq8GIsBgZhHF+slCk746rpUKKEXZsDFWctWg0hNF9XMb5Eui8MO5sELD7j+GJGI9SlWWpFC2qGB0J0a/J2SNEkDfX7ptbv8bd5JWh5Vf3cEi1CYpQNknvr6rRvoNSZlhn87Ccf0qbSUL3uOCxNbAS+V+oeIbGCydQ7iU6ydfBoUlUhCTi6F5yelMQEaX3I7I6fNiX1OGAq5afB5fpSKVPu8NzVl/QXRf6CYdkrNK7kWFXAz1A0KbvJUp2yB9bjQ78BQTw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Mon, 22 Nov 2021 10:59:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHX34NSPeXhoB5iREudUJGr9f4eDKwPWBGAgAAEhQCAAAHcgIAAATqAgAABWoA=
  • Thread-topic: [PATCH 2/2] vpci: use named rangeset for BARs


On 22.11.21 12:54, Jan Beulich wrote:
> On 22.11.2021 11:50, Oleksandr Andrushchenko wrote:
>>
>> On 22.11.21 12:43, Jan Beulich wrote:
>>> On 22.11.2021 11:27, Roger Pau Monné wrote:
>>>> On Mon, Nov 22, 2021 at 11:28:25AM +0200, Oleksandr Andrushchenko wrote:
>>>>> --- a/xen/drivers/vpci/header.c
>>>>> +++ b/xen/drivers/vpci/header.c
>>>>> @@ -206,12 +206,16 @@ static void defer_map(struct domain *d, struct 
>>>>> pci_dev *pdev,
>>>>>    static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool 
>>>>> rom_only)
>>>>>    {
>>>>>        struct vpci_header *header = &pdev->vpci->header;
>>>>> -    struct rangeset *mem = rangeset_new(NULL, NULL, 0);
>>>>> +    struct rangeset *mem;
>>>>> +    char str[32];
>>>>>        struct pci_dev *tmp, *dev = NULL;
>>>>>        const struct vpci_msix *msix = pdev->vpci->msix;
>>>>>        unsigned int i;
>>>>>        int rc;
>>>>>    
>>>>> +    snprintf(str, sizeof(str), "%pp", &pdev->sbdf);
>>>>> +    mem = rangeset_new(NULL, str, RANGESETF_no_print);
>>>> You are still not adding the rangeset to the domain list, as the first
>>>> parameter passed here in NULL instead of a domain struct.
>>>>
>>>> Given the current short living of the rangesets I'm not sure it makes
>>>> much sense to link them to the domain ATM, but I guess this is kind of
>>>> a preparatory change as other patches you have will have the
>>>> rangesets permanent as long as the device is assigned to a domain.
>>>>
>>>> Likely the above reasoning (or the appropriate one) should be added to
>>>> the commit message.
>> If I fold then there is no reason to add the comment, right?
> I'd say you still want to justify the change from "anonymous" to "named and
> accounted".
"Make the range sets permanent, e.g. create them when a PCI device is
added and destroy when it is removed. Also make the range sets named
and accounted."

Will this work in the commit message?
>
> Jan
>
>
Thank you,
Oleksandr

 


Rackspace

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