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 5590AA04FD for ; Tue, 30 Aug 2022 13:02:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C40541132; Tue, 30 Aug 2022 13:02:59 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by mails.dpdk.org (Postfix) with ESMTP id C73DB40F17; Tue, 30 Aug 2022 13:02:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=StrRpapT+dCsSv+4ilRWwrNInBB3MtDldM9fGiSornf9g+vQRdqEwNmgWm5G6Va5W+V6iG7b94Xyi6WlYI38lB3qGIDAvVj1VYTYTEiMA7oiA+xovXS2Caq3mWCHl9aCQYJyvb4SuJ+xzyoe/2GMFEWRI5hF44N6VTIvI16ZpVbnoWRj45pZoQUAKhXKzgrZMFRhi2FS90+N265Hp84XTagpyJIXB9l/YoIyfHbc2BcrUO/mAZOunBC+z5wpbNuRGtDhovZ9O39VgAhEaVoYfWK/fJ3NmtR9VZzzh6iPMY1XGOAoGjF8AAZxW5rrEQBL6u3lIb9JwAoSZ1Ekk78axA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Pb/dai6Uu+Xqr2DtMWTmF22FsfrmEb73DT5dxT24KEI=; b=FGqI3PR8bk5fvT1bLsqJz+BSReZJ/IWJoQQ8Ml4AD15kFylwcCYWIl4glZGQpgcBYpVYoVOsrs3SP6MQhqkAEkF3pbcGgnDt55WqfwVy8ix79NfVp20uunfYTEJT/B1L5s8yJ46bbZbusEo497y477XGPVel8srukWeUcy/sgmvoZ9fHA2IJ9ZJ+VBPWWYwAftIOG3cLjQ+eTbWt1lOnxqsw5ZpEhKJV+ib9H51BKNhNvh2oBL7OzMNyBJ8tTzIANmTImNHc55U71CXYollfHV7kxc49OL5SlgfPuVZng8g2YnkGWLi29AW7AHB3ZGztcnwQU9ilmwTtlw0Yb/YjjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=redhat.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pb/dai6Uu+Xqr2DtMWTmF22FsfrmEb73DT5dxT24KEI=; b=oUXYeb/9p+5QRcwtfsUIKTD0Njc8EPKhWkwLpIVm/r3MVTV509na/YBofMg6bSfnMRnszLI/sS3KkJLXUKwtwHisiRfJlq1YWx4BjkvnO4fDaGEp4dHCUPwtHPHa3lLUV6ua1J5Afe7WiTty9V21O00yhlB1BMv1L4P3/bn+BSM= Received: from SA9PR13CA0038.namprd13.prod.outlook.com (2603:10b6:806:22::13) by DM6PR02MB6426.namprd02.prod.outlook.com (2603:10b6:5:1d6::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Tue, 30 Aug 2022 11:02:52 +0000 Received: from SN1NAM02FT0039.eop-nam02.prod.protection.outlook.com (2603:10b6:806:22:cafe::32) by SA9PR13CA0038.outlook.office365.com (2603:10b6:806:22::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Tue, 30 Aug 2022 11:02:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0039.mail.protection.outlook.com (10.97.5.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Tue, 30 Aug 2022 11:02:52 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 30 Aug 2022 12:02:51 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Tue, 30 Aug 2022 12:02:51 +0100 Envelope-to: david.marchand@redhat.com, grive@u256.net, stable@dpdk.org, hyonkim@cisco.com, hkalra@marvell.com, dev@dpdk.org Received: from [10.71.194.74] (port=51979) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oSz19-00042C-AD; Tue, 30 Aug 2022 12:02:51 +0100 Message-ID: Date: Tue, 30 Aug 2022 12:02:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] net/failsafe: fix interrupt handle leak Content-Language: en-US To: David Marchand CC: Gaetan Rivet , dpdk stable , Hyong Youb Kim , Harman Kalra , dev References: <20220324150941.26157-1-david.marchand@redhat.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6ee6dee-775f-4d05-ac63-08da8a772f60 X-MS-TrafficTypeDiagnostic: DM6PR02MB6426:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sm59tADo51c7xV6U0CO27Og4Kw7CKY5T14HgBpICFxAIMUvifc/BWxuR8dJNn6Rq6zdys++u3FwGGWmYKRmzhjTfkr4GsOulFLkCIYsNYAB4WITTRYrn3UUdmgWIG7ncylj7i1uTCed+G943xHNSrRRS29g0ZmOvBL5XjxH+teitokODwpq1EsVHt75Px5HDZqpVazgnXVe0sYALpK8tSexMFWm9WX0LZXzn56bN0krPhRvsGC9hrZnmzITRE40dCSCGKiov6WRnuEuiFSm60hHwkZhLdx76qnph+oUnyGByyRYULGJo2yKaato4+GeMtmmBNQbx7yRJY3wYwkLdJANX263LarFtUBtstTieh07VCVL1r+l/brhasFo6UuFJCb4zqTniD3vCst749aRs8j4v4SDR/pqKLt5KwQDVEuh88HGMzwerPn3wj1lIb3CWkrsRwg9JM1cPMcERemYiTcu3LVholuuQwLiIEViBBdyVLZuFkh8FEnCD139/U/sNv5ScxlY/Twb7uyG+sK/78+OcCIQ3pjMlsml3a7bhz2maeHZG1A1OSdcGlC6Um/LnO4Rowss2c8oiHqZYdsD/Zc0eiESs1LJFVenFhpa7tjezmunU4v775rQhF5DJzxW5lku1Ku+TrJLGuQAaQaIkiVd9pmS5G+2nj8XuTOCyJwyLcmFcL5ieIyOeQvtVwNWbKQh1BwZ8VufWl49NTFBRNK4S46QJfTF/+6BQNE66SMInecDVtP5a47IlxS7EtKjgzi6nYERSshCdvZ3EhgHSlEaRdFPWQ6tG+tpiwdMBadUTAhuwn4FA7jNQMYhnoSumoyTBjpMLlVtYNBvcdEJBLQ== X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(39860400002)(346002)(396003)(36840700001)(40470700004)(46966006)(36756003)(6916009)(2616005)(186003)(316002)(31686004)(44832011)(83380400001)(2906002)(426003)(336012)(53546011)(26005)(356005)(31696002)(82740400003)(40480700001)(47076005)(4326008)(82310400005)(36860700001)(54906003)(478600001)(5660300002)(8936002)(41300700001)(40460700003)(70206006)(9786002)(70586007)(8676002)(7636003)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2022 11:02:52.4608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6ee6dee-775f-4d05-ac63-08da8a772f60 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0039.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6426 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 8/29/2022 11:23 AM, David Marchand wrote: > > 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. > There is no comment from maintainer, but patch is out for a while, so agree to proceed: Acked-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.