diff mbox series

[v5,15/21] virtio-net: Do not clear VIRTIO_NET_F_HASH_REPORT

Message ID 20231017040932.62997-16-akihiko.odaki@daynix.com
State New
Headers show
Series virtio-net RSS/hash report fixes and improvements | expand

Commit Message

Akihiko Odaki Oct. 17, 2023, 4:09 a.m. UTC
virtio-net can report hash values even if the peer does not have a
virtio-net header.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 hw/net/virtio-net.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jason Wang Oct. 27, 2023, 7:14 a.m. UTC | #1
On Tue, Oct 17, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> virtio-net can report hash values even if the peer does not have a
> virtio-net header.

Do we need a compat flag for this?

Thanks

>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  hw/net/virtio-net.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index c6a92ba3db..dc2b7b8ee7 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -763,8 +763,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
>          virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_TSO4);
>          virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_TSO6);
>          virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_ECN);
> -
> -        virtio_clear_feature(&features, VIRTIO_NET_F_HASH_REPORT);
>      }
>
>      if (!peer_has_vnet_hdr(n) || !peer_has_ufo(n)) {
> --
> 2.42.0
>
Akihiko Odaki Oct. 27, 2023, 8:07 a.m. UTC | #2
On 2023/10/27 16:14, Jason Wang wrote:
> On Tue, Oct 17, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>
>> virtio-net can report hash values even if the peer does not have a
>> virtio-net header.
> 
> Do we need a compat flag for this?

I don't think so. This change actually fixes the migration from a system 
with tap devices that support virtio-net headers to a system with tap 
devices that do not support virtio-net headers. Such a compatibility 
flag will revert the fix.

Regards,
Akihiko Odaki
Yuri Benditovich Oct. 29, 2023, 9:56 p.m. UTC | #3
This patch allows  VIRTIO_NET_F_HASH_REPORT feature to the adapter whose
backend does not have a virtio header and does not have offload features
that depend on it.
The migration between such different systems is very problematic even if it
seems successful, such setups are not performance-oriented and especially
supporting the hash delivery for them is (IMHO) redundant, it just requires
more testing and does not bring any advantage.


On Fri, Oct 27, 2023 at 11:07 AM Akihiko Odaki <akihiko.odaki@daynix.com>
wrote:

> On 2023/10/27 16:14, Jason Wang wrote:
> > On Tue, Oct 17, 2023 at 12:14 PM Akihiko Odaki <akihiko.odaki@daynix.com>
> wrote:
> >>
> >> virtio-net can report hash values even if the peer does not have a
> >> virtio-net header.
> >
> > Do we need a compat flag for this?
>
> I don't think so. This change actually fixes the migration from a system
> with tap devices that support virtio-net headers to a system with tap
> devices that do not support virtio-net headers. Such a compatibility
> flag will revert the fix.
>
> Regards,
> Akihiko Odaki
>
Akihiko Odaki Oct. 30, 2023, 3:59 a.m. UTC | #4
On 2023/10/30 6:56, Yuri Benditovich wrote:
> This patch allows  VIRTIO_NET_F_HASH_REPORT feature to the adapter whose 
> backend does not have a virtio header and does not have offload features 
> that depend on it.
> The migration between such different systems is very problematic even if 
> it seems successful, such setups are not performance-oriented and 
> especially supporting the hash delivery for them is (IMHO) redundant, it 
> just requires more testing and does not bring any advantage.

Whether the peer has virtio headers or not is irrelevant if 
VIRTIO_NET_F_HASH_REPORT is offloaded or not. Currently QEMU always 
implements hash reporting by itself and does not offload at all.
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index c6a92ba3db..dc2b7b8ee7 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -763,8 +763,6 @@  static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
         virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_TSO4);
         virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_TSO6);
         virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_ECN);
-
-        virtio_clear_feature(&features, VIRTIO_NET_F_HASH_REPORT);
     }
 
     if (!peer_has_vnet_hdr(n) || !peer_has_ufo(n)) {