From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0069.outbound.protection.outlook.com [104.47.38.69]) by dpdk.org (Postfix) with ESMTP id 25B041094 for ; Wed, 4 Jan 2017 14:10:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2vywewY/AHNpbMzRwMcHH1MBTo0w3N6+rnFyEgxL5jU=; b=IHRDVoYRRd3VbtPypk0GpuAaUTW0q0+hH5ZG6HuG8sPvBUeZB+DzM3L/L1IgMA0J4H1DsH3nAuGcswpYUeviaIqCiOlQyjdvF4xS6KgtBTi8ms8MLtAfRQDHO03Jhn/hhHr8Y9RDQZso3FFALcc2G3zwsBOtYhJyqr5VbEgcOxA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.172.178.75) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Wed, 4 Jan 2017 13:10:12 +0000 Date: Wed, 4 Jan 2017 18:39:54 +0530 From: Jerin Jacob To: "Hunt, David" CC: , Message-ID: <20170104130952.GC19798@localhost.localdomain> References: <1480567821-70846-2-git-send-email-david.hunt@intel.com> <1482381428-148094-1-git-send-email-david.hunt@intel.com> <1482381428-148094-4-git-send-email-david.hunt@intel.com> <20161222121943.GA8778@localhost.localdomain> <088a8953-9c8f-0665-7a53-505cd1c389bc@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <088a8953-9c8f-0665-7a53-505cd1c389bc@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.172.178.75] X-ClientProxiedBy: BM1PR01CA0057.INDPRD01.PROD.OUTLOOK.COM (10.163.199.29) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: ee13bb35-56ea-4d5f-ed03-08d434a30580 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:hHkksuFx1uIEBUQF8gWS21aRZadbQuNHJmJgzAkcPAYGEObFoNkAUneUbRBv4JuxniB3I91Wzc4Y/I+olz1ESgm201WxF5tQspBMhIUwQ27FmQxVOWl0aZb4EEhiymShksMgKVO97zrC8gxNSTzC57G5sa8+z+PsRXPHEktkp80qqaDabn6y4UzyRoyor7aco1Hn7/1i+8gv7hS8WaB0i9uvb3jybxCoQ3FvYMaJ492n/nC5mtsaZcjWqkq1v64ae3U/fL8l6HxZOpfzkV7n2g== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 25:L0aeF48piHu45qV10ZOvov0Dcu61oimkKsv31SXoVviz5aR/vWIIjJS8o0Bc73svbmzaOx3bdILFfb1emoPJodH1NDBo3ow97dtNdTfkMkSI5AARL1FHR9Jq0F0kPSI5LnfdD02LfWN9sU40V6nAeFmddl3Ty5X7U0Y+rpBz+vqo3B9M18Yu1IyRrry6g3ONW1rHAsz0/mAnujgYInuxiCKSF6zKKFcK9+pW639/z88AJjwma1668R81pTJJoil9oX1jWXDWsPrJlQmvTB7jpsZ6I04GqN7jAifHYCsDmp2noZgdJ6LStfjlLPUYHjpgwTcn3rG4FbRvNYeMYElIs0k4X3R6z2jz5GkGWVzQykNAg61j1GR2CirGKYN1hi3V6C86CQR8Hvl2UDFlO2ebaWGoTBr8i6pKjROgWtNrglmtVg34hDhaDs51iJu5bStAkjho/aQuw4YOs2O3Fkvo2rwWdgmUxTcZG2lkKbmMWNONq5c3aaJ9hX1MwtgrK8D0ORIVycTqKbv3uVwsshRNU2Hy59GccrpdJ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soIcNsesc5A2V6xIp1WpaG6Xz3PCbb568iVRRwc1+r1jDYobRnL4Ged6x/Qh/4A0O+UM/OaqdAKUlA1sbKyeCDDRjQtx/pBg5EKDPr2wqP0DDSE/DFOiVVfM3kCqjHWIYT8ZzLQkE6+BzVm7NlQkO/1HYqY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:nSQJP8w53ps6bwKtQelE1UPVhTAwSK65ccf4wu1+rlmkk/XJoBWP2L+easvTjrQLRqcr3qPrrLJQviVobXNOBa5pBvhWx90EQzhB5XRAwDVwHyYpCIBEPatErJ1sj5YW5r+H68gPf4oDft8Yr8e20pQ88loWz/GtZ8wEE9YNPbhvqwSjxOlSMx1VAqpwboNi5OqmVZ+UHYdooaVNZm98z2bEsg52AwV6X/H4Um91i/Ounn63CdTgnOFks/Y2JZhR6WcNEbQyzNqcSWFu0B47oaqJtccp6l3Gi5E1tNueydwQoY9C3t8/XmJ7warpfk6nur4oD443otA7KLZc8Ezkdphp/rYnXISjBA/OmRJtpZkQO1ivtw/dRGZ8xm6FGoCtWTME+/onf6YAMTUfCa6Yw8IjAZSEYWj7fVpsKESSWih9wJZYhPUB5lupFqvHkFQEhZc4qn15sZzbqJZjMYTLs9QGbKVzkjrfJ9m6M3E/2Fs2sAg/9cdTUMOyCgYVa4kdMHJp2Ocb809Lvd3rFriSwcrFR+DOcyCKZr/hjMJXeu1T3LGL83AdE/kWrr1eB6aPw4J2+zl2w14OXAUynE1TWqC7U8Gbzo4B9sM480UqXx0= X-Forefront-PRVS: 0177904E6B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(24454002)(377454003)(2906002)(46406003)(6506006)(106356001)(50466002)(81166006)(76176999)(189998001)(8676002)(4326007)(50986999)(9686002)(23726003)(1076002)(81156014)(68736007)(101416001)(97756001)(66066001)(97736004)(5660300001)(6116002)(93886004)(7736002)(6916009)(61506002)(6666003)(2950100002)(42882006)(305945005)(38730400001)(110136003)(54906002)(229853002)(54356999)(4001350100001)(3846002)(47776003)(33656002)(92566002)(42186005)(105586002)(55016002)(25786008)(83506001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:70j3y0tLRCr4RTO0BKtzR9a2X9xmOWu/aTAhnr5?= =?us-ascii?Q?N+mnYh25vCuxEBGOUbFAkijOa+EmmDjpDhzhupCliSzrOjxhsiwW+mOh5OfK?= =?us-ascii?Q?iLPzE2AgzTorFS7xn5TV8A+8oVdaKS6Hn7dK5XTx0ZRnsj+shheLnqqMBOdl?= =?us-ascii?Q?0uXQwbCtfEVMIDBSGcWAFlnc37xGYFxTW1dTuyiD+8RVmIoBW7iSd2LxBjzv?= =?us-ascii?Q?91IIxcjO49SdhJcY4AAfccanLEYiCgkDNJY6c1F2X9sTV7nieAsUKsYCI+SH?= =?us-ascii?Q?BhL5rliq12PPOT2fBaqNhCC9Rhjq/eBibH5OJc/xCYYgJ0Xf4OeGYZznBCcN?= =?us-ascii?Q?xFmPYft4CWW3ClTcblgOzwYPRFHPgrCuwoBZwROw66Jq8JDeR7bBokd5oLHA?= =?us-ascii?Q?6r92CHU2iKsgVzzAQUMwBvLEMLMNrHf8OUqEE5vddItoCv14qQmrxAmcmaPt?= =?us-ascii?Q?/bmajGn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bbxwIC0huqjMZFtdR5XiaDwfccZHkvdEllOExpXJVFw1mR1I521BfxnlHs1uEBHsRsJBZxaPtj5rmHSklvkGWmdUVLJtOp1WeNAQqoDGmWLwm7gW+FEka17vyaxoQx2vkyEv1qDtxh4OgElwVG26n2dSjLz49COnoWcASrVq80aLVNluAVIKgNTiCBHeiobqr0Cjmtp3LSfNbMKLUIzPhAyTWZd/w== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2017 13:10:12.6138 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: Re: [dpdk-dev] [PATCH v2 3/5] test: add distributor_perf autotest X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 13:10:16 -0000 On Mon, Jan 02, 2017 at 04:24:01PM +0000, Hunt, David wrote: > > > On 22/12/2016 12:19 PM, Jerin Jacob wrote: > > On Thu, Dec 22, 2016 at 04:37:06AM +0000, David Hunt wrote: > > > + struct rte_distributor_burst *d = arg; > > > + unsigned int count = 0; > > > + unsigned int num = 0; > > > + unsigned int id = __sync_fetch_and_add(&worker_idx, 1); > > Use rte_atomic equivalent > > Jerin, > I'm looking for an equivalent, but I can't seem to find one. Here I'm > assigning 'id' with the incremented value of worker_idx in one statement. > However, rte_atomic32_add just increments the variable and returns void, so > I'd have to use two statements, losing the atomicity. > > static inline void > rte_atomic32_add(rte_atomic32_t *v, int32_t inc) It would have been better rte_atomic32_add returns the old value. > > There's a second reason why I can't use the rte_atomics, and that's because > worker_idx is a volatile. may be you could change worker_idx as rte_atomic32_t > > Maybe we could add new atomic functions in the future to address this? Yes. I guess, the fixing the return value of rte_atomic*_[add/sub] may be enough > > Thanks, > Dave.