From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [216.205.24.181]) by dpdk.org (Postfix) with ESMTP id 3D5C6568A for ; Fri, 1 Jun 2018 12:44:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SonusNetworks.onmicrosoft.com; s=selector1-rbbn-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VuYv7e225RHp0awtNowk8vV8Bc43b0sPLMNpKor0bbQ=; b=LzSVqqqURCfBmJNY0pzdN7SJQ+vDnHFanT+IhrxhShPxBKyA2HkHwRTe/oJWMnscsHxBDN9ypYW4NbDKi3lvk6TRB9fYkSfzzcOWx2zj+AgGR374iysGDND3kE8gUi5qXzXi44FOrzFzURvRtfxcf+Go5K02Pzr3KVsSnxDcxAw= Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01lp0183.outbound.protection.outlook.com [216.32.181.183]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-43-3MbAUVTdPO6Mf-kB56U8Gw-1; Fri, 01 Jun 2018 06:44:14 -0400 Received: from CY4PR03MB2757.namprd03.prod.outlook.com (10.173.38.11) by CY4PR03MB3272.namprd03.prod.outlook.com (10.171.246.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Fri, 1 Jun 2018 10:44:11 +0000 Received: from CY4PR03MB2757.namprd03.prod.outlook.com ([fe80::6c28:b627:9132:a9bd]) by CY4PR03MB2757.namprd03.prod.outlook.com ([fe80::6c28:b627:9132:a9bd%3]) with mapi id 15.20.0820.010; Fri, 1 Jun 2018 10:44:11 +0000 From: "Giridharan, Ganesan" To: "Wiles, Keith" CC: "users@dpdk.org" Thread-Topic: [dpdk-users] TAP-PMD & tap-device PPS via Kernel Thread-Index: AdP3Zf2VY/V/YPA4SNaIT7t1FhhOvAAQjY8AAHsFP7A= Date: Fri, 1 Jun 2018 10:44:11 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.171.83.98] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR03MB3272; 7:VxX2pxjoFsDEXCD99l1KCZkrTK1Ws9YPWfA5CYyL3sgbXJbJSzpQxX/jdra06aOQa+KNGGOmqvU9dFVA3nTkSkao05b4BpwI2YWPC4q7fMHA/yL/ZmG9MI8ayn4PFO0U184QSFHxikgqhCiDLCLj3qmCv8B8oTT2wQ9mNpJY/yFHZNzA5cByQxQMJpNxXWx0rEheyJFauQ59SghvACPqBo06qh2hAFjDssMkzK1HMt1s/K03BB5X/dFhVCi886C4; 20:h+xXTLgPBcrk3R+eXKyVCZG5ofpkc0A7fey505UB4mO92wb6vq+CuYGGyaX1EpkrS1yvHc0p2HbmKSeu0oVMyTjp3ld+coPlTO+FozWJZRtWF4gbdlqEnNqCg2Vpw+56KuihMEC0+t1ar2oBXt9iusWT91GEXsZXrgX+cmJ48VE= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR03MB3272; x-ms-traffictypediagnostic: CY4PR03MB3272: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(278428928389397)(21748063052155)(21532816269658)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:CY4PR03MB3272; BCL:0; PCL:0; RULEID:; SRVR:CY4PR03MB3272; x-forefront-prvs: 0690E5FF22 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(39380400002)(396003)(346002)(376002)(199004)(189003)(4326008)(53936002)(25786009)(33656002)(6116002)(3846002)(6246003)(790700001)(2906002)(6506007)(99286004)(2900100001)(76176011)(102836004)(53546011)(26005)(59450400001)(186003)(97736004)(7696005)(54896002)(6306002)(236005)(9686003)(105586002)(316002)(5250100002)(106356001)(74316002)(81166006)(3660700001)(86362001)(81156014)(6916009)(8936002)(8676002)(478600001)(7736002)(446003)(476003)(486006)(11346002)(229853002)(55016002)(3280700002)(68736007)(14454004)(66066001)(5660300001)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3272; H:CY4PR03MB2757.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-microsoft-antispam-message-info: bD2Wh+4SZXYk+2G+m85+0ncCSnrP+SPccMd7rdgECn7nW13glj+k04F3aTjZy8RLHJoHBeWe/OZUg/S0e73v/bVMfWpHHS45olxjRoN7g0sqDkrdWzj6sxgvJWNGk05pOBwXrX0Jh8Q1bo0rrosdVGr4DhkUUrQA++B8PoGMJFRiDukphwyoRfyKfuAtFeoR spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 57327ba3-bea7-426d-05f5-08d5c7ac9ca8 X-OriginatorOrg: rbbn.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57327ba3-bea7-426d-05f5-08d5c7ac9ca8 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2018 10:44:11.7291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3272 X-MC-Unique: 3MbAUVTdPO6Mf-kB56U8Gw-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] TAP-PMD & tap-device PPS via Kernel 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: , X-List-Received-Date: Fri, 01 Jun 2018 10:44:16 -0000 R29vZCBtb3JuaW5nLi4NCg0KU2hhcmluZyBteSB0ZXN0IHJlc3VsdHMuIE1pZ2h0IGJlIGhlbHBm dWwsIGluIGNhc2UgaWYgdGhpcyBwYXRoIGlzIGRlc2lyZWQuDQoNCkh5cGVydmlzb3IgOiBIeXBl ci1WDQpHdWVzdCA6IExpbnV4IDQuMTQNClByb2Nlc3NvciA6IDI2OTB2Mg0KIyBvZiB2Q3B1cyA6 IDQNClBhY2tldCBmbG93Og0KICAgICAgICAgICAgICAgSG9zdCAtLT4gS2VybmVsIC0tPmRwZGst LT5LZXJuZWwtLT5Ib3N0ICggZGF0YSBwbGFuZSB0cmFmZmljICkNClBhY2tldCB0eXBlczogVURQ IHN0cmVhbXMNCkkgd2FzIGFibGUgdG8gY29tZm9ydGFibHkgcmVhY2ggYWJvdCB+MjhLLTMwSyBw cHMuIFBhY2tldCBsb3NzIG9jY3VycyBhdCBhYm91dCBvciBhZnRlciB0aGF0LiBUcmFmZmljIHdh cyByZWFsLXRpbWUgbGF0ZW5jeSBzZW5zaXRpdmUuDQoNCkdyZWF0IGRheQ0KLS1HRw0KDQpGcm9t OiBXaWxlcywgS2VpdGggPGtlaXRoLndpbGVzQGludGVsLmNvbT4NClNlbnQ6IFR1ZXNkYXksIE1h eSAyOSwgMjAxOCAxMTo1MyBBTQ0KVG86IEdpcmlkaGFyYW4sIEdhbmVzYW4gPGdnaXJpZGhhcmFu QHJiYm4uY29tPg0KQ2M6IHVzZXJzQGRwZGsub3JnDQp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hbnkgb3RoZXIgZGVzaWduIHVzaW5n IHR1bi90YXAgYXMgdGhlIGtlcm5lbCBpcyBzdGlsbCBpbnZvbHZlZCBpbiB0aGUgbW92ZW1lbnQg b2YgZGF0YS4NCg0KVGhlIFRBUCBQTUQgd2FzIGNyZWF0ZWQgdG8gYWxsb3cgbWUgdG8gdGVzdCBh cHBsaWNhdGlvbnMgd2l0aCBEUERLIG9uIGEgc3lzdGVtIHdpdGhvdXQgcmVhbCBOSUNzIGxpa2Ug bXkgTUFDQm9vayBQcm8gSSBoYXZlIGEgcG9ydCBvZiBEUERLIGZvciBhIE1BQy4gVGhlIFRBUCBp bnRlcmZhY2Ugc2hvdWxkIG9ubHkgYmUgdXNlZCBmb3IgdGVzdGluZyBvciBpZiB5b3UgbmVlZCBj b25uZWN0aXZpdHkgdG8gdGhlIGhvc3QvYW5vdGhlciBUQVAgZGV2aWNlLiBXaXRoIFBrdGdlbiBJ IHVzZSBpdCB0byBjb25uZWN0IHRvIHdpcmVzaGFyayB0byBkZWNvZGUgcGFja2V0cy4NCg0KPg0K PiBBcHByZWNpYXRlIHRoZSBzaGFyZSBpZiBhbnlvbmUgbWlnaHQgcG9zc2VzcyB0ZXN0IHJlc3Vs dHMuDQo+DQo+IFRoYW5rcw0KPg0KPiBHcmVhdCBkYXkNCj4gLS1HRw0KDQpSZWdhcmRzLA0KS2Vp dGgNCg== >From yipeng1.wang@intel.com Sat Jun 2 00:16:49 2018 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2A94A5F6E for ; Sat, 2 Jun 2018 00:16:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 15:16:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,467,1520924400"; d="scan'208";a="52832320" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga002.fm.intel.com with ESMTP; 01 Jun 2018 15:16:48 -0700 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 1 Jun 2018 15:16:47 -0700 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.132]) by ORSMSX112.amr.corp.intel.com ([169.254.3.228]) with mapi id 14.03.0319.002; Fri, 1 Jun 2018 15:16:47 -0700 From: "Wang, Yipeng1" To: "longtb5@viettel.com.vn" , "users@dpdk.org" CC: "Gobriel, Sameh" , "Tai, Charlie" , "Wang, Ren" Thread-Topic: Membership library thread safety Thread-Index: AdP5d0PbKeYIbXvURgy11gM7Ouff7QAWFTwQ Date: Fri, 1 Jun 2018 22:16:46 +0000 Message-ID: References: <012701d3f978$57d75d40$078617c0$@viettel.com.vn> In-Reply-To: <012701d3f978$57d75d40$078617c0$@viettel.com.vn> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWUyM2U1ZTgtMTZkYy00YzMzLTliNzUtYmYzYTQ1OTFmOTFlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlBqSVo1bXlyNHdZYUhCcEFKVFwvU2VLWDBmOTRTb3FTY2VcL1FoeWVGSjh2QT0ifQ== x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-users] Membership library thread safety 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: , X-List-Received-Date: Fri, 01 Jun 2018 22:16:49 -0000 Hi, You are right that It is similar to other rte data structure that you can i= nitialize it in a master thread and do lookup in other threads. w.r.t. concurrency, the original plan is to have the fastest data structur= e used mostly per-thread basis so any locking/atomicity guarantee is too co= stly. So for non-cache mode HT based setsum, since deletion is supported and fals= e-negative is not supposed to happen, I would say it only supports single w= riter/delete thread. For read-write concurrency, due to the "cuckoo hash" = algorithm, there might be a short window (very unlikely) that a key lookup = could return an intermediate result while another thread writing to the tab= le. Depending on how your application could tolerate such case, you may or = may not want to use it for read-write concurrency. One option is to turn of= f the cuckoo algorithm if you would like to play with the code a little bit= . Vector BF also only supports single writer if you don't want false negative= , but read-write concurrency should be fine For cache mode HT based setsum, things are less restrictive. Since it is su= pposed to be used as a cache and both false-negative and false-positive are= allowed, it would be fine for multiple writer writing concurrently.=20 Note that you can always use multiple readers concurrently. If possible, may I ask for the use case you have? The purpose is to make th= e library more usable. Feel free to propose new patches as well. If concurr= ency is definitely a requirement, we could collaborate on new concurrency A= PIs. We will improve the documentation as well to state things more clearly= . Thanks Yipeng >-----Original Message----- >From: longtb5@viettel.com.vn [mailto:longtb5@viettel.com.vn] >Sent: Friday, June 1, 2018 12:10 AM >To: users@dpdk.org >Cc: Wang, Yipeng1 ; Gobriel, Sameh >Subject: Membership library thread safety > >Hi, > >I'm using rte_member in my application. I have two questions. >1. Could a rte_member_setsum be initialized on one thread and used on >another thread? >2. Are the operations (lookup, add, reset,.) atomic, or do I need to use >some kind of locking (e.g. rte_spinlock)? > >I couldn't find anything in the doc. My guess is that you can init and use= a >setsum on different threads just fine, but sharing a setsum among differen= t >threads does require locking. > >Thanks and best regards, >-BL >