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 8E812A0542; Mon, 29 Aug 2022 12:23:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2A664113C; Mon, 29 Aug 2022 12:23:32 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 651C04069D for ; Mon, 29 Aug 2022 12:23:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661768610; 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: in-reply-to:in-reply-to:references:references; bh=l4WjdXHaFBE7jl9DOYtDj8vuYWEzWwnLRlJgpbT/eno=; b=RN5sM6YdOqVtUrYJs5Jh75LWDyu0UqQ8Op/GOWyaXhTlgEvfqTsoSacKMnT0WRv3crMHxM CmvLrSqP2KO2uX2PeJTW2k9MOPBYGNQW27zk3AjP/D6wCoPtYhRWysB+xyfq3uKUzYo4j6 jHjzvpnxWgzDS23AFBZmlNaUSES8Ep4= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-672-eBP5LvkmMMyQrwRHiV_fUw-1; Mon, 29 Aug 2022 06:23:29 -0400 X-MC-Unique: eBP5LvkmMMyQrwRHiV_fUw-1 Received: by mail-lj1-f198.google.com with SMTP id h21-20020a2e9ed5000000b0025d516572f4so1771337ljk.12 for ; Mon, 29 Aug 2022 03:23:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=l4WjdXHaFBE7jl9DOYtDj8vuYWEzWwnLRlJgpbT/eno=; b=fjQ1ozuJDicgf5IEgRc5Iix24WrjB3enL8+SwJpMb9hoCYOh+7IMU/mA4DPv+TXypI Ol5J2/vbwYyVOqMph7/xKEky1rQCWSUrznd6/ev2gXmuqesLdF3mUo301L1a+NgQbpmg xqWjjY7N+BmzDSiVtXLshBruicZUQQ6d1jX5KxJBww04HW3Oe7SuFwTiNfLzHadp4wRW +xFcV92xFDqLS/z7z5OqiUycRdLYw76LbrlkZpvDEUM2J3rU/tn5WQPVvTO8CcMg2fmj yw/m1395m+AqbevrfXXQ2TWOoyoJHl80VxGp1nT7z1gZyrA9Vdj/5CDl9UfCoWPxzXOX R2uQ== X-Gm-Message-State: ACgBeo1ZjqAQRRyTMnUHGuusHSs0eaQZNq4WaA0kxlvOKMnPmOQoP4qs V8YgHX5nTpbartqe4DsnRyidvjAHnoWKLQ/C3svDtPRsx/a9+rzuBNgNORu/qTru8mvwsK8NYx8 KmdpFHPjlaWhFo3RboMA= X-Received: by 2002:a2e:84c7:0:b0:265:1210:c31d with SMTP id q7-20020a2e84c7000000b002651210c31dmr1300376ljh.333.1661768608140; Mon, 29 Aug 2022 03:23:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7asE9oUxk49z5rufffTuYEnNLPY8ULJijB5k6oiXqAFyIrAa4Z0rAfEgUAoa8PeyL1Swuf60W/Pb3OvLTfwRM= X-Received: by 2002:a2e:84c7:0:b0:265:1210:c31d with SMTP id q7-20020a2e84c7000000b002651210c31dmr1300367ljh.333.1661768607839; Mon, 29 Aug 2022 03:23:27 -0700 (PDT) MIME-Version: 1.0 References: <20220324150941.26157-1-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Mon, 29 Aug 2022 12:23:16 +0200 Message-ID: Subject: Re: [PATCH] net/failsafe: fix interrupt handle leak To: Ferruh Yigit Cc: Gaetan Rivet , dpdk stable , Hyong Youb Kim , Harman Kalra , dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 On Fri, Apr 29, 2022 at 3:56 PM Ferruh Yigit wrote: > > On 3/24/2022 3:09 PM, David Marchand wrote: > > A intr_handle is being allocated as a hack to get a (proxy) eventfd from > > the Linux interrupt implementation. > > But this handle is never freed. > > > > Remove this convoluted hack and create an eventfd in Linux case. > > > > Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") > > Cc: stable@dpdk.org > > > > Signed-off-by: David Marchand > > --- > > drivers/net/failsafe/failsafe_ops.c | 32 ++++++++++------------------- > > 1 file changed, 11 insertions(+), 21 deletions(-) > > > > diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c > > index 55e21d635c..2c23d0e70a 100644 > > --- a/drivers/net/failsafe/failsafe_ops.c > > +++ b/drivers/net/failsafe/failsafe_ops.c > > @@ -6,6 +6,9 @@ > > #include > > #include > > #include > > +#ifdef RTE_EXEC_ENV_LINUX > > +#include > > +#endif > > > > #include > > #include > > @@ -387,28 +390,11 @@ fs_rx_queue_setup(struct rte_eth_dev *dev, > > const struct rte_eth_rxconf *rx_conf, > > struct rte_mempool *mb_pool) > > { > > - /* > > - * FIXME: Add a proper interface in rte_eal_interrupts for > > - * allocating eventfd as an interrupt vector. > > - * For the time being, fake as if we are using MSIX interrupts, > > - * this will cause rte_intr_efd_enable to allocate an eventfd for us. > > - */ > > - struct rte_intr_handle *intr_handle; > > struct sub_device *sdev; > > struct rxq *rxq; > > uint8_t i; > > int ret; > > > > - intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE); > > - if (intr_handle == NULL) > > - return -ENOMEM; > > - > > - if (rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_VFIO_MSIX)) > > - return -rte_errno; > > - > > - if (rte_intr_efds_index_set(intr_handle, 0, -1)) > > - return -rte_errno; > > - > > fs_lock(dev, 0); > > if (rx_conf->rx_deferred_start) { > > FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) { > > @@ -442,12 +428,16 @@ fs_rx_queue_setup(struct rte_eth_dev *dev, > > rxq->info.nb_desc = nb_rx_desc; > > rxq->priv = PRIV(dev); > > rxq->sdev = PRIV(dev)->subs; > > - ret = rte_intr_efd_enable(intr_handle, 1); > > - if (ret < 0) { > > +#ifdef RTE_EXEC_ENV_LINUX > > + rxq->event_fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); > > + if (rxq->event_fd < 0) { > > + ERROR("Failed to create an eventfd: %s", strerror(errno)); > > fs_unlock(dev, 0); > > - return ret; > > + return -errno; > > } > > - rxq->event_fd = rte_intr_efds_index_get(intr_handle, 0); > > +#else > > + rxq->event_fd = -1; > > +#endif > > How this impacts the BSD? I don't know if driver used on BSD but > technically it looks supported. > > @Gaetan, any objection to the change? There was no feedback for months, can we get this merged? Thanks. -- David Marchand