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 72FFDA034F; Tue, 9 Nov 2021 20:12:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F08CD40E03; Tue, 9 Nov 2021 20:12:06 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id A57194068B for ; Tue, 9 Nov 2021 20:12:04 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="318726818" X-IronPort-AV: E=Sophos;i="5.87,221,1631602800"; d="scan'208";a="318726818" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 11:12:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,221,1631602800"; d="scan'208";a="500840417" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga007.fm.intel.com with ESMTP; 09 Nov 2021 11:12:02 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 9 Nov 2021 11:12:02 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 9 Nov 2021 11:12:02 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 9 Nov 2021 11:12:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sykvj7ddzvwNgRMXXdEVGhtYsfNfeRRCTbKp5NXNaG+ywwmNVgZtdVwdP52f1yErlQbf7hQ+D5nmYqcxd7i8GS5OR52YacutR+fhJiQZOHLo7igmMs7qCYjjen8bF7tQ4wF0QDmNbYT641qN5UD/9K7Wq0ojCu2rjLJwzADUYBG/JQ5y5fP8CCVtULRr9PGqr9ByfZPJK9FuhVRbaNs+ARFJtmiR1LIRKCjBmmK/iyALzWJHn4ay8l50IdqmUyLzufewO5AHl/LWbUbOw7/3QsWdGHw34MHLJNFbjONutSCUjfIdiOylvRFORABjLgxxODKrwT5CkdT+TpLG62n8Zg== 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=UmyFAfzVP5J7ISljsC7fOI2fMyMllR7RPPAtztNsmn0=; b=JYMP5xT0S0kk2uFBPiJBsxCmA3f8hNiiS+rmqHuFXzr6ddckOA1EkutS1ZB2JqLDLD/hCuIxnObSp1S4cK+s/1u+O9Q8Zn8crWDDQL2liFRPt9CaTOKjIuHCKYIv2JRgNRfl0cROqHjynAl5M1KWOMrVuqWOyxEQy5glf1WMgR53v7YcGxepKOe98Q01V42WldenB4uDJ0ae1MjglKwenzDwPWiNJMZ5DdA1G11a/fIAFwCiNVcQCBOqwZ5WbsoX/xHNSrpsVz3gqCBD2R08sNThRcrSjLj22FXLcDsm8v8p8Nf08rK2dgwi4aGKZmATF8gow2KXnHgFGD3Jyb+wmw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UmyFAfzVP5J7ISljsC7fOI2fMyMllR7RPPAtztNsmn0=; b=qZPwMXvwLK/olw8Aa9U+I4c4D5LgP6I7OA0JsRTS3GtCufgDOP1oUK5Mo5eA0tNOf5EvGHCxBlkERjQsMZrpwzoqAIkITg2UsBBmWt7TcDuJfq4WtMp2a2oEWSmuA+l7ErHvncWTjR4fpx+PGHyBD4EXSeXPQgs+ultqvUbSYSk= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) by MWHPR1101MB2253.namprd11.prod.outlook.com (2603:10b6:301:52::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Tue, 9 Nov 2021 19:11:59 +0000 Received: from CO1PR11MB5012.namprd11.prod.outlook.com ([fe80::442b:2192:c62b:c6c3]) by CO1PR11MB5012.namprd11.prod.outlook.com ([fe80::442b:2192:c62b:c6c3%9]) with mapi id 15.20.4690.015; Tue, 9 Nov 2021 19:11:59 +0000 To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "thomas@monjalon.net" , Yipeng Wang , Sameh Gobriel , "Bruce Richardson" , nd References: <20211108173935.133310-1-vladimir.medvedkin@intel.com> From: "Medvedkin, Vladimir" Message-ID: <792513c3-fbd8-bbb9-bd81-99e96bd3b985@intel.com> Date: Tue, 9 Nov 2021 20:11:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0479.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::35) To CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) MIME-Version: 1.0 Received: from [192.198.151.52] (192.198.151.52) by LO2P265CA0479.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Tue, 9 Nov 2021 19:11:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba710a6f-0329-49e9-b862-08d9a3b4cdf5 X-MS-TrafficTypeDiagnostic: MWHPR1101MB2253: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X3nmseFkxJjJZ15YKPl77A/o+vuH5Xy/UN0t71EL/YASS+smUutR21ys9RekCgTz0h5tMouVORZ8/5OjK18oXP9676icuWrRGJgTXN7EpBypciEjMB1wFPimEhz3pxAsbmSYPdXsDpVRWsHq+UcnFdzdDpVE+DjgcU3jP9bRcDl6TOYp31bu6fyJ7TUXXQx0u13Dn0I+3F/+O31jfikL/f+Q5MMQCJgwCKV5r+IfN8Fv68pRYG/PeXxKZVd14LrR2WPrBA4am0erku+2kZgC5R8ZgNrFn3jpwqY0LVjPF1m2Pfb+EA1erTN3x8U8nYeB0D5U92RakHSfbNTrOzAuTvWuqHq8fwzrThCmA2TpLGJrDooiYk9M844lAJJzDW7qB6RczNDJPg3bYeqFj3h86ZqEVsy9OWi5bRdxLAGd6Zx37uS3aWLVwLUkF/DiYizfssrRvhr1fGjB+JAyyekRX4WfvyqwbNiepCpKSv3uFR0ejj6NJK/dtHyIpBdR+wEajYucBeQCtYYcEGmjEI9TK557xEymN9EucXiRr1Hogzcjqid9WlKucOjaVQlVRTs9cJCSsa0kYhirMqz4SMX2HrMHEHT3zew+rAKcR1sBDld8utrNWflgIIBIzpFOpqktlkl1C2xmX9HrPF8Ki1GIkgGrEA4W+rTBR9S4IVDxAdkNqLh5umMoYIMOkk2iEbhFM56/8ED6U9hyQdL9D/N+5oT8OXeElf4srMBpTLdQSuHrfhs0fb8duWrQlK4IsYdpBqzelUpjXeCTnQ/V6u4+pQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5012.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(31696002)(956004)(4326008)(8936002)(316002)(66476007)(38100700002)(83380400001)(16576012)(36756003)(53546011)(6706004)(5660300002)(31686004)(66946007)(82960400001)(186003)(54906003)(2906002)(2616005)(26005)(110136005)(8676002)(86362001)(6486002)(66556008)(6666004)(508600001)(3940600001)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SmRmNmtxQ05lVlNwYi81NnNDdUpMcHBTR2Zxd3pNZ0lESjF1NkgxaGZyL1JB?= =?utf-8?B?OXgvVUhQc29SMWowWndtanRyUExqZGoyaXVnMXNVbUJqN0liNTJEa21Ma1Ay?= =?utf-8?B?UFNFUDRoc2VSc2RoSGRhcXd0RE1OYk16cEF2T3pKUkFBWE10aHNPc0Q5dTdS?= =?utf-8?B?ejBsSUo2MFVTQm5mSzA5a2JxeW9GV3hGbFpHNEtuSytTZmdXZysvOEFUOFdk?= =?utf-8?B?RThOUFRZQ2xwelZ0S2tUdWQxazE3TFhNT2xqYkxKbDlmYU5pUnlXdWR1RXVq?= =?utf-8?B?ZzY3YzV2ZzZxbDhwRVB5Tm1RaC9Mb1lsZWdIRnhOMzF1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f-8?B?R2JqY2lHY2w2aHFEK0JIbzcyU3dKcnMvVUErS2F5YlFrNGxSNXZCWElKejdI?= =?utf-8?B?R09UOUhkaXdySkwrUkdBWkFma043NGxGU0taVVRuZEViS25XbWlwZDdoSHBF?= =?utf-8?B?Q1lxODJ6U0pXRm41Zzg3dGxkSWFBPT0=?= X-MS-Exchange-CrossTenant-Network-Message-Id: ba710a6f-0329-49e9-b862-08d9a3b4cdf5 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5012.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 19:11:59.6062 (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: 7nOFxK5yn8IkDvyE9XU/39Le8QVqQOXuRy0UEhYn2cVkf7I+iGkbEGeQyvLYbMc0wEuLvvIS1tHyYfOruzo1jApsL8+233UA9TsaC7zjWSw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2253 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] hash: clarify comments for RTE_HASH_BUCKET_ENTRIES 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 Sender: "dev" Hi Honnappa, On 08/11/2021 23:04, Honnappa Nagarahalli wrote: > > >> >> This patch adds a comment for RTE_HASH_BUCKET_ENTRIES explaining why a >> particular value was chosen. >> >> Signed-off-by: Vladimir Medvedkin >> --- >> lib/hash/rte_cuckoo_hash.h | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index >> 85be49d3bb..84dc55d86e 100644 >> --- a/lib/hash/rte_cuckoo_hash.h >> +++ b/lib/hash/rte_cuckoo_hash.h >> @@ -101,7 +101,13 @@ const rte_hash_cmp_eq_t >> cmp_jump_table[NUM_KEY_CMP_CASES] = { #endif >> >> >> -/** Number of items per bucket. */ >> +/** >> + * Number of items per bucket. >> + * 8 is a tradeoff between performance and memory consumption. >> + * When it is equal to 8, the sizeof(struct rte_hash_bucket) equal to >> + * RTE_CACHE_LINE_SIZE, thus, there are no gaps in memory between the >> +hash >> + * buckets due to their alignment. >> + */ > I think this should consider cache lines which are 128B. How about the following: > "when it is equal to 8, multiple 'struct rte_hash_bucket' can be fit on a single cache line without any gaps in memory between them". > Sounds good, will add it in v2. > On the other hand, I am wondering if 'struct rte_hash_bucket' needs to have __rte_cache_aligned attribute. When the memory is allocated for the buckets we are requesting that it is aligned on the cache line boundary. That should be sufficient. Removing the attribute will help for local variables. Some functions (for ex: rte_hash_cuckoo_move_insert_mw) have 2 local variables of this type and they can be placed on the same cache line if this attribute is removed. > I see, however I can't find inside the rte_hash_cuckoo_move_insert_mw() 'struct rte_hash_bucket' as local variables, there are only pointers: struct rte_hash_bucket *cur_bkt; struct rte_hash_bucket *prev_bkt, *curr_bkt = leaf->bkt; Yipeng, Sameh, Bruce, what do you think about removing __rte_cache_aligned attribute? >> #define RTE_HASH_BUCKET_ENTRIES 8 >> >> #if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES) >> -- >> 2.25.1 > -- Regards, Vladimir