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 4A86142B24; Tue, 16 May 2023 16:25:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F12741151; Tue, 16 May 2023 16:25:29 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 57CD040697; Tue, 16 May 2023 16:25:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684247125; x=1715783125; h=message-id:date:subject:from:to:cc:references: in-reply-to:content-transfer-encoding:mime-version; bh=RipuG6LUYsUghRGv/TWWNlzkVGFMDSmPryvmxP8aST4=; b=IgSdfUGQBSedgTz+XryHLhFqQxFU3Lq/vH6+R6/Q6btbvxKuYxbzOyJV hkucxx+GvnSGGYZmJF7U22jYIxD598iT2lZWAG30gF9ozPeUUNvhR9ZMO 4w6Z8zy6NTN8hGjflG09+BxEjAAZYfXKoJiHwdg0DRYjUFcL7r20s1O2x asPkP+Vl0bZ7TbF6wjhr0uPZswUF0V7I9qVFgMLmbZISzTCBCmAe/lLaa 6t/stf7bUpIZf6BVxF6GOjsIMmY+1+EB6yth7oE4zxN31SHgdGbZYI1TK 38GKVDynSKh18tXM2JnHRVd4LUxA5cJAD4XGY3JlOMxvEJvfOSi0MeoJY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="437833582" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="437833582" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 07:25:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="766382980" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="766382980" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP; 16 May 2023 07:25:24 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 16 May 2023 07:25:24 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 16 May 2023 07:25:23 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Tue, 16 May 2023 07:25:23 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Tue, 16 May 2023 07:25:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/XxWmQ4+tNdhegvYrjndhV7grapmBiANz6KR6QWmd7xkElM9JJQQV6F5xXBUzYvluAFzX79S2ZDMEbb9ycq0m6FOL526Tg2dRXCqb/9UVb2B/M+uWQkgU19/IU1VfdHH4Wccs2cjDWk4f5jpEctGe5Q+lAkjXGGUrzSc1CeTsCTTaIPd58XrU4jRRxdC/pkJgZOtOSVLjSuLe90HS+N/rK8UeLUP7rSVRPDzfigY3PYahiFY7t4YasalcvEXMLGhYpFPVwTw8LS4yRj9xjGOQqHoKPmR/seyrkRY3CP3TYlrUPb2RrM5wNfOj+jJrDuBsmPGcboAl9yZXuzf658Kw== 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=6Qv6DmEYTWJI919mLPZpredD/09VVj/nCj8yEFX/CFU=; b=HFLheWX0cqk0ewxGZp3XFJ5Bf1nvnXnf+kcNUtD8RHFta5oeT0cP75YwPb/rgQ2ZmVqOGjlKs5Ma4TDDtDUfsbBR1Cb6HNvIFxBrJZN55bYNjhU4A83DMvhaNssum9G5ISmdKLbzaZ9CHRnN9pstRZmo299A7xInaO8hcYiRzkr4t0ltsuG9cePVypH4OJ5YWcAxWos/667a5Y9E8w5qfn5YyIrrN/RYXHKrOYgYDHN9DsD7PxZD/02+6ko7Zy3OLdr5zOy8M/Vu/kk2fJxhxx+eYJOLqykSx0wndczysN6kJbKQn3VqzUmLsXbp2V5kWQK5eBMj/TzMzzFM8toPMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by SN7PR11MB7420.namprd11.prod.outlook.com (2603:10b6:806:328::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 14:25:21 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::49c0:aa4c:e5b4:e718]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::49c0:aa4c:e5b4:e718%5]) with mapi id 15.20.6387.033; Tue, 16 May 2023 14:25:21 +0000 Message-ID: <70200141-28a5-0368-6da9-6ba8368f6771@intel.com> Date: Tue, 16 May 2023 15:25:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH] Memory Allocation: Adding a new UT for fb_array Content-Language: en-US From: "Burakov, Anatoly" To: Vipin P R CC: , References: <1673615567-20873-1-git-send-email-vipinp@vmware.com> <1673615567-20873-2-git-send-email-vipinp@vmware.com> <73232584-b595-93dd-01d2-778a2b8ea31d@intel.com> In-Reply-To: <73232584-b595-93dd-01d2-778a2b8ea31d@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB7PR03CA0086.eurprd03.prod.outlook.com (2603:10a6:10:72::27) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|SN7PR11MB7420:EE_ X-MS-Office365-Filtering-Correlation-Id: 2dcef0e3-b178-450f-b3db-08db56196162 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZGUnXPynvD0Tx95m7mfD2fMLy0QSWjgjBH/ns7nQQi23gnPd7Xyztimr220Q3ppzZ4B2F9GBwazDVg6JB+Z6sOo+2VN0DdVIbDxeofLJBlTxK+hFwK1iSjbKWeZGCsEnXxx7Bi0hiPI3BbwTAYgOjV2PwxD9KqMLTtDFVt5d3WyWyfrMvNunoJI8/+fOe6Rw68wE9h6NZNWi8Yq/z3Jc3cdq0CksMrIib1xs6E0lppEzISbVwTG51vGTXOnQMl/w1EG70t4Taor+jQtJINVABT96tX88+Wp3PAasrpTGozBIjNXF8PFHC6QwgALhZW1ohYQMOncQIXMCiplt4HF6znKqm7wzTZTC3W810KjSCWTYGNfmHhfkYeHXK8hsVsAROjDS30kxCKeobW05PlGrGqxH0CqD03Z6qwQA0it3cIj+F5ZPOb8fmF+tSlFkuWBtqPayuKWCo8Dl3jNcU0zR/mkI8AjP2IfoHNY4kIAawApcLRg2umg3j/M13A/Lp8AZTOF59BfpTo24wMzMOa/DbGLQAMsbthutynC8b3MELkueZU7jQxL2BK5AmvO0AQGOq3941729ruV6r9RgDY7CrWVEf0fS5W5RH9kDxXxQENtNNxHTcnRZ93xTih0cB9ielwn3gKOZJpt4WyrH8WDooQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(396003)(346002)(366004)(39860400002)(136003)(451199021)(478600001)(8676002)(8936002)(5660300002)(2906002)(36756003)(86362001)(31696002)(6916009)(4326008)(66476007)(66556008)(66946007)(82960400001)(316002)(38100700002)(6486002)(41300700001)(26005)(6506007)(6512007)(186003)(53546011)(31686004)(2616005)(83380400001)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cmtOU1RtRkJMNVNrdXZ2SHh6UUpPb3l0d1NRaHlUYmtwUExQMWlNazcvNTBG?= =?utf-8?B?MzVLNzJaUHdmYjltTVhlTlhuQk9MTy9DUWFmaEVWOG5kclpmckNmZXZBNmR4?= =?utf-8?B?dy8rbVN6YjZBcXRKVUlQZVJZYitFTGticjVMOVJCMFJSTmlCa2RjbVkxUkZo?= =?utf-8?B?QXdHM3NXRHNFODVyM0FuNUhJSDBGZ01UTEplU2pDSXRPdlkwcWprN3NQQnFV?= =?utf-8?B?QSsxbHhJUE1ocUxDV09SR2NnTlVPbDVhdWNXQys3ZHZqeUpBOXZJU0F0Z2p1?= =?utf-8?B?amtUd25zSTdLU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SMytvT2ZKcWgzWDlH?= =?utf-8?B?MXA4M2VlZ0FaRk5wcnpLRVpZbU91Z2hNbkhjMmpDOTZ5Z3hkOGRqU1I4TjFE?= =?utf-8?B?WFE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2dcef0e3-b178-450f-b3db-08db56196162 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 14:25:21.3500 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kdkEImbgaEySMSE/jV2aaYAFNPDbkd+dpW0SYY16DiCLj/ie7EYqgZnKkHs7CfSHzSCNQ8c2Pv2nWxICmL7MNrus78fgNQJ0wxE/xla+H/Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7420 X-OriginatorOrg: intel.com 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 5/16/2023 2:39 PM, Burakov, Anatoly wrote: > Hi Vipin! > > Thanks for all of the work on this bug, it is highly appreciated. Below > are suggestions for improvements for this patch. > > On 1/13/2023 1:12 PM, Vipin P R wrote: >> add test case coverage to cover the ms_idx jump > > This message could be expanded to be more informative. Suggested rewording: > > test/fbarray: add test case for incorrect lookahead behavior > >> >> Cc: stable@dpdk.org >> >> Signed-off-by: Vipin P R >> Acked-by: Kumara Parameshwaran >> --- >> Depends-on: >> 0001-Memory-Allocation-Fixes-ms_idx-jump-lookahead-during.patch >> Depends-on: >> 0002-Memory-Allocation-Fixes-ms_idx-jump-lookbehind-durin.patch > > This makes no difference for commit, but for future reference: > depends-on should reference link to actual patches, not a patch file name. > >> --- >>   app/test/test_fbarray.c | 49 >> +++++++++++++++++++++++++++++++++++++++++++++++++ >>   1 file changed, 49 insertions(+) >> >> diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c >> index a691bf4..275449c 100644 >> --- a/app/test/test_fbarray.c >> +++ b/app/test/test_fbarray.c >> @@ -11,6 +11,7 @@ >>   #include >>   #include >>   #include >> +#include > > This is presumably added to get access to `struct rte_memseg`, but this > is not needed, because the bug is in the mask behavior, which does not > depend on specific data size. > >>   #include "test.h" >> @@ -402,6 +403,53 @@ static int check_used_one(void) >>       return 0; >>   } >> +/* the following test case verifies that the jump in ms_idx for an >> fb-array is correct. */ >> +static int test_jump(void) I think the test functions would be better named "test_lookahead" and "test_lookbehind" respectively. >> +{ >> +    struct rte_fbarray test_array; >> +    int input[] = {1, 1070, 1, 2, 1, 2, 4, 12, 2, 2, 1, 2, 1}; > > I've managed to reduce this bug down to a more minimal example: > > { 63, 1, 2 } > I've managed to reduce the test down to an even more minimal example, so all of the other code, loops etc. is actually not needed: 1. Allocate fbarray with 256 entries 2. Set idx 64 as used 3. Call rte_fbarray_find_next_n_free() starting with index 1 and length of 64 Returned value should be 65, but without the fix it returns 129. -- Thanks, Anatoly