[dpdk-dev,v2,6/9] net/virtio: unbind intr/eventfd when stop device
Checks
Commit Message
When virtio devices get stopped, we just tell the kernel to unbind
the mapping between interrupts and eventfds.
Note: it behaves differently from other NICs which close eventfds,
free struct. In virtio, we do those things when close device in
following patch.
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
drivers/net/virtio/virtio_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -1686,11 +1686,13 @@ static void
virtio_dev_stop(struct rte_eth_dev *dev)
{
struct rte_eth_link link;
+ struct rte_intr_conf *intr_conf = &dev->data->dev_conf.intr_conf;
+ struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
PMD_INIT_LOG(DEBUG, "stop");
- if (dev->data->dev_conf.intr_conf.lsc)
- rte_intr_disable(&dev->pci_dev->intr_handle);
+ if (intr_conf->lsc || intr_conf->rxq)
+ rte_intr_disable(intr_handle);
memset(&link, 0, sizeof(link));
virtio_dev_atomic_write_link_status(dev, &link);