[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df320160-88d4-44fc-92f8-dd7a9efb8569@redhat.com>
Date: Mon, 26 May 2025 12:57:22 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Jason Wang <jasowang@...hat.com>
Cc: netdev@...r.kernel.org, Willem de Bruijn
<willemdebruijn.kernel@...il.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, "Michael S. Tsirkin" <mst@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, Eugenio Pérez
<eperezma@...hat.com>
Subject: Re: [PATCH net-next 3/8] vhost-net: allow configuring extended
features
On 5/26/25 2:47 AM, Jason Wang wrote:
> On Wed, May 21, 2025 at 6:33 PM Paolo Abeni <pabeni@...hat.com> wrote:
>>
>> Use the extended feature type for 'acked_features' and implement
>> two new ioctls operation to get and set the extended features.
>>
>> Note that the legacy ioctls implicitly truncate the negotiated
>> features to the lower 64 bits range.
>>
>> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
>> ---
>> drivers/vhost/net.c | 26 +++++++++++++++++++++++++-
>> drivers/vhost/vhost.h | 2 +-
>> include/uapi/linux/vhost.h | 8 ++++++++
>> 3 files changed, 34 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
>> index 7cbfc7d718b3f..b894685dded3e 100644
>> --- a/drivers/vhost/net.c
>> +++ b/drivers/vhost/net.c
>> @@ -77,6 +77,10 @@ enum {
>> (1ULL << VIRTIO_F_RING_RESET)
>> };
>>
>> +#ifdef VIRTIO_HAS_EXTENDED_FEATURES
>> +#define VHOST_NET_FEATURES_EX VHOST_NET_FEATURES
>> +#endif
>> +
>> enum {
>> VHOST_NET_BACKEND_FEATURES = (1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2)
>> };
>> @@ -1614,7 +1618,7 @@ static long vhost_net_reset_owner(struct vhost_net *n)
>> return err;
>> }
>>
>> -static int vhost_net_set_features(struct vhost_net *n, u64 features)
>> +static int vhost_net_set_features(struct vhost_net *n, virtio_features_t features)
>> {
>> size_t vhost_hlen, sock_hlen, hdr_len;
>> int i;
>> @@ -1704,6 +1708,26 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
>> if (features & ~VHOST_NET_FEATURES)
>> return -EOPNOTSUPP;
>> return vhost_net_set_features(n, features);
>> +#ifdef VIRTIO_HAS_EXTENDED_FEATURES
>
> Vhost doesn't depend on virtio. But this invents a dependency, and I
> don't understand why we need to do that.
What do you mean with "dependency" here? vhost has already a build
dependency vs virtio, including several virtio headers. It has also a
logical dependency, using several virtio features.
Do you mean a build dependency? this change does not introduce such a thing.
/P
Powered by blists - more mailing lists