From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BEFCD1B347 for ; Fri, 22 Dec 2017 12:23:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2017 03:23:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,440,1508828400"; d="scan'208";a="4011183" Received: from silpixa00398162.ir.intel.com (HELO silpixa00398162.ger.corp.intel.com) ([10.237.223.171]) by fmsmga002.fm.intel.com with ESMTP; 22 Dec 2017 03:23:51 -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, 22 Dec 2017 11:23:43 +0000 Message-Id: <1513941830-186503-2-git-send-email-liang.j.ma@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1513941830-186503-1-git-send-email-liang.j.ma@intel.com> References: <1513941830-186503-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 v4 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, 22 Dec 2017 11:23:56 -0000 T1BETCByaW5nIGlzIHRoZSBjb3JlIGluZnJhc3RydWN0dXJlIG9mIE9QREwgUE1ELiBPUERMIHJp bmcgbGlicmFyeQpwcm92aWRlIHRoZSBjb3JlIGRhdGEgc3RydWN0dXJlIGFuZCBjb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IG51bV90b19wcm9jZXNz KHMsIG51bV9lbnRyaWVzLCBibG9jayk7CisKKwlpZiAobnVtX2VudHJpZXMgPT0gMCkKKwkJcmV0 dXJuIDA7CisKKwljb3B5X2VudHJpZXNfaW4odCwgaGVhZCwgZW50cmllcywgbnVtX2VudHJpZXMp OworCisJcy0+aGVhZCArPSBudW1fZW50cmllczsKKwlfX2F0b21pY19zdG9yZV9uKCZzLT5zaGFy ZWQudGFpbCwgcy0+aGVhZCwgX19BVE9NSUNfUkVMRUFTRSk7CisKKwlyZXR1cm4gbnVtX2VudHJp ZXM7CisKK30KKwordWludDMyX3QKK29wZGxfcmluZ19jb3B5X3RvX2J1cnN0KHN0cnVjdCBvcGRs X3JpbmcgKnQsIHN0cnVjdCBvcGRsX3N0YWdlICpzLAorCQl2b2lkICplbnRyaWVzLCB1aW50MzJf dCBudW1fZW50cmllcywgYm9vbCBibG9jaykKK3sKKwl1aW50MzJfdCBoZWFkID0gcy0+aGVhZDsK KworCW51bV9lbnRyaWVzID0gbnVtX3RvX3Byb2Nlc3MocywgbnVtX2VudHJpZXMsIGJsb2NrKTsK KwlpZiAobnVtX2VudHJpZXMgPT0gMCkKKwkJcmV0dXJuIDA7CisKKwljb3B5X2VudHJpZXNfb3V0 KHQsIGhlYWQsIGVudHJpZXMsIG51bV9lbnRyaWVzKTsKKworCXMtPmhlYWQgKz0gbnVtX2VudHJp ZXM7CisJX19hdG9taWNfc3RvcmVfbigmcy0+c2hhcmVkLnRhaWwsIHMtPmhlYWQsIF9fQVRPTUlD X1JFTEVBU0UpOworCisJcmV0dXJuIG51bV9lbnRyaWVzOworfQorCit1aW50MzJfdAorb3BkbF9z dGFnZV9maW5kX251bV9hdmFpbGFibGUoc3RydWN0IG9wZGxfc3RhZ2UgKnMsIHVpbnQzMl90IG51 bV9lbnRyaWVzKQoreworCS8qIHJldHVybiAobnVtX3RvX3Byb2Nlc3MocywgbnVtX2VudHJpZXMs IGZhbHNlKSk7ICovCisKKwlpZiAoYXZh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XZhaWxhYmxlX3NlcSwKKwkJCQlzLT5zaGFyZWQudGFpbCwgKHMtPm51bV9k ZXBzID4gMCkgPworCQkJCXMtPmRlcHNbMF0tPnN0YWdlLT5pbmRleCA6IDApOworCQlmb3IgKGog PSAxOyBqIDwgcy0+bnVtX2RlcHM7IGorKykKKwkJCWZwcmludGYoZiwgIiwldSIsIHMtPmRlcHNb al0tPnN0YWdlLT5pbmRleCk7CisJCWZwcmludGYoZiwgIlxuIik7CisJfQorCWZmbHVzaChmKTsK K30KKwordm9pZAorb3BkbF9yaW5nX2ZyZWUoc3RydWN0IG9wZGxfcmluZyAqdCkKK3sKKwl1aW50 MzJfdCBpOworCWNvbnN0IHN0cnVjdCBydGVfbWVtem9uZSAqbXo7CisJY2hhciBtel9uYW1lW1JU RV9NRU1aT05FX05BTUVTSVpFXTsKKworCWlmICh0ID09IE5VTEwpIHsKKwkJUE1EX0RSVl9MT0co REVCVUcsICJGcmVlaW5nIE5VTEwgT1BETCBSaW5nISIpOworCQlyZXR1cm47CisJfQorCisJUE1E X0RSVl9MT0coREVCVUcsICJGcmVlaW5nICVzIG9wZGxfcmluZyBhdCAlcCIsIHQtPm5hbWUsIHQp OworCisJZm9yIChpID0gMDsgaSA8IHQtPm51bV9zdGFnZXM7ICsraSkgeworCQlydGVfZnJlZSh0 LT5zdGFnZXNbaV0uZGVwcyk7CisJCXJ0ZV9mcmVlKHQtPnN0YWdlc1tpXS5kZXBfdHJhY2tpbmcp OworCX0KKworCXJ0ZV9mcmVlKHQtPnN0YWdlcyk7CisKKwlzbnByaW50Zihtel9uYW1lLCBzaXpl b2YobXpfbmFtZSksICIlcyVzIiwgTElCX05BTUUsIHQtPm5hbWUpOworCW16ID0gcnRlX21lbXpv bmVfbG9va3VwKG16X25hbWUpOworCWlmIChydGVfbWVtem9uZV9mcmVlKG16KSAhPSAwKQorCQlQ TURfRFJWX0xPRyhFUlIsICJDYW5ub3QgZnJlZSBtZW16b25lIGZvciAlcyIsIHQtPm5hbWU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