From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1EF9A0C41; Thu, 4 Nov 2021 15:11:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 737C642732; Thu, 4 Nov 2021 15:11:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id EBCFA42731 for ; Thu, 4 Nov 2021 15:11:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636035106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jei5YnFhBvL/ZRgY/sKQmLLwiTYiwAl0R+r47ZN3Ung=; b=UJgIAkvxHyrqZmWJ3nssMWqJvSbqE/m++3LMBZf8u7W6Z7BwYRx0VD6McQb+9Ta/DEvhq4 GkfEk9iWs+2oQVTK8AXyswgCJSou75vaWe7RSRF5C4YtIYg6UmyS18W7JqaNANn+Eqw3Zi +kpcQ0kOkh9W38uqEGoJTMfcfesNMJE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-JoHwzLPiPwCpbIAtw0lR3Q-1; Thu, 04 Nov 2021 10:11:45 -0400 X-MC-Unique: JoHwzLPiPwCpbIAtw0lR3Q-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5813D8799E0; Thu, 4 Nov 2021 14:11:44 +0000 (UTC) Received: from [10.39.208.16] (unknown [10.39.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5801B5D9DE; Thu, 4 Nov 2021 14:11:30 +0000 (UTC) Message-ID: Date: Thu, 4 Nov 2021 15:11:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 To: David Marchand , dev@dpdk.org Cc: yux.jiang@intel.com, Harman Kalra References: <20211102075259.3392-1-david.marchand@redhat.com> From: Maxime Coquelin In-Reply-To: <20211102075259.3392-1-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: fix device hotplug X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list 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 11/2/21 08:52, David Marchand wrote: > The device event interrupt handler was always freed. > > Bugzilla ID: 845 > Fixes: c2bd9367e18f ("lib: remove direct access to interrupt handle") > > Signed-off-by: David Marchand > --- > lib/eal/linux/eal_dev.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c > index 06820a3666..925cdba553 100644 > --- a/lib/eal/linux/eal_dev.c > +++ b/lib/eal/linux/eal_dev.c > @@ -317,10 +317,12 @@ rte_dev_event_monitor_start(void) > goto exit; > } > > - if (rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_DEV_EVENT)) > + ret = rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_DEV_EVENT); > + if (ret) > goto exit; > > - if (rte_intr_fd_set(intr_handle, -1)) > + ret = rte_intr_fd_set(intr_handle, -1); > + if (ret) > goto exit; > > ret = dev_uev_socket_fd_create(); > @@ -339,7 +341,10 @@ rte_dev_event_monitor_start(void) > monitor_refcount++; > > exit: > - rte_intr_instance_free(intr_handle); > + if (ret) { > + rte_intr_instance_free(intr_handle); > + intr_handle = NULL; > + } > rte_rwlock_write_unlock(&monitor_lock); > return ret; > } > @@ -370,6 +375,7 @@ rte_dev_event_monitor_stop(void) > > close(rte_intr_fd_get(intr_handle)); > rte_intr_instance_free(intr_handle); > + intr_handle = NULL; > > monitor_refcount--; > > Reviewed-by: Maxime Coquelin Thanks, Maxime