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 53C13A054A for ; Tue, 25 Oct 2022 17:08:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FACC42C3F; Tue, 25 Oct 2022 17:08:12 +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 B282442C3F for ; Tue, 25 Oct 2022 17:08:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666710491; 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=yzXENdYeCPGX0rUs3YMGGjkftVpicHX/zEOTJLyO2Is=; b=YcTEJVZsaINalqb4FQY4MWjCpavhY85QgMdh8lLSi+7gByoofw47WVqfKlcoCzng/WAljd bryQ/+PCGS6tjkXLYE1UeMf9g7rfda0QN8FfbFbkYkDVjNxLZhp2iGL5YnOi77SytmAhTF Z+RGImB/yrZEoFgwRVV5SgypqVQWE0s= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-518-RGm7BzWrN--fj0FQ9vHuVA-1; Tue, 25 Oct 2022 11:08:08 -0400 X-MC-Unique: RGm7BzWrN--fj0FQ9vHuVA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 563153C0F234; Tue, 25 Oct 2022 15:08:08 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5111C4A9254; Tue, 25 Oct 2022 15:08:07 +0000 (UTC) From: Kevin Traynor To: David Marchand Cc: Ferruh Yigit , dpdk stable Subject: patch 'net/failsafe: fix interrupt handle leak' has been queued to stable release 21.11.3 Date: Tue, 25 Oct 2022 16:06:02 +0100 Message-Id: <20221025150734.142189-7-ktraynor@redhat.com> In-Reply-To: <20221025150734.142189-1-ktraynor@redhat.com> References: <20221025150734.142189-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/01/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/f88bb5a08adb2000da8ee18a456a19ce25cb62ad Thanks. Kevin --- >From f88bb5a08adb2000da8ee18a456a19ce25cb62ad Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 24 Mar 2022 16:09:41 +0100 Subject: [PATCH] net/failsafe: fix interrupt handle leak [ upstream commit f809040b413728bc6ccaa23f0fcc57c5ce0f7930 ] 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") Signed-off-by: David Marchand Acked-by: Ferruh Yigit --- 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 @@ -7,4 +7,7 @@ #include #include +#ifdef RTE_EXEC_ENV_LINUX +#include +#endif #include @@ -388,11 +391,4 @@ fs_rx_queue_setup(struct rte_eth_dev *dev, 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; @@ -400,14 +396,4 @@ fs_rx_queue_setup(struct rte_eth_dev *dev, 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) { @@ -443,10 +429,14 @@ fs_rx_queue_setup(struct rte_eth_dev *dev, 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 dev->data->rx_queues[rx_queue_id] = rxq; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { -- 2.37.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-10-25 14:18:58.746730784 +0100 +++ 0007-net-failsafe-fix-interrupt-handle-leak.patch 2022-10-25 14:18:58.359797905 +0100 @@ -1 +1 @@ -From f809040b413728bc6ccaa23f0fcc57c5ce0f7930 Mon Sep 17 00:00:00 2001 +From f88bb5a08adb2000da8ee18a456a19ce25cb62ad Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f809040b413728bc6ccaa23f0fcc57c5ce0f7930 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org