DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Maxime Coquelin" <maxime.coquelin@redhat.com>
Cc: "David Marchand" <david.marchand@redhat.com>,
	"Harrison Caldicott" <harrison@itsfubar.com.au>, <dev@dpdk.org>
Subject: RE: Questions about RX checksum offload on virtio and vhost
Date: Tue, 15 Sep 2026 14:02:16 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65A46@smartserver.smartshare.dk> (raw)

> From: Morten Brørup
> Sent: Tuesday, 15 September 2026 11.57
> 
> Hi Maxime,
> 
> A Grout issue [1] regarding RX checksum offload with virtio and vhost
> triggered my curiosity...
> 
> AFAIU, in Linux, the VIRTIO_NET_F_GUEST_CSUM flag on a virtio network
> device tells the host that it doesn't need to set the correct checksums
> in packets it writes to the device, because the guest will do it (when
> reading them).
> 
> Now; if a guest application requests RTE_ETH_RX_OFFLOAD_CHECKSUM
> offload, the virtio PMD initializes the Linux device with
> VIRTIO_NET_F_GUEST_CSUM [2].
> This behavior seems counterintuitive to me...
> I would assume that if an application cares about packet checksums on
> ingress, it will set RTE_ETH_RX_OFFLOAD_CHECKSUM, so the NIC/PMD checks
> them, and the application can discard packets with invalid checksums on
> ingress.
> But the virtio PMD uses RTE_ETH_RX_OFFLOAD_CHECKSUM to disable
> checksums, not enable them?
> 
> Two questions:
> 1. What is the use case for a guest application receiving packets
> without correct packet checksums from the virtio ports, which motivated
> this driver behavior?
> 2. What is the performance gain in the Linux host by not setting the
> checksums (enabling VIRTIO_NET_F_GUEST_CSUM)? (If the guest application
> needs to calculate them instead, the performance cost in the guest
> might outweigh the performance gain in the host not doing it when
> creating the packet in the Linux kernel.)
> 
> NB: According to the Grout issue, the vhost PMD behaves similarly; but
> I haven't checked.
> 
> [1]: https://github.com/DPDK/grout/issues/724
> [2]: https://github.com/DPDK/dpdk/blob/25.11/drivers/net/virtio/virtio_ethdev.c#L2282-L2284
> 

I came across a patch [3], which writes into the packet's checksum field.
It seems to be for the virtio PMD running on the host.
Is something similar missing for the virtio PMD running in a guest?

https://github.com/DPDK/dpdk/commit/8f1750f42e2d2dbf49af59eb058e8412f0e3afa4


             reply	other threads:[~2026-09-15 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 12:02 Morten Brørup [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-09-15  9:57 Questions about RX checksum offload on virtio and vhost Morten Brørup

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=98CBD80474FA8B44BF855DF32C47DC35F65A46@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=harrison@itsfubar.com.au \
    --cc=maxime.coquelin@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox