vdpa: update used->flags in used ring relay

Message ID 20240717032447.39723-1-xiangwencheng@dayudpu.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vdpa: update used->flags in used ring relay |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS

Commit Message

BillXiang July 17, 2024, 3:24 a.m. UTC
From: BillXiang <xiangwencheng@dayudpu.com>

The vDPA device will work incorrectly if flags such as
VRING_USED_F_NO_NOTIFY are not updated correctly.

Signed-off-by: BillXiang <xiangwencheng@dayudpu.com>
---
 lib/vhost/vdpa.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Maxime Coquelin Sept. 19, 2024, 10:37 a.m. UTC | #1
On 7/17/24 05:24, BillXiang wrote:
> From: BillXiang <xiangwencheng@dayudpu.com>
> 
> The vDPA device will work incorrectly if flags such as
> VRING_USED_F_NO_NOTIFY are not updated correctly.
> 
> Signed-off-by: BillXiang <xiangwencheng@dayudpu.com>
> ---
>   lib/vhost/vdpa.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
> index a1dd5a753b..8abb073675 100644
> --- a/lib/vhost/vdpa.c
> +++ b/lib/vhost/vdpa.c
> @@ -174,6 +174,7 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
>   	idx = vq->used->idx;
>   	idx_m = s_vring->used->idx;
>   	ret = (uint16_t)(idx_m - idx);
> +	vq->used->flags = s_vring->used->flags;
>   
>   	while (idx != idx_m) {
>   		/* copy used entry, used ring logging is not covered here */

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin Sept. 19, 2024, 10:41 a.m. UTC | #2
On 9/19/24 12:37, Maxime Coquelin wrote:
> 
> 
> On 7/17/24 05:24, BillXiang wrote:
>> From: BillXiang <xiangwencheng@dayudpu.com>
>>
>> The vDPA device will work incorrectly if flags such as
>> VRING_USED_F_NO_NOTIFY are not updated correctly.
>>
>> Signed-off-by: BillXiang <xiangwencheng@dayudpu.com>
>> ---
>>   lib/vhost/vdpa.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
>> index a1dd5a753b..8abb073675 100644
>> --- a/lib/vhost/vdpa.c
>> +++ b/lib/vhost/vdpa.c
>> @@ -174,6 +174,7 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, 
>> void *vring_m)
>>       idx = vq->used->idx;
>>       idx_m = s_vring->used->idx;
>>       ret = (uint16_t)(idx_m - idx);
>> +    vq->used->flags = s_vring->used->flags;
>>       while (idx != idx_m) {
>>           /* copy used entry, used ring logging is not covered here */
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

I fix the title from used->flags to used flags.
And also add Fixes tag and Cc stable so that it is backported.


> Thanks,
> Maxime
  

Patch

diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
index a1dd5a753b..8abb073675 100644
--- a/lib/vhost/vdpa.c
+++ b/lib/vhost/vdpa.c
@@ -174,6 +174,7 @@  rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
 	idx = vq->used->idx;
 	idx_m = s_vring->used->idx;
 	ret = (uint16_t)(idx_m - idx);
+	vq->used->flags = s_vring->used->flags;
 
 	while (idx != idx_m) {
 		/* copy used entry, used ring logging is not covered here */