From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 3022849E0 for ; Thu, 8 Nov 2018 19:01:23 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id k15-v6so19257740wre.12 for ; Thu, 08 Nov 2018 10:01:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1iXqQRAm3Vxf5eMS4Co4n5qXBz7i7s+yoK7tytGTXlk=; b=AWChgsU/F2kzvMr/lqftYT+RItqJ6yd5SyGBmadM66OX2i/qI3y+56bC6NMnoqOF/Y aRxpyLV8YGCK2FlLL/4WT4dHeuzrEIVngaHSPXuB+KKFzydlFTufBfEYeMNeFlImpscO y83vgp4QHQ1cJnKC5JbrgrUq4z1Tf/qEydBXp8HHwpc7ZJbggt7FKAAybi1RueDO2v1E oklbM7AW0PjKRpX7JtKK4XXambRXPxTLY6IhfQLPykBggws00MF7gsoBBbLQbiT6VXUc aYdY+AuGLvfQN8w9bEPCgNGRDuURJ8sgMRbhW7OsLC3r0o1gCyV3JwcD5kf0wyS6jLwe 0s5A== X-Gm-Message-State: AGRZ1gKtWea5cjKflM8qaTi9Xn9Qr4e15uu6G1yjOBCBoCkM58P2wjND 1FDi568KcBWPjPDgsMOeMTY= X-Google-Smtp-Source: AJdET5eVwn9dfNBkx6qq0IAg9xULGaae//Mw/8KJZNDRCSHdgKdvxDLOi/oWG8N6CLE+OPrPtCEhyg== X-Received: by 2002:a05:6000:d2:: with SMTP id q18mr4896446wrx.302.1541700082618; Thu, 08 Nov 2018 10:01:22 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id t13-v6sm2776436wrn.22.2018.11.08.10.01.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 10:01:21 -0800 (PST) From: Luca Boccassi To: Luca Boccassi Cc: Brian Russell , Maxime Coquelin , dpdk stable Date: Thu, 8 Nov 2018 18:00:57 +0000 Message-Id: <20181108180111.25873-1-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181029125329.17729-20-bluca@debian.org> References: <20181029125329.17729-20-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/virtio: register/unregister intr handler on start/stop' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 18:01:23 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/10/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Luca Boccassi --- >>From 6c9fa4d84e9982b2754c7c7424f4c4306c623299 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 31 Oct 2018 18:39:43 +0000 Subject: [PATCH] net/virtio: register/unregister intr handler on start/stop [ upstream commit f9b0d1902caf893493b5e07763ecf817c34fc75c ] Register and unregister the virtio interrupt handler when the device is started and stopped. This allows a virtio device to be hotplugged or unplugged. Fixes: c1f86306a026 ("virtio: add new driver") Signed-off-by: Brian Russell Signed-off-by: Luca Boccassi Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_ethdev.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 5a27ab772..6f950f0f4 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1394,11 +1394,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) if (ret < 0) return ret; - /* Setup interrupt callback */ - if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) - rte_intr_callback_register(&pci_dev->intr_handle, - virtio_interrupt_handler, eth_dev); - return 0; } @@ -1423,11 +1418,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs = NULL; - /* reset interrupt callback */ - if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) - rte_intr_callback_unregister(&pci_dev->intr_handle, - virtio_interrupt_handler, - eth_dev); rte_eal_pci_unmap_device(pci_dev); PMD_INIT_LOG(DEBUG, "dev_uninit completed"); @@ -1538,6 +1528,12 @@ virtio_dev_start(struct rte_eth_dev *dev) return -ENOTSUP; } + /* Setup interrupt callback */ + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) + rte_intr_callback_register(&dev->pci_dev->intr_handle, + virtio_interrupt_handler, + dev); + if (rte_intr_enable(&dev->pci_dev->intr_handle) < 0) { PMD_DRV_LOG(ERR, "interrupt enable failed"); return -EIO; @@ -1645,9 +1641,17 @@ virtio_dev_stop(struct rte_eth_dev *dev) PMD_INIT_LOG(DEBUG, "stop"); - if (dev->data->dev_conf.intr_conf.lsc) + if (dev->data->dev_conf.intr_conf.lsc) { rte_intr_disable(&dev->pci_dev->intr_handle); + /* Reset interrupt callback */ + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { + rte_intr_callback_unregister(&dev->pci_dev->intr_handle, + virtio_interrupt_handler, + dev); + } + } + hw->started = 0; memset(&link, 0, sizeof(link)); virtio_dev_atomic_write_link_status(dev, &link); -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-08 17:59:30.086297561 +0000 +++ 0001-net-virtio-register-unregister-intr-handler-on-start.patch 2018-11-08 17:59:30.044751011 +0000 @@ -1,14 +1,15 @@ -From f9b0d1902caf893493b5e07763ecf817c34fc75c Mon Sep 17 00:00:00 2001 +From 6c9fa4d84e9982b2754c7c7424f4c4306c623299 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 31 Oct 2018 18:39:43 +0000 Subject: [PATCH] net/virtio: register/unregister intr handler on start/stop +[ upstream commit f9b0d1902caf893493b5e07763ecf817c34fc75c ] + Register and unregister the virtio interrupt handler when the device is started and stopped. This allows a virtio device to be hotplugged or unplugged. Fixes: c1f86306a026 ("virtio: add new driver") -Cc: stable@dpdk.org Signed-off-by: Brian Russell Signed-off-by: Luca Boccassi @@ -18,57 +19,57 @@ 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c -index 10a7e3fcc..da8717726 100644 +index 5a27ab772..6f950f0f4 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c -@@ -1679,11 +1679,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) +@@ -1394,11 +1394,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) if (ret < 0) - goto out; + return ret; - /* Setup interrupt callback */ - if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) -- rte_intr_callback_register(eth_dev->intr_handle, +- rte_intr_callback_register(&pci_dev->intr_handle, - virtio_interrupt_handler, eth_dev); - return 0; + } - out: -@@ -1706,11 +1701,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) - eth_dev->tx_pkt_burst = NULL; - eth_dev->rx_pkt_burst = NULL; +@@ -1423,11 +1418,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) + rte_free(eth_dev->data->mac_addrs); + eth_dev->data->mac_addrs = NULL; - /* reset interrupt callback */ - if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) -- rte_intr_callback_unregister(eth_dev->intr_handle, +- rte_intr_callback_unregister(&pci_dev->intr_handle, - virtio_interrupt_handler, - eth_dev); - if (eth_dev->device) - rte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev)); + rte_eal_pci_unmap_device(pci_dev); -@@ -1969,6 +1959,12 @@ virtio_dev_start(struct rte_eth_dev *dev) - dev->data->dev_conf.intr_conf.rxq) { - virtio_intr_disable(dev); + PMD_INIT_LOG(DEBUG, "dev_uninit completed"); +@@ -1538,6 +1528,12 @@ virtio_dev_start(struct rte_eth_dev *dev) + return -ENOTSUP; + } + /* Setup interrupt callback */ + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) -+ rte_intr_callback_register(dev->intr_handle, ++ rte_intr_callback_register(&dev->pci_dev->intr_handle, + virtio_interrupt_handler, + dev); + - if (virtio_intr_enable(dev) < 0) { + if (rte_intr_enable(&dev->pci_dev->intr_handle) < 0) { PMD_DRV_LOG(ERR, "interrupt enable failed"); return -EIO; -@@ -2078,9 +2074,17 @@ virtio_dev_stop(struct rte_eth_dev *dev) +@@ -1645,9 +1641,17 @@ virtio_dev_stop(struct rte_eth_dev *dev) + PMD_INIT_LOG(DEBUG, "stop"); - rte_spinlock_lock(&hw->state_lock); -- if (intr_conf->lsc || intr_conf->rxq) -+ if (intr_conf->lsc || intr_conf->rxq) { - virtio_intr_disable(dev); +- if (dev->data->dev_conf.intr_conf.lsc) ++ if (dev->data->dev_conf.intr_conf.lsc) { + rte_intr_disable(&dev->pci_dev->intr_handle); + /* Reset interrupt callback */ + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { -+ rte_intr_callback_unregister(dev->intr_handle, ++ rte_intr_callback_unregister(&dev->pci_dev->intr_handle, + virtio_interrupt_handler, + dev); + } @@ -76,7 +77,7 @@ + hw->started = 0; memset(&link, 0, sizeof(link)); - rte_eth_linkstatus_set(dev, &link); + virtio_dev_atomic_write_link_status(dev, &link); -- 2.19.1