numam-dpdk/examples/vhost
David Marchand ca7036b4af vhost: fix offload flags in Rx path
The vhost library currently configures Tx offloading (PKT_TX_*) on any
packet received from a guest virtio device which asks for some offloading.

This is problematic, as Tx offloading is something that the application
must ask for: the application needs to configure devices
to support every used offloads (ip, tcp checksumming, tso..), and the
various l2/l3/l4 lengths must be set following any processing that
happened in the application itself.

On the other hand, the received packets are not marked wrt current
packet l3/l4 checksumming info.

Copy virtio rx processing to fix those offload flags with some
differences:
- accept VIRTIO_NET_HDR_GSO_ECN and VIRTIO_NET_HDR_GSO_UDP,
- ignore anything but the VIRTIO_NET_HDR_F_NEEDS_CSUM flag (to comply with
  the virtio spec),

Some applications might rely on the current behavior, so it is left
untouched by default.
A new RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS flag is added to enable the
new behavior.

The vhost example has been updated for the new behavior: TSO is applied to
any packet marked LRO.

Fixes: 859b480d5a ("vhost: add guest offload setting")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-05-04 10:22:17 +02:00
..
ioat.c examples/vhost: fix ioat ring space in callbacks 2021-04-28 03:58:50 +02:00
ioat.h examples/vhost: remove async inflight packet counter 2021-02-04 18:19:36 +01:00
main.c vhost: fix offload flags in Rx path 2021-05-04 10:22:17 +02:00
main.h examples/vhost: remove async inflight packet counter 2021-02-04 18:19:36 +01:00
Makefile examples: warn about broken pkg-config 2021-01-30 01:27:28 +01:00
meson.build examples: reduce indentation in build files 2021-04-21 14:04:09 +02:00
virtio_net.c examples/vhost: check memory table query 2021-03-31 08:46:32 +02:00