From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by dpdk.org (Postfix) with ESMTP id C7474C39A for ; Tue, 4 Aug 2015 04:09:17 +0200 (CEST) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.1/8.15.1) with ESMTPS id t7429Hcv018691 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Aug 2015 02:09:17 GMT Received: from SGSIHTC004.nsn-intra.net ([10.159.225.21]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id t7428sM1007755 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 4 Aug 2015 04:09:16 +0200 Received: from SGSIHTC008.nsn-intra.net (10.159.225.25) by SGSIHTC004.nsn-intra.net (10.159.225.21) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 4 Aug 2015 10:08:43 +0800 Received: from SGSIMBX007.nsn-intra.net ([169.254.7.242]) by SGSIHTC008.nsn-intra.net ([10.159.225.25]) with mapi id 14.03.0248.002; Tue, 4 Aug 2015 10:08:43 +0800 From: "Yan, Liming (Nokia - CN/Hangzhou)" To: "dev@dpdk.org" Thread-Topic: Could DPDK ring provide peek interface or any comments for this function? Thread-Index: AQHQzlp8IluH7vlrDECH7VfUTVmmDw== Date: Tue, 4 Aug 2015 02:08:43 +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: [10.159.225.126] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 1964 X-purgate-ID: 151667::1438654157-000063FD-24D12595/0/0 X-Mailman-Approved-At: Tue, 04 Aug 2015 09:56:54 +0200 Subject: [dpdk-dev] Could DPDK ring provide peek interface or any comments for this function? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 02:09:18 -0000 SGksDQogICBBcyB3ZSBzZWUsIERQREsgcmluZyBoYXMgbWFpbmx5IHRoZSBlbnF1ZXVlL2RlcXVl dWUgQVBJcyBmb3IgU0lOR0xFL01VTFRJIHByb2R1Y2VyL2NvbnN1bWVyLiAgSSBoYXZlIGEgcmVx dWlyZW1lbnQgaW4gd29yayB0byB0YWtlIGEgcGVlayBvbiB0aGUgdG9wIG9iamVjdCBpbiB0aGUg cmluZy4gSSBkb24ndCB3YW50IHRvIGNvbnN1bWUgaXQsIGp1c3QgY2hlY2sgdGhlIHJlZmVyZW5j ZSBvZiB0aGUgb2JqZWN0LiAgSG93IGNvdWxkIHRoaXMgYmUgc3VwcG9ydGVkPyAgIE9yIGFueSBh bHRlcm5hdGl2ZSBzb2x1dGlvbiBmb3IgbXkgcmVxdWlyZW1lbnQ/ICBUaGFua3MuDQogICBJIHdy b3RlIG15IG93biBzaW1wbGUgcGVlayBpbnRlcmZhY2UgYnV0IGl0J3Mgbm90IE1DLXNhZmUuIEkg dGhpbmsgaXQncyBiZXR0ZXIgaWYgRFBESyBjYW4gc3VwcG9ydCBpdCBvZmZpY2lhbGx5LiAgDQoN Cg0KIC8qKg0KKyAqIEp1c3QgdGFrZSBhIHBlZWsgb24gdGhlIHRvcCBvYmplY3QgZnJvbSBhIHJp bmcgYnV0IG5vdCBjb25zdW1lIGl0Lg0KKyAqIE5vdGU6IFRoaXMgaW50ZXJmYWNlIGlzIE1DIGFu ZCBtdWx0aS10aHJlYWQgbm90IHNhZmUuDQorICogICAgICAgSXQgY2FuIG9ubHkgYmUgdXNlZCBm b3IgcmluZyB3aXRoIFJJTk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