diff mbox series

[v6,13/21] virtio-net: Always set populate_hash

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

Commit Message

Akihiko Odaki Oct. 30, 2023, 5:12 a.m. UTC
The member is not cleared during reset so may have a stale value.

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

Comments

Zhang, Chen Oct. 30, 2023, 7:02 p.m. UTC | #1
> -----Original Message-----
> From: qemu-devel-bounces+chen.zhang=intel.com@nongnu.org <qemu-
> devel-bounces+chen.zhang=intel.com@nongnu.org> On Behalf Of Akihiko
> Odaki
> Sent: Monday, October 30, 2023 1:13 PM
> Cc: qemu-devel@nongnu.org; Yuri Benditovich
> <yuri.benditovich@daynix.com>; Andrew Melnychenko
> <andrew@daynix.com>; Michael S . Tsirkin <mst@redhat.com>; Jason Wang
> <jasowang@redhat.com>; Akihiko Odaki <akihiko.odaki@daynix.com>
> Subject: [PATCH v6 13/21] virtio-net: Always set populate_hash
> 
> The member is not cleared during reset so may have a stale value.
> 

/docs/devel/ebpf_rss.rst:
populate_hash - for now, not used. eBPF RSS doesn't support hash reporting.

We need update docs?
And why not clear it in virtio_net_reset function?

Thanks
Chen

> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  hw/net/virtio-net.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index
> 1fa020d905..0fe75b3c08 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -650,6 +650,7 @@ static void virtio_net_set_mrg_rx_bufs(VirtIONet *n,
> int mergeable_rx_bufs,
>          n->guest_hdr_len = n->mergeable_rx_bufs ?
>              sizeof(struct virtio_net_hdr_mrg_rxbuf) :
>              sizeof(struct virtio_net_hdr);
> +        n->rss_data.populate_hash = false;
>      }
> 
>      for (i = 0; i < n->max_queue_pairs; i++) {
> --
> 2.42.0
>
Akihiko Odaki Oct. 31, 2023, 4:47 a.m. UTC | #2
On 2023/10/31 4:02, Zhang, Chen wrote:
> 
> 
>> -----Original Message-----
>> From: qemu-devel-bounces+chen.zhang=intel.com@nongnu.org <qemu-
>> devel-bounces+chen.zhang=intel.com@nongnu.org> On Behalf Of Akihiko
>> Odaki
>> Sent: Monday, October 30, 2023 1:13 PM
>> Cc: qemu-devel@nongnu.org; Yuri Benditovich
>> <yuri.benditovich@daynix.com>; Andrew Melnychenko
>> <andrew@daynix.com>; Michael S . Tsirkin <mst@redhat.com>; Jason Wang
>> <jasowang@redhat.com>; Akihiko Odaki <akihiko.odaki@daynix.com>
>> Subject: [PATCH v6 13/21] virtio-net: Always set populate_hash
>>
>> The member is not cleared during reset so may have a stale value.
>>
> 
> /docs/devel/ebpf_rss.rst:
> populate_hash - for now, not used. eBPF RSS doesn't support hash reporting.
> 
> We need update docs?
> And why not clear it in virtio_net_reset function?

Certainly the documentation needs to be updated.
Either of clearing it in virtio_net_reset() or 
virtio_net_set_mrg_rx_bufs() is fine.

Regards,
Akihiko Odaki
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 1fa020d905..0fe75b3c08 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -650,6 +650,7 @@  static void virtio_net_set_mrg_rx_bufs(VirtIONet *n, int mergeable_rx_bufs,
         n->guest_hdr_len = n->mergeable_rx_bufs ?
             sizeof(struct virtio_net_hdr_mrg_rxbuf) :
             sizeof(struct virtio_net_hdr);
+        n->rss_data.populate_hash = false;
     }
 
     for (i = 0; i < n->max_queue_pairs; i++) {