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 53F662B94; Tue, 20 Nov 2018 12:06:02 +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 A3E142BEA2; Tue, 20 Nov 2018 11:06:01 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BF585D9CB; Tue, 20 Nov 2018 11:06:00 +0000 (UTC) From: Kevin Traynor To: Darek Stojaczyk , dev@dpdk.org Cc: anatoly.burakov@intel.com, jia.guo@intel.com, stable@dpdk.org References: <20181024101131.17756-1-dariusz.stojaczyk@intel.com> <03d3204f-27fc-b5d8-314a-5db1df3ae925@redhat.com> Organization: Red Hat Message-ID: Date: Tue, 20 Nov 2018 11:05:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <03d3204f-27fc-b5d8-314a-5db1df3ae925@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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.39]); Tue, 20 Nov 2018 11:06:01 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] pci/vfio: fixup rte_intr_callback_unregister() handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 11:06:02 -0000 On 11/20/2018 11:04 AM, Kevin Traynor wrote: > 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. > oh, I should have read the rest of the thread before replying. Ignore previous mail, thanks. >> >> 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; >> >