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 DE1B2A0543; Sat, 8 Oct 2022 05:40:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B66B40146; Sat, 8 Oct 2022 05:40:32 +0200 (CEST) Received: from out28-171.mail.aliyun.com (out28-171.mail.aliyun.com [115.124.28.171]) by mails.dpdk.org (Postfix) with ESMTP id 5195140042 for ; Sat, 8 Oct 2022 05:40:31 +0200 (CEST) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.07444014|-1; CH=green; DM=|CONTINUE|false|; DS=CONTINUE|ham_system_inform|0.0113698-0.000216405-0.988414; FP=0|0|0|0|0|-1|-1|-1; HT=ay29a033018047198; MF=chenh@yusur.tech; NM=1; PH=DS; RN=5; RT=5; SR=0; TI=SMTPD_---.PW2l5Zw_1665200428; Received: from 192.168.10.71(mailfrom:chenh@yusur.tech fp:SMTPD_---.PW2l5Zw_1665200428) by smtp.aliyun-inc.com; Sat, 08 Oct 2022 11:40:29 +0800 Message-ID: <5265fcd7-ffe2-4da5-1dea-813a03b851d0@yusur.tech> Date: Sat, 8 Oct 2022 11:40:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH] vhost: enable CONFIG feature To: "Xia, Chenbo" , "maxime.coquelin@redhat.com" Cc: "dev@dpdk.org" , "houyl@yusur.tech" , "zy@yusur.tech" References: <20220913095519.2554445-1-chenh@yusur.tech> From: =?UTF-8?B?6ZmI5rWp?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 2022/9/26 15:26, Xia, Chenbo wrote: >> -----Original Message----- >> From: Hao Chen >> Sent: Tuesday, September 13, 2022 5:55 PM >> To: maxime.coquelin@redhat.com; Xia, Chenbo >> Cc: dev@dpdk.org; houyl@yusur.tech; zy@yusur.tech; Hao Chen >> >> 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 In function 'rte_vhost_driver_get_protocol_features' at lib/vhost/socket.c, "*protocol_features = vsocket->protocol_features & vdpa_protocol_features". If you want vdpa driver to support VHOST_ USER_ PROTOCOL_ F_ CONFIG, we need to add this feature here, and we also need the vdpa driver to support VHOST_ USER_ PROTOCOL_ F_ CONFIG in rte_ vdpa_ dev_ ops's get_ features,  only add this in vendor's vdpa driver is invalid. Thanks. >> Signed-off-by: Hao Chen >> --- >> 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