From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id CA01C4A63 for ; Fri, 15 Dec 2017 12:26:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Dec 2017 03:26:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,404,1508828400"; d="scan'208";a="2943757" Received: from silpixa00398162.ir.intel.com (HELO silpixa00398162.ger.corp.intel.com) ([10.237.223.171]) by orsmga007.jf.intel.com with ESMTP; 15 Dec 2017 03:26:21 -0800 From: Liang Ma To: jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, harry.van.haaren@intel.com, bruce.richardson@intel.com, deepak.k.jain@intel.com, john.geary@intel.com, peter.mccarthy@intel.com, seanbh@gmail.com Date: Fri, 15 Dec 2017 11:26:22 +0000 Message-Id: <1513337189-137661-2-git-send-email-liang.j.ma@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1513337189-137661-1-git-send-email-liang.j.ma@intel.com> References: <1513337189-137661-1-git-send-email-liang.j.ma@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Subject: [dpdk-dev] [PATCH v2 1/8] event/opdl: add the opdl ring infrastructure library 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: Fri, 15 Dec 2017 11:26:26 -0000 T1BETCByaW5nIGlzIHRoZSBjb3JlIGluZnJhc3RydWN0dXJlIG9mIE9QREwgUE1ELiBPUERMIHJp bmcgbGlicmFyeQpwcm92aWRlIHRoZSBjb3JlIGRhdGEgc3RydWN0dXJlIGFuZCBjb3J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v Y2spOworCWVsc2UKKwkJcmV0dXJuIG9wZGxfcmluZ19pbnB1dF9tdWx0aXRocmVhZCh0LCBlbnRy aWVzLCBudW1fZW50cmllcywKKwkJCQlibG9jayk7Cit9CisKK3VpbnQzMl90CitvcGRsX3Jpbmdf Y29weV9mcm9tX2J1cnN0KHN0cnVjdCBvcGRsX3JpbmcgKnQsIHN0cnVjdCBvcGRsX3N0YWdlICpz LAorCQljb25zdCB2b2lkICplbnRyaWVzLCB1aW50MzJfdCBudW1fZW50cmllcywgYm9vbCBibG9j aykKK3sKKwl1aW50MzJfdCBoZWFkID0gcy0+aGVhZDsKKworCW51bV9lbnRyaWVzID0gbnVtX3Rv X3Byb2Nlc3MocywgbnVtX2VudHJpZXMsIGJsb2NrKTsKKworCWlmIChudW1fZW50cmllcyA9PSAw KQorCQlyZXR1cm4gMDsKKworCWNvcHlfZW50cmllc19pbih0LCBoZWFkLCBlbnRyaWVzLCBudW1f ZW50cmllcyk7CisKKwlzLT5oZWFkICs9IG51bV9lbnRyaWVzOworCV9fYXRvbWljX3N0b3JlX24o JnMtPnNoYXJlZC50YWlsLCBzLT5oZWFkLCBfX0FUT01JQ19SRUxFQVNFKTsKKworCXJldHVybiBu dW1fZW50cmllczsKKworfQorCit1aW50MzJfdAorb3BkbF9yaW5nX2NvcHlfdG9fYnVyc3Qoc3Ry dWN0IG9wZGxfcmluZyAqdCwgc3RydWN0IG9wZGxfc3RhZ2UgKnMsCisJCXZvaWQgKmVudHJpZXMs IHVpbnQzMl90IG51bV9lbnRyaWVzLCBib29sIGJsb2NrKQoreworCXVpbnQzMl90IGhlYWQgPSBz LT5oZWFkOworCisJbnVtX2VudHJpZXMgPSBudW1fdG9fcHJvY2VzcyhzLCBudW1fZW50cmllcywg YmxvY2spOworCWlmIChudW1fZW50cmllcyA9PSAwKQorCQlyZXR1cm4gMDsKKworCWNvcHlfZW50 cmllc19vdXQodCwgaGVhZCwgZW50cmllcywgbnVtX2VudHJpZXMpOworCisJcy0+aGV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