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 A8E6342E9C; Mon, 17 Jul 2023 15:19:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 883DE40EE3; Mon, 17 Jul 2023 15:19:58 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 96C7F40698 for ; Mon, 17 Jul 2023 15:19:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689599996; x=1721135996; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=gJ7nzUGt4ZX25MYKg4Ow2cf0rzwE5RMSNq0nL2meEV0=; b=djvPajRwydRVUPzsbFlIDwpFETmCrzCtAbYv1Qfh+0NnioYH+SxodilT ecgJcddnDnVwlECSHaxdHsKRTooLvGD38kpnx6BaU6HieHi+U4I2Osu1h oJ+ZIFJeDQ6wb9NPTIy1Ks//2hLhxJ7aXOrh+6+2V8BcU6erQBo6UKcDi rEv8yPr1pI3Osmb08QgeIudSXB6dM4BJlPrz1AMxVZ1mVk3t9WBit5ufa pBtOl1mcXraSdhWABavKPj1qFTbQyGOSUiGzvWqTz9zAI/XHBOAJUVCT0 4a8YTJoSlphG+sNygWhTGDuN57iEM65rVl+vaVLSVThC39p/z+mA2Nc2g A==; X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="350791300" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="350791300" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 06:19:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="813335397" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="813335397" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jul 2023 06:19:49 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 17 Jul 2023 06:19:48 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 17 Jul 2023 06:19:48 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Mon, 17 Jul 2023 06:19:48 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Mon, 17 Jul 2023 06:19:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KJZmFs9BxBZ/GU3Lu1NmrSHI+UA9ISKrH1pciEqM1MBcweV1VBaccjUUhiPt/hC5q5IXJqwg2FPh4dNLa1Za2B/hXJc/PT0M5ju9vYZIBN4heAekVjaS6eid7NMtl47n4sJOQyMxi6jJX7Z8wwV5UXE20DHPLi6bmwQtH7k+7gf8PBrPUsfy2pSXVQ6pYCzinjDn7lGiIoIBDMY3Q22rEXakkqO/AoNDoBmI+VCHGcBF4r10jnPiRMK+hHO0IIdOuuRKnqm4TwKmzEYj36UTy6GJI5QCt+4mBhJgHxEHUquE0lVlCzm/sq3wibKlzSkaUBCZfLGM8/WgUkxRgbK1+A== 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=ZQ/wQlo313W2/0xJ3yKl2/pzsw496gAhJ3XKyNjexGo=; b=R7ymCfeFyOv8yup+wtWq4RGVvXGkjErxFYZh0mn07NY6I9bPI3s+HUeHeLlkUZfJajP/14dMi9+6LRPFBDT+gZWLUgo905HO71HY7a0ZODAn7HYEToqTVOlRjXiD3n1MPB4FxHZRWiNV3RkJ8RqdTWyYjVVerciwqZtNpnzoypoOghNn69j4KikZYWAbR6QzE76DeJdRsjuZCyV/CmCLB6pJHfZ5EAGJaSoPf0OGRUiORtFyxb8nKPOyE1VnCSQLvJLBzQqHELAuNTt6p1TD2gr49ckjZlD6HJXRpJ/kJjeGF00fmzcEY27zEMUzOea/VEvPQettxR4gy6RkGGW/eQ== 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 CY8PR11MB7732.namprd11.prod.outlook.com (2603:10b6:930:71::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul 2023 13:19:46 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::d0ad:26fd:7bc2:4487]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::d0ad:26fd:7bc2:4487%3]) with mapi id 15.20.6588.031; Mon, 17 Jul 2023 13:19:46 +0000 Message-ID: <5815b38f-ea26-6d03-5a46-5f2b8d7f0048@intel.com> Date: Mon, 17 Jul 2023 14:19:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Subject: Re: [PATCH v16 1/6] memarea: introduce memarea library To: Chengwen Feng , , CC: , , , , , References: <20220721044648.6817-1-fengchengwen@huawei.com> <20230710064923.19849-1-fengchengwen@huawei.com> <20230710064923.19849-2-fengchengwen@huawei.com> Content-Language: en-US From: "Burakov, Anatoly" In-Reply-To: <20230710064923.19849-2-fengchengwen@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0089.eurprd04.prod.outlook.com (2603:10a6:10:232::34) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|CY8PR11MB7732:EE_ X-MS-Office365-Filtering-Correlation-Id: 71f3b160-1393-4890-8176-08db86c87d96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H75hsdvfVjesSDGHHn2eYeQ2w4Zffn1A02o7xmkMb4siErc37XBoL96Nx1gTyw+3DDxN8RMDtXRzWj5KDVh1TpvDPyDU7JuZsTNTaN/XFl/Lg8G2b8bq/J06N54OyFGclJM0kQJS4xfnGHFlUQ3mNxegsWDndnhiz4BsYgzemjOHekS7aCFXn5gExviPxZo9++NOiRvX6agOpJFkjGzdqmhdzcCKsYyEbA+TAfI3ta7AH0dT5v6CUfyJNtCFfNlL+T2uT01UHdWYFRhVtpnbh75xCzmsRy/7Z7Rc5pP2sD3PT2jNrOx333XhSoNNyqXWIFLRJXWr/dK6kZOR7m48XDy/eg+8uJb8zJEuENnsZBIXVcBAZYk5KIzWtle4AL1sUGNcpwXpldeRxZk7A8Jy7rcQsj1XzJ4y1eeBy8PKmy5tLOV2qEyAkEvtK7g0jnFwEK7H15rcCnPktmU6S06rWhTXI+WqJImPYJ8nAJyUlqafsfG292wBv/StKc/0iedTzKDXxoPGIjK6V8wFgoipc46baKpF1IsZvoMNgVcLh6XDRiZEtETQfq1NSEcivT964N3ba6Z9RGeQGeF0LpkVY/14sr0RbO0eCMEDi8I85Ur3v9XG+7364QHjOm1/gmqFaSqM9zHtzIGDq+kvkzCr8w== 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)(39860400002)(396003)(366004)(136003)(346002)(376002)(451199021)(478600001)(6666004)(6486002)(6506007)(186003)(53546011)(36756003)(26005)(2616005)(6512007)(316002)(2906002)(41300700001)(4326008)(66946007)(66476007)(5660300002)(8936002)(8676002)(66556008)(38100700002)(82960400001)(86362001)(31696002)(83380400001)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TVNhRUFSdTgzK2tsL0dUR2hlTXh1ejQ0THFmR1ZFSGhtbVp2aXVPM2xxTlNY?= =?utf-8?B?eTMxMjJoVnZhcFdlTzhiU2FXUENIS1l4YWpQWFJuLzV6SHZZRnNCM2JXUjNQ?= =?utf-8?B?MjJyazBNQ1FqYit4dENJSU9UbkNiQjBtTGlveFg1Q2Q5UlVScmhkRzNFcVRT?= =?utf-8?B?aFNCTDEzNTY3NUIvaHN0dUwwZlhXeExlSSswU2JDYTdtV2c0aUZkRDZDY3dG?= =?utf-8?B?QndoWXpGNS9RVmRyYk13RUQzQm9HRnd5aytLSlRPN2RWT0c3K3dpZzltVGk3?= =?ut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2FHLy9icFJ4dVB4VFlPSnZQ?= =?utf-8?B?TUg5OWFCUXA4WlVKU25ieE1tMjFZWnYxZDJKNDd2QXV4L0E4cnJzemFlQlZ0?= =?utf-8?B?VkE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 71f3b160-1393-4890-8176-08db86c87d96 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 13:19:46.4071 (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: TvocQZeKxPy/8g9bo5F0EsmQs/B6ySObO1/agsm1/cvqXeZJe9gwhrmwldVvPnuoHFxgoGz01Ifvi3SAEUw4KGo63qObBiGCluaI3ImHBZY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7732 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 7/10/2023 7:49 AM, Chengwen Feng wrote: > The memarea library is an allocator of variable-size object which based > on a memory region. > > This patch provides rte_memarea_create() and rte_memarea_destroy() API. > > Signed-off-by: Chengwen Feng > Reviewed-by: Dongdong Liu > Acked-by: Morten Brørup > --- Hi, Couple of nitpicks below. > + /** The obj_list is an address ascending ordered linked list: > + * ---------------------- -------------- > + * | object-1 | | object-1 | > + * obj_list -> |~~~~~~~~~~~~~~~~~~~~| data-region |~~~~~~~~~~~~| > + * ---> | tailq | hdr-cookie | | tlr-cookie | > + * | ---------------------- -------------- > + * | > + * | ---------------------- -------------- > + * | | object-2 | | object-2 | > + * ---> |~~~~~~~~~~~~~~~~~~~~| data-region |~~~~~~~~~~~~| > + * ---> | tailq | hdr-cookie | | tlr-cookie | > + * | ---------------------- -------------- > + * ... > + * ... more objects. > + * ... > + * | ---------------------- > + * | | object-guard | > + * ---> |~~~~~~~~~~~~~~~~~~~~| > + * | tailq | hdr-cookie | > + * ---------------------- > + * Note: the last object is the guard object, which has no data-region > + * and no tailer cookie. Trailer* cookie > + > +/** > + * Set cookie. > + * > + * @param status > + * - 0: object is set to be available, but don't set tailer cookie. > + * - 1: object is set to be allocated, but don't set tailer cookie. > + * - 2: object is new split, the header cookie will set to be available, > + * the tailer cookie of the previous object will be set. > + * - 3: object is new split, the header cookie will set to be allocated, > + * the tailer cookie of the previous object will be set. > + * - 4: object is to be merged, it will no longer exist. the header cookie > + * is cleared and the tailer cookie of the previous object is cleared. I feel like it would've been better if all of these constants are defined, so that it wouldn't be '0' but rather STATUS_AVAILABLE (or similar). Otherwise, great bit of rework, so thanks for the effort! Acked-by: Anatoly Burakov -- Thanks, Anatoly