From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Traynor Subject: Re: [PATCH] pci/vfio: fixup rte_intr_callback_unregister() handling Date: Tue, 20 Nov 2018 11:04:16 +0000 Message-ID: <03d3204f-27fc-b5d8-314a-5db1df3ae925@redhat.com> References: <20181024101131.17756-1-dariusz.stojaczyk@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: anatoly.burakov@intel.com, jia.guo@intel.com, stable@dpdk.org To: Darek Stojaczyk , dev@dpdk.org Return-path: In-Reply-To: <20181024101131.17756-1-dariusz.stojaczyk@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/24/2018 11:11 AM, Darek Stojaczyk wrote: > This function is documented to return the number of unregistered > callbacks or negative numbers on error, but pci_vfio checks for > ret != 0 to detect failures. Not anymore. > > Fixes: c115fd000c32 ("vfio: handle hotplug request notifier") > Cc: jia.guo@intel.com > Cc: stable@dpdk.org The Fixes: commit indicates this is not for stable, and the modified function was added in that commit. If there is some equivalent fix for stable, please send a backport for that. > > Signed-off-by: Darek Stojaczyk > --- > drivers/bus/pci/linux/pci_vfio.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c > index b1f0683fe..305cc0601 100644 > --- a/drivers/bus/pci/linux/pci_vfio.c > +++ b/drivers/bus/pci/linux/pci_vfio.c > @@ -341,7 +341,7 @@ pci_vfio_enable_notifier(struct rte_pci_device *dev, int vfio_dev_fd) > ret = rte_intr_callback_unregister(&dev->vfio_req_intr_handle, > pci_vfio_req_handler, > (void *)&dev->device); > - if (ret) > + if (ret < 0) > RTE_LOG(ERR, EAL, > "Fail to unregister req notifier handler.\n"); > goto error; > @@ -373,7 +373,7 @@ pci_vfio_disable_notifier(struct rte_pci_device *dev) > ret = rte_intr_callback_unregister(&dev->vfio_req_intr_handle, > pci_vfio_req_handler, > (void *)&dev->device); > - if (ret) { > + if (ret < 0) { > RTE_LOG(ERR, EAL, > "fail to unregister req notifier handler.\n"); > return -1; >