From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2686B45EEB; Thu, 19 Dec 2024 12:02:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFA98402A3; Thu, 19 Dec 2024 12:02:44 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 28400402A0; Thu, 19 Dec 2024 12:02:43 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4YDSH10NKVz16PjZ; Thu, 19 Dec 2024 18:59:25 +0800 (CST) Received: from dggemv711-chm.china.huawei.com (unknown [10.1.198.66]) by mail.maildlp.com (Postfix) with ESMTPS id 122671401F2; Thu, 19 Dec 2024 19:02:41 +0800 (CST) Received: from kwepemn200010.china.huawei.com (7.202.194.133) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 19 Dec 2024 19:02:40 +0800 Received: from kwepemd500024.china.huawei.com (7.221.188.194) by kwepemn200010.china.huawei.com (7.202.194.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 19 Dec 2024 19:02:40 +0800 Received: from kwepemd500024.china.huawei.com ([7.221.188.194]) by kwepemd500024.china.huawei.com ([7.221.188.194]) with mapi id 15.02.1544.011; Thu, 19 Dec 2024 19:02:40 +0800 From: "Wangyunjian(wangyunjian,TongTu)" To: David Marchand , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , "chenbox@nvidia.com" , "Lilijun (Jerry)" , "xiawei (H)" , wangzengyuan , "stable@dpdk.org" Subject: RE: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading Thread-Topic: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading Thread-Index: AQHbUeCfDFMb3moSS0+hMQxlUzfoA7LtOyp7gAAU4AA= Date: Thu, 19 Dec 2024 11:02:40 +0000 Message-ID: <5809b61b17cf490b98b1bbec74c55b1a@huawei.com> References: <91dc12662805a3867413940f856ba9454b91c579.1734588243.git.wangyunjian@huawei.com> In-Reply-To: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.242.157] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IERhdmlkIE1hcmNoYW5kIFtt YWlsdG86ZGF2aWQubWFyY2hhbmRAcmVkaGF0LmNvbV0NCj4gU2VudDogVGh1cnNkYXksIERlY2Vt YmVyIDE5LCAyMDI0IDQ6MjQgUE0NCj4gVG86IFdhbmd5dW5qaWFuKHdhbmd5dW5qaWFuLFRvbmdU dSkgPHdhbmd5dW5qaWFuQGh1YXdlaS5jb20+Ow0KPiBtYXhpbWUuY29xdWVsaW5AcmVkaGF0LmNv bQ0KPiBDYzogZGV2QGRwZGsub3JnOyBjaGVuYm94QG52aWRpYS5jb207IExpbGlqdW4gKEplcnJ5 KQ0KPiA8amVycnkubGlsaWp1bkBodWF3ZWkuY29tPjsgeGlhd2VpIChIKSA8eGlhd2VpNDBAaHVh d2VpLmNvbT47DQo+IHdhbmd6ZW5neXVhbiA8d2FuZ3plbmd5dWFuQGh1YXdlaS5jb20+OyBzdGFi bGVAZHBkay5vcmcNCj4gU3ViamVjdDogUmU6IFtQQVRDSCAxLzFdIHZob3N0OiBmaXgg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BpbmRleCA2OTkwMWFiM2I1Li41 YzQwYWU3MDY5IDEwMDY0NA0KPiA+IC0tLSBhL2xpYi92aG9zdC92aXJ0aW9fbmV0LmMNCj4gPiAr KysgYi9saWIvdmhvc3QvdmlydGlvX25ldC5jDQo+ID4gQEAgLTI5MTQsMTAgKzI5MTQsMTIgQEAg ZGVzY190b19tYnVmKHN0cnVjdCB2aXJ0aW9fbmV0ICpkZXYsIHN0cnVjdA0KPiB2aG9zdF92aXJ0 cXVldWUgKnZxLA0KPiA+ICAgICAgICAgICAgICAgICAgICAgICAgICAqIGluIGEgY29udGlndW91 cyB2aXJ0dWFsIGFyZWEuDQo+ID4gICAgICAgICAgICAgICAgICAgICAgICAgICovDQo+ID4gICAg ICAgICAgICAgICAgICAgICAgICAgY29weV92bmV0X2hkcl9mcm9tX2Rlc2MoJnRtcF9oZHIsDQo+ IGJ1Zl92ZWMpOw0KPiA+IC0gICAgICAgICAgICAgICAgICAgICAgIGhkciA9ICZ0bXBfaGRyOw0K PiA+ICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KPiA+IC0gICAgICAgICAgICAgICAgICAgICAg IGhkciA9IChzdHJ1Y3QgdmlydGlvX25ldF9oZHINCj4gKikoKHVpbnRwdHJfdClidWZfdmVjWzBd LmJ1Zl9hZGRyKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBydGVfbWVtY3B5KCh2b2lk ICopKHVpbnRwdHJfdCkmdG1wX2hkciwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICh2b2lkDQo+ICopKHVpbnRwdHJfdClidWZfdmVjWzBdLmJ1Zl9hZGRyLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHN0cnVjdCB2aXJ0aW9fbmV0X2hkcikp Ow0KPiA+ICAgICAgICAgICAgICAgICB9DQo+ID4gKyAgICAgICAgICAgICAgIGhkciA9ICZ0bXBf aGRyOw0KPiA+ICAgICAgICAgfQ0KPiANCj4gVGhpcyB3aWxsIG5lZWQgc29tZSBiZW5jaG1hcmss IGFzIEkgcmVtZW1iZXIgcHV0dGluZyBydGVfbWVtY3B5IGluDQo+IGlubGluZWQgaGVscGVycyBo YWQgc29tZSBwZXJmb3JtYW5jZSBpbXBhY3QuDQo+IA0KPiBJbnN0ZWFkLCBJIHdvdWxkIGNhbGwg Y29weV92bmV0X2hkcl9mcm9tX2Rlc2MgdW5jb25kaXRpb25uYWxseSwgYW5kDQo+IHN0b3JlIGlu IGEgc3RydWN0IHZpcnRpb19uZXRfaGRyIGhkciB2YXJpYWJsZSAoKyBhIGhhc192bmV0X2hkcg0K PiBib29sZWFuIHRvIGluZGljYXRlIHZhbGlkaXR5KS4NCj4gU29tZXRoaW5nIGxpa2U6DQo+ICAg ICAgICAgaWYgKHZpcnRpb19uZXRfd2l0aF9ob3N0X29mZmxvYWQoZGV2KSkgew0KPiAtICAgICAg ICAgICAgICAgaWYgKHVubGlrZWx5KGJ1Zl92ZWNbMF0uYnVmX2xlbiA8IHNpemVvZihzdHJ1Y3QN Cj4gdmlydGlvX25ldF9oZHIpKSkgew0KPiAtICAgICAgICAgICAgICAgICAgICAgICAvKg0KPiAt ICAgICAgICAgICAgICAgICAgICAgICAgKiBObyBsdWNrLCB0aGUgdmlydGlvLW5ldCBoZWFkZXIg ZG9lc24ndCBmaXQNCj4gLSAgICAgICAgICAgICAgICAgICAgICAgICogaW4gYSBjb250aWd1b3Vz IHZpcnR1YWwgYXJlYS4NCj4gLSAgICAgICAgICAgICAgICAgICAgICAgICovDQo+IC0gICAgICAg ICAgICAgICAgICAgICAgIGNvcHlfdm5ldF9oZHJfZnJvbV9kZXNjKCZ0bXBfaGRyLCBidWZfdmVj KTsNCj4gLSAgICAgICAgICAgICAgICAgICAgICAgaGRyID0gJnRtcF9oZHI7DQo+IC0gICAgICAg ICAgICAgICB9IGVsc2Ugew0KPiAtICAgICAgICAgICAgICAgICAgICAgICBoZHIgPSAoc3RydWN0 IHZpcnRpb19u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QogICAgICAgIHN0cnVjdCBhc3luY19pbmZsaWdodF9pbmZv ICpwa3RzX2luZm87DQpAQCAtMjkyMSwxMSArMjkyMSwxMSBAQCBkZXNjX3RvX21idWYoc3RydWN0 IHZpcnRpb19uZXQgKmRldiwgc3RydWN0IHZob3N0X3ZpcnRxdWV1ZSAqdnEsDQogICAgICAgICAg ICAgICAgICAgICAgICAgKiBObyBsdWNrLCB0aGUgdmlydGlvLW5ldCBoZWFkZXIgZG9lc24ndCBm aXQNCiAgICAgICAgICAgICAgICAgICAgICAgICAqIGluIGEgY29udGlndW91cyB2aXJ0dWFsIGFy ZWEuDQogICAgICAgICAgICAgICAgICAgICAgICAgKi8NCi0gICAgICAgICAgICAgICAgICAgICAg IGNvcHlfdm5ldF9oZHJfZnJvbV9kZXNjKCZ0bXBfaGRyLCBidWZfdmVjKTsNCi0gICAgICAgICAg ICAgICAgICAgICAgIGhkciA9ICZ0bXBfaGRyOw0KKyAgICAgICAgICAgICAgICAgICAgICAgY29w eV92bmV0X2hkcl9mcm9tX2Rlc2MoJmhkciwgYnVmX3ZlYyk7DQogICAgICAgICAgICAgICAgfSBl bHNlIHsNCi0gICAgICAgICAgICAgICAgICAgICAgIGhkciA9IChzdHJ1Y3QgdmlydGlvX25ldF9o ZHIgKikoKHVpbnRwdHJfdClidWZfdmVjWzBdLmJ1Zl9hZGRyKTsNCisgICAgICAgICAgICAgICAg ICAgICAgIGhkciA9ICooc3RydWN0IHZpcnRpb19uZXRfaGRyICopKCh1aW50cHRyX3QpYnVmX3Zl Y1swXS5idWZfYWRkcik7DQogICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgIGhhc192 bmV0X2hkciA9IHRydWU7DQogICAgICAgIH0NCg0KDQo+IA0KPiANCj4gPg0KPiA+ICAgICAgICAg Zm9yICh2ZWNfaWR4ID0gMDsgdmVjX2lkeCA8IG5yX3ZlYzsgdmVjX2lkeCsrKSB7DQo+ID4gQEAg LTMzNjMsNyArMzM2NSw3IEBAI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lX21lbWNweSgodm9pZCAqKSh1aW50cHRy X3QpJmhkciwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopKHVp bnRwdHJfdClkZXNjX2FkZHJzW2ldLA0KPiBzaXplb2Yoc3RydWN0IHZpcnRpb19uZXRfaGRyKSk7 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgdmhvc3RfZGVxdWV1ZV9vZmZsb2FkKGRldiwg JmhkciwgcGt0c1tpXSwNCj4gbGVnYWN5X29sX2ZsYWdzKTsNCj4gPiAgICAgICAgICAgICAgICAg fQ0KPiA+ICAgICAgICAgfQ0KPiANCj4gSGVyZSB0b28sIHRoZXJlIG1heSBiZSBhbiBpbXBhY3Qg d2l0aCBhZGRpbmcgcnRlX21lbWNweS4NCj4gSnVzdCBkbyBhIGNvcHkgbGlrZToNCj4gDQo+ICAg ICAgICAgaWYgKHZpcnRpb19uZXRfd2l0aF9ob3N0X29mZmxvYWQoZGV2KSkgew0KPiArICAgICAg ICAgICAgICAgc3RydWN0IHZpcnRpb19uZXRfaGRyIGhkcjsNCj4gKw0KPiAgICAgICAgICAgICAg ICAgdmhvc3RfZm9yX2VhY2hfdHJ5X3Vucm9sbChpLCAwLCBQQUNLRURfQkFUQ0hfU0laRSkgew0K PiAtICAgICAgICAgICAgICAgICAgICAgICBoZHIgPSAoc3RydWN0IHZpcnRpb19uZXRfaGRyICop KGRlc2NfYWRkcnNbaV0pOw0KPiAtICAgICAgICAgICAgICAgICAgICAgICB2aG9zdF9kZXF1ZXVl X29mZmxvYWQoZGV2LCBoZHIsIHBrdHNbaV0sDQo+IGxlZ2FjeV9vbF9mbGFncyk7DQo+ICsgICAg ICAgICAgICAgICAgICAgICAgIGhkciA9ICooc3RydWN0IHZpcnRpb19uZXRfaGRyICopKGRlc2Nf YWRkcnNbaV0pOw0KPiArICAgICAgICAgICAgICAgICAgICAgICB2aG9zdF9kZXF1ZXVlX29mZmxv YWQoZGV2LCAmaGRyLCBwa3R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