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 F3057A0542 for ; Mon, 29 Aug 2022 12:23:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF95F4069D; 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 604C84003C 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-662-AdEniiAIMlGViSjBDKF-dQ-1; Mon, 29 Aug 2022 06:23:29 -0400 X-MC-Unique: AdEniiAIMlGViSjBDKF-dQ-1 Received: by mail-lj1-f198.google.com with SMTP id f10-20020a2e9e8a000000b00261af150cf0so1781426ljk.13 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=SmSRGyYKnC4tFVwo67vC6kjKC8yFMn+RIpSh3TQiG8ERshA/i36MNg6BlnR4Rbl6re G3/1AqbHV6DWPRsmo5+nLG0PsfK4ABnvWWOkPr48RtEMohBlqdeV4rQplT8PbQaIl43q 1VxdOIBUu6rTM48d7gUriol0cevyLRlcMjy/sqI2BoXIUGE78lnV1dcELRIljL69h4x9 lW4I2f+c/qjgzN6TaU1PFXmcaRv4vEwQpoFoIqP4bQRGlbMCUPpGJ6kCpxNM4F6Tz1CA DulNR+a3t2pZpCo5JJBZc7SLuJYwFCwJguVhZ1DudIxNJiL0P/DG3IUT5FOruHARmR+6 nsvw== X-Gm-Message-State: ACgBeo1KVtX22XbNT+x0dOt2u7t6U6oksc5/eIUCyg5VnIUAPDJ/PdO9 4j/bRh0r3jqfAoWnJpEQFvwzjhuDuHURKeaHCVr9KFnKIcZnTkjVB1qC+ibPtnlOSqeUJcV90iV U4SgABPD1/qQaPFAmvfUopVo= X-Received: by 2002:a2e:84c7:0:b0:265:1210:c31d with SMTP id q7-20020a2e84c7000000b002651210c31dmr1300371ljh.333.1661768608086; 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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