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 B30DEA00C5; Fri, 8 Jul 2022 19:52:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4767B406B4; Fri, 8 Jul 2022 19:52:50 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80048.outbound.protection.outlook.com [40.107.8.48]) by mails.dpdk.org (Postfix) with ESMTP id EF04B4021E for ; Fri, 8 Jul 2022 19:52:48 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=g/MX1uRleh1toz2qBfFT8wzQUTgHi6RgrGhW9BRcuYwyW0B01rlEkqxNbQnaGs9/cwKY5TGE8y1VdT8v9fjCpZzXX//oo0YSpEUGzOPjGHRFLYj0oBCWRNQGkRneloM8b7V1AAvMm2C8ILSfIDUWndqZu5AKpyf4gUZ3vp5OVNFvvaMNcWn/3drmkCLVppbEil+eoMKLPxBNpqYlWViHmDsDbCR2GOfkesMDflDC1L0dVGAnabJK9VjUbi9pAuFyvVgiPqtjEn6S3DvOJLTfC4zseBepRbDetxFfe2mdiCvuyADcXm42CfZ9lIxumnXqyjvACI9WQSNEr5erP7SBHw== ARC-Message-Signature: i=2; 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=p9MvoZJr9QHmn6WAqTBZtAczfMcE1y+R8k38nmbxyk4=; b=acxmnBASWP8db5OlirkeWNu3S6OPVBfgsUZu+oOu6AV1sK9muFaYy/7nfaoRqTzQk1m8o3/qOwShwHY0Nsy+JSeWQ3SUpOiUTfFKAMsEh+ZQk5q82pQFNhQ46m+FgCdIS+WynYj8Yh10UA7WtKcxrU2N0JvmnjOZ+Ft97LGn0+QtKrwa78hvMQQXEJtMp2ZV8m0r58UmZDZNtPzahd/e/GIAcpUkeUp0r4yRrEkFf7nUicmXKBfubg5YZh1mLwEcembDqoNa6hNS8Jjh3bCF9E6v+aNBv4KmnWaX5o1gcwakucpko7tXAjnLdD4MoG2CHZNilYkZ2SZLZf0t49Aqww== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=dpdk.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p9MvoZJr9QHmn6WAqTBZtAczfMcE1y+R8k38nmbxyk4=; b=paAoKKrY4T98kNleqk7guhU63YoAYhTQtn/CEDSXFFTs4ZBdwVSDVEsoZaugoQg5w5zS0DimunioTmN1g2/yx4MtwWAi/Ia5V5BO56W++eW/O+XxkB43X4VeZMseoZwGxUBn9LBoyPMU0l7l0031Xz0euCSr6vJOHSlEqceC3h4= Received: from FR0P281CA0087.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::12) by VI1PR0801MB1919.eurprd08.prod.outlook.com (2603:10a6:800:89::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Fri, 8 Jul 2022 17:52:46 +0000 Received: from VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1e:cafe::5a) by FR0P281CA0087.outlook.office365.com (2603:10a6:d10:1e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Fri, 8 Jul 2022 17:52:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT029.mail.protection.outlook.com (10.152.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Fri, 8 Jul 2022 17:52:45 +0000 Received: ("Tessian outbound e5f49c5d38f9:v122"); Fri, 08 Jul 2022 17:52:44 +0000 X-CR-MTA-TID: 64aa7808 Received: from f3c3a9f73419.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A2DED171-BE18-4966-A851-DBE65D7396E8.1; Fri, 08 Jul 2022 17:52:39 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f3c3a9f73419.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 08 Jul 2022 17:52:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PdmvnNBpb1SuZkwkqB2pZPYp+splN07RjtAcVjNHOM2Vag4CU1J+ZlA1kBMVA30ghRmEy9vbliFaTCzJfW48sQeXQTiWt/acYiSMH2h9Pg9qTnt2X+BO9q5qd3krDhgz2KXQoR+oTfeRL+cZ7iAfOQbIHpq/kzDnkYf9hWSh+L5rlTNYoK1B1hWZcg6L2JeKHBgBeoUlGvPlqSM+EkvRDtfadtrbHLBXKKcaK8mbbWVXsSv49VnRTBGMyg/M3TlzXCQb34BooQzrG1PC0hYYdDTR4AHcjFF7OlxPXogshaKNudEJFiF7aqBdZKygaMWRJyTs4Eg8m4hRusEa31W/Fw== 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=p9MvoZJr9QHmn6WAqTBZtAczfMcE1y+R8k38nmbxyk4=; b=C6aBlw5Zx13htVOp6Zj7zoxOC//LDI21EBMIf94tBnv9ypFpCjRpAh3jqrGNXAGJvHR/ZIZTL+4VqSxYVVAlja1pnldDts7Ns7Pm6FfTzvBLYTalQeZ2Ipq2FHu89H4bLl7656njTIcuPhSvSDz1iOybdEHUr/C5Wb3yXIB24qIj8GC91BbZUCAVcwYO32tXU2JQb5XOzebYor0x/gyVtMe8ZTqczosTFQTV+40ytzGhBk+xFi/E89ECH7JBkvtnYxh6uax8dgGiURopUjxdrFOUviA9yUqzbf0HujAN+7mzDbaaMyEPbrxUYoiC9wi1FCVFvG2IZp45x2+QGLwT8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p9MvoZJr9QHmn6WAqTBZtAczfMcE1y+R8k38nmbxyk4=; b=paAoKKrY4T98kNleqk7guhU63YoAYhTQtn/CEDSXFFTs4ZBdwVSDVEsoZaugoQg5w5zS0DimunioTmN1g2/yx4MtwWAi/Ia5V5BO56W++eW/O+XxkB43X4VeZMseoZwGxUBn9LBoyPMU0l7l0031Xz0euCSr6vJOHSlEqceC3h4= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by AM5PR0802MB2562.eurprd08.prod.outlook.com (2603:10a6:203:a1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Fri, 8 Jul 2022 17:52:38 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::1c7f:6a8d:b518:f972]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::1c7f:6a8d:b518:f972%3]) with mapi id 15.20.5417.016; Fri, 8 Jul 2022 17:52:38 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger , venkatesh bs CC: "dev@dpdk.org" , nd , nd Subject: RE: clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag Thread-Topic: clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag Thread-Index: AQHYkOrtJElVDLLrsEKML7JVlfByta1xWVoAgAAdWQCAA0xmEA== Date: Fri, 8 Jul 2022 17:52:38 +0000 Message-ID: References: <20220706082256.562c1b69@hermes.local> In-Reply-To: <20220706082256.562c1b69@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 52E46931C10CF34DA9686AD4A7FE953B.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: b2fd51e9-668c-4c90-7028-08da610aaa18 x-ms-traffictypediagnostic: AM5PR0802MB2562:EE_|VE1EUR03FT029:EE_|VI1PR0801MB1919:EE_ x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: By0OnftiGNbnT6MY1Ojl+DVWQXCVqOFArWcQbjA179Hc0W8ZHg9jGMFTm0Z1/lKO+P9or1Gs+/yTtJwNfbQFsH14b9O5jNPT3MHXTfXMsywlkWCzEruglTso7POjrWy0gr/4W5i3ic/JJ3VN4lY9U8BzJ2qipyVOrpiZIfDXvHeFjMsNvDVpfpSiWOOKK504JXJZyeiVy7yq8gMpK9G81zVz7400st4Wm5A1CZ+CKO1bQsIIfhAAFT3FWPncdLsDt5sSNkp8TzefJlRa8vvbHpAmb5HPi1lKnLgz9Q6BGjlWf0R0cZdnj467gOO5j3magcpeGdlIITfhe21Gx/xjKNuw4paqi0V+oet14o989vMF47jhICAUkROmTN/eUAIxsvID5WRixma4/3UtGIyMm2alzIaakHlnk6y1uViNPxXkqnDovRomz2gPwJdhPsJBhVXZ3MHnT/SL0Ennuh85teCRgNBRxTtzOotyz/Qhlg89BLdM0+36EQr27Phdc6flDDs3kIioeSzOl7PYvw6/dpwB8p8igSBMaSP4vQdp5QZy32iUd/CRUooMAyeec1iiiMWda3rUB6t2vBT4lNtUUIfgLVTQ0+qJmumcNWO3yq3R3Ihh7DYE5j5QSfWfpFJeIlqmbU4Q4avqPGnjiCjLV0gkQwqaMGC+H48hzFWJcTBfW1J/4ZYR2oicX6jGfFC/6Og8uI/AVmk8xbrEfLaFQlpWrAkxl4kIKQSJSa+WuSr6EYHsqihjh/T7hNySlTBvMGXC/ZZxcnqEVy20kEWewqUzVj5b1D3Plb3M23tfzG4cVu7C2hou4NY0vrVbeQkw4ayTts+Jl5JdQMjw18NbuBzScb2uXd0BsnwIABvv/WA= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(366004)(39860400002)(136003)(396003)(83380400001)(38070700005)(186003)(2906002)(66476007)(5660300002)(55016003)(52536014)(8936002)(41300700001)(33656002)(4326008)(66946007)(8676002)(66446008)(6506007)(66556008)(7696005)(9686003)(76116006)(38100700002)(54906003)(316002)(110136005)(71200400001)(64756008)(26005)(122000001)(478600001)(86362001)(43860200002); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2562 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 824da2ce-0d33-4560-a390-08da610aa584 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mWlfSOpRxHURGttA2YRlv9+nQws+s+QGE/ZPodjHHoJqGavxtQEEvOUmfXb2uVf57/RNrezygS4crS7nE1aSjOvcBYvGRt2a6kGSF4IXDb8DlPTB1acaNPK1n5AglMPOInVegFVH2WzE9HbTz2vSTjwQ+boI4a8IUOqslbUZ3ox2fE20Cj4UfhdPSWt81LG3cvXetWGHkAPlCraslM3031bw+bLxs+/A1hFoboRVsJmQDO3IEPaB7YgKze66JeIXcSAhEWFi4eH2BehBjmZvcQQE123kBf/aQynhSP2Re0drrgt+pBd4xbQAV0ffjl9mj7++16KceQCesMqGHHtzaniC8ubThxAD+EDcH/M+58LJI4vDaBAF/9qMlMD7u5dpnY0xpmP5Eg7iQW8NSJjgpjCBE65veXKzQluZdKuzjtdCkDrzA/ot/A+LPUohCpESsn5AWq+rNnyAXOFdm+wDhnJEX726pO8qblag3XaHMQcXe20APvLmjlwEyDLyEix5jfubZFRj83TV6vzhanpPlrk2v5G6so/PQ8qMFUtmguOt2prOw6AiAL39aENKu6ibDeLDBKhVeB72tWFPewJP3EW/jOYKIHW99A/nKXUfiSBeQYu/BLF0mKSJ11Kt4ogYIHFqScx485sY3W4bOVPC/p8iCWi/sPZv06jkNbWbQUbxRIWQtB1NvrTrcZNYOCrXUorCfhr9r59cQqnRF4R1V//pNJUhWzsAta3FnHKRYaxCkDhFTTWo4EHWRuwswOij8SLdkG40Np5DDdNEA53JBReqeCyKD6rEu9FLaOypgB6X1257ba57iqwx5ItnnBhL3Zd/5wPzY56k8eZMNTeoCshwsG1418wdtSosrRyLrZs= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(376002)(136003)(346002)(36840700001)(40470700004)(46966006)(54906003)(40460700003)(47076005)(55016003)(40480700001)(36860700001)(2906002)(33656002)(81166007)(336012)(82310400005)(41300700001)(186003)(83380400001)(8936002)(4326008)(52536014)(5660300002)(8676002)(70586007)(70206006)(316002)(26005)(82740400003)(6506007)(356005)(7696005)(9686003)(86362001)(110136005)(478600001)(43860200002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2022 17:52:45.6548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2fd51e9-668c-4c90-7028-08da610aaa18 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1919 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 Wed, 6 Jul 2022 19:07:54 +0530 > venkatesh bs wrote: >=20 > > Hi All, > > > > In multithreaded/Multicore environment can we use > > RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF > > independently, This flag is about reader-writer concurrency (not writer-writer concurrency= ). Reader-writer concurrency will use lock-free algorithm allowing for the = data plane to scale well. > > or this flag should always be used with > > RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD. If you have multiple writers, you need to enable this flag. This is unrelat= ed to RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF. > > > > We are trying to create and access the hash table with > > RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF > > only. > > We are getting crashes in multi core environments , we debugged > > nothing wrong in the application , everything looks good. If the crash is happening while adding/deleting keys and there are multiple= writers, enabling RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD might solve the pr= oblem. > > > > We call rte_hash_del_key() first and from the returned position we are > > calling rte_hash_free_key_with_position(). > > > > Please let me know if we missed something. > > > > Thanks, > > Venkatesh. >=20 > Repeating same question doesn't get answer faster. >=20 > Read the code, it is fairly straightforward. >=20 > The multi-writer add means that writers take a lock. > If doing lock free support then: > 1. It is up to your application to use a single writer and/or > wrap writer calls in a lock. >=20 > 2. You need to use RCU mechanism to guarantee that no reader > will access a deleted entry. Something like: >=20 > rte_hash_del_key() > synchronize_rcu() > rte_hash_free_key_with_position() >=20 > You can use either the DPDK RCU library or the userspace RCU library= . > Read that documentation, RCU is non-trivial change. RCU is integrated in the hash library. You could use that as well. Look at = ' rte_hash_rcu_qsbr_add' API for more details. >=20