vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits
PATCH 1/1 vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits
Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER feature bits for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.
--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)
hw/net/vhost_net.c +10 -0
@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* +* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + }return vhost_get_features (&net->dev,vhost_net_get_feature_bits (net), features); }
net/vhost-vdpa.c +2 -0
@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET ,
Signature · 1 line
2.25.1
Hi Michael,
Can you review this feature support patch, appreciate your review and comments.
Patch considers all feature bits supported by vhost net client type as part of feature negotiation to address the concerns raised in below thread.
https://patchew.org/QEMU/[email protected]/
Regards
Vamsi
Quoted 58 lines
-----Original Message-----
From: Srujana Challa <[email protected]>
Sent: Tuesday, January 2, 2024 4:45 PM
To: [email protected]
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>
Subject: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsEnables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeature bits for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +10
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* +* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + }return vhost_get_features (&net->dev,vhost_net_get_feature_bits (net), features);}
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Ping.
Quoted 77 lines
Subject: RE: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsHi Michael,
Can you review this feature support patch, appreciate your review and comments.
Patch considers all feature bits supported by vhost net client type as part of feature negotiation to address the concerns raised in below thread.
https://patchew.org/QEMU/1533833677-27512-1-git-send-email-
[email protected]/Regards
VamsiQuoted 7 lines
-----Original Message-----
From: Srujana Challa <[email protected]>
Sent: Tuesday, January 2, 2024 4:45 PM
To: [email protected]
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>
Subject: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature
Quoted 3 lines
bits to
vdpa_feature_bitsEnables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeaturebits
Quoted 49 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +10
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* +* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + } return vhost_get_features(&net->dev, vhost_net_get_feature_bits(net),features);}
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Sorry this got tagged for Linux by mistake.
Replied now.
Quoted 79 lines · Srujana Challa
Ping.
Quoted 77 lines
Subject: RE: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsHi Michael,
Can you review this feature support patch, appreciate your review and comments.
Patch considers all feature bits supported by vhost net client type as part of feature negotiation to address the concerns raised in below thread.
https://patchew.org/QEMU/1533833677-27512-1-git-send-email-
[email protected]/Regards
VamsiQuoted 7 lines
-----Original Message-----
From: Srujana Challa <[email protected]>
Sent: Tuesday, January 2, 2024 4:45 PM
To: [email protected]
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>
Subject: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature
Quoted 3 lines
bits to
vdpa_feature_bitsEnables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeaturebits
Quoted 49 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +10
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* +* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + } return vhost_get_features(&net->dev, vhost_net_get_feature_bits(net),features);}
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Quoted 22 lines · Srujana Challa
Enables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeature bits for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c +3
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/*
hw/net/vhost_net.c static const int *vhost_net_get_feature_bits(struct vhost_net *net) · line 132
Quoted 10 lines
hw/net/vhost_net.c +7
-0+* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + }return vhost_get_features (&net->dev,vhost_net_get_feature_bits (net), features); }
I don't think we should do this part. With vdpa QEMU is in control of which features are exposed and that is intentional since features are often tied to other behaviour.
Quoted 16 lines
net/vhost-vdpa.c +2
-0@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET ,Signature · 1 line
2.25.1
Quoted 46 lines
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, February 19, 2024 3:15 PM
To: Srujana Challa <[email protected]>
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob <[email protected]>; Jason Wang <[email protected]>
Subject: [EXT] Re: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsExternal Email
----------------------------------------------------------------------
Quoted 1 line · Srujana Challa
Enables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeaturebits
Quoted 28 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +9
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* +* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++;
Quoted 8 lines
Quoted 4 lines
hw/net/vhost_net.c +1
-0+ }return vhost_get_features (&net->dev,vhost_net_get_feature_bits (net), features);}
I don't think we should do this part. With vdpa QEMU is in control of which features are exposed and that is intentional since features are often tied to other behaviour.
Vdpa Qemu can negotiate all the features which vdpa backend device supports with the guest right? Guest drivers (it could be userspace or kernel drivers) will negotiate their own features, so that frontend supported features will get the precedence.
Quoted 17 lines
Quoted 17 lines
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Ping.
Quoted 81 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsQuoted 44 lines
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, February 19, 2024 3:15 PM
To: Srujana Challa <[email protected]>
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob <[email protected]>; Jason Wang <[email protected]>
Subject: [EXT] Re: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsExternal Email
----------------------------------------------------------------------
Quoted 1 line · Srujana Challa
Enables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeaturebits
Quoted 28 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest.
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +9
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* +* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++;Quoted 8 lines
Quoted 4 lines
hw/net/vhost_net.c +1
-0+ }return vhost_get_features (&net->dev,vhost_net_get_feature_bits (net), features);}
I don't think we should do this part. With vdpa QEMU is in control of which features are exposed and that is intentional since features are often tied to other behaviour.
Vdpa Qemu can negotiate all the features which vdpa backend device supports with the guest right?
Guest drivers (it could be userspace or kernel drivers) will negotiate their own features, so that
frontend supported features will get the precedence.Quoted 17 lines
Quoted 17 lines
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Hi Michael,
VIRTIO_F_NOTIFICATION_DATA needs to be exposed to make Marvell's device works with Qemu. Any other better ways to expose VIRTIO_F_NOTIFICATION_DATA feature bit for vhost vdpa use case?
Thanks,
Srujana.
Quoted 89 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsPing.
Quoted 20 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsQuoted 15 lines
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, February 19, 2024 3:15 PM
To: Srujana Challa <[email protected]>
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob <[email protected]>; Jason Wang <[email protected]>
Subject: [EXT] Re: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsExternal Email
--------------------------------------------------------------------
Quoted 1 line · Srujana Challa
Enables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeature
Quoted 4 lines
Quoted 4 lines
bits
Quoted 3 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with
guest.
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +0
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
hw/net/vhost_net.c +3
-0uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* Quoted 8 lines
hw/net/vhost_net.c static const int *vhost_net_get_feature_bits(struct vhost_net *net)
Quoted 8 lines
hw/net/vhost_net.c +7
-0+* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + } return vhost_get_features(&net->dev,
vhost_net_get_feature_bits(net),Quoted 30 lines
Quoted 6 lines
Quoted 2 lines
hw/net/vhost_net.c +0
-0features);}
I don't think we should do this part. With vdpa QEMU is in control of which features are exposed and that is intentional since features are often tied to other behaviour.
Vdpa Qemu can negotiate all the features which vdpa backend device supports with the guest right?
Guest drivers (it could be userspace or kernel drivers) will negotiate their own features, so that frontend supported features will get the precedence.Quoted 17 lines
Quoted 17 lines
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Quoted 7 lines · Srujana Challa
Hi Michael,
VIRTIO_F_NOTIFICATION_DATAneeds to be exposed to make Marvell's device works with Qemu. Any other better ways to exposeVIRTIO_F_NOTIFICATION_DATAfeature bit for vhost vdpa use case?
Hi!
Jonah Palmer is working on implementing notification_data [1]. He's implementing it on emulated devices first but the resulting QEMU should be able to enable it for vdpa devices too. Would it be possible for you to review it, and /or test the series against your devices? And checking that everything works on emulated devices too?
Thanks!
[1] https://lists.nongnu.org/archive/html/qemu-devel/2024-03/msg00755.html
Quoted 94 lines
Thanks,
Srujana.Quoted 89 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsPing.
Quoted 20 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsQuoted 15 lines
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, February 19, 2024 3:15 PM
To: Srujana Challa <[email protected]>
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob <[email protected]>; Jason Wang <[email protected]>
Subject: [EXT] Re: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsExternal Email
--------------------------------------------------------------------
Quoted 1 line · Srujana Challa
Enables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeature
Quoted 4 lines
Quoted 4 lines
bits
Quoted 3 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with
guest.
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +0
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
hw/net/vhost_net.c +3
-0uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* Quoted 8 lines
hw/net/vhost_net.c static const int *vhost_net_get_feature_bits(struct vhost_net *net)
Quoted 8 lines
hw/net/vhost_net.c +7
-0+* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + } return vhost_get_features(&net->dev,
vhost_net_get_feature_bits(net),Quoted 30 lines
Quoted 6 lines
Quoted 2 lines
hw/net/vhost_net.c +0
-0features);}
I don't think we should do this part. With vdpa QEMU is in control of which features are exposed and that is intentional since features are often tied to other behaviour.
Vdpa Qemu can negotiate all the features which vdpa backend device supports with the guest right?
Guest drivers (it could be userspace or kernel drivers) will negotiate their own features, so that frontend supported features will get the precedence.Quoted 17 lines
Quoted 17 lines
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1
Quoted 17 lines · Eugenio Perez Martin
Quoted 7 lines · Srujana Challa
Hi Michael,
VIRTIO_F_NOTIFICATION_DATAneeds to be exposed to make Marvell's device works with Qemu. Any other better ways to exposeVIRTIO_F_NOTIFICATION_DATAfeature bit for vhost vdpa use case?Hi!
Jonah Palmer is working on implementing
notification_data[1]. He's implementing it on emulated devices first but the resulting QEMU should be able to enable it for vdpa devices too. Would it be possible for you to review it, and /or test the series against your devices? And checking that everything works on emulated devices too?
Quoted 3 lines
Thanks!
[1] https://lists.nongnu.org/archive/html/qemu-devel/2024-03/msg00755.html
Yes, please do. And if anything is missing in his patches you can post a patch on top.
Quoted 94 lines
Quoted 94 lines
Thanks,
Srujana.Quoted 89 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsPing.
Quoted 20 lines
Subject: RE: [EXT] Re: [PATCH]
vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsQuoted 15 lines
-----Original Message-----
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, February 19, 2024 3:15 PM
To: Srujana Challa <[email protected]>
Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]>; Jerin Jacob <[email protected]>; Jason Wang <[email protected]>
Subject: [EXT] Re: [PATCH]vhost_net: addNOTIFICATION_DATAandIN_ORDERfeature bits tovdpa_feature_bitsExternal Email
--------------------------------------------------------------------
Quoted 1 line · Srujana Challa
Enables
VIRTIO_F_NOTIFICATION_DATAandVIRTIO_F_IN_ORDERfeature
Quoted 4 lines
Quoted 4 lines
bits
Quoted 3 lines
for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with
guest.
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Signed-off-by Srujana Challa <[email protected]>--- hw/net/vhost_net.c | 10 ++++++++++ net/vhost-vdpa.c | 2 ++ 2 files changed, 12 insertions(+)hw/net/vhost_net.c index renamed from hw/net/vhost_net.c +0
-0
e8e1661646..65ae8bcece100644hw/net/vhost_net.c +0
-0@@ -117,6 +117,16 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net)Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
hw/net/vhost_net.c +3
-0uint64_t vhost_net_get_features (struct vhost_net *net,uint64_t features) { +const int *bit =vhost_net_get_feature_bits (net); + +/* Quoted 8 lines
hw/net/vhost_net.c static const int *vhost_net_get_feature_bits(struct vhost_net *net)
Quoted 8 lines
hw/net/vhost_net.c +7
-0+* Consider all feature bits for feature negotiation with vhost backend, +* so that all backend device supported features can be negotiated. +*/ +while (*bit !=VHOST_INVALID_FEATURE_BIT ) { + features |= (1ULL << *bit); + bit++; + } return vhost_get_features(&net->dev,
vhost_net_get_feature_bits(net),Quoted 30 lines
Quoted 6 lines
Quoted 2 lines
hw/net/vhost_net.c +0
-0features);}
I don't think we should do this part. With vdpa QEMU is in control of which features are exposed and that is intentional since features are often tied to other behaviour.
Vdpa Qemu can negotiate all the features which vdpa backend device supports with the guest right?
Guest drivers (it could be userspace or kernel drivers) will negotiate their own features, so that frontend supported features will get the precedence.Quoted 17 lines
Quoted 17 lines
net/vhost-vdpa.c index renamed from net/vhost-vdpa.c +0
-0
3726ee5d67..51334fcfe2100644net/vhost-vdpa.c +2
-1@@ -57,7 +57,9 @@ typedef struct VhostVDPAState {*/ const int vdpa_feature_bits[] = {VIRTIO_F_ANY_LAYOUT , +VIRTIO_F_IN_ORDER ,VIRTIO_F_IOMMU_PLATFORM , +VIRTIO_F_NOTIFICATION_DATA ,VIRTIO_F_NOTIFY_ON_EMPTY ,VIRTIO_F_RING_PACKED ,VIRTIO_F_RING_RESET , --2.25.1