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 65DD0423E6; Sun, 15 Jan 2023 21:12:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 648AF42D28; Sun, 15 Jan 2023 21:11:46 +0100 (CET) Received: from DM4PR02CU001-vft-obe.outbound.protection.outlook.com (mail-centralusazon11012011.outbound.protection.outlook.com [52.101.63.11]) by mails.dpdk.org (Postfix) with ESMTP id 2ECCB42DAB; Fri, 13 Jan 2023 14:14:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bklSfeo0AgQscY1MPXejr/8PFLs++dufj3eJNzQUKMN7vKsQYVwBQAcxz22EIEdbCEId1em2dtduuno+6STWaT5V2B3Rr9iilHPCOlEaUD7P0NzhroB7h9rNLai3bmLJWf+/Co0qvSs39nF8Mk3af4bB2MSXrhL6TpB0hmP1uPEqh5jZWsaybzcGJkewJuGiPVpS4cRn8XYyZW1SMWmizSaE8prp6fQ03UpzLm54x23GbTOgBPzooCePPEVj9fk0P0dpChOfnJRoiTixie2QrGA5RR+JZRGgMqrZVL3/+jQxUhQ3GzbMC7mM6LPQYjh85WUPqTFanywTyUzK7UisRA== 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=Anrugz+LILMpqMG/0qN6L9OgCS3iYT82/QEiYwxduVo=; b=M6Bs6TC7nsHCxZsER+6rzO2M0LY7nuAFTggYopamFdVMaQpw9lczTs13AGq/20RpDOawqjq5lISdAxO+THuJADD/GP99//2fjK1NjIglkS3cqmB6jMsvAl9NXT9k3cZEVW3kq1dPf53L9q3PaUlUfEPb2Rhg9RfxS05yQqvxmygcj49BoVG08GvgI/pgeTLSwbqGRTiIEdSsTxQWwTRG73UcJH+iCn44wZJggjw07u8cCo8vijam/bkqOGaFdHWTft7llm5vqMy8JtlxzV22Is10qzKlvYvO1jdZd6yCjZFsfDsOZQ06/koWq6RK8rqYTOBSgsJMBqkjWly3/Z9uYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Anrugz+LILMpqMG/0qN6L9OgCS3iYT82/QEiYwxduVo=; b=F5s//GsBNhfbtbu2etREJvlB9bA2KjuaC/DWUPnBe/Wq1ZETrYJzKKqOPOg7GAJ7/rAcBnF8iLiV4eTDY8FgsFYiT/u8go7Auz/Muu1JpMena3pbkYxUtGc/1AQgnsPRNdb6yzBGmOWYLaLuZJcmpkpbgO+qPZnYLQ4gLLwfYAo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; Received: from DM6PR05MB5577.namprd05.prod.outlook.com (2603:10b6:5:c::16) by CY4PR05MB3431.namprd05.prod.outlook.com (2603:10b6:910:59::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 13:14:45 +0000 Received: from DM6PR05MB5577.namprd05.prod.outlook.com ([fe80::4cbc:cca6:3a16:5023]) by DM6PR05MB5577.namprd05.prod.outlook.com ([fe80::4cbc:cca6:3a16:5023%4]) with mapi id 15.20.5986.018; Fri, 13 Jan 2023 13:14:45 +0000 From: Vipin P R To: anatoly.burakov@intel.com Cc: dev@dpdk.org, Vipin P R , stable@dpdk.org Subject: [PATCH 1/2] Memory Allocation: Fixes ignore_msk during find_next_n() in fb_array library Date: Fri, 13 Jan 2023 13:14:28 +0000 Message-Id: <1673615669-21011-2-git-send-email-vipinp@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1673615669-21011-1-git-send-email-vipinp@vmware.com> References: <1673615669-21011-1-git-send-email-vipinp@vmware.com> Content-Type: text/plain X-ClientProxiedBy: BY5PR13CA0009.namprd13.prod.outlook.com (2603:10b6:a03:180::22) To DM6PR05MB5577.namprd05.prod.outlook.com (2603:10b6:5:c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR05MB5577:EE_|CY4PR05MB3431:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ec32241-1827-4f63-1488-08daf56823e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ySLKtTtHiJkUVXrw0Mut7UAwxWTEmtvKwdtr+ByLwQKiXZQ7nXZiO95E5JPwo4+NODRp7d49dd3LdG6fuO7W8G3RE7R/pk7HF0U6NguPsXpHKKCkalZXw9FmUDnKtrRDQH4KB43f46N1KyR+F8MQdvRYZ05/9a9647dPtGP7PdeO6tUm/NNCn5fSEJ2OZjT27+ri98kK73hnCW5ItkrhLKa9A2FtBjProNwM3Ryf0BTP3AS/V7X8qf2zxQgKZXOV7nDwnmEzX3kSzEyaNW9qK0/FftJxSZcxQ76vDiGuXFyjlYSlYq5k+03EWwgXvv6QvUWgCjGELQI3mgDVLNUbYZFIDHYbGMGfLEesoRvtp2oddKOm3WmU6EVATnPMg87NL5i/PUWKL2usONGja4FdfiTqKsfqMgwvKZi+Vrwiue/UlwF4tDWjidMnbg1p13kUTKfE+9rWFAx76bx08qlTqF6Ll4ku9fQvrUchtaon4TEglJSNLsZCDyKX2X2Bp0el/hpuqkJuYA83cieSXWIiUpW5K6zJS4+gpZI4KR4BnBEL/y0jDbRKbPQrEErObNOdBi83rj9EUTouGS+24BEa6/GyEQGWnO8I8pev2p04xHTTZIYCJc7Ajd11xw5EI3jTaUo4Fn1oP8Ac285pfPv8gkKwutpsiKLvVqna1SRuZ18D5hSP3cPL7tz4nnB1IGf/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR05MB5577.namprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(346002)(366004)(376002)(39860400002)(451199015)(6506007)(36756003)(6666004)(2906002)(5660300002)(83380400001)(4326008)(6916009)(8936002)(8676002)(38350700002)(6512007)(38100700002)(478600001)(41300700001)(6486002)(26005)(66946007)(52116002)(186003)(66476007)(66556008)(2616005)(86362001)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?o0UX8I4y16cwybkujuCOqc8YNPdCatg5r09glLTPLsfK76gaiBkCP4H/1Z4P?= =?us-ascii?Q?0LUls6IfPvz0CwfsPKbRYpszmepHYfUzURFYxFxYvIF1Wb61Jhd2R241WcBZ?= =?us-ascii?Q?6rdFl9jibnDfFFTXTya+P0V8qsqW2MTXNr+Dkj8dYaAr3H4LRKKFS5JDXJKq?= =?us-ascii?Q?goqwAB7cdBkAJtxhvD3TdGNEVsbLERAcuTnqnOh8HbjFvaS96jE6X5o8MN5S?= =?us-ascii?Q?MkIiKD+AF9CZSxhqG9AuqQL8wl680D20eBEbTiTYiRPJk2sfWoflJorhn6h5?= =?us-ascii?Q?aRrrD3SrMGdEE3tH6+C7XT3Sef1B9oE5axPvzpz9UaGU5BwYFsyKMGycwyBo?= =?us-ascii?Q?/hS7gqtLK4hcUW8dg01Wul4K9Wiy6MT8gNASihzRPCqj2leGhojZbRwkoW1w?= =?us-ascii?Q?QvDrX3clKXBbja8BBxMZAaiZJCVVM8m5jGFJ+c82tHXcw1Wm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HPu/74nUrUebTAJBu68SfLniH4tvVhqioTuPWcB1pA92i5nWSVfne7X7?= =?us-ascii?Q?p9HO+mUEDyL1Sk050UB9n5h4x3I1+Hdwdssg6kYQoTuIfUIXjEHhEbAenJM2?= =?us-ascii?Q?xACBHZ00kKWMLALTG9mRigUaFRiuQjE+HBYKR+vqcMhFydu2YWUaxmgin48N?= =?us-ascii?Q?Ut0GhlnHoQq3xW6j0b0AW6tB8MlkcK9NbAzGS1EH03V+YcFrvx5kwbqb04mU?= =?us-ascii?Q?ABsF1F6+FPto7F6Y4uZavwIF+D5iWVKVFAXmJj8d?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec32241-1827-4f63-1488-08daf56823e7 X-MS-Exchange-CrossTenant-AuthSource: DM6PR05MB5577.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 13:14:45.5971 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0Gemyul++FFcsEV3z9mA0bMYDzxvg3VF+dcifGiViTsMqMzupcii7IQawQblJY+nNeAyKtp5f54M8HjwcIDCRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR05MB3431 X-Mailman-Approved-At: Sun, 15 Jan 2023 21:11:39 +0100 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 Ignore mask ignores essential bits WHICH could have been contiguous. This commit aims to rectify that 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 --- lib/eal/common/eal_common_fbarray.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c index 90240e8..313681a 100644 --- a/lib/eal/common/eal_common_fbarray.c +++ b/lib/eal/common/eal_common_fbarray.c @@ -235,7 +235,12 @@ find_next_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n, * no runs in the space we've lookahead-scanned * as well, so skip that on next iteration. */ - ignore_msk = ~((1ULL << need) - 1); + if (!lookahead_msk) { + /* There aren't "need" number of contiguous bits anywhere in the mask. + * Ignore these many number of bits from LSB for the next iteration. + */ + ignore_msk = ~((1ULL << need) - 1); + } msk_idx = lookahead_idx - 1; break; } -- 2.7.4