diff mbox series

[v5,12/21] virtio-net: Always set populate_hash

Message ID 20231017040932.62997-13-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
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

Jason Wang Oct. 27, 2023, 7:08 a.m. UTC | #1
On Tue, Oct 17, 2023 at 12:10 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> The member is not cleared during reset so may have a stale value.

Nit: I guess it should be "always unset populate_hash"?

Thanks

>
> 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 20feb20bb1..6eb206f297 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -643,6 +643,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. 27, 2023, 7:57 a.m. UTC | #2
On 2023/10/27 16:08, Jason Wang wrote:
> On Tue, Oct 17, 2023 at 12:10 PM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>>
>> The member is not cleared during reset so may have a stale value.
> 
> Nit: I guess it should be "always unset populate_hash"?

I meant populate_hash should be always set to either of true or false in 
virtio_net_set_mrg_rx_bufs(), but I agree it's confusing.

Regards,
Akihiko Odaki
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 20feb20bb1..6eb206f297 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -643,6 +643,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++) {