From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 769EBA04F2 for ; Thu, 5 Dec 2019 11:55:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 56B2C1BF81; Thu, 5 Dec 2019 11:55:06 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id DBC251BF7D; Thu, 5 Dec 2019 11:55:04 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2019 02:55:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,281,1571727600"; d="scan'208";a="214147293" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 05 Dec 2019 02:55:03 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 5 Dec 2019 02:55:03 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.58) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 5 Dec 2019 02:55:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ct2KnGNgm6mBcmLETqzbgXG7gjruxAr01OTsWnEwIof1q/4AOzVca8PnBoTHTKOi1KKpFPbwz5O6SSAy2uRuKaIJK+D5B0fYE7on4xMcwBrttMBghSerLJpCvnhMpU46NhVVVchrdT4iS0r1KRFWCIAK6uxFNCbN4/Isa/Sr4uBCIQP7j7P8fuCsrZkmlbWsImc6IRwG24R9W9MduAG5tt4wNcCH7ZZunW+hN0tAFOGiZuIHAVRvM9N7lVXCzTYwYKl6VcW2PJeK/l8Yk6gyTz+Q65s8QUjysCiEHE4Mvf4nC9ImLk1zOOjWSzoCtViyNgnZYWPXDGWc4V4ZxdU2Aw== 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-SenderADCheck; bh=qt1viPXjCOSffhn6EVVXrsQu/r6bQ/dRgbPn7AEsIvU=; b=GE17OQgU886k6jhQE3S2D3/mXCvMOJqParTmkntVK7VEjfmarXDLYY6wE8BqImJ2XBbI+glero8Lcg02TZ20fuwRcnF2krZpU11ze2Gq5bWU/n4wKvcU4qxYv6l27mbvcUgp9Vavxrk/J0VgOsufnRoeaBZ6BLuWsOx7+hWIJY1nAXxF1XY9aAMLZG6YBAeFo8w+7y14VaKefoEOMAgg0cU2ascBm71Ur1lThmlLkyY6Nmc/KONyjEp2+fS35GI7E6pYwy+hMlPVFY5bS+FeY0usIy0YEVrdhA+OfrVEJebKnE7Ym8gPU2zvhVKdca0zIoIrBC1WMPLWc5hfAZaebw== 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=qt1viPXjCOSffhn6EVVXrsQu/r6bQ/dRgbPn7AEsIvU=; b=jlerXGDHJLXOOqo/usCUlckElhJ4kVu/gHk9CLoQeQG4fH5lNSHNGY9rznupieecdnXJQDIuq/Q1X3qWlUO4awxeLcdW5tNZa353AQh1CN0J2v8CBoVMqjpfZDWMhCQ1y6t46pViX6lAoOLgJrp0kwvlyJDGUfYhiC9BYVYs0Iw= Received: from MN2PR11MB4447.namprd11.prod.outlook.com (52.135.39.217) by MN2PR11MB3663.namprd11.prod.outlook.com (20.178.253.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.21; Thu, 5 Dec 2019 10:54:59 +0000 Received: from MN2PR11MB4447.namprd11.prod.outlook.com ([fe80::c4e6:5cec:9c4c:e37]) by MN2PR11MB4447.namprd11.prod.outlook.com ([fe80::c4e6:5cec:9c4c:e37%2]) with mapi id 15.20.2495.026; Thu, 5 Dec 2019 10:54:59 +0000 From: "Van Haaren, Harry" To: Tom Barbette , Perugu Hemasai Chandra Prasad , "users@dpdk.org" , "dev@dpdk.org" Thread-Topic: [dpdk-users] [dpdk-dev] Sharing Data structure between logical cores in DPDK- regarding Thread-Index: AQHVq1jTg98jDMtzUkCQMa4FAm3g7qerXX1w Date: Thu, 5 Dec 2019 10:54:59 +0000 Message-ID: References: <1575542540897.56972@kth.se> In-Reply-To: <1575542540897.56972@kth.se> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjkyOTA4NGItNGNhYy00NTQwLWJlYTAtN2NmZjY1ZDk5YTAzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicVJGRjFQdFpyZXJaRVB2aDJDdkIyUml5RkFidVNVcUhVK3RUdTl1TDJDcXRXRVwvN0NIN2IzUUQ0QkZkRWw5NGYifQ== dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=harry.van.haaren@intel.com; x-originating-ip: [192.198.151.166] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5c6f3124-3825-40cd-577f-08d7797192e9 x-ms-traffictypediagnostic: MN2PR11MB3663: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(39860400002)(366004)(396003)(136003)(189003)(199004)(13464003)(53754006)(7696005)(66476007)(66556008)(76116006)(81166006)(66946007)(64756008)(76176011)(52536014)(81156014)(8936002)(66446008)(14444005)(66574012)(26005)(11346002)(33656002)(71190400001)(71200400001)(102836004)(186003)(25786009)(5660300002)(53546011)(6506007)(14454004)(99286004)(2906002)(478600001)(110136005)(229853002)(316002)(55016002)(86362001)(305945005)(9686003)(74316002); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR11MB3663; H:MN2PR11MB4447.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LpjgA9uhC4VCQqQnhB31G9zQ+HwBXthE+y9MTFnJpMIqOslXyT/aSWe3dNgBPKVF8iLbaf5vc95d2adE+1FyOThdvvI13fREnQWb3iZjFlcUVyHMUZMrkyx4qN7+9qZT4GtCPiuw/dgkz3xVOGaOoqsbpe2w9uzVxolTAl/DT1VXv45UlfXLC3A/jmwziWbrKo6qC+shIFUzeTVSominU7GKl0NO01GbMeQStnDV5VXAzkrn21L8raMZuIUbtTjoqRba/gWPiXa4Sa2JIkCRFQfcbQFW0CNyep/irj2X8YYsOD3cnqh88K9yyPlcY798edgbVzOV1Rx7fw53/0E9REPm6ECBjEQaz8X+qyQrpbqq07nV9lUK+xkHIHc71xtZX4CHNYIUfJgFFIM7jXcNoVY4G3b6Ymnv41swpxTcJ1xPebRZRkuOvO2rhY8ikTqfvvNHDANI9QekhFWJAl9y3hw+oIufsO5Nyxxl8rXApFCfwaDNoUMVtmgRDsz2GGfHRooPfredTaqTYtOXT3iQpw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5c6f3124-3825-40cd-577f-08d7797192e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 10:54:59.7466 (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: hrxxsznebSUozVjbklXS4YX1kygm2L1Qu5jFuo8394AK3iXDHePNJK8EA0Z7ofW+r+ucsg6awF0OjpN6/ZAQkQBBsiAlhNSTEvJ5Bxl6y6I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3663 X-OriginatorOrg: intel.com Subject: Re: [dpdk-users] [dpdk-dev] Sharing Data structure between logical cores in DPDK- regarding X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" > -----Original Message----- > From: users On Behalf Of Tom Barbette > Sent: Thursday, December 5, 2019 10:42 AM > To: Perugu Hemasai Chandra Prasad ; > users@dpdk.org; dev@dpdk.org > Subject: Re: [dpdk-users] [dpdk-dev] Sharing Data structure between logic= al > cores in DPDK- regarding >=20 > It depends on the datastructure. >=20 > If you use rte_hash, with the thread safety flags, it's safe. >=20 > In any case having a lot of cores accessing the same DS will lead to bad > performance. You should try to have per-core data structures whenever > possible. >=20 > Tom >=20 > ________________________________________ > De : dev de la part de Perugu Hemasai Chandra Pras= ad > > Envoy=E9 : jeudi 5 d=E9cembre 2019 11:16 > =C0 : users@dpdk.org; dev@dpdk.org > Objet : [dpdk-dev] Sharing Data structure between logical cores in DPDK- > regarding >=20 > Hi All, Hi! > I have a small doubt, can we share a data structure between > multiple logical cores in DPDK without locking? Note that "locking" and "atomic instructions" are not the same. So locking = a mutex is only one way of ensuring multiple cores have a coherent view on = the datastructure. The other method of doing "lock free" but multi-core safe data-structures i= s by using Atomic instructions, which ensure that results are observed corr= ectly on all cores accessing that data-structure. A good example is the Mul= ti-producer or Multi-consumer versions of the DPDK rte_ring ringbuffer. Regards, -Harry > I have tested it by sharing > a small structure with two variable and incrementing them in all logical > cores. It ran smooth I didn't get any issue. But I doubt if we can run it > for long time with some huge data structure having many elements getting > accessed by multiple logical cores. > Can anyone please clarify this. >=20 > Thanks and regards, > Hemasai.