[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC XEN PATCH v4 5/5] libxl: Use gsi instead of irq for mapping pirq
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Fri, 5 Jan 2024 07:59:48 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=UF2+6CmOgts5Jd5H1iy89Xf6TWMrLIQq6E3AzRzjjDo=; b=gva58OH4ULbJIbYnRcr2sggWasv+fgkCmy2d//KVTjS/6X12IAq5mmWJSg3lZiHTJvZURMA+ShcjuxmWVCsxkW2Li7A6l3WwwbLDgpiIviONpAVuGVDSSu5HVgX0Ev6YPBsngfP/dSSjPSMjYbIWKXRgQ/RStjwLMxZ/Ob46z6YAfdfO/EFVvIcwUOqF8wCNklTP75ezb3FvtJjJ5r3rY0vpkf6w41xTPjhhST29Q3L+TFKky2yc7/bWPrcKZWMiUX+SHdL8oOtQixYiQ3jhKaERxwqh9JgtIx3gDMo50rw3caayza2WmmiZjDI9YJIr1bLNZqbGHjH60M7KSzdYww==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JHYbU86+BS3ltDxFcCT6wc4Rha33VAVxTRNgmdWB1vOeLQsxqhUYkxjGtbFTt5tPRfbkvjaimfKxf1qSq7QBP5cQyFplRo0MxOcMxx6yBhp01WpbXEoyImWGtaETjY7mG4hEHL1k/YTwkcTmw/V42gupnAB/0e3QNqix1fKG0Ih/3/jOPYEoP/3Dn51aHeSY+Wdz511DaEHJn3x0zLOQz5UaTpOG8tQ9hR7wNfkLDBct9hbVHq9b3oZT0G5WxNdlqPTNontRXA00clJNfz1ZOdgmOr9paS5CGJoa1t0f/UxKJbGwO8Ru8rWSNW60nmdRqPt0mDpV+JNWr+xUVuDRLQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Fri, 05 Jan 2024 08:00:06 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHaP6Y3HXW6ZoMbT0+Rfz8pptyOwLDK1HoAgACMDIA=
- Thread-topic: [RFC XEN PATCH v4 5/5] libxl: Use gsi instead of irq for mapping pirq
On 2024/1/5 15:36, Jan Beulich wrote:
> On 05.01.2024 08:09, Jiqian Chen wrote:
>> --- a/tools/libs/light/libxl_pci.c
>> +++ b/tools/libs/light/libxl_pci.c
>> @@ -1479,8 +1479,14 @@ static void pci_add_dm_done(libxl__egc *egc,
>> fclose(f);
>> if (!pci_supp_legacy_irq())
>> goto out_no_irq;
>> - sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
>> + sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/gsi", pci->domain,
>> pci->bus, pci->dev, pci->func);
>> +
>> + if (access(sysfs_path, F_OK) != 0) {
>
> I suppose you want to also check errno, and fall back only when you got
> back (I guess) ENOENT.
Ok, will check errno in next version, if it is ENOENT, then use irq, if it is
not ENOENT, then log error and go to out.
>
> Jan
>
>> + sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
>> + pci->bus, pci->dev, pci->func);
>> + }
>> +
>> f = fopen(sysfs_path, "r");
>> if (f == NULL) {
>> LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path);
>> @@ -2231,9 +2237,14 @@ skip_bar:
>> if (!pci_supp_legacy_irq())
>> goto skip_legacy_irq;
>>
>> - sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
>> + sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/gsi", pci->domain,
>> pci->bus, pci->dev, pci->func);
>>
>> + if (access(sysfs_path, F_OK) != 0) {
>> + sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
>> + pci->bus, pci->dev, pci->func);
>> + }
>> +
>> f = fopen(sysfs_path, "r");
>> if (f == NULL) {
>> LOGED(ERROR, domid, "Couldn't open %s", sysfs_path);
>
--
Best regards,
Jiqian Chen.
|