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

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


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 22 Nov 2021 11:43:38 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=MdAnDADdZvHAbA7rz9ndwQXvpVWPYHtTJsLbFz7+HYU=; b=PTTHtXp1UGvlPB5rX9FMNuSwiaYpZ9MkWkXbulQaQvBxbUufCGYOJHt88b6IDMjhMMACsynnaKJ4enPRpkJE2biKhnU2J49Gyh02nIEtg6zliDVfDN1n0iuOOAhvNB4W35gF8lCFUPLF7MroP4E8lH29Fm4mHOx7sY8NrgyNZM3YQcq+1tHYN0dLWr2RYf03AVmf4OuTUGFvXjTE0Jg8RrcHnAVI2+nLR88brZPvwaCrlFhmnnUlBCfgiKxDngxlUy8vuoI/QMC+L2mn0yKxzSMaNOHuLL4i/QNwBBTsBWoDQ7ktZ9nLpwnNz77kqjJziWh+DWGrr7kz69JatKUtgQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KoB2dJLiOrVXCVNLUNckDhsoX4EoNIr1MVkpGJWx6VwldjJzrIjSkmCx1rV00TCBkQ1mK1LU1dIBzXdVH+ItkcPu5WRXw6WwynkpijvkMPsT4cGAV2UHJUGcExdfaXTGiwJOEQtikirvnFfk76KoodgkSaxHHrNb1wRjJYqkuw6FdQj3p8aPuVPcaStMPtI5kp7/djTNS5l/keaqGoz5UR6zJk5O05OOJzSsI/UZoqISaxfS7pCoXSoe0oRI5tXtPZgt1mmiLVQL6e1Cah8ZRHzOnsf3zR/zucHf4poPYErWS6ZwdMcj6jlMbfQVi3dARYoYJn2vm3M5sBJ0Qa+zkA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
  • Delivery-date: Mon, 22 Nov 2021 10:43:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Or, as also suggested as an option, them getting accounted to the domain
could be folded into the patch making them long-lived.

Jan




 


Rackspace

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