From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by dpdk.org (Postfix) with ESMTP id A0756160 for ; Mon, 23 Jul 2018 20:59:31 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Date: Mon, 23 Jul 2018 20:59:29 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35B421F0@smartserver.smartshare.dk> In-Reply-To: <20180723103757.47e4c26b@xeon-e3> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [dpdk-dev] rte_mbuf library likely()/unlikely() Thread-Index: AdQiq+n6U5bLiVtmTZyuezS/wfPrGAACpQGQ References: <98CBD80474FA8B44BF855DF32C47DC35B421EE@smartserver.smartshare.dk> <20180723103757.47e4c26b@xeon-e3> From: =?utf-8?B?TW9ydGVuIEJyw7hydXA=?= To: "Stephen Hemminger" Cc: "Olivier Matz" , Subject: Re: [dpdk-dev] rte_mbuf library likely()/unlikely() 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: Mon, 23 Jul 2018 18:59:31 -0000 DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFN0ZXBoZW4gSGVtbWluZ2Vy IFttYWlsdG86c3RlcGhlbkBuZXR3b3JrcGx1bWJlci5vcmddDQo+IFNlbnQ6IE1vbmRheSwgSnVs eSAyMywgMjAxOCA3OjM4IFBNDQo+IFRvOiBNb3J0ZW4gQnLDuHJ1cA0KPiBDYzogT2xpdmllciBN YXR6OyBkZXZAZHBkay5vcmcNCj4gU3ViamVjdDogUmU6IFtkcGRrLWRldl0gcnRlX21idWYgbGli cmFyeSBsaWtlbHkoKS91bmxpa2V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zZWcgPSBzZWctPm5leHQ7DQogICAgICAgIH0NCg0K LSAgICAgICBpZiAob2ZmICsgbGVuIDw9IHJ0ZV9wa3RtYnVmX2RhdGFfbGVuKHNlZykpDQorICAg ICAgIGlmIChsaWtlbHkob2ZmICsgbGVuIDw9IHJ0ZV9wa3RtYnVmX2RhdGFfbGVuKHNlZykpKQ0K ICAgICAgICAgICAgICAgIHJldHVybiBydGVfcGt0bWJ1Zl9tdG9kX29mZnNldChzZWcsIGNoYXIg Kiwgb2ZmKTsNCg0KICAgICAgICAvKiByYXJlIGNhc2U6IGhlYWRlciBpcyBzcGxpdCBhbW9uZyBz ZXZlcmFsIHNlZ21lbnRzICovDQpAQCAtMzQ0LDcgKzM0NCw3IEBADQogICAgICAgIHVuc2lnbmVk IGludCBpOw0KICAgICAgICBpbnQgcmV0Ow0KDQotICAgICAgIGlmIChidWZsZW4gPT0gMCkNCisg ICAgICAgaWYgKHVubGlrZWx5KGJ1ZmxlbiA9PSAwKSkNCiAgICAgICAgICAgICAgICByZXR1cm4g LTE7DQoNCiAgICAgICAgYnVmWzBdID0gJ1wwJzsNCkBAIC0zNTUsOSArMzU1LDkgQEANCiAgICAg ICAgICAgICAgICBpZiAobmFtZSA9PSBOVUxMKQ0KICAgICAgICAgICAgICAgICAgICAgICAgbmFt ZSA9IHJ4X2ZsYWdzW2ldLmRlZmF1bHRfbmFtZTsNCiAgICAgICAgICAgICAgICByZXQgPSBzbnBy aW50ZihidWYsIGJ1ZmxlbiwgIiVzICIsIG5hbWUpOw0KLSAgICAgICAgICAgICAgIGlmIChyZXQg PCAwKQ0KKyAgICAgICAgICAgICAgIGlmICh1bmxpa2VseShyZXQgPCAwKSkNCiAgICAgICAgICAg ICAgICAgICAgICAgIHJldHVybiAtMTsNCi0gICAgICAgICAgICAgICBpZiAoKHNpemVfdClyZXQg Pj0gYnVmbGVuKQ0KKyAgICAgICAgICAgICAgIGlmICh1bmxpa2VseSgoc2l6ZV90KXJldCA+PSBi dWZsZW4pKQ0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOw0KICAgICAgICAgICAg ICAgIGJ1ZiArPSByZXQ7DQogICAgICAgICAgICAgICAgYnVmbGVuIC09IHJldDsNCkBAIC00NDAs NyArNDQwLDcgQEANCiAgICAgICAgdW5zaWduZWQgaW50IGk7DQogICAgICAgIGludCByZXQ7DQoN Ci0gICAgICAgaWYgKGJ1ZmxlbiA9PSAwKQ0KKyAgICAgICBpZiAodW5saWtlbHkoYnVmbGVuID09 IDApKQ0KICAgICAgICAgICAgICAgIHJldHVybiAtMTsNCg0KICAgICAgICBidWZbMF0gPSAnXDAn Ow0KQEAgLTQ1MSw5ICs0NTEsOSBAQA0KICAgICAgICAgICAgICAgIGlmIChuYW1lID09IE5VTEwp DQogICAgICAgICAgICAgICAgICAgICAgICBuYW1lID0gdHhfZmxhZ3NbaV0uZGVmYXVsdF9uYW1l Ow0KICAgICAgICAgICAgICAgIHJldCA9IHNucHJpbnRmKGJ1ZiwgYnVmbGVuLCAiJXMgIiwgbmFt ZSk7DQotICAgICAgICAgICAgICAgaWYgKHJldCA8IDApDQorICAgICAgICAgICAgICAgaWYgKHVu bGlrZWx5KHJldCA8IDApKQ0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOw0KLSAg ICAgICAgICAgICAgIGlmICgoc2l6ZV90KXJldCA+PSBidWZsZW4pDQorICAgICAgICAgICAgICAg aWYgKHVubGlrZWx5KChzaXplX3QpcmV0ID49IGJ1ZmxlbikpDQogICAgICAgICAgICAgICAgICAg ICAgICByZXR1cm4gLTE7DQogICAgICAgICAgICAgICAgYnVmICs9IHJldDsNCiAgICAgICAgICAg ICAgICBidWZsZW4gLT0gcmV0Ow0KDQoNCk1lZCB2ZW5saWcgaGlsc2VuIC8ga2luZCByZWdhcmRz DQotIE1vcnRlbiBCcsO4cnVwDQo=