From 4790c4033f6102a8f4961570d1ace244bb0f182a Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Wed, 20 Sep 2017 18:06:28 +0200 Subject: [PATCH] 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: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/379337 Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu --- lib/bdev/virtio/rte_virtio/virtio_pci.c | 15 --------------- lib/bdev/virtio/rte_virtio/virtio_pci.h | 2 -- lib/bdev/virtio/rte_virtio/virtio_user.c | 18 +++++------------- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/lib/bdev/virtio/rte_virtio/virtio_pci.c b/lib/bdev/virtio/rte_virtio/virtio_pci.c index 9a226191b2..041d122fd2 100644 --- a/lib/bdev/virtio/rte_virtio/virtio_pci.c +++ b/lib/bdev/virtio/rte_virtio/virtio_pci.c @@ -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, diff --git a/lib/bdev/virtio/rte_virtio/virtio_pci.h b/lib/bdev/virtio/rte_virtio/virtio_pci.h index 395e434ff2..a80d6f4e9c 100644 --- a/lib/bdev/virtio/rte_virtio/virtio_pci.h +++ b/lib/bdev/virtio/rte_virtio/virtio_pci.h @@ -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); diff --git a/lib/bdev/virtio/rte_virtio/virtio_user.c b/lib/bdev/virtio/rte_virtio/virtio_user.c index bf1a027d6d..a50a0cb536 100644 --- a/lib/bdev/virtio/rte_virtio/virtio_user.c +++ b/lib/bdev/virtio/rte_virtio/virtio_user.c @@ -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,