From: "houyl@yusur.tech" <houyl@yusur.tech>
To: 陈浩 <chenh@yusur.tech>, mst <mst@redhat.com>,
"raphael.norwitz" <raphael.norwitz@nutanix.com>,
jasowang <jasowang@redhat.com>
Cc: kwolf <kwolf@redhat.com>, hreitz <hreitz@redhat.com>,
qemu-block <qemu-block@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>, zy <zy@yusur.tech>,
陈浩 <chenh@yusur.tech>, houyl <houyl@yusur.tech>
Subject: Re: [PATCH] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically
Date: Thu, 15 Sep 2022 15:52:48 +0800 [thread overview]
Message-ID: <2022091515524780307618@yusur.tech> (raw)
In-Reply-To: 20220913090817.212224-1-chenh@yusur.tech
On Tue, Sep 13, 2022 at 17:08 PM Hao Chen <chenh@yusur.tech> wrote:
>From: Hao Chen
>Date: 2022-09-13 17:08
>To: mst; raphael.norwitz
>CC: kwolf; hreitz; jasowang; qemu-block; qemu-devel; houyl; zy; Hao Chen
>Subject: [PATCH] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically
>When use dpdk-vdpa tests vdpa device. You need to specify the mac address to
>start the virtual machine through libvirt or qemu, but now, the libvirt or
>qemu can call dpdk vdpa vendor driver's ops .get_config through vhost_net_get_config
>to get the mac address of the vdpa hardware without manual configuration.
>Signed-off-by: Hao Chen <chenh@yusur.tech>
>---
>hw/block/vhost-user-blk.c | 1 -
>hw/net/virtio-net.c | 3 ++-
>hw/virtio/vhost-user.c | 19 -------------------
>3 files changed, 2 insertions(+), 21 deletions(-)
>diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
>index 9117222456..5dca4eab09 100644
>--- a/hw/block/vhost-user-blk.c
>+++ b/hw/block/vhost-user-blk.c
>@@ -337,7 +337,6 @@ static int vhost_user_blk_connect(DeviceState *dev, Error **errp)
> vhost_dev_set_config_notifier(&s->dev, &blk_ops);
>- s->vhost_user.supports_config = true;
> ret = vhost_dev_init(&s->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USER, 0,
> errp);
> if (ret < 0) {
>diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
>index dd0d056fde..274ea84644 100644
>--- a/hw/net/virtio-net.c
>+++ b/hw/net/virtio-net.c
>@@ -149,7 +149,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
> * Is this VDPA? No peer means not VDPA: there's no way to
>
> * disconnect/reconnect a VDPA peer.
> */
>- if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
>+ if ((nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) ||
>+ (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER)) {
> ret = vhost_net_get_config(get_vhost_net(nc->peer), (uint8_t *)&netcfg,
n->config_size);
> if (ret != -1) {
>diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
>index bd24741be8..8b01078249 100644
>--- a/hw/virtio/vhost-user.c
>+++ b/hw/virtio/vhost-user.c
>@@ -2013,8 +2013,6 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,
> }
> if (virtio_has_feature(features, VHOST_USER_F_PROTOCOL_FEATURES)) {
>- bool supports_f_config = vus->supports_config ||
>- (dev->config_ops && dev->config_ops->vhost_dev_config_notifier);
> uint64_t protocol_features;
> dev->backend_features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
>@@ -2033,23 +2031,6 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,
> */
> protocol_features &= VHOST_USER_PROTOCOL_FEATURE_MASK;
>- if (supports_f_config) {
>- if (!virtio_has_feature(protocol_features,
>- VHOST_USER_PROTOCOL_F_CONFIG)) {
>- error_setg(errp, "vhost-user device expecting "
>- "VHOST_USER_PROTOCOL_F_CONFIG but the vhost-user backend does "
>- "not support it.");
>- return -EPROTO;
>- }
>- } else {
>- if (virtio_has_feature(protocol_features,
>- VHOST_USER_PROTOCOL_F_CONFIG)) {
>- warn_reportf_err(*errp, "vhost-user backend supports "
>- "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does not.");
>- protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_CONFIG);
>- }
>- }
>-
> /* final set of protocol features */
> dev->protocol_features = protocol_features;
> err = vhost_user_set_protocol_features(dev, dev->protocol_features);
>--
Yusur (YUSUR Technology Co., Ltd.) focuses on the research and development of special data processors.
The independently developed international leading DPU series products can be widely used in ultra-low
latency network, big data processing, 5G edge computing, high-speed storage and other scenarios,
helping computing power become the new productivity of the digital era.
The company put forward innovative Software Defined Accelerator technology and independently
developed the chip architecture KPU(Kernel Processing Unit) and agile heterogeneous Software stack
(HADOS) for domain-specific computing (DSA).
Now, adding the feature of obtain vdpa device's mac address automatically for DPDK vDPA path.
next prev parent reply other threads:[~2022-09-15 13:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 9:08 [PATCH] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically Hao Chen
2022-09-15 7:52 ` houyl [this message]
2022-09-20 2:18 ` Jason Wang
2022-09-21 5:28 ` Raphael Norwitz
2022-09-21 6:26 ` 陈浩
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=2022091515524780307618@yusur.tech \
--to=houyl@yusur.tech \
--cc=chenh@yusur.tech \
--cc=hreitz@redhat.com \
--cc=jasowang@redhat.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael.norwitz@nutanix.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).