From: Hao Chen <chenh@yusur.tech>
To: maxime.coquelin@redhat.com, chenbo.xia@intel.com
Cc: dev@dpdk.org, houyl@yusur.tech, zy@yusur.tech
Subject: [PATCH v2] vhost: enable CONFIG feature for vdpa
Date: Tue, 11 Oct 2022 10:54:35 +0800 [thread overview]
Message-ID: <20221011025435.3769-1-chenh@yusur.tech> (raw)
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
next reply other threads:[~2022-10-11 2:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-11 2:54 Hao Chen [this message]
2022-11-03 3:27 ` Xia, Chenbo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221011025435.3769-1-chenh@yusur.tech \
--to=chenh@yusur.tech \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=houyl@yusur.tech \
--cc=maxime.coquelin@redhat.com \
--cc=zy@yusur.tech \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).