[PATCH] vhost: enable CONFIG feature
Hao Chen
chenh at yusur.tech
Sat Oct 8 09:56:37 CEST 2022
On 2022/9/26 15:26, Xia, Chenbo wrote:
>> -----Original Message-----
>> From: Hao Chen <chenh at yusur.tech>
>> Sent: Tuesday, September 13, 2022 5:55 PM
>> To: maxime.coquelin at redhat.com; Xia, Chenbo <chenbo.xia at intel.com>
>> Cc: dev at dpdk.org; houyl at yusur.tech; zy at yusur.tech; Hao Chen
>> <chenh at yusur.tech>
>> Subject: [PATCH] vhost: enable CONFIG feature
>>
>> Enable this feature, so that libvirt or qemu can call vdpa vendor
>> driver's ops '.get_config' through 'vhost_net_get_config' to get
>> the mac address of the vdpa hardware without manual configuration.
> I think we should add this in vendor's vdpa driver, not in common library.
> Because some hardware and the sw back-end can't support get/set config.
>
> Thanks,
> Chenbo
Yeah, maybe add "if (vdpa_protocol_features & (1ULL <<
VHOST_USER_PROTOCOL_F_CONFIG)) *protocol_features |= (1ULL <<
VHOST_USER_PROTOCOL_F_CONFIG);" at the end of function
'rte_vhost_driver_get_protocol_features' will be better. I will send
patch v2.
Thanks.
>> Signed-off-by: Hao Chen <chenh at yusur.tech>
>> ---
>> lib/vhost/vhost_user.h | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h
>> index 8ecca68597..12e8d116f3 100644
>> --- a/lib/vhost/vhost_user.h
>> +++ b/lib/vhost/vhost_user.h
>> @@ -23,7 +23,8 @@
>> (1ULL <<
>> VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
>> (1ULL <<
>> VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
>> (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) |
>> \
>> - (1ULL << VHOST_USER_PROTOCOL_F_STATUS))
>> + (1ULL << VHOST_USER_PROTOCOL_F_STATUS) | \
>> + (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))
>>
>> typedef enum VhostUserRequest {
>> VHOST_USER_NONE = 0,
>> --
>> 2.34.1
More information about the dev
mailing list