Commit 4790c403 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

rte_virtio: removed vtpci->reset callback



It's not used anywhere. There's already a
vtpci->set_status(RESET) equivalent that
does the same.

Change-Id: I0f04ba094848806c647ede4be2ef77b423ead288
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/379337


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 893c1f7e
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -221,12 +221,6 @@ legacy_set_status(struct virtio_dev *dev, uint8_t status)
	rte_pci_ioport_write(VTPCI_IO(dev), &status, 1, VIRTIO_PCI_STATUS);
}

static void
legacy_reset(struct virtio_dev *dev)
{
	legacy_set_status(dev, VIRTIO_CONFIG_STATUS_RESET);
}

static uint8_t
legacy_get_isr(struct virtio_dev *dev)
{
@@ -305,7 +299,6 @@ legacy_notify_queue(struct virtio_dev *dev, struct virtqueue *vq)
const struct virtio_pci_ops legacy_ops = {
	.read_dev_cfg	= legacy_read_dev_config,
	.write_dev_cfg	= legacy_write_dev_config,
	.reset		= legacy_reset,
	.get_status	= legacy_get_status,
	.set_status	= legacy_set_status,
	.get_features	= legacy_get_features,
@@ -404,13 +397,6 @@ modern_set_status(struct virtio_dev *dev, uint8_t status)
	rte_write8(status, &hw->common_cfg->device_status);
}

static void
modern_reset(struct virtio_dev *dev)
{
	modern_set_status(dev, VIRTIO_CONFIG_STATUS_RESET);
	modern_get_status(dev);
}

static uint8_t
modern_get_isr(struct virtio_dev *dev)
{
@@ -514,7 +500,6 @@ modern_notify_queue(struct virtio_dev *dev __rte_unused, struct virtqueue *vq)
const struct virtio_pci_ops modern_ops = {
	.read_dev_cfg	= modern_read_dev_config,
	.write_dev_cfg	= modern_write_dev_config,
	.reset		= modern_reset,
	.get_status	= modern_get_status,
	.set_status	= modern_set_status,
	.get_features	= modern_get_features,
+0 −2
Original line number Diff line number Diff line
@@ -191,8 +191,6 @@ struct virtio_pci_ops {
			     void *dst, int len);
	void (*write_dev_cfg)(struct virtio_dev *hw, size_t offset,
			      const void *src, int len);
	void (*reset)(struct virtio_dev *hw);

	uint8_t (*get_status)(struct virtio_dev *hw);
	void    (*set_status)(struct virtio_dev *hw, uint8_t status);

+5 −13
Original line number Diff line number Diff line
@@ -68,24 +68,17 @@ virtio_user_write_dev_config(struct virtio_dev *vdev, size_t offset,
	PMD_DRV_LOG(ERR, "not supported offset=%zu, len=%d", offset, length);
}

static void
virtio_user_reset(struct virtio_dev *vdev)
{
	struct virtio_user_dev *dev = virtio_dev_get_user_dev(vdev);

	if (dev->status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
		virtio_user_stop_device(dev);
}

static void
virtio_user_set_status(struct virtio_dev *vdev, uint8_t status)
{
	struct virtio_user_dev *dev = virtio_dev_get_user_dev(vdev);

	if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
	if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) {
		virtio_user_start_device(dev);
	else if (status == VIRTIO_CONFIG_STATUS_RESET)
		virtio_user_reset(vdev);
	} else if (status == VIRTIO_CONFIG_STATUS_RESET &&
			(dev->status & VIRTIO_CONFIG_STATUS_DRIVER_OK)) {
		virtio_user_stop_device(dev);
	}
	dev->status = status;
}

@@ -242,7 +235,6 @@ virtio_user_free(struct virtio_dev *vdev)
const struct virtio_pci_ops virtio_user_ops = {
	.read_dev_cfg	= virtio_user_read_dev_config,
	.write_dev_cfg	= virtio_user_write_dev_config,
	.reset		= virtio_user_reset,
	.get_status	= virtio_user_get_status,
	.set_status	= virtio_user_set_status,
	.get_features	= virtio_user_get_features,