Skip to contentSkip to conversation

vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

PATCH In review Srujana Challa 4 participants 10 messages Jan 2, 2024 – Mar 12, 2024 Networking

lore
Share & tools
lore
#0 lore raw

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
index e8e1661646..65ae8bcece 100644
@@ -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
index 3726ee5d67..51334fcfe2 100644
@@ -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
#1 lore raw

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: 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 index renamed from hw/net/vhost_net.c +0 -0

e8e1661646..65ae8bcece 100644

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 index renamed from net/vhost-vdpa.c +0 -0

3726ee5d67..51334fcfe2 100644

net/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

#2 lore raw

Ping.

Quoted 77 lines

Subject: RE: [PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

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/1533833677-27512-1-git-send-email-
[email protected]/

Regards
Vamsi

Quoted 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: add NOTIFICATION_DATA and IN_ORDER

feature

Quoted 3 lines

bits to vdpa_feature_bits

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER feature

bits

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.

---
 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..65ae8bcece 100644

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 index renamed from net/vhost-vdpa.c +0 -0

3726ee5d67..51334fcfe2 100644

net/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

#3 lore raw

Sorry this got tagged for Linux by mistake.
Replied now.

Quoted 79 lines · Srujana Challa

Ping.

Quoted 77 lines

Subject: RE: [PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

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/1533833677-27512-1-git-send-email-
[email protected]/

Regards
Vamsi

Quoted 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: add NOTIFICATION_DATA and IN_ORDER

feature

Quoted 3 lines

bits to vdpa_feature_bits

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER feature

bits

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.

---
 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..65ae8bcece 100644

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 index renamed from net/vhost-vdpa.c +0 -0

3726ee5d67..51334fcfe2 100644

net/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

#4 lore raw
In reply to Srujana Challa
Quoted 22 lines · Srujana Challa

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 +3 -0
index e8e1661646..65ae8bcece 100644
@@ -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
index 3726ee5d67..51334fcfe2 100644
@@ -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
#5 lore raw
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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

External Email

----------------------------------------------------------------------

Quoted 1 line · Srujana Challa

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER feature

bits

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.

---
 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..65ae8bcece 100644

hw/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..51334fcfe2 100644

net/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

#6 lore raw

Ping.

Quoted 81 lines

Subject: RE: [EXT] Re: [PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Quoted 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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

External Email

----------------------------------------------------------------------

Quoted 1 line · Srujana Challa

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER feature

bits

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.

---
 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..65ae8bcece 100644

hw/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..51334fcfe2 100644

net/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

#7 lore raw

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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Ping.

Quoted 20 lines

Subject: RE: [EXT] Re: [PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Quoted 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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

External Email

--------------------------------------------------------------------

Quoted 1 line · Srujana Challa

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER

feature

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
---
 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..65ae8bcece 100644

hw/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 -0
 uint64_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 -0
             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..51334fcfe2 100644

net/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

#8 lore raw
Quoted 7 lines · Srujana Challa

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?

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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Ping.

Quoted 20 lines

Subject: RE: [EXT] Re: [PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Quoted 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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

External Email

--------------------------------------------------------------------

Quoted 1 line · Srujana Challa

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER

feature

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
---
 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..65ae8bcece 100644

hw/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 -0
 uint64_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 -0
             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..51334fcfe2 100644

net/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

#9 lore raw
Quoted 17 lines · Eugenio Perez Martin
Quoted 7 lines · Srujana Challa

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?

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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Ping.

Quoted 20 lines

Subject: RE: [EXT] Re: [PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

Quoted 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: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

External Email

--------------------------------------------------------------------

Quoted 1 line · Srujana Challa

Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER

feature

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
---
 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..65ae8bcece 100644

hw/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 -0
 uint64_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 -0
             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..51334fcfe2 100644

net/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