[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 11:14:11 +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=55NDRTyfekNmjQ+peTiPRW/tkm0QGbNwHcGG4EBK7jU=; b=Npg50x2YJm3FKqg0OGh2eP+T9ermdWC6ejwW0jlMt2W0R4xQLjEc57amdY4JQNScU0QlJheVeh/whZpIYX0nyvsBIjBQueXne+hHV99jXyTr661Teat84Tgj/pGpCLyDGAb5a8mXNcXf9Uqb3yP/KA2uGhg7vyLVCI/Gn99/zXoMPdrp7SSYaodqMF+ivfMV+NAn/Sl8d6iU0u0HZHVV3gazkylgsint0jL8oXK8Xm8JzIy0OaR/sPTSAdP3HRLuI+0DRkTI8/podBBnqrjd9pxKlWHuzpCKhSPLdyO2KktBI6zcxrFT4sIYEAN/MS7kaPm4zm4+Qsv7+6Tdgjtayw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBr036J/e4AlawXY891pGXfiFWr/caHOHF9Kz3Qn9Ox7uALWJ7b/XMKMY6II2w06Tv9kX9d0DGhr9werH8SsDFBxu8gB7XTFzVVCIeOfDWnf2GTEJtP3NiBVFG5anzHlOGKHG9zur40BosaZ3DiiPqncWGdN6vrU+cmQK3yoT7nywnOQFTXT6C4eYv7Lgzzo++Ei9K9wr2sF6ZBvJfJWW0PS80nqhXWTy/fQjQ4XbljktPZfJJUfU0FwjRmMwhUwy2QQwXsDPvnF/kB2nAM9zbaB/C69LRa6tSBBu+P/eL+EE3J4KLOfZ6Ou0XdvXQ9LD1AUXa3p8l9StF3BDbNvTg==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Mon, 22 Nov 2021 11:14:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHX34NSPeXhoB5iREudUJGr9f4eDKwPWBGAgAAEhQCAAAHcgIAAATqAgAABWoCAAAKVgIAAAYKA
  • Thread-topic: [PATCH 2/2] vpci: use named rangeset for BARs


On 22.11.21 13:08, Jan Beulich wrote:
> On 22.11.2021 11:59, Oleksandr Andrushchenko wrote:
>> 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."
> Making them permanent is a requirement of your change iirc, so I'd start with
> "Because the range sets now become permanent, make them ...".
"As the range sets are now created when a PCI device is added and destroyed
when it is removed so make them named and accounted."
>
> Jan
>
>
Thank you,
Oleksandr

 


Rackspace

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