All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Shameer Kolothum <skolothumtho@nvidia.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	eric.auger@redhat.com, alex@shazbot.org, clg@redhat.com,
	cohuck@redhat.com, nicolinc@nvidia.com, nathanc@nvidia.com,
	mochs@nvidia.com, jgg@nvidia.com, kjaju@nvidia.com,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH v2 2/4] hw/net/virtio-net: Adapt hash handling to updated UAPI
Date: Tue, 3 Feb 2026 12:32:02 -0500	[thread overview]
Message-ID: <20260203123143-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260113113754.1189-3-skolothumtho@nvidia.com>

On Tue, Jan 13, 2026 at 11:37:52AM +0000, Shameer Kolothum wrote:
> The virtio_net_hdr_v1_hash layout changed in the Linux UAPI, replacing
> the 32-bit hash_value field with two 16-bit fields, hash_value_lo and
> hash_value_hi.
> 
> Update hash handling to populate the new fields correctly and adjust
> offset and size calculations accordingly.
> 
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com>


Has to be squashed in patch 1 or bisect will be broken.

> ---
>  hw/net/virtio-net.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 317f1ad23b..512a7c02c9 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1879,7 +1879,8 @@ static int virtio_net_process_rss(NetClientState *nc, const uint8_t *buf,
>                                               n->rss_data.runtime_hash_types);
>      if (net_hash_type > NetPktRssIpV6UdpEx) {
>          if (n->rss_data.populate_hash) {
> -            hdr->hash_value = VIRTIO_NET_HASH_REPORT_NONE;
> +            hdr->hash_value_lo = VIRTIO_NET_HASH_REPORT_NONE;
> +            hdr->hash_value_hi = VIRTIO_NET_HASH_REPORT_NONE;
>              hdr->hash_report = 0;
>          }
>          return n->rss_data.redirect ? n->rss_data.default_queue : -1;
> @@ -1888,7 +1889,8 @@ static int virtio_net_process_rss(NetClientState *nc, const uint8_t *buf,
>      hash = net_rx_pkt_calc_rss_hash(pkt, net_hash_type, n->rss_data.key);
>  
>      if (n->rss_data.populate_hash) {
> -        hdr->hash_value = hash;
> +        hdr->hash_value_lo = cpu_to_le16(hash & 0xffff);
> +        hdr->hash_value_hi = cpu_to_le16((hash >> 16) & 0xffff);
>          hdr->hash_report = reports[net_hash_type];
>      }
>  
> @@ -1990,10 +1992,11 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
>  
>              receive_header(n, sg, elem->in_num, buf, size);
>              if (n->rss_data.populate_hash) {
> -                offset = offsetof(typeof(extra_hdr), hash_value);
> +                offset = offsetof(typeof(extra_hdr), hash_value_lo);
>                  iov_from_buf(sg, elem->in_num, offset,
>                               (char *)&extra_hdr + offset,
> -                             sizeof(extra_hdr.hash_value) +
> +                             sizeof(extra_hdr.hash_value_lo) +
> +                             sizeof(extra_hdr.hash_value_hi) +
>                               sizeof(extra_hdr.hash_report));
>              }
>              offset = n->host_hdr_len;
> -- 
> 2.43.0



  parent reply	other threads:[~2026-02-03 17:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 11:37 [PATCH v2 0/4] vfio: Add DMABUF support for PCI BAR regions Shameer Kolothum
2026-01-13 11:37 ` [PATCH v2 1/4] linux-headers: Update to Linux v6.19-rc1 Shameer Kolothum
2026-01-15 12:45   ` Cédric Le Goater
2026-01-13 11:37 ` [PATCH v2 2/4] hw/net/virtio-net: Adapt hash handling to updated UAPI Shameer Kolothum
2026-01-15 12:45   ` Cédric Le Goater
2026-02-03 17:32   ` Michael S. Tsirkin [this message]
2026-01-13 11:37 ` [PATCH v2 3/4] hw/vfio: Add helper to retrieve device feature Shameer Kolothum
2026-01-14 10:19   ` Jonathan Cameron via
2026-01-14 10:19     ` Jonathan Cameron via qemu development
2026-01-15 12:44     ` Cédric Le Goater
2026-01-15 12:46   ` Cédric Le Goater
2026-01-13 11:37 ` [PATCH v2 4/4] hw/vfio/region: Create dmabuf for PCI BAR per region Shameer Kolothum
2026-01-14  9:16   ` Duan, Zhenzhong
2026-01-15 12:50     ` Cédric Le Goater
2026-01-15 14:32       ` Shameer Kolothum
2026-01-15 15:58         ` Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260203123143-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex@shazbot.org \
    --cc=clg@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kjaju@nvidia.com \
    --cc=mochs@nvidia.com \
    --cc=nathanc@nvidia.com \
    --cc=nicolinc@nvidia.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=skolothumtho@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.