[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] hw/virtio/vhost-user: support obtain vdpa device's mac ad
From: |
Alex Bennée |
Subject: |
Re: [PATCH v2] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically |
Date: |
Thu, 22 Sep 2022 11:02:56 +0100 |
User-agent: |
mu4e 1.9.0; emacs 28.2.50 |
"Michael S. Tsirkin" <mst@redhat.com> writes:
> On Wed, Sep 21, 2022 at 07:23:12PM +0100, Alex Bennée wrote:
>>
>> chenh <chenh@yusur.tech> writes:
>>
>> > From: Hao Chen <chenh@yusur.tech>
>> >
>> > 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.
>> >
>> > v1->v2:
>> > Only copy ETH_ALEN data of netcfg for some vdpa device such as
>> > NVIDIA BLUEFIELD DPU(BF2)'s netcfg->status is not right.
>> > We only need the mac address and don't care about the status field.
>> >
>> > Signed-off-by: Hao Chen <chenh@yusur.tech>
>> > ---
>> > hw/block/vhost-user-blk.c | 1 -
>> > hw/net/virtio-net.c | 7 +++++++
>> > hw/virtio/vhost-user.c | 19 -------------------
>> > 3 files changed, 7 insertions(+), 20 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;
>>
>> <snip>
>>
>> NACK from me. The supports_config flag is there for a reason.
>
>
> Alex please, do not send NACKs. If you feel compelled to stress
> your point, provide extra justification instead. Thanks!
OK I was objecting to ripping out the common vhost-user code which was
implemented as a fix for behaviour found while attempting to upstream:
Subject: [PATCH v4 for 7.2 00/22] virtio-gpio and various virtio cleanups
Date: Tue, 2 Aug 2022 10:49:48 +0100
Message-Id: <20220802095010.3330793-1-alex.bennee@linaro.org>
I vhost-user-blk wants to suppress its use of vhost-user config messages
I guess that should be a control option but it sounds like a buggy
back-end.
>
>> >
>> > 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);
>>
>>
>> --
>> Alex Bennée
--
Alex Bennée
Re: [PATCH v2] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically, Alex Bennée, 2022/09/21