From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B7C571B494 for ; Fri, 23 Nov 2018 11:29:00 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29694C057F2A; Fri, 23 Nov 2018 10:29:00 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6914B413C; Fri, 23 Nov 2018 10:28:56 +0000 (UTC) From: Kevin Traynor To: Luca Boccassi Cc: Brian Russell , Maxime Coquelin , dpdk stable Date: Fri, 23 Nov 2018 10:26:16 +0000 Message-Id: <20181123102713.17309-12-ktraynor@redhat.com> In-Reply-To: <20181123102713.17309-1-ktraynor@redhat.com> References: <20181123102713.17309-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 23 Nov 2018 10:29:00 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio: register/unregister intr handler on start/stop' has been queued to stable release 18.08.1 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: Fri, 23 Nov 2018 10:29:01 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 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/29/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. Kevin Traynor --- >>From 6771b50519140b37d4477eab061aef81a4ea0be0 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 614357da7..3195443a1 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1680,9 +1680,4 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) goto out; - /* Setup interrupt callback */ - if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) - rte_intr_callback_register(eth_dev->intr_handle, - virtio_interrupt_handler, eth_dev); - return 0; @@ -1710,9 +1705,4 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) 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, - virtio_interrupt_handler, - eth_dev); if (eth_dev->device) rte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev)); @@ -1973,4 +1963,10 @@ virtio_dev_start(struct rte_eth_dev *dev) virtio_intr_disable(dev); + /* Setup interrupt callback */ + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) + rte_intr_callback_register(dev->intr_handle, + virtio_interrupt_handler, + dev); + if (virtio_intr_enable(dev) < 0) { PMD_DRV_LOG(ERR, "interrupt enable failed"); @@ -2082,7 +2078,15 @@ virtio_dev_stop(struct rte_eth_dev *dev) rte_spinlock_lock(&hw->state_lock); - if (intr_conf->lsc || intr_conf->rxq) + if (intr_conf->lsc || intr_conf->rxq) { virtio_intr_disable(dev); + /* Reset interrupt callback */ + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { + rte_intr_callback_unregister(dev->intr_handle, + virtio_interrupt_handler, + dev); + } + } + hw->started = 0; memset(&link, 0, sizeof(link)); -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-23 10:22:54.559733834 +0000 +++ 0012-net-virtio-register-unregister-intr-handler-on-start.patch 2018-11-23 10:22:54.000000000 +0000 @@ -1,14 +1,15 @@ -From f9b0d1902caf893493b5e07763ecf817c34fc75c Mon Sep 17 00:00:00 2001 +From 6771b50519140b37d4477eab061aef81a4ea0be0 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,7 +19,7 @@ 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 614357da7..3195443a1 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1680,9 +1680,4 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) @@ -31,8 +32,8 @@ - return 0; -@@ -1707,9 +1702,4 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) - eth_dev->rx_pkt_burst = NULL; +@@ -1710,9 +1705,4 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) + eth_dev->data->mac_addrs = NULL; - /* reset interrupt callback */ - if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) @@ -41,7 +42,7 @@ - eth_dev); if (eth_dev->device) rte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev)); -@@ -1970,4 +1960,10 @@ virtio_dev_start(struct rte_eth_dev *dev) +@@ -1973,4 +1963,10 @@ virtio_dev_start(struct rte_eth_dev *dev) virtio_intr_disable(dev); + /* Setup interrupt callback */ @@ -52,7 +53,7 @@ + if (virtio_intr_enable(dev) < 0) { PMD_DRV_LOG(ERR, "interrupt enable failed"); -@@ -2079,7 +2075,15 @@ virtio_dev_stop(struct rte_eth_dev *dev) +@@ -2082,7 +2078,15 @@ virtio_dev_stop(struct rte_eth_dev *dev) rte_spinlock_lock(&hw->state_lock); - if (intr_conf->lsc || intr_conf->rxq)