rte_virtio: disable legacy PCI for dpdk < 17.05-rc4
17.05-rc4 is the version e.g. rte_pci_ioport_read function was introduced in. The bdev_virtio module previously did not compile with older DPDK versions. Change-Id: Ib96d5d7934166acc552515b02bfba25b71929438 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/382829 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
901aafe675
commit
fb99e9e644
@ -71,12 +71,6 @@ check_vq_phys_addr_ok(struct virtqueue *vq)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct rte_pci_ioport *
|
|
||||||
vtpci_io(struct virtio_dev *vdev)
|
|
||||||
{
|
|
||||||
return &g_virtio_driver.internal[vdev->id].io;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_virtio_hw(struct virtio_dev *dev)
|
free_virtio_hw(struct virtio_dev *dev)
|
||||||
{
|
{
|
||||||
@ -94,6 +88,14 @@ free_virtio_hw(struct virtio_dev *dev)
|
|||||||
free(hw);
|
free(hw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PCI_LEGACY_SUPPORT
|
||||||
|
|
||||||
|
static struct rte_pci_ioport *
|
||||||
|
vtpci_io(struct virtio_dev *vdev)
|
||||||
|
{
|
||||||
|
return &g_virtio_driver.internal[vdev->id].io;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since we are in legacy mode:
|
* Since we are in legacy mode:
|
||||||
* http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf
|
* http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf
|
||||||
@ -275,6 +277,8 @@ const struct virtio_pci_ops legacy_ops = {
|
|||||||
.dump_json_config = pci_dump_json_config,
|
.dump_json_config = pci_dump_json_config,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* PCI_LEGACY_SUPPORT */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi)
|
io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi)
|
||||||
{
|
{
|
||||||
@ -695,6 +699,7 @@ pci_enum_virtio_probe_cb(void *ctx, struct spdk_pci_device *pci_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PCI_LEGACY_SUPPORT
|
||||||
#if 0
|
#if 0
|
||||||
PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");
|
PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");
|
||||||
if (rte_pci_ioport_map(dev, 0, vtpci_io(hw)) < 0) {
|
if (rte_pci_ioport_map(dev, 0, vtpci_io(hw)) < 0) {
|
||||||
@ -717,6 +722,7 @@ pci_enum_virtio_probe_cb(void *ctx, struct spdk_pci_device *pci_dev)
|
|||||||
vdev->modern = 0;
|
vdev->modern = 0;
|
||||||
virtio_dev_pci_init(vdev);
|
virtio_dev_pci_init(vdev);
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
err:
|
err:
|
||||||
free_virtio_hw(vdev);
|
free_virtio_hw(vdev);
|
||||||
|
@ -38,12 +38,17 @@
|
|||||||
#include <linux/virtio_config.h>
|
#include <linux/virtio_config.h>
|
||||||
#include <linux/virtio_pci.h>
|
#include <linux/virtio_pci.h>
|
||||||
|
|
||||||
|
#include <rte_version.h>
|
||||||
#include <rte_pci.h>
|
#include <rte_pci.h>
|
||||||
|
|
||||||
#include "spdk/env.h"
|
#include "spdk/env.h"
|
||||||
#include "spdk/json.h"
|
#include "spdk/json.h"
|
||||||
#include "virtio_dev.h"
|
#include "virtio_dev.h"
|
||||||
|
|
||||||
|
#if RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 4)
|
||||||
|
#define PCI_LEGACY_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
struct virtqueue;
|
struct virtqueue;
|
||||||
|
|
||||||
#define VIRTIO_MAX_DEVICES 128
|
#define VIRTIO_MAX_DEVICES 128
|
||||||
@ -119,7 +124,9 @@ struct virtio_hw {
|
|||||||
*/
|
*/
|
||||||
struct vtpci_internal {
|
struct vtpci_internal {
|
||||||
const struct virtio_pci_ops *vtpci_ops;
|
const struct virtio_pci_ops *vtpci_ops;
|
||||||
|
#ifdef PCI_LEGACY_SUPPORT
|
||||||
struct rte_pci_ioport io;
|
struct rte_pci_ioport io;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct virtio_driver {
|
struct virtio_driver {
|
||||||
|
Loading…
Reference in New Issue
Block a user