]> git.droids-corp.org - dpdk.git/commit
net/vhost: perform SW checksum in Tx path
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 8 Jun 2022 12:49:46 +0000 (14:49 +0200)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 17 Jun 2022 12:41:04 +0000 (14:41 +0200)
commit8ba1723783b28178a6c57ea7c499f483c255fbca
tree4270ab2afd55b011fb6f1de8564f572ce743848a
parent8f1750f42e2d2dbf49af59eb058e8412f0e3afa4
net/vhost: perform SW checksum in Tx path

Virtio specification supports guest checksum offloading
for L4, which is enabled with VIRTIO_NET_F_GUEST_CSUM
feature negotiation. However, the Vhost PMD does not
advertise Tx checksum offload capabilities.

Advertising these offload capabilities at the ethdev level
is not enough, because we could still end-up with the
application enabling these offloads while the guest not
negotiating it.

This patch advertises the Tx checksum offload capabilities,
and introduces a compatibility layer to cover the case
VIRTIO_NET_F_GUEST_CSUM has not been negotiated but the
application does configure the Tx checksum offloads. This
function performs the L4 Tx checksum in SW for UDP and TCP.
Compared to Rx SW checksum, the Tx SW checksum function
needs to compute the pseudo-header checksum, as we cannot
know whether it was done before.

This patch does not advertise SCTP checksum offloading
capability for now, but it could be handled later if the
need arises.

Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Cheng Jiang <cheng1.jiang@intel.com>
drivers/net/vhost/rte_eth_vhost.c