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 3A66EA0543 for ; Wed, 5 Oct 2022 17:41:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35871427EB; Wed, 5 Oct 2022 17:41:57 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2085.outbound.protection.outlook.com [40.107.100.85]) by mails.dpdk.org (Postfix) with ESMTP id 8455140143; Wed, 5 Oct 2022 17:41:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l/mVSXqRDmOnywkabqUAqtdHK/HbASJ01wt3qzC4RZG/Sam2nH02b6sJjeOIjtvLvbrc2fusNcGeMr6/9S7F2M7zIVpEhtC/txKEhoAO8wS5SRcKtSzXODOfLSVxGjOwdf57FS2FoT/8rChMGqlMN242ZVyJHxyZR5eOsYhx8YCEjG9faEqJT5zTKJyf+WfAdPm8vZZkj03qNbbQ+Xv8UD15RB17sJXN2jofSbzMuBqpuc343HFF/jSJgNSRB84OBuz6BtNCKjJPB0ZL1JsokCFyt7nUfQ1j7cOlrqxJN0Ied3xYEbkgbUUcU7JFzESr+VeRzFPbldYse/VmmDCxQA== 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=UHm2fNotwgt33W0Ra/N/VliJ0Gr3inoiZZlD6YiA9hI=; b=nPJdxnF7Zdg8SG6SX1g0nxfoX2FcfJiCLIql0HzoOUHCgqDv4J1rh9SjtZA+KZS2/BLk1H0mh+ctAX7RaLWn1CoOKt2w7txa3xPxluna4yFiW/DBmDDYMvahBTw6bRmAa7xH07XaI+UmefAm9oWeJB7/wc6qbo16rqxUTRVXeEwUHuKaZSMLzwYOxn5m9v/UPuH9fy8pUhNwTKlFNgDQXgNW79Q8DdKnmwGC3q2o1nR2hgIF2Np3XfG1USG29dO3yrUPw2OfRs3IZ/oYLNyMbgeHsT+9vulob0EWrNvEYEGfhc2h37sM33gOvLme5zPsAe2sCnW0YXkKqmVgPwmUBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UHm2fNotwgt33W0Ra/N/VliJ0Gr3inoiZZlD6YiA9hI=; b=wLCYHyyJKMXMU5m42vsGmMy86H3EpYxZ+MoPSMjb63zWYbxsbZsZxcqKrRUqwa0CIqK9ky+P960b9g38nGi34TZdygpXeNRtsTzxA5JWvMjvu83adcoVHaw5K1uNgb3UaGqJu7jbBYL0jYNloA+804FzRHSPOy5nR1MrtHzsJ1I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by BY5PR12MB4195.namprd12.prod.outlook.com (2603:10b6:a03:200::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Wed, 5 Oct 2022 15:41:53 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f%7]) with mapi id 15.20.5676.032; Wed, 5 Oct 2022 15:41:53 +0000 Message-ID: <8a472501-4228-7d6d-ad2b-3fafd9a4f570@amd.com> Date: Wed, 5 Oct 2022 16:41:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] net/nfp: fix memory leak for receive function Content-Language: en-US To: =?UTF-8?Q?Niklas_S=c3=b6derlund?= , dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , louis.peens@corigine.com, stable@dpdk.org, Chaoyong He References: <20220922130944.698880-1-niklas.soderlund@corigine.com> From: Ferruh Yigit In-Reply-To: <20220922130944.698880-1-niklas.soderlund@corigine.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0154.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c7::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BY5PR12MB4195:EE_ X-MS-Office365-Filtering-Correlation-Id: fc79988c-f985-4e57-4add-08daa6e82023 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HpgFHtHVmj7Ln8eSpw4U8BeSsHyLGrydG++US9Dw1ofV8ji38MPioHWYtD2y9sK3J1blFoL9PQQE9Jd52YJMSSQoFpqgLYFti9svYBN/u9EC5/x8EAeteD6iuFkdVLbM13B0hnKHvkp2ZKVyjAhZlOhEgPX/VpW/4ns8WbJsYTGM7g3Fe/VbtRZ1q9frAgB9PtXQZZ8oVCOac+3Li9LappF7t8ha8SJ4NsjYrCEb6in4ohAX+WZvFEVGkFqCgCn22/vGXhHj1X9DR9HS40ksMDhL+e+mcKnV7q6cFYA6KNNrftM4SFI3t+8/hto12XD3+aQ/OkfsudWtQlXyv6oU9GXe3O01s2kDRXoOunj5FkGiDQx1k3i8K29JoQAYbTOxRXwRdzwxHF4Sh6qGEoNpqUNjMx2+5dNxyGePA7zBo+CeiDoxxyxKp3Wbd0735fvM/JWFud7fsTUaVVKn9c77RwxCVj2CxxNZppJZGAVpCm49m/BUwgUJaN1Im69aB8v7Usx5MLhyp4ulruhIuaTtNjGnG7jmtyV270eoTGPTHLnGK7o7ffnTUG5qZYfcHom6AAnQ5j8B6cHgfLTs3JiYhOtHCm6GwTWOGL1BWLuxPCY9bdtLp4lpCuQA248y1JtAEHxg44yUImxBG3YIbxkH9cS6dyd53+bvHS5dAy8Zn8oM5fr+B2nnKL6AHgOtaUaVepiCb3zWeUPc0w4ORiYN4C01vYFrtFlFSNB+QVegDZ8DIjaLrMzo8+MUSpsyzt7ovCk7ulskUwGG6lqBejdOXiyiLpmTJkNAWZU3UNWkme4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(366004)(346002)(376002)(136003)(451199015)(6506007)(316002)(6666004)(31686004)(66946007)(66476007)(36756003)(66556008)(8676002)(54906003)(4326008)(6486002)(31696002)(86362001)(26005)(2616005)(478600001)(186003)(38100700002)(6512007)(41300700001)(2906002)(53546011)(44832011)(8936002)(5660300002)(4744005)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZWhsVXVYbXJWZjZDakNJNkloRjcrSHhZMy9WNWVIQjJjQ0tqSDYwOGJTcDN2?= =?utf-8?B?RGNFOTFaZXA1eEFpazl4VGd6NjByMVE5bVdwYXAvQTFEYU1lMkFLZkJETThX?= =?utf-8?B?c3l3L3NZZ1VTRHBjaFdUSGlYdEU3b0QxS21PUDVSdk9TN0hFTHhEYTlVYXcz?= =?utf-8?B?QzFOZ3NlOVB1bkxvVHl2NlpMU05lQy9Qa25lZGdjNGJuZDBISDFz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nMyK1NqT2dG?= =?utf-8?B?THNVNGJZSjVqQlJVdjUreVRFU1NtTHJDdXdadVZVN2hTL3ExNHFteGQ4dFRo?= =?utf-8?Q?8MrfB/QIt+1qdl6YMlUzOT2WY?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc79988c-f985-4e57-4add-08daa6e82023 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 15:41:53.1126 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dNDOS7gCtGIjhov5PE51KEQRKDilAz29byQKlvxfXj5qM1uZm4L/R6NTNfWD3Eyw X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4195 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 9/22/2022 2:09 PM, Niklas Söderlund wrote: > From: Long Wu > > nfp_net_recv_pkts() should not return a value that less than 0 and the > inappropriate return value in receive loop also causes the memory leak. > Modify code to avoid return a value less than 0. Furthermore, When > nfp_net_recv_pkts() break out from the receive loop because of packet > problems, a rte_mbuf will not be freed and it will cause memory leak. > Free the rte_mbuf before break out. > > Fixes: b812daadad0d ("nfp: add Rx and Tx") > Cc: louis.peens@corigine.com > Cc: stable@dpdk.org > > Signed-off-by: Long Wu > Reviewed-by: Chaoyong He > Reviewed-by: Niklas Söderlund > Signed-off-by: Niklas Söderlund Applied to dpdk-next-net/main, thanks.