[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 6/7] libqos: Added MSI-X support
From: |
Marc Marí |
Subject: |
Re: [Qemu-devel] [PATCH v5 6/7] libqos: Added MSI-X support |
Date: |
Mon, 18 Aug 2014 19:46:44 +0200 |
>El Mon, 18 Aug 2014 14:46:11 +0200
>Marc Marí <address@hidden> escribió:
> +void qpci_msix_enable(QPCIDevice *dev)
> +{
> + uint8_t addr;
> + uint16_t val;
> + uint32_t table;
> + uint8_t bir_table;
> + uint8_t bir_pba;
> + void *offset;
> +
> + addr = qpci_find_capability(dev, PCI_CAP_ID_MSIX);
> + g_assert_cmphex(addr, !=, 0);
> +
> + val = qpci_config_readw(dev, addr + PCI_MSIX_FLAGS);
> + qpci_config_writew(dev, addr + PCI_MSIX_FLAGS, val |
> PCI_MSIX_FLAGS_ENABLE); +
> + table = qpci_config_readl(dev, addr + PCI_MSIX_TABLE);
> + bir_table = table & PCI_MSIX_FLAGS_BIRMASK;
> + offset = qpci_iomap(dev, bir_table);
> + dev->msix_table = offset + (table & ~PCI_MSIX_FLAGS_BIRMASK);
> +
> + table = qpci_config_readl(dev, addr+PCI_MSIX_PBA);
> + bir_pba = table & PCI_MSIX_FLAGS_BIRMASK;
> + if (bir_pba != bir_table) {
> + offset = qpci_iomap(dev, bir_pba);
qpci_iomap changed its prototype in one of the lastest pull requests.
Both qpci_iomap should have a NULL as third parameter. Will change in
next version.
Marc
- [Qemu-devel] [PATCH v5 0/7] Virtio PCI libqos driver, Marc Marí, 2014/08/18
- [Qemu-devel] [PATCH v5 1/7] tests: Functions bus_foreach and device_find from libqos virtio API, Marc Marí, 2014/08/18
- [Qemu-devel] [PATCH v5 2/7] tests: Add virtio device initialization, Marc Marí, 2014/08/18
- [Qemu-devel] [PATCH v5 3/7] libqos: Added basic virtqueue support to virtio implementation, Marc Marí, 2014/08/18
- [Qemu-devel] [PATCH v5 4/7] libqos: Added indirect descriptor support to virtio implementation, Marc Marí, 2014/08/18
- [Qemu-devel] [PATCH v5 5/7] libqos: Added test case for configuration changes in virtio-blk test, Marc Marí, 2014/08/18
- [Qemu-devel] [PATCH v5 6/7] libqos: Added MSI-X support, Marc Marí, 2014/08/18
- Re: [Qemu-devel] [PATCH v5 6/7] libqos: Added MSI-X support,
Marc Marí <=
- [Qemu-devel] [PATCH v5 7/7] libqos: Added EVENT_IDX support, Marc Marí, 2014/08/18