DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] vhost: enable CONFIG feature for vdpa
@ 2022-10-11  2:54 Hao Chen
  2022-11-03  3:27 ` Xia, Chenbo
  0 siblings, 1 reply; 2+ messages in thread
From: Hao Chen @ 2022-10-11  2:54 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, houyl, zy

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.

v1->v2:
Move VHOST_USER_PROTOCOL_F_CONFIG from VHOST_USER_PROTOCOL_FEATURES
to function 'rte_vhost_driver_get_protocol_features'.

Signed-off-by: Hao Chen <chenh@yusur.tech>
---
 lib/vhost/socket.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index a8df2d484a..df8f26a5bd 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -808,6 +808,10 @@ rte_vhost_driver_get_protocol_features(const char *path,
 	*protocol_features = vsocket->protocol_features
 		& vdpa_protocol_features;
 
+	/* Get the unique features of vdpa */
+	if (vdpa_protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))
+		*protocol_features |= (1ULL << VHOST_USER_PROTOCOL_F_CONFIG);
+
 unlock_exit:
 	pthread_mutex_unlock(&vhost_user.mutex);
 	return ret;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-03  3:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11  2:54 [PATCH v2] vhost: enable CONFIG feature for vdpa Hao Chen
2022-11-03  3:27 ` Xia, Chenbo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).